Accepting request 667615 from home:dmolkentin:branches:Base:System

* adds 0588-Ensure-mmc-host-modules-get-included-properly.patch
  * adds 0587-Fix-a-missing-space-in-example-configs.patch 
  * adds 0586-95zfcp_rules-parse-zfcp.sh-remove-rule-existence-check.patch
-  emergency mode: bring shell and all vital information to
   all ttys specified as console devices
   (FATE#325386, bsc#1053248, bsc#937555)
   * Adds 0585-emergency-mode-use-sulogin.patch

OBS-URL: https://build.opensuse.org/request/show/667615
OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=361
This commit is contained in:
Daniel Molkentin 2019-01-21 14:33:39 +00:00 committed by Git OBS Bridge
parent 1b61a795a1
commit 3e7d1873a8
6 changed files with 114 additions and 6 deletions

View File

@ -0,0 +1,96 @@
From 97ce7a8179dfebe16d072d8d7355af3817512d0d Mon Sep 17 00:00:00 2001
From: Daniel Molkentin <dmolkentin@suse.com>
Date: Wed, 5 Dec 2018 16:52:45 +0100
Subject: [PATCH] emergency mode: use sulogin
- allow emergency login on every console
specified in the kernel cmdline
- require password for hostonly images
- emergency mode: Manually multiplex emergency infos
This will bring all vital information to all ttys specified
as console devices, regardless of wether they hold the C flag.
Reference: FATE#325386
Reference: #449
---
modules.d/98dracut-systemd/dracut-emergency.sh | 29 +++++++++++++++-----------
modules.d/98dracut-systemd/module-setup.sh | 2 ++
modules.d/99base/module-setup.sh | 8 +++++--
3 files changed, 25 insertions(+), 14 deletions(-)
Index: dracut-044/modules.d/98dracut-systemd/dracut-emergency.sh
===================================================================
--- dracut-044.orig/modules.d/98dracut-systemd/dracut-emergency.sh
+++ dracut-044/modules.d/98dracut-systemd/dracut-emergency.sh
@@ -17,20 +17,26 @@ source_hook "$hook"
if getargbool 1 rd.shell -d -y rdshell || getarg rd.break -d rdbreak; then
FSTXT="/usr/share/fsck/fsck_help_$fstype.txt"
+ RDSOSREPORT="$(rdsosreport)"
echo
- rdsosreport
- echo
- echo
- echo 'Entering emergency mode. Exit the shell to continue.'
- echo 'Type "journalctl" to view system logs.'
- echo 'You might want to save "/run/initramfs/rdsosreport.txt" to a USB stick or /boot'
- echo 'after mounting them and attach it to a bug report.'
- echo
- echo
- [ -f $FSTXT ] && cat $FSTXT
+ while read _tty rest; do
+ (
+ echo
+ echo $RDSOSREPORT
+ echo
+ echo
+ echo 'Entering emergency mode. Exit the shell to continue.'
+ echo 'Type "journalctl" to view system logs.'
+ echo 'You might want to save "/run/initramfs/rdsosreport.txt" to a USB stick or /boot'
+ echo 'after mounting them and attach it to a bug report.'
+ echo
+ echo
+ [ -f "$FSTXT" ] && cat "$FSTXT"
+ ) > /dev/$_tty
+ done < /dev/consoles
[ -f /etc/profile ] && . /etc/profile
[ -z "$PS1" ] && export PS1="$_name:\${PWD}# "
- exec sh -i -l
+ exec sulogin -e
else
warn "$action has failed. To debug this issue add \"rd.shell rd.debug\" to the kernel command line."
exit 1
Index: dracut-044/modules.d/98dracut-systemd/module-setup.sh
===================================================================
--- dracut-044.orig/modules.d/98dracut-systemd/module-setup.sh
+++ dracut-044/modules.d/98dracut-systemd/module-setup.sh
@@ -59,5 +59,7 @@ install() {
done
inst_simple "$moddir/dracut-tmpfiles.conf" "$tmpfilesdir/dracut-tmpfiles.conf"
+
+ inst_multiple sulogin
}
Index: dracut-044/modules.d/99base/module-setup.sh
===================================================================
--- dracut-044.orig/modules.d/99base/module-setup.sh
+++ dracut-044/modules.d/99base/module-setup.sh
@@ -26,9 +26,13 @@ install() {
(ln -s bash "${initdir}/bin/sh" || :)
fi
- #add common users in /etc/passwd, it will be used by nfs/ssh currently
- egrep '^root:' "$initdir/etc/passwd" 2>/dev/null || echo 'root:x:0:0::/root:/bin/sh' >> "$initdir/etc/passwd"
- egrep '^nobody:' /etc/passwd >> "$initdir/etc/passwd"
+ # add common users in /etc/passwd, it will be used by nfs/ssh currently
+ # use password for hostonly images to facilitate secure sulogin in emergency console
+ [[ $hostonly ]] && pwshadow='x'
+ grep '^root:' "$initdir/etc/passwd" 2>/dev/null || echo "root:$pwshadow:0:0::/root:/bin/sh" >> "$initdir/etc/passwd"
+ grep '^nobody:' /etc/passwd >> "$initdir/etc/passwd"
+
+ [[ $hostonly ]] && grep '^root:' /etc/shadow >> "$initdir/etc/shadow"
# install our scripts and hooks
inst_script "$moddir/init.sh" "/init"

View File

@ -2,19 +2,19 @@
Mon Jan 21 14:01:20 UTC 2019 - Daniel Molkentin <daniel.molkentin@suse.com>
- Ensure mmc host modules get included properly (bsc#1119037)
* adds 0587-Ensure-mmc-host-modules-get-included-properly.patch
* adds 0588-Ensure-mmc-host-modules-get-included-properly.patch
-------------------------------------------------------------------
Sun Jan 20 21:11:06 UTC 2019 - Daniel Molkentin <daniel.molkentin@suse.com>
- Fix a missing space in example configs (boo#1121251)
* adds 0586-Fix-a-missing-space-in-example-configs.patch
* adds 0587-Fix-a-missing-space-in-example-configs.patch
-------------------------------------------------------------------
Fri Dec 21 11:02:32 UTC 2018 - Michal Suchanek <msuchanek@suse.com>
- 95zfcp_rules/parse-zfcp.sh: remove rule existence check (bsc#1008352).
* adds 0585-95zfcp_rules-parse-zfcp.sh-remove-rule-existence-check.patch
* adds 0586-95zfcp_rules-parse-zfcp.sh-remove-rule-existence-check.patch
-------------------------------------------------------------------
Mon Dec 17 15:27:15 UTC 2018 - jdelvare@suse.com
@ -32,6 +32,14 @@ Mon Dec 17 15:27:15 UTC 2018 - jdelvare@suse.com
backup files are not needed in the first place. Get rid of them
to simplify and speed up the whole process.
-------------------------------------------------------------------
Fri Dec 7 09:56:45 UTC 2018 - Daniel Molkentin <daniel.molkentin@suse.com>
- emergency mode: bring shell and all vital information to
all ttys specified as console devices
(FATE#325386, bsc#1053248, bsc#937555)
* Adds 0585-emergency-mode-use-sulogin.patch
-------------------------------------------------------------------
Wed Oct 31 09:57:55 UTC 2018 - Daniel Molkentin <daniel.molkentin@suse.com>

View File

@ -413,12 +413,15 @@ Patch582: 0582-98dracut-systemd-Start-systemd-vconsole-setup-before.patch
Patch583: 0583-99base-Allow-files-with-backslashes-in-hostonly-file.patch
# Patch adopted from upstream commit b38b7fef36333a59890233dccfbbb6d2c40ebe83
Patch584: 0584-95dasd_rules-mark-dasd-rules-host_only.patch
# Patch adopted from upstream commit 32f68c1f9ac3720e8ce4b95a09c0ce680d5da786
Patch585: 0585-emergency-mode-use-sulogin.patch
# Patch adopted from git commit 69198cba654cb81093e36cca242481d26bec4b40
Patch585: 0585-95zfcp_rules-parse-zfcp.sh-remove-rule-existence-check.patch
Patch586: 0586-95zfcp_rules-parse-zfcp.sh-remove-rule-existence-check.patch
# Patch adopted from upstream commit 58e0d2d5b5b3a5e7d6dbf74baa2f08f041de5a81
Patch586: 0586-Fix-a-missing-space-in-example-configs.patch
Patch587: 0587-Fix-a-missing-space-in-example-configs.patch
# Fix for 0562-Adjust-driver-list-to-modern-kernels.patch
Patch587: 0587-Ensure-mmc-host-modules-get-included-properly.patch
Patch588: 0588-Ensure-mmc-host-modules-get-included-properly.patch
BuildRequires: asciidoc
BuildRequires: bash
BuildRequires: docbook-xsl-stylesheets
@ -723,6 +726,7 @@ chmod a+x modules.d/95qeth_rules/module-setup.sh
%patch585 -p1
%patch586 -p1
%patch587 -p1
%patch588 -p1
%build
%configure\