Use common element select-boot-kernel-initrd
Several elements were using almost similar code to get the current kernel and initrd inside an image. After factoring out this code into a common element, modify the elements to make use of it. Change-Id: Ib547cd96b2b354b1c97342cacf5f0d0a3f70a3da
This commit is contained in:
parent
4c977082c4
commit
156d3495e0
1
elements/dracut-network/element-deps
Normal file
1
elements/dracut-network/element-deps
Normal file
@ -0,0 +1 @@
|
|||||||
|
select-boot-kernel-initrd
|
@ -3,16 +3,8 @@
|
|||||||
set -eu
|
set -eu
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
# Prioritize PAE if present
|
RET=$(/bin/select-boot-kernel-initrd)
|
||||||
KERNEL=$(basename `ls -1rv /boot/vmlinuz* | grep PAE | grep -v debug | head -1`)
|
KERNEL_VERSION=`echo ${RET%:*} | sed 's/vmlinuz-//g'`
|
||||||
if [ ! $KERNEL ]; then
|
RAMDISK=/boot/${RET#*:}
|
||||||
KERNEL=$(basename `ls -1rv /boot/vmlinuz* | grep -v debug | head -1`)
|
|
||||||
if [ ! $KERNEL ]; then
|
|
||||||
echo "No suitable kernel found."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
KERNEL_VERSION=`echo $KERNEL | sed 's/vmlinuz-//g'`
|
|
||||||
RAMDISK=/boot/initramfs-$KERNEL_VERSION.img
|
|
||||||
|
|
||||||
dracut --force --add "network" $RAMDISK $KERNEL_VERSION
|
dracut --force --add "network" $RAMDISK $KERNEL_VERSION
|
||||||
|
Loading…
Reference in New Issue
Block a user