From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ya.ru; s=mail; t=1575482525; bh=I/fwlnJayXs2i3yXQ8QpyeAyrhD/JGN/DTRB+Bpj4es=; h=Subject:From:To:Date:Message-ID; b=LpTxNWf8KSglUDGGn158IYQofDqgJD+CD67PS5QTz/YtaLYlHSPYgrdrcpHzMbWlI Sot1BDTX56jRvIWfCFH1GIoUdCYEx9xoFMTtLCYntMWWt4KFdb54I2SOiQJJTVXHbP C0pCxIFlqqkTy9Obx7+WwNoWCx2N7fK3lvEVHcZc= Authentication-Results: mxback13g.mail.yandex.net; dkim=pass header.i=@ya.ru To: devel-distro@lists.altlinux.org From: =?UTF-8?B?0JDQvdGC0L7QvSDQnNC40LTRjtC60L7Qsg==?= Message-ID: <820a9927-782a-81f6-2858-602c12027655@ya.ru> Date: Thu, 5 Dec 2019 01:02:03 +0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------B08AB44778962AF0185BDE66" Content-Language: ru Subject: [devel-distro] =?utf-8?b?0JLQvtC30LLRgNCw0YnQsNC10Lwg0LLQvtC30Lw=?= =?utf-8?b?0L7QttC90L7RgdGC0Ywg0LfQsNC00LDQvdC40Y8g0L/QvtGA0Y/QtNC60LAg?= =?utf-8?b?0LfQsNCz0YDRg9C30LrQuCDRj9C00LXRgA==?= X-BeenThere: devel-distro@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Distributions development List-Id: Distributions development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Dec 2019 18:02:08 -0000 Archived-At: List-Archive: This is a multi-part message in MIME format. --------------B08AB44778962AF0185BDE66 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Доброго времени суток Так как у нас по дефолту включена сортировка пакетов, то порядок в $KFLAVOURS перестал иметь значение. Ядра всегда устанавливаются в алфавитном порядке. Поэтому смысла сортировать по buildtime нет. See-also: https://bugzilla.altlinux.org/show_bug.cgi?id=30806 Также была исправлена моя печатка, сделанная при починке возможности грузить несколько ядер. При создании симлинка использовалась переменная $kver, т.е. весь список ядер, а не последнее значение $KVER в списке. -- С уважением, Антон Мидюков --------------B08AB44778962AF0185BDE66 Content-Type: text/x-patch; name="0001-build-vm-kernel-uboot-return-possibility-of-changing.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-build-vm-kernel-uboot-return-possibility-of-changing.pa"; filename*1="tch" >>From dbe8fc74f4868c8755a14b2ec93171920e3c50df Mon Sep 17 00:00:00 2001 From: Anton Midyukov Date: Sat, 9 Nov 2019 20:44:03 +0700 Subject: [PATCH] build-vm, kernel, uboot: return possibility of changing boot sequence of kernels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since packet sorting is enabled by default, then the order in KFLAVORS has ceased to matter. Kernels are always installed in alphabetical order. Therefore, it makes no sense to sort by buildtime. See-also: https://bugzilla.altlinux.org/show_bug.cgi?id=30806 Also fixed my typo. When creating a symlink, the variable $kver was used, i.e. the entire list of kernels, not the last value $KVER of the list. --- .../build-vm/image-scripts.d/07-kernel | 23 ++++++++++++------- features.in/kernel/config.mk | 1 + .../image-scripts.d/90-uboot-config-install | 17 +++++++++----- 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/features.in/build-vm/image-scripts.d/07-kernel b/features.in/build-vm/image-scripts.d/07-kernel index e496a735d9..fd4280825d 100755 --- a/features.in/build-vm/image-scripts.d/07-kernel +++ b/features.in/build-vm/image-scripts.d/07-kernel @@ -2,13 +2,20 @@ # predictable file locations make bootloader configuration simple; # this script relates to features.in/stage2/stage1/scripts.d/81-make-initfs -kver="$(rpm -qa 'kernel-image*' \ - --qf '%{installtime} %{version}-%{name}-%{release}\n' \ - | sort -n \ - | cut -f 2 -d ' ' \ - | sed 's/kernel-image-//')" +[ -n "$GLOBAL_KFLAVOURS" ] || + { echo "** KFLAVOURS is empty" >&2; exit 0; } -[ -n "$kver" ] || { echo "** unable to deduce kernel version" >&2; exit 1; } +kver= +echo $GLOBAL_KFLAVOURS +for KFLAVOUR in $GLOBAL_KFLAVOURS; do + kver+=" $(rpm -qa 'kernel-image*' \ + --qf '%{version}-%{name}-%{release}\n' \ + | grep "$KFLAVOUR" \ + | sed 's/kernel-image-//')" +done + +[ ! -z "${kver#"${kver%%[! ]*}"}" ] || + { echo "** unable to deduce kernel version" >&2; exit 1; } cd /boot @@ -20,6 +27,6 @@ for KVER in $kver; do done # NB: e2k kernel builds "image" instead of "vmlinuz" -[ -f vmlinuz-$kver ] && ln -s vmlinuz-$kver vmlinuz ||: -ln -s initrd-$kver.img initrd.img # missing at this stage +[ -f vmlinuz-$KVER ] && ln -s vmlinuz-$KVER vmlinuz ||: +ln -s initrd-$KVER.img initrd.img # missing at this stage : diff --git a/features.in/kernel/config.mk b/features.in/kernel/config.mk index 3a00a2d469..c8caff06c0 100644 --- a/features.in/kernel/config.mk +++ b/features.in/kernel/config.mk @@ -20,6 +20,7 @@ else endif endif endif + @$(call xport,KFLAVOURS) # r8168 is a kludge, never install it by default use/kernel/net: diff --git a/features.in/uboot/image-scripts.d/90-uboot-config-install b/features.in/uboot/image-scripts.d/90-uboot-config-install index b52d33d861..5dab7d1628 100755 --- a/features.in/uboot/image-scripts.d/90-uboot-config-install +++ b/features.in/uboot/image-scripts.d/90-uboot-config-install @@ -1,12 +1,17 @@ #!/bin/sh -x -kver="$(rpm -qa 'kernel-image*' \ - --qf '%{installtime} %{version}-%{name}-%{release}\n' \ - | sort -n \ - | cut -f 2 -d ' ' \ - | sed 's/kernel-image-//')" +[ -n "$GLOBAL_KFLAVOURS" ] || + { echo "** KFLAVOURS is empty" >&2; exit 0; } -[ -n "$kver" ] || { echo "** unable to deduce kernel version" >&2; exit 1; } +kver= +for KFLAVOUR in $GLOBAL_KFLAVOURS; do + kver+=" $(rpm -qa 'kernel-image*' \ + --qf '%{version}-%{name}-%{release}\n' \ + | grep "$KFLAVOUR" \ + | sed 's/kernel-image-//')" +done +[ ! -z "${kver#"${kver%%[! ]*}"}" ] || + { echo "** unable to deduce kernel version" >&2; exit 1; } for KVER in $kver; do /sbin/installkernel --uboot --keep-initrd "$KVER" -- 2.21.0 --------------B08AB44778962AF0185BDE66--