[PATCH 1/2] mki-build-propagator: allow multiple kernels

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


---
 tools/mki-build-propagator | 47 +++++++++++++++++++-------------------
 1 file changed, 24 insertions(+), 23 deletions(-)

diff --git a/tools/mki-build-propagator b/tools/mki-build-propagator
index 365d359..691f231 100755
--- a/tools/mki-build-propagator
+++ b/tools/mki-build-propagator
@@ -30,34 +30,35 @@ make_exec "$chroot/.host/packimage.sh" <<EOF
 
 libdir="\$(getconf LIBDIR)"
 
-if [ -L /boot/vmlinuz ]; then
-	kimage="\$(readlink -ev /boot/vmlinuz)"
-else
-	kimage="\$(find /boot -type f -name 'vmlinuz-*' -print -quit)"
-fi
-kver="\${kimage#/boot/vmlinuz-}"
-
-if type mkmodpack >/dev/null 2>&1; then
-	mkmodpack -p '/.in/${mar_modules##*/}' -o /tmp/modules -k "\$kver"
-else
-	mkmar -r / -p '/.in/${mar_modules##*/}' -o /tmp/modules -k "\$kver"
-fi
-
+kimage="\$(find /boot -type f -name 'vmlinuz-*')"
 printf '%s\n' "${PROPAGATOR_VERSION:-}" > /tmp/.VERSION
 
-rm -f /boot/full.cz
+rm -f /boot/full*.cz
+
+for kver in \$kimage; do
+	kver="\${kver#/boot/vmlinuz-}"
+	if type mkmodpack >/dev/null 2>&1; then
+		mkmodpack -p '/.in/${mar_modules##*/}' -o /tmp/modules-"\$kver" -k "\$kver"
+	else
+		mkmar -r / -p '/.in/${mar_modules##*/}' -o /tmp/modules-"\$kver" -k "\$kver"
+	fi
+	[ ! -f /tmp/modules-"\$kver" ] ||
+		cat "\$libdir/propagator/initfs" /tmp/modules-"\$kver" > /boot/full-"\$kver".cz
+	
+	sed \
+		-e "s, ÎÁ LIBDIR@,\$libdir," \
+		-e "s, ÎÁ TMPDIR@,/tmp,g" \
+		< '/.in/${initfs##*/}' |
+		gencpio - |
+		gzip -c >> /boot/full-"\$kver".cz
+
+done
 
-[ ! -f /tmp/modules ] ||
-	cat "\$libdir/propagator/initfs" /tmp/modules > /boot/full.cz
+rm -rf -- /tmp/.VERSION
 
-sed \
-	-e "s, ÎÁ LIBDIR@,\$libdir," \
-	-e "s, ÎÁ TMPDIR@,/tmp,g" \
-	< '/.in/${initfs##*/}' |
-	gencpio - |
-	gzip -c >> /boot/full.cz
+[ -L /boot/vmlinuz ] ||
+	ln -s vmlinuz-"\$kver" vmlinuz
 
-rm -rf -- /tmp/.VERSION
 EOF
 
 rc=0
-- 
2.21.0


--------------32E72CFB8E5A5D3B4E7E091D
Content-Type: text/x-patch;
 name="0002-mki-copy-isolinux-allow-multiple-kernels.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="0002-mki-copy-isolinux-allow-multiple-kernels.patch"



More information about the devel-distro mailing list