Commit 801e99b0 authored by Anton Midyukov's avatar Anton Midyukov

build-vm, kernel, uboot: return possibility of changing boot sequence of kernels

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.
parent a02c3284
...@@ -2,13 +2,20 @@ ...@@ -2,13 +2,20 @@
# predictable file locations make bootloader configuration simple; # predictable file locations make bootloader configuration simple;
# this script relates to features.in/stage2/stage1/scripts.d/81-make-initfs # this script relates to features.in/stage2/stage1/scripts.d/81-make-initfs
kver="$(rpm -qa 'kernel-image*' \ [ -n "$GLOBAL_KFLAVOURS" ] ||
--qf '%{installtime} %{version}-%{name}-%{release}\n' \ { echo "** KFLAVOURS is empty" >&2; exit 0; }
| sort -n \
| cut -f 2 -d ' ' \ 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-//')" | sed 's/kernel-image-//')"
done
[ -n "$kver" ] || { echo "** unable to deduce kernel version" >&2; exit 1; } [ ! -z "${kver#"${kver%%[! ]*}"}" ] ||
{ echo "** unable to deduce kernel version" >&2; exit 1; }
cd /boot cd /boot
...@@ -20,6 +27,6 @@ for KVER in $kver; do ...@@ -20,6 +27,6 @@ for KVER in $kver; do
done done
# NB: e2k kernel builds "image" instead of "vmlinuz" # NB: e2k kernel builds "image" instead of "vmlinuz"
[ -f vmlinuz-$kver ] && ln -s vmlinuz-$kver vmlinuz ||: [ -f vmlinuz-$KVER ] && ln -s vmlinuz-$KVER vmlinuz ||:
ln -s initrd-$kver.img initrd.img # missing at this stage ln -s initrd-$KVER.img initrd.img # missing at this stage
: :
...@@ -20,6 +20,7 @@ else ...@@ -20,6 +20,7 @@ else
endif endif
endif endif
endif endif
@$(call xport,KFLAVOURS)
# r8168 is a kludge, never install it by default # r8168 is a kludge, never install it by default
use/kernel/net: use/kernel/net:
......
#!/bin/sh -x #!/bin/sh -x
kver="$(rpm -qa 'kernel-image*' \ [ -n "$GLOBAL_KFLAVOURS" ] ||
--qf '%{installtime} %{version}-%{name}-%{release}\n' \ { echo "** KFLAVOURS is empty" >&2; exit 0; }
| sort -n \
| cut -f 2 -d ' ' \
| sed 's/kernel-image-//')"
[ -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 for KVER in $kver; do
/sbin/installkernel --uboot --keep-initrd "$KVER" /sbin/installkernel --uboot --keep-initrd "$KVER"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment