From: "Антон Мидюков" <midyukov-anton@ya.ru> To: devel-distro@lists.altlinux.org Subject: [devel-distro] Несколько ядер в stage1 и stage2 Date: Sun, 13 Oct 2019 23:44:56 +0700 Message-ID: <ae9e5799-b990-002f-b1a8-3cde3d7df429@ya.ru> (raw) [-- Attachment #1: Type: text/plain, Size: 691 bytes --] Всем привет Сделал первый шажочек в сторону того, чтобы начать собирать iso с несколькими ядрами. 0001-stage1-stage2-allow-multiple-kernels.patch для mkimage-profiles, разрешает несколько ядер в stage1 и stage2 Другие два патча для mkimage. На данный момент это позволило собрать образ с несколькими ядрами для isolinux. Но меню syslinux требует доработки, нужна опция выбора ядра. -- С уважением, Антон Мидюков <antohami@altlinux.org> [-- Attachment #2: 0001-mki-build-propagator-allow-multiple-kernels.patch --] [-- Type: text/x-patch, Size: 2054 bytes --] >From 09846301adef606f42ef37d531667c38c3843f17 Mon Sep 17 00:00:00 2001 From: Anton Midyukov <antohami@altlinux.org> Date: Sun, 13 Oct 2019 23:35:03 +0700 Subject: [PATCH 1/2] mki-build-propagator: allow multiple kernels --- 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 [-- Attachment #3: 0002-mki-copy-isolinux-allow-multiple-kernels.patch --] [-- Type: text/x-patch, Size: 1392 bytes --] >From 2b76b1f683f05b7205b30175ac98cd16ba5b5e7e Mon Sep 17 00:00:00 2001 From: Anton Midyukov <antohami@altlinux.org> Date: Sun, 13 Oct 2019 23:35:37 +0700 Subject: [PATCH 2/2] mki-copy-isolinux: allow multiple kernels --- 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 [-- Attachment #4: 0001-stage1-stage2-allow-multiple-kernels.patch --] [-- Type: text/x-patch, Size: 1437 bytes --] >From 6ffe72bb7eb8c4bc34255bfdd8b7db29158e2f75 Mon Sep 17 00:00:00 2001 From: Anton Midyukov <antohami@altlinux.org> Date: Sun, 13 Oct 2019 23:30:25 +0700 Subject: [PATCH] stage1, stage2: allow multiple kernels --- sub.in/stage1/Makefile | 2 +- sub.in/stage2/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sub.in/stage1/Makefile b/sub.in/stage1/Makefile index 112c95336..d06fd43e8 100644 --- a/sub.in/stage1/Makefile +++ b/sub.in/stage1/Makefile @@ -22,7 +22,7 @@ include $(MKIMAGE_PREFIX)/targets.mk # only a single kernel might be needed (STAGE1_KFLAVOUR sets explicitly); # kernel image copied from instrumental chroot into .work/syslinux/alt0/ -STAGE1_KFLAVOUR ?= $(lastword $(KFLAVOURS)) +STAGE1_KFLAVOUR ?= $(KFLAVOURS) # propagator needed iff stage1 kernel installed (not for e.g. syslinux.iso) ifneq "$(STAGE1_KFLAVOUR)" "" diff --git a/sub.in/stage2/Makefile b/sub.in/stage2/Makefile index f124dfc66..e07d434b5 100644 --- a/sub.in/stage2/Makefile +++ b/sub.in/stage2/Makefile @@ -29,7 +29,7 @@ IMAGE_PACKAGES += $(SYSTEM_PACKAGES) $(STAGE2_PACKAGES) # here we also try and come up with the stage1 kernel/modules, if any; # no kernel flavour specified will result in no modules for stage1 vmlinuz -STAGE1_KFLAVOUR ?= $(lastword $(KFLAVOURS)) +STAGE1_KFLAVOUR ?= $(KFLAVOURS) ifeq (,$(STAGE1_KFLAVOUR)) $(error STAGE1_KFLAVOUR is utterly empty; cannot guess either) -- 2.21.0
reply other threads:[~2019-10-13 16:44 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=ae9e5799-b990-002f-b1a8-3cde3d7df429@ya.ru \ --to=midyukov-anton@ya.ru \ --cc=devel-distro@lists.altlinux.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
ALT Linux Distributions development This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/devel-distro/0 devel-distro/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 devel-distro devel-distro/ http://lore.altlinux.org/devel-distro \ devel-distro@lists.altlinux.org devel-distro@lists.altlinux.ru devel-distro@lists.altlinux.com public-inbox-index devel-distro Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.devel-distro AGPL code for this site: git clone https://public-inbox.org/public-inbox.git