fixed symbolic link creation in the initramfs

Resolves: rhbz#728863
This commit is contained in:
Harald Hoyer 2011-08-10 18:52:14 +02:00
parent f3160a5b6c
commit 428fde5d57
23 changed files with 2336 additions and 1 deletions

View File

@ -0,0 +1,52 @@
From 4a855e6bebed956c108865823bcc131ebea2841a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Am=C3=A9rico=20Wang?= <xiyou.wangcong@gmail.com>
Date: Thu, 21 Jul 2011 15:33:19 +0800
Subject: [PATCH] busybox module: parse busybox defined functions dynamically
Currently in dracut busybox module, we hard-code the list of binaries
available in busybox. Actually we can get this list by running busybox
without any arguments.
Also, if find_binary() finds nothing, we would symlink $initdir/
which is not we expect.
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
---
modules.d/05busybox/module-setup.sh | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/modules.d/05busybox/module-setup.sh b/modules.d/05busybox/module-setup.sh
index 5ef03ef..2e9ead8 100755
--- a/modules.d/05busybox/module-setup.sh
+++ b/modules.d/05busybox/module-setup.sh
@@ -15,22 +15,22 @@ depends() {
install() {
local _i _progs _path
inst busybox /usr/bin/busybox
-
- # List of shell programs that we use in other official dracut modules, that
- # must be supported by the busybox installed on the host system
- _progs="echo grep usleep [ rmmod insmod mount uname umount setfont kbd_mode stty gzip bzip2 chvt readlink blkid dd losetup tr sed seq ps more cat rm free ping netstat vi ping6 fsck ip hostname basename mknod mkdir pidof sleep chroot ls cp mv dmesg mkfifo less ln modprobe"
+ for _i in `/sbin/busybox | sed -ne '1,/Currently/!{s/,//g; s/busybox//g; p}'`
+ do
+ _progs="$_progs $_i"
+ done
# FIXME: switch_root should be in the above list, but busybox version hangs
# (using busybox-1.15.1-7.fc14.i686 at the time of writing)
for _i in $_progs; do
- _path=$(find_binary "$_i")
+ _path=$(find_binary "$_i")
+ [ -z "$_path" ] && continue
if [[ $_path != ${_path#/usr} ]]; then
- ln -s ../../usr/bin/busybox "$initdir/$_path"
+ ln -sf ../../usr/bin/busybox "$initdir/$_path"
else
- ln -s ../usr/bin/busybox "$initdir/$_path"
+ ln -sf ../usr/bin/busybox "$initdir/$_path"
fi
done
-
}

View File

@ -0,0 +1,22 @@
From c029f4c1da5b938c65e088bf6f103a1c27c27c85 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jul 2011 09:41:24 +0200
Subject: [PATCH] dracut.kernel.7.xml: s/voonsole.keymap/vconsole.keymap
---
dracut.kernel.7.xml | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dracut.kernel.7.xml b/dracut.kernel.7.xml
index a277c74..891e3c6 100644
--- a/dracut.kernel.7.xml
+++ b/dracut.kernel.7.xml
@@ -176,7 +176,7 @@ This parameter can be specified multiple times.</para>
<variablelist>
<varlistentry>
<term>
- <envar>voonsole.keymap=</envar>
+ <envar>vconsole.keymap=</envar>
<replaceable>&lt;keymap base file name&gt;</replaceable>
</term>
<listitem>

View File

@ -0,0 +1,62 @@
From 09e0549d5183fcbc40830d4af0ac2621d7f670c0 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jul 2011 09:49:49 +0200
Subject: [PATCH] dracut.kernel.7.xml: beautified doc
---
dracut.kernel.7.xml | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/dracut.kernel.7.xml b/dracut.kernel.7.xml
index 891e3c6..8914cd9 100644
--- a/dracut.kernel.7.xml
+++ b/dracut.kernel.7.xml
@@ -87,7 +87,7 @@ accordingly.</para>
<envar>rd.driver.blacklist=<replaceable>&lt;drivername&gt;<optional>,&lt;drivername&gt;,...</optional></replaceable></envar>
</term>
<listitem>
- <para>do not load kernel module &lt;drivername&gt;
+ <para>do not load kernel module &lt;drivername&gt;.
This parameter can be specified multiple times.</para>
</listitem>
</varlistentry>
@@ -96,7 +96,7 @@ This parameter can be specified multiple times.</para>
<envar>rd.driver.pre=<replaceable>&lt;drivername&gt;<optional>,&lt;drivername&gt;,...</optional></replaceable></envar>
</term>
<listitem>
- <para>force loading kernel module &lt;drivername&gt;
+ <para>force loading kernel module &lt;drivername&gt;.
This parameter can be specified multiple times.</para>
</listitem>
</varlistentry>
@@ -420,7 +420,7 @@ e.g.
<envar>ip=</envar><replaceable>{dhcp|on|any|dhcp6|auto6|ibft}</replaceable>
</term>
<listitem>
- <para>dhcp|on|any: get ip from dhcp server from all interfaces. If root=dhcp,
+ <para><constant>dhcp|on|any</constant>: get ip from dhcp server from all interfaces. If root=dhcp,
loop sequentially through all interfaces (eth0, eth1, ...) and use the first
with a valid DHCP root-path.</para>
<para><constant>auto6</constant>: IPv6 autoconfiguration</para>
@@ -431,9 +431,9 @@ with a valid DHCP root-path.</para>
<varlistentry>
<term><envar>ip=</envar><replaceable>&lt;interface&gt;</replaceable>:<replaceable>{dhcp|on|any|dhcp6|auto6}</replaceable></term>
<listitem>
- <para>dhcp|on|any|dhcp6: get ip from dhcp server on a specific interface
-auto6: do IPv6 autoconfiguration
-This parameter can be specified multiple times.</para>
+ <para><constant>dhcp|on|any|dhcp6</constant>: get ip from dhcp server on a specific interface</para>
+ <para><constant>auto6</constant>: do IPv6 autoconfiguration</para>
+ <para>This parameter can be specified multiple times.</para>
</listitem>
</varlistentry>
<varlistentry>
@@ -698,7 +698,7 @@ rd.znet=ctc,0.0.0600,0.0.0601,0.0.0602,protocol=bar</programlisting></para>
<varlistentry>
<term><envar>rd.plymouth</envar>=0</term>
<listitem>
- <para>disable plymouth. This will not work with encrypted partitions.</para>
+ <para>disable the plymouth bootsplash.</para>
</listitem>
</varlistentry>
</variablelist>

View File

@ -0,0 +1,21 @@
From 82eea29797588621fc10f7f2e335ec5bf727164f Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jul 2011 14:17:59 +0200
Subject: [PATCH] 99base/dracut-lib.sh: don't be quiet on rd.debug
---
modules.d/99base/dracut-lib.sh | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index 6807b53..f65e853 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -272,6 +272,7 @@ check_quiet() {
if [ -z "$DRACUT_QUIET" ]; then
DRACUT_QUIET="yes"
getargbool 0 rd.info -y rdinfo && DRACUT_QUIET="no"
+ getargbool 0 rd.debug -y rdinitdebug && DRACUT_QUIET="no"
getarg quiet || DRACUT_QUIET="yes"
fi
}

View File

@ -0,0 +1,23 @@
From a4c235ed3acd1c4cffcbda81efc8dc18f4ef01c7 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jul 2011 14:18:23 +0200
Subject: [PATCH] dracut-functions: only "dinfo" about missing optioal
dracut_install
---
dracut-functions | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dracut-functions b/dracut-functions
index e3e0392..cdb1964 100755
--- a/dracut-functions
+++ b/dracut-functions
@@ -489,7 +489,7 @@ dracut_install() {
while (($# > 0)); do
if ! inst "$1" ; then
if [[ $_optional = yes ]]; then
- dwarn "Skipping program $1 as it cannot be found and is" \
+ dinfo "Skipping program $1 as it cannot be found and is" \
"flagged to be optional"
else
dfatal "Failed to install $1"

View File

@ -0,0 +1,76 @@
From 40ee8c1814510bc95ab0d5dffd17af28c14df182 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jul 2011 11:21:24 +0200
Subject: [PATCH] 99base/init: try to mount /usr, if init lives on /usr
---
TODO | 1 +
modules.d/99base/init | 27 +++++++++++++++++++++++++--
modules.d/99base/module-setup.sh | 2 +-
3 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/TODO b/TODO
index 7dcf8dc..e5abef0 100644
--- a/TODO
+++ b/TODO
@@ -4,6 +4,7 @@ INITRAMFS TODO
- The hard-coded list of udev rules that we care about is kind of lame.
- automatic kexec fallback
- panic fallback
+- fsck for $NEWROOT/usr
GENERATOR TODO
diff --git a/modules.d/99base/init b/modules.d/99base/init
index 5975b25..1fac580 100755
--- a/modules.d/99base/init
+++ b/modules.d/99base/init
@@ -306,10 +306,33 @@ getarg 'rd.break=pre-pivot' 'rdbreak=pre-pivot' && emergency_shell -n pre-pivot
source_hook pre-pivot
# by the time we get here, the root filesystem should be mounted.
-# Try to find init.
+# Try to find init and mount /usr, if needed to access init.
+unset __usr_found
for i in "$(getarg real_init=)" "$(getarg init=)" /sbin/init /etc/init /init /bin/sh; do
[ -n "$i" ] || continue
- if ! [ -d "$NEWROOT$i" ] && [ -L "$NEWROOT$i" -o -x "$NEWROOT$i" ]; then
+
+ __p=$(readlink -m "$NEWROOT$i")
+ if [ -n "$__p" ] \
+ && [ "x$__usr_found" = "x" ] \
+ && [ ! -x "$__p" ] \
+ && strstr "$__p" "$NEWROOT/usr" \
+ ; then
+ # we have to mount /usr
+ while read dev mp fs opts rest; do
+ if [ "$mp" = "/usr" ]; then
+ echo "$dev $NEWROOT$mp $fs ${opts},ro $rest"
+ __usr_found="1"
+ break
+ fi
+ done < "$NEWROOT/etc/fstab" >> /etc/fstab
+ if [ "x$__usr_found" != "x" ]; then
+ info "Mounting /usr"
+ mount "$NEWROOT/usr" 2>&1 | vinfo
+ fi
+ fi
+
+ __p=$(readlink -f "$NEWROOT$i")
+ if [ -x "$__p" ]; then
INIT="$i"
break
fi
diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh
index 20454f9..40c94f6 100755
--- a/modules.d/99base/module-setup.sh
+++ b/modules.d/99base/module-setup.sh
@@ -14,7 +14,7 @@ depends() {
install() {
local _d
dracut_install mount mknod mkdir modprobe pidof sleep chroot \
- sed ls flock cp mv dmesg rm ln rmmod mkfifo umount
+ sed ls flock cp mv dmesg rm ln rmmod mkfifo umount readlink
dracut_install -o less
if [ ! -e "${initdir}/bin/sh" ]; then
dracut_install bash

50
0021-fixed-typos.patch Normal file
View File

@ -0,0 +1,50 @@
From 7641c73decf850aeffe59bb6122db41b8aae4b30 Mon Sep 17 00:00:00 2001
From: Thomas Lange <lange@informatik.uni-koeln.de>
Date: Mon, 25 Jul 2011 09:11:56 +0200
Subject: [PATCH] fixed typos
---
NEWS | 2 +-
modules.d/02caps/README | 2 +-
modules.d/95nbd/parse-nbdroot.sh | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/NEWS b/NEWS
index 8566260..a93a9cd 100644
--- a/NEWS
+++ b/NEWS
@@ -21,7 +21,7 @@ dracut-009
- initramfs
- hooks moved to /lib/dracut/hooks in initramfs
- - rd.driver.{blacklist|pre|post} accept comma seperated driver list
+ - rd.driver.{blacklist|pre|post} accept comma separated driver list
- iSCSI: iSCSI Boot Firmware Table (iBFT) support
- support for /run
- live image: support for generic rootfs.img (instead of ext3fs.img)
diff --git a/modules.d/02caps/README b/modules.d/02caps/README
index 57d2538..34e0f02 100644
--- a/modules.d/02caps/README
+++ b/modules.d/02caps/README
@@ -2,7 +2,7 @@ This adds the following parameters:
rd.caps=1
turn the caps module on/off
rd.caps.initdrop=cap_sys_module,cap_sys_rawio
- drop the specified comma seperated capabilities
+ drop the specified comma separated capabilities
rd.caps.disablemodules=1
turn off module loading
rd.caps.disablekexec=1
diff --git a/modules.d/95nbd/parse-nbdroot.sh b/modules.d/95nbd/parse-nbdroot.sh
index 40fcef6..376681b 100755
--- a/modules.d/95nbd/parse-nbdroot.sh
+++ b/modules.d/95nbd/parse-nbdroot.sh
@@ -6,7 +6,7 @@
# root=nbd:srv:port[:fstype[:rootflags[:nbdopts]]]
# [root=*] netroot=nbd:srv:port[:fstype[:rootflags[:nbdopts]]]
#
-# nbdopts is a comma seperated list of options to give to nbd-client
+# nbdopts is a comma separated list of options to give to nbd-client
#
# root= takes precedence over netroot= if root=nbd[...]
#

View File

@ -0,0 +1,30 @@
From 3cd98a6094ff6120a7a53429bf3db70f80523a44 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 25 Jul 2011 10:25:12 +0200
Subject: [PATCH] dracut-logger: initialize basic vars
---
dracut-logger | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/dracut-logger b/dracut-logger
index a5a3ee9..d85cbaf 100755
--- a/dracut-logger
+++ b/dracut-logger
@@ -107,14 +107,12 @@ __DRACUT_LOGGER__=1
# See file doc comment for details.
dlog_init() {
local __oldumask
- # Skip initialization if it's already done.
- [ -n "$maxloglvl" ] && return 0
-
local ret=0; local errmsg
-
[ -z "$stdloglvl" ] && stdloglvl=4
[ -z "$sysloglvl" ] && sysloglvl=0
[ -z "$kmsgloglvl" ] && kmsgloglvl=0
+ # Skip initialization if it's already done.
+ [ -n "$maxloglvl" ] && return 0
if [ -z "$fileloglvl" ]; then
[ -w "$logfile" ] && fileloglvl=4 || fileloglvl=0

View File

@ -0,0 +1,94 @@
From d4bb4316214022ae7902c5c45ab557f7ea8a5c39 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 25 Jul 2011 10:25:44 +0200
Subject: [PATCH] dracut-functions: convert absolute symlinks to relative
---
dracut-functions | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 55 insertions(+), 4 deletions(-)
diff --git a/dracut-functions b/dracut-functions
index cdb1964..2a45419 100755
--- a/dracut-functions
+++ b/dracut-functions
@@ -82,6 +82,55 @@ print_vars() {
done
}
+
+convert_abs_rel() {
+ local __current __absolute __abssize __cursize __i __level __newpath
+# PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): ';
+
+ if [[ "$1" == "$2" ]]
+ then
+ echo "."
+ return
+ fi
+
+ IFS="/"
+
+ __current=($1)
+ __absolute=($2)
+
+ __abssize=${#__absolute[@]}
+ __cursize=${#__current[@]}
+
+ while [[ ${__absolute[__level]} == ${__current[__level]} ]]
+ do
+ (( __level++ ))
+ if (( __level > __abssize || __level > __cursize ))
+ then
+ break
+ fi
+ done
+
+ for ((__i = __level; __i < __cursize-1; __i++))
+ do
+ if ((__i > __level))
+ then
+ __newpath=$__newpath"/"
+ fi
+ __newpath=$__newpath".."
+ done
+
+ for ((__i = __level; __i < __abssize; __i++))
+ do
+ if [[ -n $__newpath ]]
+ then
+ __newpath=$__newpath"/"
+ fi
+ __newpath=$__newpath${__absolute[__i]}
+ done
+
+ echo "$__newpath"
+}
+
get_fs_env() {
[[ $1 ]] || return
unset ID_FS_TYPE
@@ -228,10 +277,12 @@ inst_dir() {
if [[ -L $_file ]]; then
# create link as the original
local target=$(readlink "$_file")
- ln -sfn "$target" "${initdir}$_file" || return 1
- # resolve relative path and recursively install destination
- [[ $target == ${target#/} ]] && target="$(dirname "$_file")/$target"
inst_dir "$target"
+ inst_symlink "$_file"
+ #ln -sfn "$target" "${initdir}$_file" || return 1
+ # resolve relative path and recursively install destination
+ #[[ $target == ${target#/} ]] && target="$(dirname "$_file")/$target"
+ #inst_dir "$target"
else
[[ -h ${initdir}$_file ]] && _file=$(readlink "${initdir}$_file")
# create directory
@@ -409,7 +460,7 @@ inst_symlink() {
inst "$_realsrc" && mkdir -m 0755 -p "${_target%/*}"
fi
if [[ -e "${_src}" ]]; then
- cp -aP "${_src}" "$_target"
+ ln -sfn $(convert_abs_rel "${_src}" "${_realsrc}") "$_target"
else
ln -sfn "$_realsrc" "$_target"
fi

View File

@ -0,0 +1,653 @@
From a8eecab0797f939cac52a9213776a59a245ccd73 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 25 Jul 2011 10:31:54 +0200
Subject: [PATCH] move "debian" to debian.template on request of debian
maintainer
---
debian.template/changelog | 53 ++++++++++++++++++++++++++++++++
debian.template/compat | 1 +
debian.template/control | 41 ++++++++++++++++++++++++
debian.template/copyright | 39 +++++++++++++++++++++++
debian.template/dracut-network.dirs | 5 +++
debian.template/dracut-network.install | 5 +++
debian.template/dracut.dirs | 25 +++++++++++++++
debian.template/dracut.docs | 4 ++
debian.template/dracut.install | 28 +++++++++++++++++
debian.template/dracut.manpages | 4 ++
debian.template/dracut.postinst | 8 +++++
debian.template/dracut.triggers | 1 +
debian.template/rules | 3 ++
debian/changelog | 53 --------------------------------
debian/compat | 1 -
debian/control | 41 ------------------------
debian/copyright | 39 -----------------------
debian/dracut-network.dirs | 5 ---
debian/dracut-network.install | 5 ---
debian/dracut.dirs | 25 ---------------
debian/dracut.docs | 4 --
debian/dracut.install | 28 -----------------
debian/dracut.manpages | 4 --
debian/dracut.postinst | 8 -----
debian/dracut.triggers | 1 -
debian/rules | 3 --
26 files changed, 217 insertions(+), 217 deletions(-)
create mode 100644 debian.template/changelog
create mode 100644 debian.template/compat
create mode 100644 debian.template/control
create mode 100644 debian.template/copyright
create mode 100644 debian.template/dracut-network.dirs
create mode 100644 debian.template/dracut-network.install
create mode 100644 debian.template/dracut.dirs
create mode 100644 debian.template/dracut.docs
create mode 100644 debian.template/dracut.install
create mode 100644 debian.template/dracut.manpages
create mode 100644 debian.template/dracut.postinst
create mode 100644 debian.template/dracut.triggers
create mode 100755 debian.template/rules
delete mode 100644 debian/changelog
delete mode 100644 debian/compat
delete mode 100644 debian/control
delete mode 100644 debian/copyright
delete mode 100644 debian/dracut-network.dirs
delete mode 100644 debian/dracut-network.install
delete mode 100644 debian/dracut.dirs
delete mode 100644 debian/dracut.docs
delete mode 100644 debian/dracut.install
delete mode 100644 debian/dracut.manpages
delete mode 100644 debian/dracut.postinst
delete mode 100644 debian/dracut.triggers
delete mode 100755 debian/rules
diff --git a/debian.template/changelog b/debian.template/changelog
new file mode 100644
index 0000000..b7a9d12
--- /dev/null
+++ b/debian.template/changelog
@@ -0,0 +1,53 @@
+dracut (2.26) unstable; urgency=low
+
+ [ Harald Hoyer ]
+ * multipath: install udev rules and helper tools
+ * NEWS update
+ * multipath: install xdr utils
+ * multipath: install multipath kernel module
+ * specfile update
+ * dracut.8: fixed formatting for rootfs and mount options
+ * dracut: check more return codes, check for permissions and use
+ derror
+ * dracut: create initramfs-$(kernelversion).img by default
+ * Makefile: add WITH_SWITCH_ROOT
+ * fips: search different lib paths
+ * kernel-modules: add firewire-ohci to hardcoded modules list
+ * 90dm: install more device mapper kernel modules
+ * specfile update
+
+ [ Peter Jones ]
+ * Use glob for libdir when installing multipath libraries.
+ * Add #!/bin/bash for consistency.
+ * Make sure and get all the multipath related modules.
+ * Bring up multipath devices that are configured in multipath.conf.
+ * Fix missing shell variables.
+ * This has to be executable.
+ * Handle modules with hyphens in their names properly.
+
+ [ Harald Hoyer ]
+ * lvm: scan without monitor
+
+ [ Yanko Kaneti ]
+ * Wildcards need dracut_install
+
+ [ Harald Hoyer ]
+ * lvm/dmraid: make LIBDIR depend on the binary
+ * nfs: install passwd entries for nobody and nfsnobody
+ * nfs: add rd_NFS_DOMAIN parameter to set the NFSv4 domain name
+ * dracut-functions: inst_simple(): do not bail out if target is a dir
+ and exists
+ * dm: install dmsetup
+ * multipath: corrected initqueue parameter
+ * rootfs-block/mount-root: remount root with /etc/fstab filesystem
+ options
+ * test: set PATH
+
+ -- Philippe Seewer <philippe.seewer@.bfh.ch> Fri, 27 Nov 2009 10:58:26 +0100
+
+dracut (2.21) unstable; urgency=low
+ [ Harald Hoyer ]
+ * fix rd_DASD argument handling (bug #531720)
+ * Resolves: rhbz#531720
+
+ -- Philippe Seewer <philippe.seewer@.bfh.ch> Fri, 06 Nov 2009 15:52:00 +0100
diff --git a/debian.template/compat b/debian.template/compat
new file mode 100644
index 0000000..7ed6ff8
--- /dev/null
+++ b/debian.template/compat
@@ -0,0 +1 @@
+5
diff --git a/debian.template/control b/debian.template/control
new file mode 100644
index 0000000..430d427
--- /dev/null
+++ b/debian.template/control
@@ -0,0 +1,41 @@
+Source: dracut
+Section: utils
+Priority: optional
+Maintainer: Philippe Seewer <philippe.seewer@bfh.ch>
+Build-Depends: debhelper (>= 5.0), cdbs
+Standards-Version: 3.8.4
+Vcs-Browser: http://git.kernel.org/?p=boot/dracut/dracut.git
+Vcs-Git: git://git.kernel.org/pub/scm/boot/dracut/dracut.git
+
+Package: dracut
+Architecture: all
+Recommends: cryptsetup, dmsetup, dmraid, lvm2, mdadm
+Suggests: dracut-network
+Depends: cpio, module-init-tools, udev, ${misc:Depends}
+Provides: linux-initramfs-tool
+Description: A new initramfs infrastructure
+ Unlike existing initramfs's, this is an attempt at having as little as
+ possible hard-coded into the initramfs as possible. The initramfs has
+ (basically) one purpose in life -- getting the rootfs mounted so that
+ we can transition to the real rootfs. This is all driven off of
+ device availability. Therefore, instead of scripts hard-coded to do
+ various things, we depend on udev to create device nodes for us and
+ then when we have the rootfs's device node, we mount and carry on.
+ Having the root on MD, LVM2, LUKS is supported as well as NFS, iSCSI,
+ NBD and FCOE with dracut-network.
+
+Package: dracut-network
+Architecture: all
+Recommends: nfs-common, open-iscsi, nbd-client
+Depends: dracut, iputils-arping, dhcp3-client, ${misc:Depends}
+Description: A new initramfs infrastucture
+ Unlike existing initramfs's, this is an attempt at having as little as
+ possible hard-coded into the initramfs as possible. The initramfs has
+ (basically) one purpose in life -- getting the rootfs mounted so that
+ we can transition to the real rootfs. This is all driven off of
+ device availability. Therefore, instead of scripts hard-coded to do
+ various things, we depend on udev to create device nodes for us and
+ then when we have the rootfs's device node, we mount and carry on.
+ Having the root on MD, LVM2, LUKS is supported as well as NFS, iSCSI,
+ NBD and FCOE with dracut-network.
+
diff --git a/debian.template/copyright b/debian.template/copyright
new file mode 100644
index 0000000..8d6caf7
--- /dev/null
+++ b/debian.template/copyright
@@ -0,0 +1,39 @@
+This package was debianized by Philippe Seewer <philippe.seewer@bfh.ch> on
+Fri Nov 20 15:45:00 +0100
+
+Sources can be downloaded from:
+
+ http://www.kernel.org/pub/linux/utils/boot/dracut/
+
+Upstream Maintainer:
+ Harald Hoyer <harald@redhat.com>
+
+Updstream Authors:
+ Victor Lowther <victor.lowther@gmail.com>
+ Warren Togami <wtogami@redhat.com>
+ Jeremy Katz <katzj@redhat.com>
+ Philippe Seewer <philippe.seewer@bfh.ch>
+ David Dillow <dave@thedillows.org>
+ Andreas Thienemann <andreas@bawue.net>
+ Hans de Goede <hdegoede@redhat.com>
+ Marc Grimme <grimme@atix.de>
+ Bill Nottingham <notting@redhat.com>
+ Daniel Drake <dsd@laptop.org>
+ Lance Albertson <lance@osuosl.org>
+ Michael Ploujnikov <plouj@somanetworks.com>
+ Peter Jones <pjones@redhat.com>
+ Dave Jones <davej@redhat.com>
+ Michal Schmidt <mschmidt@redhat.com>
+ Peter Rajnoha <prajnoha@redhat.com>
+ Quentin Armitage <quentin@armitage.org.uk>
+ Sergey Fionov <fionov@gmail.com>
+ Thilo Bangert <thilo.bangert@gmx.net>
+
+Copyright:
+ Copyright 2009 Harald Hoyer <harald@redhat.com>
+
+
+License: GPLv2
+
+On Debian systems, the complete text of the GNU General Public
+License version 2 can be found in `/usr/share/common-licenses/GPL-2'.
diff --git a/debian.template/dracut-network.dirs b/debian.template/dracut-network.dirs
new file mode 100644
index 0000000..44f96fb
--- /dev/null
+++ b/debian.template/dracut-network.dirs
@@ -0,0 +1,5 @@
+usr/share/dracut/modules.d/40network
+usr/share/dracut/modules.d/95fcoe
+usr/share/dracut/modules.d/95iscsi
+usr/share/dracut/modules.d/95nbd
+usr/share/dracut/modules.d/95nfs
diff --git a/debian.template/dracut-network.install b/debian.template/dracut-network.install
new file mode 100644
index 0000000..dd11096
--- /dev/null
+++ b/debian.template/dracut-network.install
@@ -0,0 +1,5 @@
+modules.d/40network usr/share/dracut/modules.d
+modules.d/95fcoe usr/share/dracut/modules.d
+modules.d/95iscsi usr/share/dracut/modules.d
+modules.d/95nbd usr/share/dracut/modules.d
+modules.d/95nfs usr/share/dracut/modules.d
diff --git a/debian.template/dracut.dirs b/debian.template/dracut.dirs
new file mode 100644
index 0000000..6314b20
--- /dev/null
+++ b/debian.template/dracut.dirs
@@ -0,0 +1,25 @@
+usr/share/dracut
+usr/share/dracut/modules.d/00dash
+usr/share/dracut/modules.d/01fips
+usr/share/dracut/modules.d/60xen
+usr/share/dracut/modules.d/90crypt
+usr/share/dracut/modules.d/90dm
+usr/share/dracut/modules.d/90dmraid
+usr/share/dracut/modules.d/90kernel-modules
+usr/share/dracut/modules.d/90lvm
+usr/share/dracut/modules.d/90mdraid
+usr/share/dracut/modules.d/90multipath
+usr/share/dracut/modules.d/95dasd
+usr/share/dracut/modules.d/95dasd_mod
+usr/share/dracut/modules.d/95debug
+usr/share/dracut/modules.d/95resume
+usr/share/dracut/modules.d/95rootfs-block
+usr/share/dracut/modules.d/95terminfo
+usr/share/dracut/modules.d/95udev-rules
+usr/share/dracut/modules.d/95uswsusp
+usr/share/dracut/modules.d/95zfcp
+usr/share/dracut/modules.d/95znet
+usr/share/dracut/modules.d/98syslog
+usr/share/dracut/modules.d/99base
+/var/lib/dracut
+/etc/dracut.conf.d
\ No newline at end of file
diff --git a/debian.template/dracut.docs b/debian.template/dracut.docs
new file mode 100644
index 0000000..883ffc9
--- /dev/null
+++ b/debian.template/dracut.docs
@@ -0,0 +1,4 @@
+HACKING
+README.generic
+README.kernel
+README.modules
diff --git a/debian.template/dracut.install b/debian.template/dracut.install
new file mode 100644
index 0000000..50e01b6
--- /dev/null
+++ b/debian.template/dracut.install
@@ -0,0 +1,28 @@
+dracut usr/sbin
+dracut-catimages usr/sbin
+dracut-update-initramfs usr/sbin
+dracut-gencmdline usr/sbin
+dracut-functions usr/share/dracut
+dracut.conf etc
+modules.d/00dash usr/share/dracut/modules.d
+modules.d/01fips usr/share/dracut/modules.d
+modules.d/60xen usr/share/dracut/modules.d
+modules.d/90crypt usr/share/dracut/modules.d
+modules.d/90dm usr/share/dracut/modules.d
+modules.d/90dmraid usr/share/dracut/modules.d
+modules.d/90kernel-modules usr/share/dracut/modules.d
+modules.d/90lvm usr/share/dracut/modules.d
+modules.d/90mdraid usr/share/dracut/modules.d
+modules.d/90multipath usr/share/dracut/modules.d
+modules.d/95dasd usr/share/dracut/modules.d
+modules.d/95dasd_mod usr/share/dracut/modules.d
+modules.d/95debug usr/share/dracut/modules.d
+modules.d/95resume usr/share/dracut/modules.d
+modules.d/95rootfs-block usr/share/dracut/modules.d
+modules.d/95terminfo usr/share/dracut/modules.d
+modules.d/95udev-rules usr/share/dracut/modules.d
+modules.d/95uswsusp usr/share/dracut/modules.d
+modules.d/95zfcp usr/share/dracut/modules.d
+modules.d/95znet usr/share/dracut/modules.d
+modules.d/98syslog usr/share/dracut/modules.d
+modules.d/99base usr/share/dracut/modules.d
diff --git a/debian.template/dracut.manpages b/debian.template/dracut.manpages
new file mode 100644
index 0000000..cad8c6e
--- /dev/null
+++ b/debian.template/dracut.manpages
@@ -0,0 +1,4 @@
+dracut.8
+dracut.conf.5
+dracut-catimages.8
+dracut-gencmdline.8
diff --git a/debian.template/dracut.postinst b/debian.template/dracut.postinst
new file mode 100644
index 0000000..f2f61ed
--- /dev/null
+++ b/debian.template/dracut.postinst
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+set -e
+
+# Regenerate initramfs when we're `installed`
+DPKG_MAINTSCRIPT_PACKAGE='' dracut-update-initramfs -u
+
+#DEBHELPER#
diff --git a/debian.template/dracut.triggers b/debian.template/dracut.triggers
new file mode 100644
index 0000000..860c664
--- /dev/null
+++ b/debian.template/dracut.triggers
@@ -0,0 +1 @@
+interest update-initramfs
diff --git a/debian.template/rules b/debian.template/rules
new file mode 100755
index 0000000..e6192f6
--- /dev/null
+++ b/debian.template/rules
@@ -0,0 +1,3 @@
+#!/usr/bin/make -f
+
+include /usr/share/cdbs/1/rules/debhelper.mk
diff --git a/debian/changelog b/debian/changelog
deleted file mode 100644
index b7a9d12..0000000
--- a/debian/changelog
+++ /dev/null
@@ -1,53 +0,0 @@
-dracut (2.26) unstable; urgency=low
-
- [ Harald Hoyer ]
- * multipath: install udev rules and helper tools
- * NEWS update
- * multipath: install xdr utils
- * multipath: install multipath kernel module
- * specfile update
- * dracut.8: fixed formatting for rootfs and mount options
- * dracut: check more return codes, check for permissions and use
- derror
- * dracut: create initramfs-$(kernelversion).img by default
- * Makefile: add WITH_SWITCH_ROOT
- * fips: search different lib paths
- * kernel-modules: add firewire-ohci to hardcoded modules list
- * 90dm: install more device mapper kernel modules
- * specfile update
-
- [ Peter Jones ]
- * Use glob for libdir when installing multipath libraries.
- * Add #!/bin/bash for consistency.
- * Make sure and get all the multipath related modules.
- * Bring up multipath devices that are configured in multipath.conf.
- * Fix missing shell variables.
- * This has to be executable.
- * Handle modules with hyphens in their names properly.
-
- [ Harald Hoyer ]
- * lvm: scan without monitor
-
- [ Yanko Kaneti ]
- * Wildcards need dracut_install
-
- [ Harald Hoyer ]
- * lvm/dmraid: make LIBDIR depend on the binary
- * nfs: install passwd entries for nobody and nfsnobody
- * nfs: add rd_NFS_DOMAIN parameter to set the NFSv4 domain name
- * dracut-functions: inst_simple(): do not bail out if target is a dir
- and exists
- * dm: install dmsetup
- * multipath: corrected initqueue parameter
- * rootfs-block/mount-root: remount root with /etc/fstab filesystem
- options
- * test: set PATH
-
- -- Philippe Seewer <philippe.seewer@.bfh.ch> Fri, 27 Nov 2009 10:58:26 +0100
-
-dracut (2.21) unstable; urgency=low
- [ Harald Hoyer ]
- * fix rd_DASD argument handling (bug #531720)
- * Resolves: rhbz#531720
-
- -- Philippe Seewer <philippe.seewer@.bfh.ch> Fri, 06 Nov 2009 15:52:00 +0100
diff --git a/debian/compat b/debian/compat
deleted file mode 100644
index 7ed6ff8..0000000
--- a/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-5
diff --git a/debian/control b/debian/control
deleted file mode 100644
index 430d427..0000000
--- a/debian/control
+++ /dev/null
@@ -1,41 +0,0 @@
-Source: dracut
-Section: utils
-Priority: optional
-Maintainer: Philippe Seewer <philippe.seewer@bfh.ch>
-Build-Depends: debhelper (>= 5.0), cdbs
-Standards-Version: 3.8.4
-Vcs-Browser: http://git.kernel.org/?p=boot/dracut/dracut.git
-Vcs-Git: git://git.kernel.org/pub/scm/boot/dracut/dracut.git
-
-Package: dracut
-Architecture: all
-Recommends: cryptsetup, dmsetup, dmraid, lvm2, mdadm
-Suggests: dracut-network
-Depends: cpio, module-init-tools, udev, ${misc:Depends}
-Provides: linux-initramfs-tool
-Description: A new initramfs infrastructure
- Unlike existing initramfs's, this is an attempt at having as little as
- possible hard-coded into the initramfs as possible. The initramfs has
- (basically) one purpose in life -- getting the rootfs mounted so that
- we can transition to the real rootfs. This is all driven off of
- device availability. Therefore, instead of scripts hard-coded to do
- various things, we depend on udev to create device nodes for us and
- then when we have the rootfs's device node, we mount and carry on.
- Having the root on MD, LVM2, LUKS is supported as well as NFS, iSCSI,
- NBD and FCOE with dracut-network.
-
-Package: dracut-network
-Architecture: all
-Recommends: nfs-common, open-iscsi, nbd-client
-Depends: dracut, iputils-arping, dhcp3-client, ${misc:Depends}
-Description: A new initramfs infrastucture
- Unlike existing initramfs's, this is an attempt at having as little as
- possible hard-coded into the initramfs as possible. The initramfs has
- (basically) one purpose in life -- getting the rootfs mounted so that
- we can transition to the real rootfs. This is all driven off of
- device availability. Therefore, instead of scripts hard-coded to do
- various things, we depend on udev to create device nodes for us and
- then when we have the rootfs's device node, we mount and carry on.
- Having the root on MD, LVM2, LUKS is supported as well as NFS, iSCSI,
- NBD and FCOE with dracut-network.
-
diff --git a/debian/copyright b/debian/copyright
deleted file mode 100644
index 8d6caf7..0000000
--- a/debian/copyright
+++ /dev/null
@@ -1,39 +0,0 @@
-This package was debianized by Philippe Seewer <philippe.seewer@bfh.ch> on
-Fri Nov 20 15:45:00 +0100
-
-Sources can be downloaded from:
-
- http://www.kernel.org/pub/linux/utils/boot/dracut/
-
-Upstream Maintainer:
- Harald Hoyer <harald@redhat.com>
-
-Updstream Authors:
- Victor Lowther <victor.lowther@gmail.com>
- Warren Togami <wtogami@redhat.com>
- Jeremy Katz <katzj@redhat.com>
- Philippe Seewer <philippe.seewer@bfh.ch>
- David Dillow <dave@thedillows.org>
- Andreas Thienemann <andreas@bawue.net>
- Hans de Goede <hdegoede@redhat.com>
- Marc Grimme <grimme@atix.de>
- Bill Nottingham <notting@redhat.com>
- Daniel Drake <dsd@laptop.org>
- Lance Albertson <lance@osuosl.org>
- Michael Ploujnikov <plouj@somanetworks.com>
- Peter Jones <pjones@redhat.com>
- Dave Jones <davej@redhat.com>
- Michal Schmidt <mschmidt@redhat.com>
- Peter Rajnoha <prajnoha@redhat.com>
- Quentin Armitage <quentin@armitage.org.uk>
- Sergey Fionov <fionov@gmail.com>
- Thilo Bangert <thilo.bangert@gmx.net>
-
-Copyright:
- Copyright 2009 Harald Hoyer <harald@redhat.com>
-
-
-License: GPLv2
-
-On Debian systems, the complete text of the GNU General Public
-License version 2 can be found in `/usr/share/common-licenses/GPL-2'.
diff --git a/debian/dracut-network.dirs b/debian/dracut-network.dirs
deleted file mode 100644
index 44f96fb..0000000
--- a/debian/dracut-network.dirs
+++ /dev/null
@@ -1,5 +0,0 @@
-usr/share/dracut/modules.d/40network
-usr/share/dracut/modules.d/95fcoe
-usr/share/dracut/modules.d/95iscsi
-usr/share/dracut/modules.d/95nbd
-usr/share/dracut/modules.d/95nfs
diff --git a/debian/dracut-network.install b/debian/dracut-network.install
deleted file mode 100644
index dd11096..0000000
--- a/debian/dracut-network.install
+++ /dev/null
@@ -1,5 +0,0 @@
-modules.d/40network usr/share/dracut/modules.d
-modules.d/95fcoe usr/share/dracut/modules.d
-modules.d/95iscsi usr/share/dracut/modules.d
-modules.d/95nbd usr/share/dracut/modules.d
-modules.d/95nfs usr/share/dracut/modules.d
diff --git a/debian/dracut.dirs b/debian/dracut.dirs
deleted file mode 100644
index 6314b20..0000000
--- a/debian/dracut.dirs
+++ /dev/null
@@ -1,25 +0,0 @@
-usr/share/dracut
-usr/share/dracut/modules.d/00dash
-usr/share/dracut/modules.d/01fips
-usr/share/dracut/modules.d/60xen
-usr/share/dracut/modules.d/90crypt
-usr/share/dracut/modules.d/90dm
-usr/share/dracut/modules.d/90dmraid
-usr/share/dracut/modules.d/90kernel-modules
-usr/share/dracut/modules.d/90lvm
-usr/share/dracut/modules.d/90mdraid
-usr/share/dracut/modules.d/90multipath
-usr/share/dracut/modules.d/95dasd
-usr/share/dracut/modules.d/95dasd_mod
-usr/share/dracut/modules.d/95debug
-usr/share/dracut/modules.d/95resume
-usr/share/dracut/modules.d/95rootfs-block
-usr/share/dracut/modules.d/95terminfo
-usr/share/dracut/modules.d/95udev-rules
-usr/share/dracut/modules.d/95uswsusp
-usr/share/dracut/modules.d/95zfcp
-usr/share/dracut/modules.d/95znet
-usr/share/dracut/modules.d/98syslog
-usr/share/dracut/modules.d/99base
-/var/lib/dracut
-/etc/dracut.conf.d
\ No newline at end of file
diff --git a/debian/dracut.docs b/debian/dracut.docs
deleted file mode 100644
index 883ffc9..0000000
--- a/debian/dracut.docs
+++ /dev/null
@@ -1,4 +0,0 @@
-HACKING
-README.generic
-README.kernel
-README.modules
diff --git a/debian/dracut.install b/debian/dracut.install
deleted file mode 100644
index 50e01b6..0000000
--- a/debian/dracut.install
+++ /dev/null
@@ -1,28 +0,0 @@
-dracut usr/sbin
-dracut-catimages usr/sbin
-dracut-update-initramfs usr/sbin
-dracut-gencmdline usr/sbin
-dracut-functions usr/share/dracut
-dracut.conf etc
-modules.d/00dash usr/share/dracut/modules.d
-modules.d/01fips usr/share/dracut/modules.d
-modules.d/60xen usr/share/dracut/modules.d
-modules.d/90crypt usr/share/dracut/modules.d
-modules.d/90dm usr/share/dracut/modules.d
-modules.d/90dmraid usr/share/dracut/modules.d
-modules.d/90kernel-modules usr/share/dracut/modules.d
-modules.d/90lvm usr/share/dracut/modules.d
-modules.d/90mdraid usr/share/dracut/modules.d
-modules.d/90multipath usr/share/dracut/modules.d
-modules.d/95dasd usr/share/dracut/modules.d
-modules.d/95dasd_mod usr/share/dracut/modules.d
-modules.d/95debug usr/share/dracut/modules.d
-modules.d/95resume usr/share/dracut/modules.d
-modules.d/95rootfs-block usr/share/dracut/modules.d
-modules.d/95terminfo usr/share/dracut/modules.d
-modules.d/95udev-rules usr/share/dracut/modules.d
-modules.d/95uswsusp usr/share/dracut/modules.d
-modules.d/95zfcp usr/share/dracut/modules.d
-modules.d/95znet usr/share/dracut/modules.d
-modules.d/98syslog usr/share/dracut/modules.d
-modules.d/99base usr/share/dracut/modules.d
diff --git a/debian/dracut.manpages b/debian/dracut.manpages
deleted file mode 100644
index cad8c6e..0000000
--- a/debian/dracut.manpages
+++ /dev/null
@@ -1,4 +0,0 @@
-dracut.8
-dracut.conf.5
-dracut-catimages.8
-dracut-gencmdline.8
diff --git a/debian/dracut.postinst b/debian/dracut.postinst
deleted file mode 100644
index f2f61ed..0000000
--- a/debian/dracut.postinst
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-set -e
-
-# Regenerate initramfs when we're `installed`
-DPKG_MAINTSCRIPT_PACKAGE='' dracut-update-initramfs -u
-
-#DEBHELPER#
diff --git a/debian/dracut.triggers b/debian/dracut.triggers
deleted file mode 100644
index 860c664..0000000
--- a/debian/dracut.triggers
+++ /dev/null
@@ -1 +0,0 @@
-interest update-initramfs
diff --git a/debian/rules b/debian/rules
deleted file mode 100755
index e6192f6..0000000
--- a/debian/rules
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/make -f
-
-include /usr/share/cdbs/1/rules/debhelper.mk

View File

@ -0,0 +1,29 @@
From 7b07f4e83fe514dbbe66869337d3d0cf8610240b Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 25 Jul 2011 10:55:19 +0200
Subject: [PATCH] dracut-functions: resolve relative path and recursively
install destination
---
dracut-functions | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/dracut-functions b/dracut-functions
index 2a45419..a261ddd 100755
--- a/dracut-functions
+++ b/dracut-functions
@@ -277,12 +277,10 @@ inst_dir() {
if [[ -L $_file ]]; then
# create link as the original
local target=$(readlink "$_file")
+ # resolve relative path and recursively install destination
+ [[ $target == ${target#/} ]] && target="$(dirname "$_file")/$target"
inst_dir "$target"
inst_symlink "$_file"
- #ln -sfn "$target" "${initdir}$_file" || return 1
- # resolve relative path and recursively install destination
- #[[ $target == ${target#/} ]] && target="$(dirname "$_file")/$target"
- #inst_dir "$target"
else
[[ -h ${initdir}$_file ]] && _file=$(readlink "${initdir}$_file")
# create directory

View File

@ -0,0 +1,330 @@
From 5a10d93d2996cffed09e082fabb155e8ddcf2812 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 25 Jul 2011 10:57:52 +0200
Subject: [PATCH] removed debian.template
---
debian.template/changelog | 53 --------------------------------
debian.template/compat | 1 -
debian.template/control | 41 ------------------------
debian.template/copyright | 39 -----------------------
debian.template/dracut-network.dirs | 5 ---
debian.template/dracut-network.install | 5 ---
debian.template/dracut.dirs | 25 ---------------
debian.template/dracut.docs | 4 --
debian.template/dracut.install | 28 -----------------
debian.template/dracut.manpages | 4 --
debian.template/dracut.postinst | 8 -----
debian.template/dracut.triggers | 1 -
debian.template/rules | 3 --
13 files changed, 0 insertions(+), 217 deletions(-)
delete mode 100644 debian.template/changelog
delete mode 100644 debian.template/compat
delete mode 100644 debian.template/control
delete mode 100644 debian.template/copyright
delete mode 100644 debian.template/dracut-network.dirs
delete mode 100644 debian.template/dracut-network.install
delete mode 100644 debian.template/dracut.dirs
delete mode 100644 debian.template/dracut.docs
delete mode 100644 debian.template/dracut.install
delete mode 100644 debian.template/dracut.manpages
delete mode 100644 debian.template/dracut.postinst
delete mode 100644 debian.template/dracut.triggers
delete mode 100755 debian.template/rules
diff --git a/debian.template/changelog b/debian.template/changelog
deleted file mode 100644
index b7a9d12..0000000
--- a/debian.template/changelog
+++ /dev/null
@@ -1,53 +0,0 @@
-dracut (2.26) unstable; urgency=low
-
- [ Harald Hoyer ]
- * multipath: install udev rules and helper tools
- * NEWS update
- * multipath: install xdr utils
- * multipath: install multipath kernel module
- * specfile update
- * dracut.8: fixed formatting for rootfs and mount options
- * dracut: check more return codes, check for permissions and use
- derror
- * dracut: create initramfs-$(kernelversion).img by default
- * Makefile: add WITH_SWITCH_ROOT
- * fips: search different lib paths
- * kernel-modules: add firewire-ohci to hardcoded modules list
- * 90dm: install more device mapper kernel modules
- * specfile update
-
- [ Peter Jones ]
- * Use glob for libdir when installing multipath libraries.
- * Add #!/bin/bash for consistency.
- * Make sure and get all the multipath related modules.
- * Bring up multipath devices that are configured in multipath.conf.
- * Fix missing shell variables.
- * This has to be executable.
- * Handle modules with hyphens in their names properly.
-
- [ Harald Hoyer ]
- * lvm: scan without monitor
-
- [ Yanko Kaneti ]
- * Wildcards need dracut_install
-
- [ Harald Hoyer ]
- * lvm/dmraid: make LIBDIR depend on the binary
- * nfs: install passwd entries for nobody and nfsnobody
- * nfs: add rd_NFS_DOMAIN parameter to set the NFSv4 domain name
- * dracut-functions: inst_simple(): do not bail out if target is a dir
- and exists
- * dm: install dmsetup
- * multipath: corrected initqueue parameter
- * rootfs-block/mount-root: remount root with /etc/fstab filesystem
- options
- * test: set PATH
-
- -- Philippe Seewer <philippe.seewer@.bfh.ch> Fri, 27 Nov 2009 10:58:26 +0100
-
-dracut (2.21) unstable; urgency=low
- [ Harald Hoyer ]
- * fix rd_DASD argument handling (bug #531720)
- * Resolves: rhbz#531720
-
- -- Philippe Seewer <philippe.seewer@.bfh.ch> Fri, 06 Nov 2009 15:52:00 +0100
diff --git a/debian.template/compat b/debian.template/compat
deleted file mode 100644
index 7ed6ff8..0000000
--- a/debian.template/compat
+++ /dev/null
@@ -1 +0,0 @@
-5
diff --git a/debian.template/control b/debian.template/control
deleted file mode 100644
index 430d427..0000000
--- a/debian.template/control
+++ /dev/null
@@ -1,41 +0,0 @@
-Source: dracut
-Section: utils
-Priority: optional
-Maintainer: Philippe Seewer <philippe.seewer@bfh.ch>
-Build-Depends: debhelper (>= 5.0), cdbs
-Standards-Version: 3.8.4
-Vcs-Browser: http://git.kernel.org/?p=boot/dracut/dracut.git
-Vcs-Git: git://git.kernel.org/pub/scm/boot/dracut/dracut.git
-
-Package: dracut
-Architecture: all
-Recommends: cryptsetup, dmsetup, dmraid, lvm2, mdadm
-Suggests: dracut-network
-Depends: cpio, module-init-tools, udev, ${misc:Depends}
-Provides: linux-initramfs-tool
-Description: A new initramfs infrastructure
- Unlike existing initramfs's, this is an attempt at having as little as
- possible hard-coded into the initramfs as possible. The initramfs has
- (basically) one purpose in life -- getting the rootfs mounted so that
- we can transition to the real rootfs. This is all driven off of
- device availability. Therefore, instead of scripts hard-coded to do
- various things, we depend on udev to create device nodes for us and
- then when we have the rootfs's device node, we mount and carry on.
- Having the root on MD, LVM2, LUKS is supported as well as NFS, iSCSI,
- NBD and FCOE with dracut-network.
-
-Package: dracut-network
-Architecture: all
-Recommends: nfs-common, open-iscsi, nbd-client
-Depends: dracut, iputils-arping, dhcp3-client, ${misc:Depends}
-Description: A new initramfs infrastucture
- Unlike existing initramfs's, this is an attempt at having as little as
- possible hard-coded into the initramfs as possible. The initramfs has
- (basically) one purpose in life -- getting the rootfs mounted so that
- we can transition to the real rootfs. This is all driven off of
- device availability. Therefore, instead of scripts hard-coded to do
- various things, we depend on udev to create device nodes for us and
- then when we have the rootfs's device node, we mount and carry on.
- Having the root on MD, LVM2, LUKS is supported as well as NFS, iSCSI,
- NBD and FCOE with dracut-network.
-
diff --git a/debian.template/copyright b/debian.template/copyright
deleted file mode 100644
index 8d6caf7..0000000
--- a/debian.template/copyright
+++ /dev/null
@@ -1,39 +0,0 @@
-This package was debianized by Philippe Seewer <philippe.seewer@bfh.ch> on
-Fri Nov 20 15:45:00 +0100
-
-Sources can be downloaded from:
-
- http://www.kernel.org/pub/linux/utils/boot/dracut/
-
-Upstream Maintainer:
- Harald Hoyer <harald@redhat.com>
-
-Updstream Authors:
- Victor Lowther <victor.lowther@gmail.com>
- Warren Togami <wtogami@redhat.com>
- Jeremy Katz <katzj@redhat.com>
- Philippe Seewer <philippe.seewer@bfh.ch>
- David Dillow <dave@thedillows.org>
- Andreas Thienemann <andreas@bawue.net>
- Hans de Goede <hdegoede@redhat.com>
- Marc Grimme <grimme@atix.de>
- Bill Nottingham <notting@redhat.com>
- Daniel Drake <dsd@laptop.org>
- Lance Albertson <lance@osuosl.org>
- Michael Ploujnikov <plouj@somanetworks.com>
- Peter Jones <pjones@redhat.com>
- Dave Jones <davej@redhat.com>
- Michal Schmidt <mschmidt@redhat.com>
- Peter Rajnoha <prajnoha@redhat.com>
- Quentin Armitage <quentin@armitage.org.uk>
- Sergey Fionov <fionov@gmail.com>
- Thilo Bangert <thilo.bangert@gmx.net>
-
-Copyright:
- Copyright 2009 Harald Hoyer <harald@redhat.com>
-
-
-License: GPLv2
-
-On Debian systems, the complete text of the GNU General Public
-License version 2 can be found in `/usr/share/common-licenses/GPL-2'.
diff --git a/debian.template/dracut-network.dirs b/debian.template/dracut-network.dirs
deleted file mode 100644
index 44f96fb..0000000
--- a/debian.template/dracut-network.dirs
+++ /dev/null
@@ -1,5 +0,0 @@
-usr/share/dracut/modules.d/40network
-usr/share/dracut/modules.d/95fcoe
-usr/share/dracut/modules.d/95iscsi
-usr/share/dracut/modules.d/95nbd
-usr/share/dracut/modules.d/95nfs
diff --git a/debian.template/dracut-network.install b/debian.template/dracut-network.install
deleted file mode 100644
index dd11096..0000000
--- a/debian.template/dracut-network.install
+++ /dev/null
@@ -1,5 +0,0 @@
-modules.d/40network usr/share/dracut/modules.d
-modules.d/95fcoe usr/share/dracut/modules.d
-modules.d/95iscsi usr/share/dracut/modules.d
-modules.d/95nbd usr/share/dracut/modules.d
-modules.d/95nfs usr/share/dracut/modules.d
diff --git a/debian.template/dracut.dirs b/debian.template/dracut.dirs
deleted file mode 100644
index 6314b20..0000000
--- a/debian.template/dracut.dirs
+++ /dev/null
@@ -1,25 +0,0 @@
-usr/share/dracut
-usr/share/dracut/modules.d/00dash
-usr/share/dracut/modules.d/01fips
-usr/share/dracut/modules.d/60xen
-usr/share/dracut/modules.d/90crypt
-usr/share/dracut/modules.d/90dm
-usr/share/dracut/modules.d/90dmraid
-usr/share/dracut/modules.d/90kernel-modules
-usr/share/dracut/modules.d/90lvm
-usr/share/dracut/modules.d/90mdraid
-usr/share/dracut/modules.d/90multipath
-usr/share/dracut/modules.d/95dasd
-usr/share/dracut/modules.d/95dasd_mod
-usr/share/dracut/modules.d/95debug
-usr/share/dracut/modules.d/95resume
-usr/share/dracut/modules.d/95rootfs-block
-usr/share/dracut/modules.d/95terminfo
-usr/share/dracut/modules.d/95udev-rules
-usr/share/dracut/modules.d/95uswsusp
-usr/share/dracut/modules.d/95zfcp
-usr/share/dracut/modules.d/95znet
-usr/share/dracut/modules.d/98syslog
-usr/share/dracut/modules.d/99base
-/var/lib/dracut
-/etc/dracut.conf.d
\ No newline at end of file
diff --git a/debian.template/dracut.docs b/debian.template/dracut.docs
deleted file mode 100644
index 883ffc9..0000000
--- a/debian.template/dracut.docs
+++ /dev/null
@@ -1,4 +0,0 @@
-HACKING
-README.generic
-README.kernel
-README.modules
diff --git a/debian.template/dracut.install b/debian.template/dracut.install
deleted file mode 100644
index 50e01b6..0000000
--- a/debian.template/dracut.install
+++ /dev/null
@@ -1,28 +0,0 @@
-dracut usr/sbin
-dracut-catimages usr/sbin
-dracut-update-initramfs usr/sbin
-dracut-gencmdline usr/sbin
-dracut-functions usr/share/dracut
-dracut.conf etc
-modules.d/00dash usr/share/dracut/modules.d
-modules.d/01fips usr/share/dracut/modules.d
-modules.d/60xen usr/share/dracut/modules.d
-modules.d/90crypt usr/share/dracut/modules.d
-modules.d/90dm usr/share/dracut/modules.d
-modules.d/90dmraid usr/share/dracut/modules.d
-modules.d/90kernel-modules usr/share/dracut/modules.d
-modules.d/90lvm usr/share/dracut/modules.d
-modules.d/90mdraid usr/share/dracut/modules.d
-modules.d/90multipath usr/share/dracut/modules.d
-modules.d/95dasd usr/share/dracut/modules.d
-modules.d/95dasd_mod usr/share/dracut/modules.d
-modules.d/95debug usr/share/dracut/modules.d
-modules.d/95resume usr/share/dracut/modules.d
-modules.d/95rootfs-block usr/share/dracut/modules.d
-modules.d/95terminfo usr/share/dracut/modules.d
-modules.d/95udev-rules usr/share/dracut/modules.d
-modules.d/95uswsusp usr/share/dracut/modules.d
-modules.d/95zfcp usr/share/dracut/modules.d
-modules.d/95znet usr/share/dracut/modules.d
-modules.d/98syslog usr/share/dracut/modules.d
-modules.d/99base usr/share/dracut/modules.d
diff --git a/debian.template/dracut.manpages b/debian.template/dracut.manpages
deleted file mode 100644
index cad8c6e..0000000
--- a/debian.template/dracut.manpages
+++ /dev/null
@@ -1,4 +0,0 @@
-dracut.8
-dracut.conf.5
-dracut-catimages.8
-dracut-gencmdline.8
diff --git a/debian.template/dracut.postinst b/debian.template/dracut.postinst
deleted file mode 100644
index f2f61ed..0000000
--- a/debian.template/dracut.postinst
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-set -e
-
-# Regenerate initramfs when we're `installed`
-DPKG_MAINTSCRIPT_PACKAGE='' dracut-update-initramfs -u
-
-#DEBHELPER#
diff --git a/debian.template/dracut.triggers b/debian.template/dracut.triggers
deleted file mode 100644
index 860c664..0000000
--- a/debian.template/dracut.triggers
+++ /dev/null
@@ -1 +0,0 @@
-interest update-initramfs
diff --git a/debian.template/rules b/debian.template/rules
deleted file mode 100755
index e6192f6..0000000
--- a/debian.template/rules
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/make -f
-
-include /usr/share/cdbs/1/rules/debhelper.mk

View File

@ -0,0 +1,29 @@
From 6f09acf8558d0ce7f831d05b3aa0abbc9c136414 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 25 Jul 2011 14:28:40 +0200
Subject: [PATCH] dracut: install /lib* for kernel images
---
dracut | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/dracut b/dracut
index 079d5be..aa8cb58 100755
--- a/dracut
+++ b/dracut
@@ -503,6 +503,15 @@ if [[ $kernel_only != yes ]]; then
ln -sfn /run "$initdir/var/run"
ln -sfn /run/lock "$initdir/var/lock"
+else
+ for d in lib "$libdir"; do
+ [[ -e "${initdir}${prefix}/$d" ]] && continue
+ if [ -h "/$d" ]; then
+ inst "/$d" "${prefix}/$d"
+ else
+ mkdir -m 0755 -p "${initdir}${prefix}/$d"
+ fi
+ done
fi
# check all our modules to see if they should be sourced.

View File

@ -0,0 +1,45 @@
From 626d9eba9c421640da5bb8f881a892a460067929 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 25 Jul 2011 14:28:55 +0200
Subject: [PATCH] dracut-functions: remove double slashes, for symlink
conversion
remove double slashes for symlink conversion from absolute to relative
---
dracut-functions | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/dracut-functions b/dracut-functions
index a261ddd..61e10e8 100755
--- a/dracut-functions
+++ b/dracut-functions
@@ -82,6 +82,13 @@ print_vars() {
done
}
+normalize_path() {
+ p=$1
+ while [[ ${p#*//*} != $p ]]; do
+ p=${p/\/\///}
+ done
+ echo $p
+}
convert_abs_rel() {
local __current __absolute __abssize __cursize __i __level __newpath
@@ -92,11 +99,12 @@ convert_abs_rel() {
echo "."
return
fi
-
+ __current=$(normalize_path "$1")
+ __absolute=$(normalize_path "$2")
IFS="/"
- __current=($1)
- __absolute=($2)
+ __current=($__current)
+ __absolute=($__absolute)
__abssize=${#__absolute[@]}
__cursize=${#__current[@]}

View File

@ -0,0 +1,577 @@
From b6632d616f8edbbb9406c6105264b1f646b9a97f Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 25 Jul 2011 18:01:02 +0200
Subject: [PATCH] dracut-update-initramfs: removed on request of the debian
maintainer
---
dracut-update-initramfs | 560 -----------------------------------------------
1 files changed, 0 insertions(+), 560 deletions(-)
delete mode 100755 dracut-update-initramfs
diff --git a/dracut-update-initramfs b/dracut-update-initramfs
deleted file mode 100755
index 259c774..0000000
--- a/dracut-update-initramfs
+++ /dev/null
@@ -1,560 +0,0 @@
-#!/bin/bash
-# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
-# ex: ts=8 sw=4 sts=4 et filetype=sh
-
-STATEDIR=/var/lib/dracut
-BOOTDIR=/boot
-CONF=/etc/dracut.conf
-KPKGCONF=/etc/kernel-img.conf
-USETRIGGERS=true
-mode=""
-version=""
-
-set -e
-
-if $USETRIGGERS \
- && [ x"$DPKG_MAINTSCRIPT_PACKAGE" != x ] \
- && [ $# = 1 ] \
- && [ x"$1" = x-u ] \
- && dpkg-trigger --check-supported 2>/dev/null
-then
- if dpkg-trigger --no-await update-initramfs; then
- echo "dracut-update-initramfs: deferring update (trigger activated)"
- exit 0
- fi
-fi
-
-usage()
-{
- if [ -n "${1}" ]; then
- printf "${@}\n\n" >&2
- fi
- cat >&2 << EOF
-Usage: ${0} [OPTION]...
-
-Options:
- -k [version] Specify kernel version or 'all'
- -c Create a new initramfs
- -u Update an existing initramfs
- -d Remove an existing initramfs
- -t Take over a custom initramfs with this one
- -b Set alternate boot directory
- -v Be verbose
- -h This message
-
-EOF
- exit 1
-}
-
-# chroot check
-chrooted()
-{
- # borrowed from udev's postinst
- if [ "$(stat -c %d/%i /)" = "$(stat -Lc %d/%i /proc/1/root 2>/dev/null)" ]; then
- # the devicenumber/inode pair of / is the same as that of
- # /sbin/init's root, so we're *not* in a chroot and hence
- # return false.
- return 1
- fi
- return 0
-}
-
-mild_panic()
-{
- if [ -n "${1}" ]; then
- printf "${@}\n" >&2
- fi
- exit 0
-}
-
-panic()
-{
- if [ -n "${1}" ]; then
- printf "${@}\n" >&2
- fi
- exit 1
-}
-
-verbose()
-{
- if [ "${verbose}" = 1 ]; then
- printf "${@}\n"
- fi
-}
-
-version_exists()
-{
- [ -e "${STATEDIR}/${1}" ] && [ -e "${initramfs}" ]
- return $?
-}
-
-set_initramfs()
-{
- initramfs="${BOOTDIR}/dracut.img-${version}"
-}
-
-
-# backup initramfs while running
-backup_initramfs()
-{
- [ ! -r "${initramfs}" ] && return 0
- initramfs_bak="${initramfs}.dpkg-bak"
- [ -r "${initramfs_bak}" ] && rm -f "${initramfs_bak}"
- ln -f "${initramfs}" "${initramfs_bak}" \
- || cp -a "${initramfs}" "${initramfs_bak}"
- verbose "Keeping ${initramfs_bak}"
-}
-
-# keep booted initramfs
-backup_booted_initramfs()
-{
- initramfs_bak="${initramfs}.dpkg-bak"
-
- # first time run thus no backup
- [ ! -r "${initramfs_bak}" ] && return 0
-
- # chroot with no /proc
- [ ! -r /proc/uptime ] && rm -f "${initramfs_bak}" && return 0
-
- # no kept backup wanted
- [ "${backup_initramfs}" = "no" ] && rm -f "${initramfs_bak}" && return 0
-
- # no backup yet
- if [ ! -r "${initramfs}.bak" ]; then
- mv -f ${initramfs_bak} "${initramfs}.bak"
- verbose "Backup ${initramfs}.bak"
- return 0
- fi
-
- # keep booted initramfs
- uptime_days=$(awk '{printf "%d", $1 / 3600 / 24}' /proc/uptime)
- if [ -n "$uptime_days" ]; then
- boot_initramfs=$(find "${initramfs}.bak" -mtime +${uptime_days})
- fi
- if [ -n "${boot_initramfs}" ]; then
- mv -f "${initramfs_bak}" "${initramfs}.bak"
- verbose "Backup ${initramfs}.bak"
- return 0
- fi
- verbose "Removing current backup ${initramfs_bak}"
- rm -f ${initramfs_bak}
-}
-
-# nuke generated copy
-remove_initramfs()
-{
- [ -z "${initramfs_bak}" ] && return 0
- rm -f "${initramfs_bak}"
- verbose "Removing ${initramfs_bak}"
-}
-
-
-generate_initramfs()
-{
- echo "dracut-update-initramfs: Generating ${initramfs}"
- OPTS=""
- if [ "${verbose}" = 1 ]; then
- OPTS="-v ${OPTS}"
- fi
- ##WORK HERE!
- if dracut ${OPTS} "${initramfs}.new" "${version}"; then
- mv -f "${initramfs}.new" "${initramfs}"
- set_sha1
- else
- mkinitramfs_return="$?"
- remove_initramfs
- rm -f "${initramfs}.new"
- if [ "$mkinitramfs_return" = "2" ]; then
- # minversion wasn't met, exit 0
- exit 0
- fi
- echo "update-initramfs: failed for ${initramfs}"
- exit $mkinitramfs_return
- fi
-}
-
-# lilo call
-run_lilo()
-{
- # show lilo errors on failure
- if ! lilo -t > /dev/null 2>&1 ; then
- echo "ERROR lilo fails for new ${initramfs}:"
- echo
- lilo -t
- fi
- lilo
-}
-
-# check if lilo is on mbr
-mbr_check()
-{
- # try to discover grub|grub2 and be happy
- [ -r /boot/grub/grub.cfg ] \
- && groot=$(awk '/^set root=/{print substr($2, 7, 3); exit}' \
- /boot/grub/grub.cfg)
- [ -r /boot/grub/menu.lst ] \
- && groot=$(awk '/^root/{print substr($2, 2, 3); exit}' \
- /boot/grub/menu.lst)
- [ -e /boot/grub/device.map ] && [ -n "${groot}" ] \
- && dev=$(awk "/${groot}/{ print \$NF}" /boot/grub/device.map)
- [ -n "${dev}" ] && [ -r ${dev} ] \
- && dd if="${dev}" bs=512 skip=0 count=1 2> /dev/null \
- | grep -q GRUB && return 0
-
- # check out lilo.conf for validity
- boot=$(awk -F = '/^boot=/{ print $2}' /etc/lilo.conf)
- [ -z "${boot}" ] && return 0
- case ${boot} in
- /dev/md/*)
- if [ -r /proc/mdstat ]; then
- MD=${boot#/dev/md/}
- boot="/dev/$(awk "/^md${MD}/{print substr(\$5, 1, 3)}" \
- /proc/mdstat)"
- fi
- ;;
- /dev/md*)
- if [ -r /proc/mdstat ]; then
- MD=${boot#/dev/}
- boot="/dev/$(awk "/^${MD}/{print substr(\$5, 1, 3)}" \
- /proc/mdstat)"
- fi
- ;;
- esac
- [ ! -r "${boot}" ] && return 0
- dd if="${boot}" bs=512 skip=0 count=1 2> /dev/null | grep -q LILO \
- && run_lilo && return 0
-
- # no idea which bootloader is used
- echo
- echo "WARNING: grub and lilo installed."
- echo "If you use grub as bootloader everything is fine."
- echo "If you use lilo as bootloader you must run lilo!"
- echo
-}
-
-# Invoke bootloader
-run_bootloader()
-{
- # if both lilo and grub around, figure out if lilo needs to be run
- if ( command -v update-grub >/dev/null 2>&1 \
- || [ -e /boot/grub/menu.lst ] || [ -e /boot/grub/grub.cfg ] ) \
- && ( [ -e /etc/lilo.conf ] && command -v lilo >/dev/null 2>&1 ); then
- [ -r "${KPKGCONF}" ] && \
- do_b=$(awk '/^do_bootloader/{print $3}' "${KPKGCONF}")
- if [ "${do_b}" = "yes" ] || [ "${do_b}" = "Yes" ] \
- || [ "${do_b}" = "YES" ]; then
- run_lilo
- return 0
- elif [ "${do_b}" = "no" ] || [ "${do_b}" = "No" ] \
- || [ "${do_b}" = "NO" ]; then
- return 0
- fi
-
- # do_bootloader unconfigured
- mbr_check
- return 0
- fi
- if [ -r /etc/lilo.conf ] && command -v lilo >/dev/null 2>&1; then
- run_lilo
- return 0
- fi
- if command -v elilo >/dev/null 2>&1; then
- elilo
- return 0
- fi
- if [ -r /etc/zipl.conf ]; then
- zipl
- fi
- if flash-kernel --supported >/dev/null 2>&1; then
- flash-kernel ${version}
- fi
-}
-
-compare_sha1()
-{
- sha1sum "${initramfs}" | diff "${STATEDIR}/${version}" - >/dev/null 2>&1
- return $?
-}
-
-# Note that this must overwrite so that updates work.
-set_sha1()
-{
- sha1sum "${initramfs}" > "${STATEDIR}/${version}"
-}
-
-delete_sha1()
-{
- rm -f "${STATEDIR}/${version}"
-}
-
-# ro /boot is not modified
-ro_boot_check()
-{
- # check irrelevant inside of a chroot
- if [ ! -r /proc/mounts ] || chrooted; then
- return 0
- fi
-
- boot_opts=$(awk '/boot/{if ((match($4, /^ro/) || match($4, /,ro/)) \
- && $2 == "/boot") print "ro"}' /proc/mounts)
- if [ -n "${boot_opts}" ]; then
- echo "WARNING: /boot is ro mounted."
- echo "update-initramfs: Not updating ${initramfs}"
- exit 0
- fi
-}
-
-get_sorted_versions()
-{
- version_list=""
-
- for gsv_x in "${STATEDIR}"/*; do
- gsv_x="$(basename "${gsv_x}")"
- if [ "${gsv_x}" = '*' ]; then
- return 0
- fi
- worklist=""
- for gsv_i in $version_list; do
- if dpkg --compare-versions "${gsv_x}" '>' "${gsv_i}"; then
- worklist="${worklist} ${gsv_x} ${gsv_i}"
- gsv_x=""
- else
- worklist="${worklist} ${gsv_i}"
- fi
- done
- if [ "${gsv_x}" != "" ]; then
- worklist="${worklist} ${gsv_x}"
- fi
- version_list="${worklist}"
- done
-
- verbose "Available versions: ${version_list}"
-}
-
-set_current_version()
-{
- if [ -f /boot/dracut.img-`uname -r` ]; then
- version=`uname -r`
- fi
-}
-
-set_linked_version()
-{
- if [ -e /initrd.img ] && [ -L /initrd.img ]; then
- linktarget="$(basename "$(readlink /initrd.img)")"
- fi
-
- if [ -e /boot/initrd.img ] && [ -L /boot/initrd.img ]; then
- linktarget="$(basename "$(readlink /boot/initrd.img)")"
- fi
-
- if [ -z "${linktarget}" ]; then
- return
- fi
-
- version="${linktarget##*img-}"
-}
-
-set_highest_version()
-{
- get_sorted_versions
- set -- ${version_list}
- version=${1}
-}
-
-create()
-{
- if [ -z "${version}" ]; then
- usage "Create mode requires a version argument"
- fi
-
- set_initramfs
-
- if [ "${takeover}" = 0 ]; then
- if version_exists "${version}"; then
- panic "Cannot create version ${version}: already exists"
- fi
-
- if [ -e "${initramfs}" ]; then
- panic "${initramfs} already exists, cannot create."
- fi
- fi
-
- generate_initramfs
-}
-
-update()
-{
- if [ "${update_initramfs}" = "no" ]; then
- echo "update-initramfs: Not updating initramfs."
- exit 0
- fi
-
- if [ -z "${version}" ]; then
- set_highest_version
- fi
-
- if [ -z "${version}" ]; then
- set_linked_version
- fi
-
- if [ -z "${version}" ]; then
- set_current_version
- fi
-
- if [ -z "${version}" ]; then
- verbose "Nothing to do, exiting."
- exit 0
- fi
-
- set_initramfs
-
- ro_boot_check
-
- altered_check
-
- backup_initramfs
-
- generate_initramfs
-
- run_bootloader
-
- backup_booted_initramfs
-}
-
-delete()
-{
- if [ -z "${version}" ]; then
- usage "Delete mode requires a version argument"
- fi
-
- set_initramfs
-
- if [ ! -e "${initramfs}" ]; then
- panic "Cannot delete ${initramfs}, doesn't exist."
- fi
-
- if ! version_exists "${version}"; then
- panic "Cannot delete version ${version}: Not created by this utility."
- fi
-
- altered_check
-
- echo "update-initramfs: Deleting ${initramfs}"
-
- delete_sha1
-
- rm -f "${initramfs}"
-}
-
-# Check for update mode on existing and modified initramfs
-altered_check()
-{
- # No check on takeover
- [ "${takeover}" = 1 ] && return 0
- if [ ! -e "${initramfs}" ]; then
- mild_panic "${initramfs} does not exist. Cannot update."
- fi
- if ! compare_sha1; then
- echo "update-initramfs: ${initramfs} has been altered." >&2
- mild_panic "update-initramfs: Cannot update. Override with -t option."
- fi
-}
-
-# Defaults
-verbose=0
-yes=0
-# We default to takeover=1 in Ubuntu, but not Debian
-takeover=0
-
-##
-
-while getopts "k:cudyvtb:h?" flag; do
- case "${flag}" in
- k)
- version="${OPTARG}"
- ;;
- c)
- mode="c"
- ;;
- d)
- mode="d"
- ;;
- u)
- mode="u"
- ;;
- v)
- verbose="1"
- ;;
- y)
- yes="1"
- ;;
- t)
- takeover="1"
- ;;
- b)
- BOOTDIR="${OPTARG}"
- if [ ! -d "${BOOTDIR}" ]; then
- echo "Error: ${BOOTDIR} is not a directory."
- exit 1
- fi
- ;;
- h|?)
- usage
- ;;
- esac
-done
-
-shift $((${OPTIND} - 1))
-
-if [ $# -ne 0 ]; then
- echo "Invalid argument for option -k."
- usage
-fi
-
-# Validate arguments
-if [ -z "${mode}" ]; then
- usage "You must specify at least one of -c, -u, or -d."
-fi
-
-if [ "${version}" = "all" ] \
- || ( [ "${update_initramfs}" = "all" ] && [ -z "${version}" ] ); then
- : FIXME check for --yes, and if not ask are you sure
- get_sorted_versions
- if [ -z "${version_list}" ]; then
- verbose "Nothing to do, exiting."
- exit 0
- fi
-
- OPTS="-b ${BOOTDIR}"
- if [ "${verbose}" = "1" ]; then
- OPTS="${OPTS} -v"
- fi
- if [ "${takeover}" = "1" ]; then
- OPTS="${OPTS} -t"
- fi
- if [ "${yes}" = "1" ]; then
- OPTS="${OPTS} -y"
- fi
- for u_version in ${version_list}; do
- # Don't stop if one version doesn't work.
- set +e
- verbose "Execute: ${0} -${mode} -k \"${u_version}\" ${OPTS}"
- "${0}" -${mode} -k "${u_version}" ${OPTS}
- set -e
- done
- exit 0
-fi
-
-
-case "${mode}" in
- c)
- create
- ;;
- d)
- delete
- ;;
- u)
- update
- ;;
-esac

View File

@ -0,0 +1,31 @@
From a6c418ee432bbc62633a42417d6a0c41160c404a Mon Sep 17 00:00:00 2001
From: Roberto Sassu <roberto.sassu@polito.it>
Date: Fri, 8 Jul 2011 14:10:59 +0200
Subject: [PATCH] base/init: mount the securityfs filesystem
Mount the securityfs filesystem and make available its location through the
exported variable SECURITYFSDIR.
Signed-off-by: Roberto Sassu <roberto.sassu@polito.it>
Acked-by: Gianluca Ramunno <ramunno@polito.it>
---
modules.d/99base/init | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/modules.d/99base/init b/modules.d/99base/init
index 1fac580..ae834be 100755
--- a/modules.d/99base/init
+++ b/modules.d/99base/init
@@ -84,6 +84,12 @@ RD_DEBUG=""
[ ! -d /sys/kernel ] && \
mount -t sysfs -o nosuid,noexec,nodev sysfs /sys >/dev/null 2>&1
+SECURITYFSDIR="/sys/kernel/security"
+export SECURITYFSDIR
+if ! ismounted "${SECURITYFSDIR}"; then
+ mount -t securityfs -o nosuid,noexec,nodev ${SECURITYFSDIR} ${SECURITYFSDIR} >/dev/null 2>&1
+fi
+
if [ -x /lib/systemd/systemd-timestamp ]; then
RD_TIMESTAMP=$(/lib/systemd/systemd-timestamp)
else

View File

@ -0,0 +1,29 @@
From 6c706227f55161c31d17769155c179180e5be75e Mon Sep 17 00:00:00 2001
From: Michal Soltys <soltys@ziu.info>
Date: Thu, 28 Jul 2011 14:40:10 +0200
Subject: [PATCH] parse-lvm.sh: fix for generated initqueue/finished script
The script that was generated always returned the status of the last test
condition, potentially missing any earlier non-existing devices.
The change assures, that the script returns 0 only if all expected
devices are found.
Signed-off-by: Michal Soltys <soltys@ziu.info>
---
modules.d/90lvm/parse-lvm.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/modules.d/90lvm/parse-lvm.sh b/modules.d/90lvm/parse-lvm.sh
index 2e21d82..b85a1ac 100755
--- a/modules.d/90lvm/parse-lvm.sh
+++ b/modules.d/90lvm/parse-lvm.sh
@@ -10,7 +10,7 @@ if ! getargbool 1 rd.lvm -n rd_NO_LVM; then
rm -f /etc/udev/rules.d/64-lvm*.rules
else
for dev in $(getargs rd.lvm.vg rd_LVM_VG=) $(getargs rd.lvm.lv rd_LVM_LV=); do
- printf '[ -e "/dev/%s" ]\n' $dev \
+ printf '[ -e "/dev/%s" ] || return 1\n' $dev \
>> $hookdir/initqueue/finished/lvm.sh
{
printf '[ -e "/dev/%s" ] || ' $dev

View File

@ -0,0 +1,22 @@
From aaced3f9909dddc0ff858634711c3e97b80b09ec Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 29 Jul 2011 11:12:07 +0200
Subject: [PATCH] git2spec.pl: make rename diffs
---
git2spec.pl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git2spec.pl b/git2spec.pl
index 6e0bff8..8525ad2 100755
--- a/git2spec.pl
+++ b/git2spec.pl
@@ -19,7 +19,7 @@ sub last_tag {
sub create_patches {
my $tag=shift;
my $num=0;
- open( GIT, 'git format-patch -M -N --no-signature '.$tag.' |');
+ open( GIT, 'git format-patch --no-renames -N --no-signature '.$tag.' |');
@lines=<GIT>;
close GIT; # be done
return @lines;

View File

@ -0,0 +1,23 @@
From d727c5ae7b83247e4c577e338a582b5f3f57044d Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 29 Jul 2011 11:14:41 +0200
Subject: [PATCH] dracut.spec: add 97masterkey 98ecryptfs 98integrity
---
dracut.spec | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/dracut.spec b/dracut.spec
index 30741cd..b75cd19 100644
--- a/dracut.spec
+++ b/dracut.spec
@@ -248,6 +248,9 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/dracut/modules.d/95terminfo
%{_datadir}/dracut/modules.d/95udev-rules
%{_datadir}/dracut/modules.d/97biosdevname
+%{_datadir}/dracut/modules.d/97masterkey
+%{_datadir}/dracut/modules.d/98ecryptfs
+%{_datadir}/dracut/modules.d/98integrity
%{_datadir}/dracut/modules.d/98selinux
%{_datadir}/dracut/modules.d/98syslog
%{_datadir}/dracut/modules.d/99base

View File

@ -0,0 +1,25 @@
From e51260e4fe7aea29d850456b8ea0d3b17da971f5 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 10 Aug 2011 17:38:02 +0200
Subject: [PATCH] dracut-functions: create relative symlinks for libraries
---
dracut-functions | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/dracut-functions b/dracut-functions
index 61e10e8..5779a18 100755
--- a/dracut-functions
+++ b/dracut-functions
@@ -359,10 +359,9 @@ inst_library() {
inst "${_src%/*}/.${_src##*/}.hmac" "${_dest%/*}/.${_dest##*/}.hmac"
fi
_reallib=$(readlink -f "$_src")
- _lib=${_src##*/}
inst_simple "$_reallib" "$_reallib"
inst_dir "${_dest%/*}"
- (cd "${initdir}${_dest%/*}" && ln -sfn "$_reallib" "$_lib")
+ ln -sfn $(convert_abs_rel "${_dest}" "${_reallib}") "${initdir}${_dest}"
else
inst_simple "$_src" "$_dest"
fi

View File

@ -0,0 +1,26 @@
From 6a3c2215bb2d153b02ef27ca586eff13af9f79a7 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Tue, 2 Aug 2011 14:57:49 +0200
Subject: [PATCH] 99base/init: use udevadm control to set the logging priority
due to a bad revert commit, "udevadm control" was converted to
"udevproperty", which is the wrong command to set the logging priority.
---
modules.d/99base/init | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules.d/99base/init b/modules.d/99base/init
index ae834be..b991196 100755
--- a/modules.d/99base/init
+++ b/modules.d/99base/init
@@ -197,8 +197,8 @@ if [ $UDEVVERSION -lt 140 ]; then
UDEV_QUEUE_EMPTY="udevadm settle --timeout=1"
fi
-getargbool 0 rd.udev.info -y rdudevinfo && udevproperty "$UDEV_LOG_PRIO_ARG=info"
-getargbool 0 rd.udev.debug -y rdudevdebug && udevproperty "$UDEV_LOG_PRIO_ARG=debug"
+getargbool 0 rd.udev.info -y rdudevinfo && udevadm control "$UDEV_LOG_PRIO_ARG=info"
+getargbool 0 rd.udev.debug -y rdudevdebug && udevadm control "$UDEV_LOG_PRIO_ARG=debug"
udevproperty "hookdir=$hookdir"
getarg 'rd.break=pre-trigger' 'rdbreak=pre-trigger' && emergency_shell -n pre-trigger "Break before pre-trigger"

View File

@ -0,0 +1,36 @@
From d765a3e71b7abfbda7a1f9f65745dde25c8b814c Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 4 Aug 2011 13:19:00 +0200
Subject: [PATCH] dracut-lib.sh: getarg() echo with "" to prevent wildcard
subst
if a value of a key on the kernel command line includes wildcards, these
would be expanded.
E.g., if you have "key=/dev/sd*" the value would be substituted with
"/dev/sda /dev/sda1 /dev/sda2" instead of returning "/dev/sd*"
---
modules.d/99base/dracut-lib.sh | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index f65e853..80c1f84 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -74,7 +74,7 @@ _dogetarg() {
fi
done
if [ -n "$_val" ]; then
- [ "x$_doecho" != "x" ] && echo $_val;
+ [ "x$_doecho" != "x" ] && echo "$_val";
return 0;
fi
return 1;
@@ -150,7 +150,7 @@ getargs() {
shift
done
if [ -n "$_val" ]; then
- echo -n $_val
+ echo -n "$_val"
[ "$RD_DEBUG" = "yes" ] && set -x
return 0
fi

View File

@ -8,7 +8,7 @@
Name: dracut Name: dracut
Version: 011 Version: 011
Release: 15.git20110720 Release: 40.git20110810
Summary: Initramfs generator using udev Summary: Initramfs generator using udev
%if 0%{?fedora} %if 0%{?fedora}
@ -36,6 +36,31 @@ Patch11: 0011-shutdown-fixed-check_shutdown-loop.patch
Patch12: 0012-dracut-lib.sh-fixed-getargs.patch Patch12: 0012-dracut-lib.sh-fixed-getargs.patch
Patch13: 0013-99base-dracut-lib.sh-fix-previous-getargs-patch.patch Patch13: 0013-99base-dracut-lib.sh-fix-previous-getargs-patch.patch
Patch14: 0014-TEST-10-RAID-test-init-add-comment-for-rd.break-shut.patch Patch14: 0014-TEST-10-RAID-test-init-add-comment-for-rd.break-shut.patch
Patch15: 0015-busybox-module-parse-busybox-defined-functions-dynam.patch
Patch16: 0016-dracut.kernel.7.xml-s-voonsole.keymap-vconsole.keyma.patch
Patch17: 0017-dracut.kernel.7.xml-beautified-doc.patch
Patch18: 0018-99base-dracut-lib.sh-don-t-be-quiet-on-rd.debug.patch
Patch19: 0019-dracut-functions-only-dinfo-about-missing-optioal-dr.patch
Patch20: 0020-99base-init-try-to-mount-usr-if-init-lives-on-usr.patch
Patch21: 0021-fixed-typos.patch
Patch22: 0022-dracut-logger-initialize-basic-vars.patch
Patch23: 0023-dracut-functions-convert-absolute-symlinks-to-relati.patch
Patch24: 0024-move-debian-to-debian.template-on-request-of-debian-.patch
Patch25: 0025-dracut-functions-resolve-relative-path-and-recursive.patch
Patch26: 0026-removed-debian.template.patch
Patch27: 0027-dracut-install-lib-for-kernel-images.patch
Patch28: 0028-dracut-functions-remove-double-slashes-for-symlink-c.patch
Patch29: 0029-dracut-update-initramfs-removed-on-request-of-the-de.patch
Patch30: 0030-base-init-mount-the-securityfs-filesystem.patch
#Patch31: 0031-dracut-added-new-module-masterkey.patch
#Patch32: 0032-dracut-added-new-module-integrity.patch
#Patch33: 0033-dracut-added-new-module-ecryptfs.patch
Patch34: 0034-parse-lvm.sh-fix-for-generated-initqueue-finished-sc.patch
Patch35: 0035-git2spec.pl-make-rename-diffs.patch
Patch36: 0036-dracut.spec-add-97masterkey-98ecryptfs-98integrity.patch
Patch37: 0037-dracut-functions-create-relative-symlinks-for-librar.patch
Patch38: 0038-99base-init-use-udevadm-control-to-set-the-logging-p.patch
Patch39: 0039-dracut-lib.sh-getarg-echo-with-to-prevent-wildcard-s.patch
BuildArch: noarch BuildArch: noarch
@ -184,6 +209,31 @@ This package contains tools to assemble the local initrd and host configuration.
%patch12 -p1 %patch12 -p1
%patch13 -p1 %patch13 -p1
%patch14 -p1 %patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
%patch28 -p1
%patch29 -p1
%patch30 -p1
#%patch31 -p1
#%patch32 -p1
#%patch33 -p1
%patch34 -p1
%patch35 -p1
%patch36 -p1
%patch37 -p1
%patch38 -p1
%patch39 -p1
%build %build