ALT Linux Distributions development
 help / color / mirror / Atom feed
From: "Антон Мидюков" <midyukov-anton@ya.ru>
To: devel-distro@lists.altlinux.org
Subject: [devel-distro] Возвращаем возможность задания порядка загрузки ядер
Date: Thu, 5 Dec 2019 01:02:03 +0700
Message-ID: <820a9927-782a-81f6-2858-602c12027655@ya.ru> (raw)

[-- Attachment #1: Type: text/plain, Size: 906 bytes --]

Доброго времени суток

Так как у нас по дефолту включена сортировка пакетов, то
порядок в $KFLAVOURS перестал иметь значение.
Ядра всегда устанавливаются в алфавитном порядке.
Поэтому смысла сортировать по buildtime нет.

See-also: https://bugzilla.altlinux.org/show_bug.cgi?id=30806

Также была исправлена моя печатка, сделанная при починке возможности
грузить несколько ядер. При создании симлинка использовалась
переменная $kver, т.е. весь список ядер, а не последнее значение $KVER в
списке.

-- 
С уважением, Антон Мидюков <antohami@altlinux.org>


[-- Attachment #2: 0001-build-vm-kernel-uboot-return-possibility-of-changing.patch --]
[-- Type: text/x-patch, Size: 3809 bytes --]

>From dbe8fc74f4868c8755a14b2ec93171920e3c50df Mon Sep 17 00:00:00 2001
From: Anton Midyukov <antohami@altlinux.org>
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


             reply	other threads:[~2019-12-04 18:02 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-04 18:02 Антон Мидюков [this message]
2020-02-25 18:31 ` Leonid Krivoshein
2020-02-25 18:58   ` [devel-distro] Несколько ядер в stage1 и stage2 Антон Мидюков
2020-02-25 19:31     ` Leonid Krivoshein
2020-02-26  6:02       ` Nikolai Kostrigin
2020-02-26 10:43         ` Leonid Krivoshein
2020-02-26 10:55           ` Anton V. Boyarshinov
2020-02-26 11:01       ` Антон Мидюков
2020-02-26 12:02         ` Sergey V Turchin
2020-02-27  1:53           ` Leonid Krivoshein
2020-02-27  6:01             ` Sergey V Turchin
2020-02-27 10:06             ` Anton V. Boyarshinov
2020-02-27  1:46         ` Leonid Krivoshein
2020-02-27 10:04           ` Anton V. Boyarshinov
2020-02-27 11:42             ` Leonid Krivoshein
2020-02-27 11:50               ` Anton V. Boyarshinov
2020-02-27 12:31                 ` Leonid Krivoshein
2020-02-27 12:51                     ` Антон Мидюков
2020-02-27 13:02                       ` Leonid Krivoshein
2020-02-28  3:21                           ` Leonid Krivoshein
2020-02-28  3:35                             ` Антон Мидюков
2020-02-28  3:50                               ` Anton Farygin
2020-02-28  3:52                                 ` Leonid Krivoshein
2020-02-28  3:57                                 ` Антон Мидюков
2020-02-28  4:02                                   ` Anton Farygin
2020-02-28  4:11                                     ` Антон Мидюков
2020-02-28  8:33                                       ` Anton Farygin
2020-02-28 10:32                                   ` Leonid Krivoshein
2020-03-04 16:09                                     ` Антон Мидюков
2020-03-04 17:50                                       ` Leonid Krivoshein
2020-03-04 18:00                                         ` Антон Мидюков
2020-03-04 18:03                                           ` Leonid Krivoshein
2020-03-05  7:50                                         ` Sergey V Turchin
2020-03-11 19:49                                       ` Антон Мидюков
2020-02-27 11:58               ` Антон Мидюков
2020-02-27 12:39                 ` Leonid Krivoshein
2020-02-27 12:48                   ` Антон Мидюков
2020-02-27 13:09                 ` Leonid Krivoshein

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=820a9927-782a-81f6-2858-602c12027655@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