diskimage-builder/elements/dracut-network/finalise.d/98-regenerate-initramfs
Ghe Rivero 156d3495e0 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
2014-06-26 10:19:09 +00:00

10 lines
211 B
Bash
Executable file

#!/bin/bash
set -eu
set -o pipefail
RET=$(/bin/select-boot-kernel-initrd)
KERNEL_VERSION=`echo ${RET%:*} | sed 's/vmlinuz-//g'`
RAMDISK=/boot/${RET#*:}
dracut --force --add "network" $RAMDISK $KERNEL_VERSION