2013-10-11 12:39:16 +00:00
|
|
|
#!/bin/bash
|
2014-04-22 21:44:37 +00:00
|
|
|
# The base image created by kiwi does not contain an initrd so create one
|
2014-09-04 04:56:29 +00:00
|
|
|
# here.
|
2013-10-11 12:39:16 +00:00
|
|
|
|
2014-09-04 04:56:29 +00:00
|
|
|
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
|
|
|
|
set -x
|
|
|
|
fi
|
2013-10-11 12:39:16 +00:00
|
|
|
set -eu
|
2014-04-03 02:24:15 +00:00
|
|
|
set -o pipefail
|
2013-10-11 12:39:16 +00:00
|
|
|
|
|
|
|
# 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).
|
2017-01-29 23:52:40 +00:00
|
|
|
echo "rootfstype=${DIB_ROOT_FSTYPE}" > /etc/sysconfig/initrd
|
2013-10-11 12:39:16 +00:00
|
|
|
|
2017-01-29 23:52:40 +00:00
|
|
|
# ToDo: This it not really clear to me.
|
|
|
|
# Let's see which error occurs.
|
2014-04-22 21:44:37 +00:00
|
|
|
# openSuse mkinitrd requires a valid root device be in fstab.
|
2017-01-29 23:52:40 +00:00
|
|
|
##sed -i 's/vda1/sda1/' /etc/fstab
|
2014-04-22 21:44:37 +00:00
|
|
|
mkinitrd -A -B
|
2013-10-11 12:39:16 +00:00
|
|
|
|
|
|
|
# And cleanup again
|
|
|
|
rm /etc/sysconfig/initrd
|