[PATCH 2/2] mki-copy-isolinux: allow multiple kernels

Anton Midyukov antohami at altlinux.org
Sun Oct 13 19:35:37 MSK 2019


---
 tools/mki-copy-isolinux | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/tools/mki-copy-isolinux b/tools/mki-copy-isolinux
index e9ae6fd..a6dae36 100755
--- a/tools/mki-copy-isolinux
+++ b/tools/mki-copy-isolinux
@@ -32,10 +32,12 @@ run_chrooted "$chroot" <<EOF
 
 if [ -L /boot/vmlinuz ]; then
 	kimage="\$(readlink -ev /boot/vmlinuz)"
-else
-	kimage="\$(find /boot -type f -name 'vmlinuz-*' -print -quit)"
+	kverdef="\${kimage#/boot/vmlinuz-}"
 fi
 
+kimage="\$(find /boot -type f -name 'vmlinuz-*')"
+propagator="\$(find /boot -type f -name 'full-*.cz')"
+
 mkdir $verbose -p -- /.image/$imgsubdir/syslinux
 cd /.image/$imgsubdir/syslinux
 
@@ -43,9 +45,12 @@ if [ -n "\$kimage" ]; then
 	mkdir $verbose alt0
 	cd /.image/$imgsubdir/syslinux
 
-	cp $verbose -af \$kimage alt0/vmlinuz
-	[ ! -f /boot/full.cz ] ||
-		cp $verbose -af /boot/full.cz alt0/full.cz
+	cp $verbose -af \$kimage alt0/
+	[ -n "\$kverdef" ] &&
+		mv alt0/vmlinuz-\$kverdef alt0/vmlinuz
+	cp $verbose -af \$propagator alt0/
+		[ -n "\$kverdef" ] &&
+			mv alt0/full-\$kverdef.cz alt0/full.cz
 fi
 
 cp $verbose -f /usr/lib/syslinux/isolinux.bin .
-- 
2.21.0


--------------32E72CFB8E5A5D3B4E7E091D
Content-Type: text/x-patch;
 name="0001-stage1-stage2-allow-multiple-kernels.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="0001-stage1-stage2-allow-multiple-kernels.patch"



More information about the devel-distro mailing list