summaryrefslogtreecommitdiffstats
path: root/dracut/generate-initramfs
diff options
context:
space:
mode:
authorGatis Paeglis <gatis.paeglis@qt.io>2017-01-02 12:00:45 +0100
committerGatis Paeglis <gatis.paeglis@qt.io>2017-01-05 08:50:38 +0000
commit21703b921dc113bee64e65e3e63bb5482a15c734 (patch)
treef652b0e14596fda5d2b9968a408da42c961036b8 /dracut/generate-initramfs
parent67d7afa9def07eac716ea164fa1a2be101c420de (diff)
Remove the remaining traces of System V support
Support for System V was dropped a while back for the following reasons: - b2qt images have switched to systemd by default, therefore System V code path is untested and can't be officially supported. - supporting anyting else than systemd is not a high priority (if somebody really wants to use some other init system, that can be done with little extra effort). Change-Id: I33295d85ff72af232bf431989b5244f15b62747a Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Diffstat (limited to 'dracut/generate-initramfs')
-rwxr-xr-xdracut/generate-initramfs26
1 files changed, 9 insertions, 17 deletions
diff --git a/dracut/generate-initramfs b/dracut/generate-initramfs
index 2e46f21..4471611 100755
--- a/dracut/generate-initramfs
+++ b/dracut/generate-initramfs
@@ -68,11 +68,10 @@ generate_initramfs()
{
MODULE_PATH=/usr/lib/dracut/modules.d/
- substring="No such file or directory"
- output=$("${ADB}" shell ls /lib/systemd/systemd)
- systemd=false
- if [[ $output != *${substring}* ]] ; then
- systemd=true
+ init_system=$(basename $("${ADB}" shell readlink -f /sbin/init) | tr -d '\r')
+ if [ "$init_system" != "systemd" ] ; then
+ echo "error: Failed to detected systemd init support on the image"
+ exit 1
fi
options='/boot/initramfs.img
@@ -82,18 +81,11 @@ generate_initramfs()
--stdlog 3
--force'
- if [ ${systemd} = true ] ; then
- # OSTree ships with a dracut module for systemd based images.
- echo "Generating initramfs for systemd based image ..."
- "${ADB}" push "${ROOT}"/systemd/01-qt.conf /etc/dracut.conf.d/
- "${ADB}" push "${ROOT}"/systemd/e2fsck.conf /etc/
- custom_options="--add systemd --install /etc/e2fsck.conf"
- else
- # Deploy our custom dracut module for systemd-less images.
- echo "WARNING: Failed to detect systemd init support. Using System V as a fallback init system ..."
- "${ADB}" push "${ROOT}"/systemv/ "${MODULE_PATH}"/98ostree/
- custom_options="--omit systemd"
- fi
+ # OSTree ships with a dracut module for systemd based images.
+ echo "Generating initramfs for systemd based image ..."
+ "${ADB}" push "${ROOT}"/systemd/01-qt.conf /etc/dracut.conf.d/
+ "${ADB}" push "${ROOT}"/systemd/e2fsck.conf /etc/
+ custom_options="--add systemd --install /etc/e2fsck.conf"
# Recovery module parts
#"${ADB}" push "${ROOT}"/recovery/ "${MODULE_PATH}"/98recovery/