Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12:GA
dracut
0104-Generate-fallback-mount-unit-for-root-file...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0104-Generate-fallback-mount-unit-for-root-filesystem.patch of Package dracut
From 7bbe5a2608be72ecc51c3a28f0da1ddaf522e293 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens <tbehrens@suse.com> Date: Mon, 7 Jul 2014 01:14:45 +0200 Subject: Generate fallback mount unit for root filesystem If kernel cmdline has no root= provided, *and* the initrd carries a default value, create a systemd mount unit to have it available in /sysroot References: bnc#855258 Signed-off-by: Thorsten Behrens <tbehrens@suse.com> --- modules.d/98systemd/rootfs-generator.sh | 34 ++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/modules.d/98systemd/rootfs-generator.sh b/modules.d/98systemd/rootfs-generator.sh index a2b71ff..13428da 100755 --- a/modules.d/98systemd/rootfs-generator.sh +++ b/modules.d/98systemd/rootfs-generator.sh @@ -37,6 +37,35 @@ generator_wait_for_dev() fi } +generator_mount_rootfs() +{ + local _type=$2 + local _flags=$3 + local _name + + [ -z "$1" ] && return 0 + + _name=$(dev_unit_name "$1") + [ -d /run/systemd/generator ] || mkdir -p /run/systemd/generator + if ! [ -f /run/systemd/generator/sysroot.mount ]; then + { + echo "[Unit]" + echo "Before=initrd-root-fs.target" + echo "RequiresOverridable=systemd-fsck@${_name}.service" + echo "After=systemd-fsck@${_name}.service" + echo "[Mount]" + echo "Where=/sysroot" + echo "What=$1" + echo "Options=${_flags}" + echo "Type=${_type}" + } > /run/systemd/generator/sysroot.mount + fi + if ! [ -L /run/systemd/generator/initrd-root-fs.target.requires/sysroot.mount ]; then + [ -d /run/systemd/generator/initrd-root-fs.target.requires ] || mkdir -p /run/systemd/generator/initrd-root-fs.target.requires + ln -s ../sysroot.mount /run/systemd/generator/initrd-root-fs.target.requires/sysroot.mount + fi +} + root=$(getarg root=) case "$root" in block:LABEL=*|LABEL=*) @@ -63,6 +92,9 @@ case "$root" in rootok=1 ;; esac -[ "${root%%:*}" = "block" ] && generator_wait_for_dev "${root#block:}" "$RDRETRY" +if [ "${root%%:*}" = "block" ]; then + generator_wait_for_dev "${root#block:}" "$RDRETRY" + grep -q 'root=' /proc/cmdline || generator_mount_rootfs "${root#block:}" "$(getarg rootfstype=)" "$(getarg rootflags=)" +fi exit 0 -- 1.8.4.5
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor