summaryrefslogtreecommitdiffstats
path: root/main/syslinux
diff options
context:
space:
mode:
authorDubiousjim <dubiousjim@gmail.com>2013-06-29 16:41:21 -0400
committerNatanael Copa <ncopa@alpinelinux.org>2013-06-30 11:17:13 +0000
commite81e10dcbe9483a701ade938a5b64d353c6c60f1 (patch)
tree16e1db379fec5520781e14c44dad7ec8fe267808 /main/syslinux
parentc806a273d13463e250192199f2fe8c90eb282164 (diff)
downloadaports-e81e10dcbe9483a701ade938a5b64d353c6c60f1.tar.bz2
aports-e81e10dcbe9483a701ade938a5b64d353c6c60f1.tar.xz
main/syslinux: fix/refactor initramfs
If xen.gz is present, there are multiple kernels, and later ones lack an initramfs, they'll currently be (wrongly) configured to use a initramfs anyway. Fixed. We also refactor the check for /boot/initramfs-$tag, and configure this using a separate INITRD line, instead of adding it to the APPEND line. In passing, this also closes a second might-use-a-stale-initramfs bug.
Diffstat (limited to 'main/syslinux')
-rwxr-xr-xmain/syslinux/update-extlinux13
1 files changed, 7 insertions, 6 deletions
diff --git a/main/syslinux/update-extlinux b/main/syslinux/update-extlinux
index a4d4fa7b1..2b980a947 100755
--- a/main/syslinux/update-extlinux
+++ b/main/syslinux/update-extlinux
@@ -91,6 +91,8 @@ if [ -f "/boot/xen.gz" ]; then
if [ -f "/boot/initramfs-$tag" ]; then
everbose "Found initramfs: /boot/initramfs-$tag"
initramfs="initramfs-$tag"
+ else
+ initramfs=
fi
label=xen-$(grep -w -l $tag /usr/share/kernel/*/kernel.release \
| cut -d/ -f5)
@@ -113,11 +115,6 @@ fi
for kernel in $(find /boot -name "vmlinuz-*" -type f); do
tag=$(basename $kernel | cut -b9-)
everbose "Found kernel: $kernel"
-
- if [ -f "/boot/initramfs-$tag" ]; then
- everbose "Found initramfs: /boot/initramfs-$tag"
- initramfs="initrd=initramfs-$tag"
- fi
label=$(grep -w -l $tag /usr/share/kernel/*/kernel.release | cut -d/ -f5)
if [ -z "$label" ]; then
label=$lst
@@ -128,7 +125,11 @@ for kernel in $(find /boot -name "vmlinuz-*" -type f); do
fi
echo " MENU LABEL Linux $tag" >> $conf.new
echo " KERNEL $(basename $kernel)" >> $conf.new
- echo " APPEND $initramfs root=$root modules=${modules}${TYPE:+,$TYPE} $default_kernel_opts" >> $conf.new
+ if [ -f "/boot/initramfs-$tag" ]; then
+ everbose "Found initramfs: /boot/initramfs-$tag"
+ echo " INITRD initramfs-$tag" >> $conf.new
+ fi
+ echo " APPEND root=$root modules=${modules}${TYPE:+,$TYPE} $default_kernel_opts" >> $conf.new
echo "" >> $conf.new
lst=$(($lst + 1))
done