diskimage-builder/diskimage_builder/elements/zypper/post-install.d/10-mkinitrd
Andreas Florath e4e23897a1 Refactor: block-device filesystem creation, mount and fstab
This patch finalizes the block device refactoring.  It moves the three
remaining levels (filesystem creation, mount and fstab handling) into
the new python module.

Now it is possible to use any number of disk images, any number of
partitions and used them mounted to different directories.

Notes:

 * unmount_dir : modified to only unmount the subdirs mounted by
   mount_proc_sys_dev().  dib-block-device unmounts
   $TMP_MOUNT_PATH/mnt (see I85e01f3898d3c043071de5fad82307cb091a64a9)

Change-Id: I592c0b1329409307197460cfa8fd69798013f1f8
Signed-off-by: Andreas Florath <andreas@florath.net>
Closes-Bug: #1664924
2017-05-12 13:52:02 +02:00

24 lines
718 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=${DIB_ROOT_FSTYPE}" > /etc/sysconfig/initrd
# ToDo: This it not really clear to me.
# Let's see which error occurs.
# 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