diskimage-builder/elements/zypper/post-install.d/10-mkinitrd
Markos Chandras 8dde310cf3 Move the opensuse mkinitrd script to the zypper element
All SUSE-based elements can benefit from the mkinitrd phase to move it
to a more generic location.

Change-Id: Ife171d462a393b6ac0bf2c5eaa48ea25eaf4d1cc
2016-10-05 09:11:00 +01:00

23 lines
628 B
Bash
Executable File

#!/bin/bash
# The base image created by kiwi does not contain an initrd so create one
# here.
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
# This is to tell mkinitrd to include the right tools for the root filesystem
# that will actually be used for the final image. This is likely something
# different than what the chroot is currently on (which might currently be a
# tmpfs even).
echo "rootfstype=$FS_TYPE" > /etc/sysconfig/initrd
# openSuse mkinitrd requires a valid root device be in fstab.
sed -i 's/vda1/sda1/' /etc/fstab
mkinitrd -A -B
# And cleanup again
rm /etc/sysconfig/initrd