Merge "Parameterise PXE kernel and initrd selection"
This commit is contained in:
commit
de8073d4d3
@ -3,3 +3,11 @@ This is the baremetal (IE: real hardware) element.
|
|||||||
Does the following:
|
Does the following:
|
||||||
|
|
||||||
* extracts the kernel and initial ramdisk of the built image.
|
* extracts the kernel and initial ramdisk of the built image.
|
||||||
|
|
||||||
|
Optional parameters:
|
||||||
|
|
||||||
|
* DIB_BAREMETAL_KERNEL_PATTERN and DIB_BAREMETAL_INITRD_PATTERN
|
||||||
|
may be supplied to specify which kernel files are preferred; this
|
||||||
|
can be of use when using custom kernels that don't fit the
|
||||||
|
standard naming patterns. Both variables must be provided in
|
||||||
|
order for them to have any effect.
|
||||||
|
@ -23,7 +23,10 @@ set -o pipefail
|
|||||||
BOOTDIR="$TARGET_ROOT/boot"
|
BOOTDIR="$TARGET_ROOT/boot"
|
||||||
KERNEL=
|
KERNEL=
|
||||||
RAMDISK=
|
RAMDISK=
|
||||||
if [ -f $TARGET_ROOT/etc/redhat-release ]; then
|
if [ -n "${DIB_BAREMETAL_KERNEL_PATTERN:-}" -a -n "${DIB_BAREMETAL_INITRD_PATTERN:-}" ]; then
|
||||||
|
KERNEL=$(basename `eval ls -1rv "$BOOTDIR/${DIB_BAREMETAL_KERNEL_PATTERN}" | head -1`)
|
||||||
|
RAMDISK=$(basename `eval ls -1rv "$BOOTDIR/${DIB_BAREMETAL_INITRD_PATTERN}" | head -1`)
|
||||||
|
elif [ -f $TARGET_ROOT/etc/redhat-release ]; then
|
||||||
|
|
||||||
# Prioritize PAE if present
|
# Prioritize PAE if present
|
||||||
KERNEL=$(ls -1rv $BOOTDIR/vmlinuz* | grep PAE | grep -v debug | head -1 || echo "")
|
KERNEL=$(ls -1rv $BOOTDIR/vmlinuz* | grep PAE | grep -v debug | head -1 || echo "")
|
||||||
|
Loading…
Reference in New Issue
Block a user