017-22.git20120302

nfs path fixes for live image over nfs
root=live:nfs://10.10.10.10:/srv/all/install.img ip=dhcp rd.neednet
This commit is contained in:
Harald Hoyer 2012-03-02 14:07:53 +01:00
parent ada75c35fa
commit 65a3b7477c
4 changed files with 178 additions and 1 deletions

View File

@ -0,0 +1,22 @@
From 778f767bccf14f49573d5fffca40841f42401e75 Mon Sep 17 00:00:00 2001
From: Jan Stodola <jstodola@redhat.com>
Date: Thu, 1 Mar 2012 20:22:57 +0100
Subject: [PATCH] Fix correct nfs path
---
modules.d/45url-lib/url-lib.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/modules.d/45url-lib/url-lib.sh b/modules.d/45url-lib/url-lib.sh
index 383e7ac..1fc80a1 100755
--- a/modules.d/45url-lib/url-lib.sh
+++ b/modules.d/45url-lib/url-lib.sh
@@ -99,7 +99,7 @@ nfs_fetch_url() {
mntdir=$(nfs_already_mounted $server $path)
if [ -z "$mntdir" ]; then
local mntdir="$(mkuniqdir /run nfs_mnt)"
- mount_nfs $nfs:$server:$path${options:+:$options} $mntdir
+ mount_nfs $nfs:$server:$filepath${options:+:$options} $mntdir
# lazy unmount during pre-pivot hook
inst_hook --hook pre-pivot --name 99url-lib-umount-nfs umount -l $mntdir
fi

View File

@ -0,0 +1,118 @@
From ffcc64bdea9080c2a1430ba59720f583bc0ac908 Mon Sep 17 00:00:00 2001
From: Will Woods <wwoods@redhat.com>
Date: Wed, 29 Feb 2012 13:09:58 -0500
Subject: [PATCH] move emergency_shell to dracut-lib.sh
This lets things running outside init call an emergency_shell.
(example: scripts called by initqueue)
---
modules.d/99base/dracut-lib.sh | 38 ++++++++++++++++++++++++++++++++++++++
modules.d/99base/init.sh | 40 +---------------------------------------
2 files changed, 39 insertions(+), 39 deletions(-)
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index afd366e..c31854e 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -753,3 +753,41 @@ killproc() {
need_shutdown() {
>/run/initramfs/.need_shutdown
}
+
+emergency_shell()
+{
+ local _ctty
+ set +e
+ if [ "$1" = "-n" ]; then
+ _rdshell_name=$2
+ shift 2
+ else
+ _rdshell_name=dracut
+ fi
+ echo ; echo
+ warn $@
+ source_hook emergency
+ echo
+ wait_for_loginit
+ [ -e /run/initramfs/.die ] && exit 1
+ if getargbool 1 rd.shell -y rdshell || getarg rd.break rdbreak; then
+ echo "Dropping to debug shell."
+ echo
+ export PS1="$_rdshell_name:\${PWD}# "
+ [ -e /.profile ] || >/.profile
+ _ctty=/dev/console
+ if [ -n "$(command -v setsid)" ]; then
+ _ctty="$(getarg rd.ctty=)" && _ctty="/dev/${_ctty##*/}"
+ [ -c "$_ctty" ] || _ctty=/dev/tty1
+ setsid sh -i -l 0<$_ctty 1>$_ctty 2>&1
+ elif [ -n "$(command -v openvt)" ] && ! getarg "console=" >/dev/null 2>&1 && getargbool 1 "rd.openvt" ; then
+ openvt -f -c 1 -w -s -l -- sh
+ else
+ sh -i -l 0<$_ctty 1>$_ctty 2>&1
+ fi
+ else
+ warn "Boot has failed. To debug this issue add \"rdshell\" to the kernel command line."
+ # cause a kernel panic
+ exit 1
+ fi
+}
diff --git a/modules.d/99base/init.sh b/modules.d/99base/init.sh
index 4d0a2a2..d197497 100755
--- a/modules.d/99base/init.sh
+++ b/modules.d/99base/init.sh
@@ -38,54 +38,16 @@ wait_for_loginit()
rm -f /run/initramfs/loginit.pipe /run/initramfs/loginit.pid
}
-emergency_shell()
-{
- local _ctty
- set +e
- if [ "$1" = "-n" ]; then
- _rdshell_name=$2
- shift 2
- else
- _rdshell_name=dracut
- fi
- echo ; echo
- warn $@
- source_hook emergency
- echo
- wait_for_loginit
- [ -e /run/initramfs/.die ] && exit 1
- if getargbool 1 rd.shell -y rdshell || getarg rd.break rdbreak; then
- echo "Dropping to debug shell."
- echo
- export PS1="$_rdshell_name:\${PWD}# "
- [ -e /.profile ] || >/.profile
- _ctty=/dev/console
- if [ -n "$(command -v setsid)" ]; then
- _ctty="$(getarg rd.ctty=)" && _ctty="/dev/${_ctty##*/}"
- [ -c "$_ctty" ] || _ctty=/dev/tty1
- setsid sh -i -l 0<$_ctty 1>$_ctty 2>&1
- elif [ -n "$(command -v openvt)" ] && ! getarg "console=" >/dev/null 2>&1 && getargbool 1 "rd.openvt" ; then
- openvt -f -c 1 -w -s -l -- sh
- else
- sh -i -l 0<$_ctty 1>$_ctty 2>&1
- fi
- else
- warn "Boot has failed. To debug this issue add \"rdshell\" to the kernel command line."
- # cause a kernel panic
- exit 1
- fi
-}
-
NEWROOT="/sysroot"
[ -d $NEWROOT ] || mkdir -p -m 0755 $NEWROOT
-trap "emergency_shell Signal caught!" 0
OLDPATH=$PATH
PATH=/usr/sbin:/usr/bin:/sbin:/bin
export PATH
RD_DEBUG=""
. /lib/dracut-lib.sh
+trap "emergency_shell Signal caught!" 0
[ -c /dev/null ] || mknod -m 0666 /dev/null c 1 3

View File

@ -0,0 +1,30 @@
From 8a0d2fc56feeb04d314a7fd6030bda5ce748b2f6 Mon Sep 17 00:00:00 2001
From: Will Woods <wwoods@redhat.com>
Date: Wed, 29 Feb 2012 13:09:57 -0500
Subject: [PATCH] url-lib: make nfs support optional
Only include /lib/nfs-lib.sh if it exists, and then only run
add_url_handler if nfs-lib was imported.
---
modules.d/45url-lib/url-lib.sh | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules.d/45url-lib/url-lib.sh b/modules.d/45url-lib/url-lib.sh
index 1fc80a1..043a700 100755
--- a/modules.d/45url-lib/url-lib.sh
+++ b/modules.d/45url-lib/url-lib.sh
@@ -74,7 +74,7 @@ set_http_header() {
### NFS ##############################################################
-. /lib/nfs-lib.sh
+[ -e /lib/nfs-lib.sh ] && . /lib/nfs-lib.sh
nfs_already_mounted() {
local server="$1" path="$2" localdir="" s="" p=""
@@ -112,4 +112,4 @@ nfs_fetch_url() {
[ -f "$outloc" ] || return 253
echo "$outloc"
}
-add_url_handler nfs_fetch_url nfs nfs4
+command -v nfs_to_var >/dev/null && add_url_handler nfs_fetch_url nfs nfs4

View File

@ -10,7 +10,7 @@
Name: dracut
Version: 017
Release: 19.git20120301%{?dist}
Release: 22.git20120302%{?dist}
Summary: Initramfs generator using udev
%if 0%{?fedora} || 0%{?rhel}
@ -42,6 +42,9 @@ Patch15: 0015-98usrmount-mount-usr.sh-check-if-we-have-NEWROOT-etc.patch
Patch16: 0016-30convertfs-convertfs.sh-correct-check-for-usr-bin.patch
Patch17: 0017-90crypt-parse-crypt.sh-simplify-rd.luks.uuid-testing.patch
Patch18: 0018-dracut-functions.sh-install_kmod_with_fw-delay-.kern.patch
Patch19: 0019-Fix-correct-nfs-path.patch
Patch20: 0020-move-emergency_shell-to-dracut-lib.sh.patch
Patch21: 0021-url-lib-make-nfs-support-optional.patch
BuildArch: noarch
@ -345,6 +348,10 @@ rm -rf $RPM_BUILD_ROOT
%dir /var/lib/dracut/overlay
%changelog
* Fri Mar 02 2012 Harald Hoyer <harald@redhat.com> 017-22.git20120302
- nfs path fixes for live image over nfs
root=live:nfs://10.10.10.10:/srv/all/install.img ip=dhcp rd.neednet
* Thu Mar 01 2012 Harald Hoyer <harald@redhat.com> 017-19.git20120301
- fixed include of some kernel modules