From e2833744e03b923fe7f619abd1c2393e60246a721a6301b341dc77f9c3143fbc Mon Sep 17 00:00:00 2001 From: Thomas Renninger Date: Fri, 11 Sep 2015 13:57:10 +0000 Subject: [PATCH 1/6] Accepting request 330513 from home:favogt:branches:Base:System Change the way /sysroot is mounted in dracut with systemd. OBS-URL: https://build.opensuse.org/request/show/330513 OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=225 --- 0400-use_fstab_systemd.patch | 185 +++++++++++++++++++++++++++++ 0401-mount_option_mountpoint.patch | 57 +++++++++ dracut.changes | 13 ++ dracut.spec | 6 + 4 files changed, 261 insertions(+) create mode 100644 0400-use_fstab_systemd.patch create mode 100644 0401-mount_option_mountpoint.patch diff --git a/0400-use_fstab_systemd.patch b/0400-use_fstab_systemd.patch new file mode 100644 index 0000000..148c82e --- /dev/null +++ b/0400-use_fstab_systemd.patch @@ -0,0 +1,185 @@ +From: Fabian Vogt +Subject: Use /etc/fstab for /sysroot instead of custom sysroot.mount + +systemd-fstab-generator is capable of mounting /sysroot itself, +looking at /proc/cmdline if root= is set. + +Index: dracut-043/modules.d/00systemd/module-setup.sh +=================================================================== +--- dracut-043.orig/modules.d/00systemd/module-setup.sh ++++ dracut-043/modules.d/00systemd/module-setup.sh +@@ -14,7 +14,7 @@ check() { + + # called by dracut + depends() { +- return 0 ++ echo fs-lib + } + + installkernel() { +@@ -22,6 +22,23 @@ installkernel() { + instmods -s efivarfs + } + ++fstab_sysroot() { ++ local _dev=/dev/block/$(find_root_block_device) ++ local _fstype _flags _subvol ++ if [ -e $_dev ]; then ++ _dev=$(shorten_persistent_dev "$(get_persistent_dev "$_dev")") ++ _fstype="$(find_mp_fstype /)" ++ _flags="$(find_mp_fsopts /)" ++ ++ if [[ $use_fstab != yes ]] && [[ $_fstype = btrfs ]]; then ++ _subvol=$(findmnt -e -v -n -o FSROOT --target /) \ ++ && _subvol=${_subvol#/} ++ _flags="$_flags,${_subvol:+subvol=$_subvol}" ++ fi ++ printf "%s /sysroot %s %s 1 1\n" "$_dev" "$_fstype" "${_flags#,}" ++ fi ++} ++ + # called by dracut + install() { + local _mods +@@ -216,5 +233,8 @@ install() { + } >> "$initdir/etc/systemd/journald.conf" + + ln_r "${systemdsystemunitdir}/multi-user.target" "${systemdsystemunitdir}/default.target" ++ ++ # Add entry for /sysroot to /etc/fstab ++ fstab_sysroot >> "$initdir/etc/fstab" + } + +Index: dracut-043/modules.d/95rootfs-block/module-setup.sh +=================================================================== +--- dracut-043.orig/modules.d/95rootfs-block/module-setup.sh ++++ dracut-043/modules.d/95rootfs-block/module-setup.sh +@@ -48,22 +48,25 @@ cmdline_rootfs() { + + # called by dracut + cmdline() { +- cmdline_rootfs +- cmdline_journal ++ # When using systemd, we're storing the root device in /etc/fstab instead. ++ if ! dracut_module_included "systemd"; then ++ cmdline_rootfs ++ cmdline_journal ++ fi + } + + # called by dracut + install() { +- if [[ $hostonly_cmdline == "yes" ]]; then +- local _journaldev=$(cmdline_journal) +- [[ $_journaldev ]] && printf "%s\n" "$_journaldev" >> "${initdir}/etc/cmdline.d/95root-journaldev.conf" +- local _rootdev=$(cmdline_rootfs) +- [[ $_rootdev ]] && printf "%s\n" "$_rootdev" >> "${initdir}/etc/cmdline.d/95root-dev.conf" +- fi +- + inst_multiple umount + inst_multiple tr + if ! dracut_module_included "systemd"; then ++ if [[ $hostonly_cmdline == "yes" ]]; then ++ local _journaldev=$(cmdline_journal) ++ [[ $_journaldev ]] && printf "%s\n" "$_journaldev" >> "${initdir}/etc/cmdline.d/95root-journaldev.conf" ++ local _rootdev=$(cmdline_rootfs) ++ [[ $_rootdev ]] && printf "%s\n" "$_rootdev" >> "${initdir}/etc/cmdline.d/95root-dev.conf" ++ fi ++ + inst_hook cmdline 95 "$moddir/parse-block.sh" + inst_hook pre-udev 30 "$moddir/block-genrules.sh" + inst_hook mount 99 "$moddir/mount-root.sh" +Index: dracut-043/modules.d/98dracut-systemd/dracut-cmdline.sh +=================================================================== +--- dracut-043.orig/modules.d/98dracut-systemd/dracut-cmdline.sh ++++ dracut-043/modules.d/98dracut-systemd/dracut-cmdline.sh +@@ -68,8 +68,12 @@ case "$root" in + rootok=1 ;; + esac + +-[ -z "$root" ] && die "No or empty root= argument" +-[ -z "$rootok" ] && die "Don't know how to handle 'root=$root'" ++if [ -z "$root" ]; then ++ root=$(findmnt --fstab -n --output source --target /sysroot) ++ [ -z "$root" ] && die "No or empty root= argument and not in fstab" ++elif [ -z "$rootok" ]; then ++ die "Don't know how to handle 'root=$root'" ++fi + + export root rflags fstype netroot NEWROOT + +Index: dracut-043/modules.d/98dracut-systemd/rootfs-generator.sh +=================================================================== +--- dracut-043.orig/modules.d/98dracut-systemd/rootfs-generator.sh ++++ dracut-043/modules.d/98dracut-systemd/rootfs-generator.sh +@@ -36,35 +36,6 @@ 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 "$GENERATOR_DIR" ] || mkdir -p "$GENERATOR_DIR" +- if ! [ -f "$GENERATOR_DIR"/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}" +- } > "$GENERATOR_DIR"/sysroot.mount +- fi +- if ! [ -L "$GENERATOR_DIR"/initrd-root-fs.target.requires/sysroot.mount ]; then +- [ -d "$GENERATOR_DIR"/initrd-root-fs.target.requires ] || mkdir -p "$GENERATOR_DIR"/initrd-root-fs.target.requires +- ln -s ../sysroot.mount "$GENERATOR_DIR"/initrd-root-fs.target.requires/sysroot.mount +- fi +-} +- + generator_fsck_after_pre_mount() + { + local _name +@@ -111,9 +82,12 @@ esac + GENERATOR_DIR="$1" + + if [ "${root%%:*}" = "block" ]; then +- generator_wait_for_dev "${root#block:}" "$RDRETRY" +- generator_fsck_after_pre_mount "${root#block:}" +- strstr "$(cat /proc/cmdline)" 'root=' || generator_mount_rootfs "${root#block:}" "$(getarg rootfstype=)" "$(getarg rootflags=)" ++ generator_wait_for_dev "${root#block:}" "$RDRETRY" ++ generator_fsck_after_pre_mount "${root#block:}" ++ if ! [ -L "$GENERATOR_DIR"/initrd-root-fs.target.requires/sysroot.mount ]; then ++ [ -d "$GENERATOR_DIR"/initrd-root-fs.target.requires ] || mkdir -p "$GENERATOR_DIR"/initrd-root-fs.target.requires ++ ln -s ../sysroot.mount "$GENERATOR_DIR"/initrd-root-fs.target.requires/sysroot.mount ++ fi + fi + + exit 0 +Index: dracut-043/modules.d/99base/init.sh +=================================================================== +--- dracut-043.orig/modules.d/99base/init.sh ++++ dracut-043/modules.d/99base/init.sh +@@ -128,8 +128,12 @@ make_trace_mem "hook cmdline" '1+:mem' ' + getarg 'rd.break=cmdline' -d 'rdbreak=cmdline' && emergency_shell -n cmdline "Break before cmdline" + source_hook cmdline + +-[ -z "$root" ] && die "No or empty root= argument" +-[ -z "$rootok" ] && die "Don't know how to handle 'root=$root'" ++if [ -z "$root" ]; then ++ root=$(findmnt --fstab -n --output source --target /sysroot) ++ [ -z "$root" ] && die "No or empty root= argument and not in fstab" ++elif [ -z "$rootok" ]; then ++ die "Don't know how to handle 'root=$root'" ++fi + + export root rflags fstype netroot NEWROOT + diff --git a/0401-mount_option_mountpoint.patch b/0401-mount_option_mountpoint.patch new file mode 100644 index 0000000..21a6082 --- /dev/null +++ b/0401-mount_option_mountpoint.patch @@ -0,0 +1,57 @@ +From: Fabian Vogt +Subject: dracut.sh: Support --mount with just mountpoint as parameter + +Right now the --mount parameter of dracut expects a rather long fstab-like +line. This makes it possible to invoke dracut with e.g. --mount /boot. + +Index: dracut-043/dracut.8.asc +=================================================================== +--- dracut-043.orig/dracut.8.asc ++++ dracut-043/dracut.8.asc +@@ -338,6 +338,10 @@ provide a valid _/etc/fstab_. + The default __ is "0". + the default __ is "2". + ++**--mount** "__":: ++ Like above, but __, __ and __ ++ are determined by looking at the current mounts. ++ + **--add-device** __ :: + Bring up __ in initramfs, __ should be the device name. + This can be useful in hostonly mode for resume support when your swap is on +Index: dracut-043/dracut.sh +=================================================================== +--- dracut-043.orig/dracut.sh ++++ dracut-043/dracut.sh +@@ -152,6 +152,8 @@ Creates initial ramdisk images for prelo + --mount "[DEV] [MP] [FSTYPE] [FSOPTS]" + Mount device [DEV] on mountpoint [MP] with filesystem + [FSTYPE] and options [FSOPTS] in the initramfs ++ --mount "[MP]" Same as above, but [DEV], [FSTYPE] and [FSOPTS] are ++ determined by looking at the current mounts. + --add-device "[DEV]" Bring up [DEV] in initramfs + -i, --include [SOURCE] [TARGET] + Include the files in the SOURCE directory into the +@@ -1536,9 +1538,21 @@ if [[ $kernel_only != yes ]]; then + + while pop fstab_lines line; do + line=($line) +- [ -z "${line[3]}" ] && line[3]="defaults" ++ ++ if [ -z "${line[1]}" ]; then ++ # Determine device and mount options from current system ++ mountpoint -q "${line[0]}" || derror "${line[0]} is not a mount point!" ++ line=($(findmnt --raw -n --target "${line[0]}" --output=source,target,fstype,options)) ++ dinfo "Line for ${line[1]}: ${line[@]}" ++ else ++ # Use default options ++ [ -z "${line[3]}" ] && line[3]="defaults" ++ fi ++ ++ # Default options for freq and passno + [ -z "${line[4]}" ] && line[4]="0" + [ -z "${line[5]}" ] && line[5]="2" ++ + strstr "${line[2]}" "nfs" && line[5]="0" + echo "${line[@]}" >> "${initdir}/etc/fstab" + done diff --git a/dracut.changes b/dracut.changes index 995cecc..89ab8a2 100644 --- a/dracut.changes +++ b/dracut.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Fri Sep 11 11:06:46 UTC 2015 - fvogt@suse.com + +- Add 0401-mount_option_mountpoint.patch: + Make it possible to use a mountpoint as --mount parameter + +------------------------------------------------------------------- +Fri Sep 11 10:56:42 UTC 2015 - fvogt@suse.com + +- Add experimental 0400-use_fstab_systemd.patch: + Add entry for /sysroot in /etc/fstab instead of relying + on root= and rootflags= + ------------------------------------------------------------------- Sun Aug 23 19:14:15 UTC 2015 - seife+obs@b1-systems.com diff --git a/dracut.spec b/dracut.spec index bd21154..b5a6b06 100644 --- a/dracut.spec +++ b/dracut.spec @@ -116,6 +116,9 @@ Patch202: dracut_dmraid_use_udev.patch ## fix for SUSE systems which have dpkg installed anyway Patch300: dracut_dont_use_dpkg_defaults_on_SUSE.patch +Patch400: 0400-use_fstab_systemd.patch +Patch401: 0401-mount_option_mountpoint.patch + BuildRequires: asciidoc BuildRequires: bash BuildRequires: docbook-xsl-stylesheets @@ -245,6 +248,9 @@ and its cryptography during startup. %patch300 -p1 +%patch400 -p1 +%patch401 -p1 + %build %configure\ --systemdsystemunitdir=%{_unitdir}\ From 79df380af0a7b4d5507881fdd111ab7c3b8431729ec4237aa88ae58bd40e5059 Mon Sep 17 00:00:00 2001 From: Thomas Renninger Date: Wed, 16 Sep 2015 09:17:31 +0000 Subject: [PATCH 2/6] Accepting request 330991 from home:tsaupe:branches:Base:System:bsc943312-dracut fix systemd-vconsole-error in initrd (bsc#943312) OBS-URL: https://build.opensuse.org/request/show/330991 OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=226 --- 0180-add-trivial-vconsole-fontmap.patch | 12 ++++++++++++ dracut.changes | 6 ++++++ dracut.spec | 2 ++ 3 files changed, 20 insertions(+) create mode 100644 0180-add-trivial-vconsole-fontmap.patch diff --git a/0180-add-trivial-vconsole-fontmap.patch b/0180-add-trivial-vconsole-fontmap.patch new file mode 100644 index 0000000..28bfa4e --- /dev/null +++ b/0180-add-trivial-vconsole-fontmap.patch @@ -0,0 +1,12 @@ +Index: dracut-043/modules.d/98dracut-systemd/module-setup.sh +=================================================================== +--- dracut-043.orig/modules.d/98dracut-systemd/module-setup.sh ++++ dracut-043/modules.d/98dracut-systemd/module-setup.sh +@@ -70,5 +70,7 @@ install() { + done + + inst_simple "$moddir/dracut-tmpfiles.conf" "$tmpfilesdir/dracut-tmpfiles.conf" ++ ++ inst_simple /usr/share/kbd/consoletrans/trivial + } + diff --git a/dracut.changes b/dracut.changes index 89ab8a2..c3dce40 100644 --- a/dracut.changes +++ b/dracut.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Sep 14 11:33:51 UTC 2015 - thomas.blume@suse.com + +- fix systemd-vconsole-error in initrd (bsc#943312) + Add 0180-dracut-add-trivial-vconsole-fontmap.patch + ------------------------------------------------------------------- Fri Sep 11 11:06:46 UTC 2015 - fvogt@suse.com diff --git a/dracut.spec b/dracut.spec index b5a6b06..2bc2b86 100644 --- a/dracut.spec +++ b/dracut.spec @@ -101,6 +101,7 @@ Patch163: 0163-Install-etc-sysconfig-console-to-see-specific-fonts.patch Patch164: 0164-Fix-initramfs-ver.img-vs-initrd-ver-in-dracut-initra.patch Patch165: 0165-Order-root-fsck-after-pre-mount.patch Patch168: 0168-remove_plymouth_logo_file.patch +Patch180: 0180-add-trivial-vconsole-fontmap.patch # Still needed Patch133: 0133-Allow-multiple-configurations-per-network-interface-.patch @@ -241,6 +242,7 @@ and its cryptography during startup. %patch164 -p1 %patch165 -p1 %patch168 -p1 +%patch180 -p1 %patch200 -p1 %patch201 -p1 From d26a160145f974ff2b476bd65da709ea42a657988b83b4afd151728958eb13f4 Mon Sep 17 00:00:00 2001 From: Thomas Renninger Date: Thu, 17 Sep 2015 07:45:51 +0000 Subject: [PATCH 3/6] Accepting request 331496 from home:favogt:branches:Base:System Fix systemd-vconsole-error properly (bsc#943312 and bsc#932981) -Rewrite 0180-dracut-add-trivial-vconsole-fontmap.patch as 0180-i18n_add_correct_fontmaps.patch OBS-URL: https://build.opensuse.org/request/show/331496 OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=227 --- 0180-add-trivial-vconsole-fontmap.patch | 12 ------------ 0180-i18n_add_correct_fontmaps.patch | 17 +++++++++++++++++ dracut.changes | 7 +++++++ dracut.spec | 2 +- 4 files changed, 25 insertions(+), 13 deletions(-) delete mode 100644 0180-add-trivial-vconsole-fontmap.patch create mode 100644 0180-i18n_add_correct_fontmaps.patch diff --git a/0180-add-trivial-vconsole-fontmap.patch b/0180-add-trivial-vconsole-fontmap.patch deleted file mode 100644 index 28bfa4e..0000000 --- a/0180-add-trivial-vconsole-fontmap.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: dracut-043/modules.d/98dracut-systemd/module-setup.sh -=================================================================== ---- dracut-043.orig/modules.d/98dracut-systemd/module-setup.sh -+++ dracut-043/modules.d/98dracut-systemd/module-setup.sh -@@ -70,5 +70,7 @@ install() { - done - - inst_simple "$moddir/dracut-tmpfiles.conf" "$tmpfilesdir/dracut-tmpfiles.conf" -+ -+ inst_simple /usr/share/kbd/consoletrans/trivial - } - diff --git a/0180-i18n_add_correct_fontmaps.patch b/0180-i18n_add_correct_fontmaps.patch new file mode 100644 index 0000000..7712875 --- /dev/null +++ b/0180-i18n_add_correct_fontmaps.patch @@ -0,0 +1,17 @@ +Index: dracut-043/modules.d/10i18n/module-setup.sh +=================================================================== +--- dracut-043.orig/modules.d/10i18n/module-setup.sh ++++ dracut-043/modules.d/10i18n/module-setup.sh +@@ -196,7 +196,11 @@ install() { + if [[ ${FONT_MAP} ]] + then + FONT_MAP=${FONT_MAP%.trans} +- inst_simple ${kbddir}/consoletrans/${FONT_MAP}.trans ++ # There are three different formats that setfont supports ++ inst_simple ${kbddir}/consoletrans/${FONT_MAP} \ ++ || inst_simple ${kbddir}/consoletrans/${FONT_MAP}.trans \ ++ || inst_simple ${kbddir}/consoletrans/${FONT_MAP}_to_uni.trans \ ++ || dwarn "Could not find FONT_MAP ${FONT_MAP}!" + fi + + if [[ ${FONT_UNIMAP} ]] diff --git a/dracut.changes b/dracut.changes index c3dce40..a5e04ff 100644 --- a/dracut.changes +++ b/dracut.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Sep 16 12:12:12 UTC 2015 - fvogt@suse.com + +- Fix systemd-vconsole-error properly (bsc#943312 and bsc#932981) + Rewrite 0180-dracut-add-trivial-vconsole-fontmap.patch + as 0180-i18n_add_correct_fontmaps.patch + ------------------------------------------------------------------- Mon Sep 14 11:33:51 UTC 2015 - thomas.blume@suse.com diff --git a/dracut.spec b/dracut.spec index 2bc2b86..750d443 100644 --- a/dracut.spec +++ b/dracut.spec @@ -101,7 +101,7 @@ Patch163: 0163-Install-etc-sysconfig-console-to-see-specific-fonts.patch Patch164: 0164-Fix-initramfs-ver.img-vs-initrd-ver-in-dracut-initra.patch Patch165: 0165-Order-root-fsck-after-pre-mount.patch Patch168: 0168-remove_plymouth_logo_file.patch -Patch180: 0180-add-trivial-vconsole-fontmap.patch +Patch180: 0180-i18n_add_correct_fontmaps.patch # Still needed Patch133: 0133-Allow-multiple-configurations-per-network-interface-.patch From 7a97064f3e029d77b8dee21a8af68f021441e80a209b92aa1214fa3613d1162b Mon Sep 17 00:00:00 2001 From: Thomas Renninger Date: Tue, 22 Sep 2015 15:10:26 +0000 Subject: [PATCH 4/6] Accepting request 332598 from home:favogt:branches:Base:System -Add patch 0181-no_systemd_cryptsetup.patch: - rd.luks.key is not implemented (properly) if systemd is enabled, so ignore systemd in 90crypt -Fixes boo#915849 OBS-URL: https://build.opensuse.org/request/show/332598 OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=228 --- 0181-no_systemd_cryptsetup.patch | 128 +++++++++++++++++++++++++++++++ dracut.changes | 8 ++ dracut.spec | 2 + 3 files changed, 138 insertions(+) create mode 100644 0181-no_systemd_cryptsetup.patch diff --git a/0181-no_systemd_cryptsetup.patch b/0181-no_systemd_cryptsetup.patch new file mode 100644 index 0000000..294b2d0 --- /dev/null +++ b/0181-no_systemd_cryptsetup.patch @@ -0,0 +1,128 @@ +From 56f390967ff87515f7269f4793b9a651f0e3b87c Mon Sep 17 00:00:00 2001 +From: Fabian Vogt +Date: Mon, 21 Sep 2015 12:37:14 +0200 +Subject: [PATCH] 90crypt: Don't use systemd for crypt + +- rd.luks.key is not implemented (properly) if systemd is enabled, + so ignore systemd in 90crypt +- Source of this patch: + https://github.com/jsynacek/dracut/commit/058aa18e3ec2bd6b34e6afff0f2653d742dea0f5 +- Fixes boo#915849 + +Signed-off-by: Fabian Vogt +--- + modules.d/90crypt/crypt-run-generator.sh | 31 ------------------------------- + modules.d/90crypt/module-setup.sh | 9 --------- + modules.d/90crypt/parse-crypt.sh | 20 -------------------- + 3 files changed, 60 deletions(-) + delete mode 100755 modules.d/90crypt/crypt-run-generator.sh + +diff --git a/modules.d/90crypt/crypt-run-generator.sh b/modules.d/90crypt/crypt-run-generator.sh +deleted file mode 100755 +index 3c5d7b1..0000000 +--- a/modules.d/90crypt/crypt-run-generator.sh ++++ /dev/null +@@ -1,31 +0,0 @@ +-#!/bin/sh +- +-. /lib/dracut-lib.sh +-type crypttab_contains >/dev/null 2>&1 || . /lib/dracut-crypt-lib.sh +- +-dev=$1 +-luks=$2 +- +-crypttab_contains "$luks" && exit 0 +- +-allowdiscards="-" +- +-# parse for allow-discards +-if strstr "$(cryptsetup --help)" "allow-discards"; then +- if discarduuids=$(getargs "rd.luks.allow-discards"); then +- discarduuids=$(str_replace "$discarduuids" 'luks-' '') +- if strstr " $discarduuids " " ${luks##luks-}"; then +- allowdiscards="allow-discards" +- fi +- elif getargbool 0 rd.luks.allow-discards; then +- allowdiscards="allow-discards" +- fi +-fi +- +-echo "$luks $dev - timeout=0,$allowdiscards" >> /etc/crypttab +- +-if command -v systemctl >/dev/null; then +- systemctl daemon-reload +- systemctl start cryptsetup.target +-fi +-exit 0 +diff --git a/modules.d/90crypt/module-setup.sh b/modules.d/90crypt/module-setup.sh +index 721b447..a73e4ee 100755 +--- a/modules.d/90crypt/module-setup.sh ++++ b/modules.d/90crypt/module-setup.sh +@@ -89,14 +89,5 @@ install() { + inst_simple "$moddir/crypt-lib.sh" "/lib/dracut-crypt-lib.sh" + inst_simple "/tmp/dracut_block_uuid.map" "/usr/lib/dracut/modules.d/90crypt/block_uuid.map" + +- inst_multiple -o \ +- $systemdutildir/system-generators/systemd-cryptsetup-generator \ +- $systemdutildir/systemd-cryptsetup \ +- $systemdsystemunitdir/systemd-ask-password-console.path \ +- $systemdsystemunitdir/systemd-ask-password-console.service \ +- $systemdsystemunitdir/cryptsetup.target \ +- $systemdsystemunitdir/sysinit.target.wants/cryptsetup.target \ +- systemd-ask-password systemd-tty-ask-password-agent +- inst_script "$moddir"/crypt-run-generator.sh /sbin/crypt-run-generator + dracut_need_initqueue + } +diff --git a/modules.d/90crypt/parse-crypt.sh b/modules.d/90crypt/parse-crypt.sh +index 5bda006..d84ff62 100755 +--- a/modules.d/90crypt/parse-crypt.sh ++++ b/modules.d/90crypt/parse-crypt.sh +@@ -25,7 +25,6 @@ else + + luksid=${luksid##luks-} + +- if [ -z "$DRACUT_SYSTEMD" ]; then + { + printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", ' + printf -- 'ENV{ID_FS_UUID}=="*%s*", ' $luksid +@@ -33,17 +32,6 @@ else + printf -- '--name cryptroot-ask-%%k %s ' $(command -v cryptroot-ask) + printf -- '$env{DEVNAME} luks-$env{ID_FS_UUID} %s"\n' $tout + } >> /etc/udev/rules.d/70-luks.rules.new +- else +- if ! crypttab_contains "$luksid"; then +- { +- printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", ' +- printf -- 'ENV{ID_FS_UUID}=="*%s*", ' $luksid +- printf -- 'RUN+="%s --settled --unique --onetime ' $(command -v initqueue) +- printf -- '--name systemd-cryptsetup-%%k %s start ' $(command -v systemctl) +- printf -- 'systemd-cryptsetup@luks$$(dev_unit_name -$env{ID_FS_UUID}).service"\n' +- } >> /etc/udev/rules.d/70-luks.rules.new +- fi +- fi + + uuid=$luksid + while [ "$uuid" != "${uuid#*-}" ]; do uuid=${uuid%%-*}${uuid#*-}; done +@@ -56,19 +44,11 @@ else + } >> $hookdir/emergency/90-crypt.sh + done + elif getargbool 0 rd.auto; then +- if [ -z "$DRACUT_SYSTEMD" ]; then + { + printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="%s ' $(command -v initqueue) + printf -- '--unique --settled --onetime --name cryptroot-ask-%%k ' + printf -- '%s $env{DEVNAME} luks-$env{ID_FS_UUID} %s"\n' $(command -v cryptroot-ask) $tout + } >> /etc/udev/rules.d/70-luks.rules.new +- else +- { +- printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="%s ' $(command -v initqueue) +- printf -- '--unique --settled --onetime --name crypt-run-generator-%%k ' +- printf -- '%s $env{DEVNAME} luks-$env{ID_FS_UUID}"\n' $(command -v crypt-run-generator) +- } >> /etc/udev/rules.d/70-luks.rules.new +- fi + fi + + echo 'LABEL="luks_end"' >> /etc/udev/rules.d/70-luks.rules.new +-- +2.5.1 + diff --git a/dracut.changes b/dracut.changes index a5e04ff..45ac057 100644 --- a/dracut.changes +++ b/dracut.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Sep 21 10:45:14 UTC 2015 - fvogt@suse.com + +- Add patch 0181-no_systemd_cryptsetup.patch: + - rd.luks.key is not implemented (properly) if systemd is enabled, + so ignore systemd in 90crypt +- Fixes boo#915849 + ------------------------------------------------------------------- Wed Sep 16 12:12:12 UTC 2015 - fvogt@suse.com diff --git a/dracut.spec b/dracut.spec index 750d443..0804ae6 100644 --- a/dracut.spec +++ b/dracut.spec @@ -102,6 +102,7 @@ Patch164: 0164-Fix-initramfs-ver.img-vs-initrd-ver-in-dracut-initra.patch Patch165: 0165-Order-root-fsck-after-pre-mount.patch Patch168: 0168-remove_plymouth_logo_file.patch Patch180: 0180-i18n_add_correct_fontmaps.patch +Patch181: 0181-no_systemd_cryptsetup.patch # Still needed Patch133: 0133-Allow-multiple-configurations-per-network-interface-.patch @@ -243,6 +244,7 @@ and its cryptography during startup. %patch165 -p1 %patch168 -p1 %patch180 -p1 +%patch181 -p1 %patch200 -p1 %patch201 -p1 From 81c21a141d35e951a3676c2117b9100b976313f6d6d5b9f42ac996bd1f9f80ff Mon Sep 17 00:00:00 2001 From: Thomas Renninger Date: Tue, 22 Sep 2015 15:18:34 +0000 Subject: [PATCH 5/6] Accepting request 332992 from home:favogt:branches:Base:System - Add patch 0182-fix-include-parsing.patch: - Fix parsing of "-i" and "--include" - Fixes boo#908452 OBS-URL: https://build.opensuse.org/request/show/332992 OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=229 --- 0182-fix-include-parsing.patch | 40 ++++++++++++++++++++++++++++++++++ dracut.changes | 7 ++++++ dracut.spec | 2 ++ 3 files changed, 49 insertions(+) create mode 100644 0182-fix-include-parsing.patch diff --git a/0182-fix-include-parsing.patch b/0182-fix-include-parsing.patch new file mode 100644 index 0000000..4573537 --- /dev/null +++ b/0182-fix-include-parsing.patch @@ -0,0 +1,40 @@ +From 11d6560d7bbd8a4c4610a39c0985e50d728920fb Mon Sep 17 00:00:00 2001 +From: Fabian Vogt +Date: Mon, 21 Sep 2015 15:15:07 +0200 +Subject: [PATCH] Fix parsing of "-i" and "--include" + +- dracut replaced every instance of "-i" in the cmdline, + even if it was part of a kernel image name, e.g. "vmlinuz-i" +- Fixes boo#908452 + +Signed-off-by: Fabian Vogt +--- + dracut.sh | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index 6c1a374..44b8a3d 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -310,11 +310,13 @@ dropindirs_sort() + rearrange_params() + { + # Workaround -i, --include taking 2 arguments +- set -- "${@/--include/++include}" +- +- # This prevents any long argument ending with "-i" +- # -i, like --opt-i but I think we can just prevent that +- set -- "${@/%-i/++include}" ++ all=" $@ " # Convert $@ to string, add space so "-i..." matches the regex. ++ while [[ $all =~ (.*)[[:blank:]]((-i)|(--include[[:blank:]]))(.*) ]]; do ++ all="${BASH_REMATCH[1]} ++include ${BASH_REMATCH[5]}" # Replace -i and --include by ++include ++ done ++ ++ all=($all) # Convert $all to array ++ set -- "${all[@]}" # Set modified $@ + + TEMP=$(unset POSIXLY_CORRECT; getopt \ + -o "a:m:o:d:I:k:c:L:fvqlHhMN" \ +-- +2.5.1 + diff --git a/dracut.changes b/dracut.changes index 45ac057..1a2441c 100644 --- a/dracut.changes +++ b/dracut.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Sep 21 13:18:43 UTC 2015 - fvogt@suse.com + +- Add patch 0182-fix-include-parsing.patch: + - Fix parsing of "-i" and "--include" +- Fixes boo#908452 + ------------------------------------------------------------------- Mon Sep 21 10:45:14 UTC 2015 - fvogt@suse.com diff --git a/dracut.spec b/dracut.spec index 0804ae6..91e13e0 100644 --- a/dracut.spec +++ b/dracut.spec @@ -103,6 +103,7 @@ Patch165: 0165-Order-root-fsck-after-pre-mount.patch Patch168: 0168-remove_plymouth_logo_file.patch Patch180: 0180-i18n_add_correct_fontmaps.patch Patch181: 0181-no_systemd_cryptsetup.patch +Patch182: 0182-fix-include-parsing.patch # Still needed Patch133: 0133-Allow-multiple-configurations-per-network-interface-.patch @@ -245,6 +246,7 @@ and its cryptography during startup. %patch168 -p1 %patch180 -p1 %patch181 -p1 +%patch182 -p1 %patch200 -p1 %patch201 -p1 From 406d64cbdbec56c412d4b159998c19c277dfff50458dda483f1cac45f8582f3b Mon Sep 17 00:00:00 2001 From: Thomas Renninger Date: Wed, 23 Sep 2015 12:25:24 +0000 Subject: [PATCH 6/6] Accepting request 333153 from home:favogt:branches:Base:System - Fix 0182-fix-include-parsing.patch - Didn't parse arguments with spaces correctly - Add patch 0183-fix_add_drivers_hang.patch: - Fix possible hang in dracut caused by add_drivers+=" " in dracut.conf OBS-URL: https://build.opensuse.org/request/show/333153 OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=230 --- 0182-fix-include-parsing.patch | 29 +++++++++++++++-------------- 0183-fix_add_drivers_hang.patch | 28 ++++++++++++++++++++++++++++ dracut.changes | 13 +++++++++++++ dracut.spec | 2 ++ 4 files changed, 58 insertions(+), 14 deletions(-) create mode 100644 0183-fix_add_drivers_hang.patch diff --git a/0182-fix-include-parsing.patch b/0182-fix-include-parsing.patch index 4573537..310efcb 100644 --- a/0182-fix-include-parsing.patch +++ b/0182-fix-include-parsing.patch @@ -12,11 +12,11 @@ Signed-off-by: Fabian Vogt dracut.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) -diff --git a/dracut.sh b/dracut.sh -index 6c1a374..44b8a3d 100755 ---- a/dracut.sh -+++ b/dracut.sh -@@ -310,11 +310,13 @@ dropindirs_sort() +Index: dracut-043/dracut.sh +=================================================================== +--- dracut-043.orig/dracut.sh ++++ dracut-043/dracut.sh +@@ -310,11 +310,17 @@ dropindirs_sort() rearrange_params() { # Workaround -i, --include taking 2 arguments @@ -25,16 +25,17 @@ index 6c1a374..44b8a3d 100755 - # This prevents any long argument ending with "-i" - # -i, like --opt-i but I think we can just prevent that - set -- "${@/%-i/++include}" -+ all=" $@ " # Convert $@ to string, add space so "-i..." matches the regex. -+ while [[ $all =~ (.*)[[:blank:]]((-i)|(--include[[:blank:]]))(.*) ]]; do -+ all="${BASH_REMATCH[1]} ++include ${BASH_REMATCH[5]}" # Replace -i and --include by ++include ++ newat=() ++ for i in "$@"; do ++ if [[ $i =~ ^-i(.*) ]]; then ++ newat+=("++include" "${BASH_REMATCH[1]}") # Replace -i by ++include ++ elif [[ $i == "--include" ]]; then ++ newat+=("++include") # Replace --include by ++include ++ else ++ newat+=("$i") ++ fi + done -+ -+ all=($all) # Convert $all to array -+ set -- "${all[@]}" # Set modified $@ ++ set -- "${newat[@]}" # Set new $@ TEMP=$(unset POSIXLY_CORRECT; getopt \ -o "a:m:o:d:I:k:c:L:fvqlHhMN" \ --- -2.5.1 - diff --git a/0183-fix_add_drivers_hang.patch b/0183-fix_add_drivers_hang.patch new file mode 100644 index 0000000..d59807f --- /dev/null +++ b/0183-fix_add_drivers_hang.patch @@ -0,0 +1,28 @@ +From d774a6f49771b9f55de2956c3c0038a7655b6e94 Mon Sep 17 00:00:00 2001 +From: Fabian Vogt +Date: Wed, 23 Sep 2015 12:12:08 +0200 +Subject: [PATCH] Fix possible hang in dracut + +- Caused by add_drivers+=" " in dracut.conf (bsc#923116) + +Signed-off-by: Fabian Vogt +--- + dracut.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dracut.sh b/dracut.sh +index 44b8a3d..11a4a2e 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1501,7 +1501,7 @@ if [[ $no_kernel != yes ]]; then + hostonly='' instmods $drivers + fi + +- if [[ $add_drivers ]]; then ++ if [[ -n "${add_drivers// }" ]]; then + hostonly='' instmods -c $add_drivers + fi + if [[ $force_drivers ]]; then +-- +2.5.1 + diff --git a/dracut.changes b/dracut.changes index 1a2441c..b31668d 100644 --- a/dracut.changes +++ b/dracut.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Wed Sep 23 11:26:05 UTC 2015 - fvogt@suse.com + +- Fix 0182-fix-include-parsing.patch +- Didn't parse arguments with spaces correctly + +------------------------------------------------------------------- +Wed Sep 23 10:16:47 UTC 2015 - fvogt@suse.com + +- Add patch 0183-fix_add_drivers_hang.patch: + - Fix possible hang in dracut + caused by add_drivers+=" " in dracut.conf (bsc#923116) + ------------------------------------------------------------------- Mon Sep 21 13:18:43 UTC 2015 - fvogt@suse.com diff --git a/dracut.spec b/dracut.spec index 91e13e0..7400da9 100644 --- a/dracut.spec +++ b/dracut.spec @@ -104,6 +104,7 @@ Patch168: 0168-remove_plymouth_logo_file.patch Patch180: 0180-i18n_add_correct_fontmaps.patch Patch181: 0181-no_systemd_cryptsetup.patch Patch182: 0182-fix-include-parsing.patch +Patch183: 0183-fix_add_drivers_hang.patch # Still needed Patch133: 0133-Allow-multiple-configurations-per-network-interface-.patch @@ -247,6 +248,7 @@ and its cryptography during startup. %patch180 -p1 %patch181 -p1 %patch182 -p1 +%patch183 -p1 %patch200 -p1 %patch201 -p1