fixed symlink creation for lorax

This commit is contained in:
Harald Hoyer 2011-08-12 16:24:08 +02:00
parent 7f792c1202
commit 153f869b61
40 changed files with 12 additions and 3127 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
/dracut-011-9b30d47.tar.bz2
/dracut-011.tar.bz2
/dracut-013.tar.bz2

View File

@ -1,22 +0,0 @@
From 8e702c3d0facbe4f6381068b74efb56bdc0c1653 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 20 Jul 2011 12:39:58 +0200
Subject: [PATCH] dracut.spec: remove noreplace for 01-dist.conf
---
dracut.spec | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dracut.spec b/dracut.spec
index 26263d8..30741cd 100644
--- a/dracut.spec
+++ b/dracut.spec
@@ -215,7 +215,7 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/dracut/dracut-logger
%config(noreplace) /etc/dracut.conf
%if 0%{?fedora} || 0%{?suse_version}
-%config(noreplace) /etc/dracut.conf.d/01-dist.conf
+%config /etc/dracut.conf.d/01-dist.conf
%endif
%dir /etc/dracut.conf.d
%{_mandir}/man8/dracut.8*

View File

@ -1,192 +0,0 @@
From 54703a719f49b3c4aafb60d49b265e2cde9bb16f Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 20 Jul 2011 14:10:30 +0200
Subject: [PATCH] add TEST-15-BTRFSRAID
---
test/TEST-15-BTRFSRAID/99-idesymlinks.rules | 8 +++
test/TEST-15-BTRFSRAID/Makefile | 10 +++
test/TEST-15-BTRFSRAID/create-root.sh | 22 +++++++
test/TEST-15-BTRFSRAID/hard-off.sh | 3 +
test/TEST-15-BTRFSRAID/test-init | 11 ++++
test/TEST-15-BTRFSRAID/test.sh | 82 +++++++++++++++++++++++++++
6 files changed, 136 insertions(+), 0 deletions(-)
create mode 100644 test/TEST-15-BTRFSRAID/99-idesymlinks.rules
create mode 100644 test/TEST-15-BTRFSRAID/Makefile
create mode 100755 test/TEST-15-BTRFSRAID/create-root.sh
create mode 100755 test/TEST-15-BTRFSRAID/hard-off.sh
create mode 100755 test/TEST-15-BTRFSRAID/test-init
create mode 100755 test/TEST-15-BTRFSRAID/test.sh
diff --git a/test/TEST-15-BTRFSRAID/99-idesymlinks.rules b/test/TEST-15-BTRFSRAID/99-idesymlinks.rules
new file mode 100644
index 0000000..d557790
--- /dev/null
+++ b/test/TEST-15-BTRFSRAID/99-idesymlinks.rules
@@ -0,0 +1,8 @@
+ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="hda", SYMLINK+="sda"
+ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="partition", KERNEL=="hda*", SYMLINK+="sda$env{MINOR}"
+ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="hdb", SYMLINK+="sdb"
+ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="partition", KERNEL=="hdb*", SYMLINK+="sdb$env{MINOR}"
+ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="hdc", SYMLINK+="sdc"
+ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="partition", KERNEL=="hdc*", SYMLINK+="sdc$env{MINOR}"
+ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="hdd", SYMLINK+="sdd"
+ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="partition", KERNEL=="hdd*", SYMLINK+="sdd$env{MINOR}"
diff --git a/test/TEST-15-BTRFSRAID/Makefile b/test/TEST-15-BTRFSRAID/Makefile
new file mode 100644
index 0000000..bc0ddb6
--- /dev/null
+++ b/test/TEST-15-BTRFSRAID/Makefile
@@ -0,0 +1,10 @@
+all:
+ @make -s --no-print-directory -C ../.. all
+ @basedir=../.. testdir=../ ./test.sh --all
+setup:
+ @make --no-print-directory -C ../.. all
+ @basedir=../.. testdir=../ ./test.sh --setup
+clean:
+ @basedir=../.. testdir=../ ./test.sh --clean
+run:
+ @basedir=../.. testdir=../ ./test.sh --run
diff --git a/test/TEST-15-BTRFSRAID/create-root.sh b/test/TEST-15-BTRFSRAID/create-root.sh
new file mode 100755
index 0000000..60dd319
--- /dev/null
+++ b/test/TEST-15-BTRFSRAID/create-root.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+# don't let udev and this script step on eachother's toes
+for x in 64-lvm.rules 70-mdadm.rules 99-mount-rules; do
+ > "/etc/udev/rules.d/$x"
+done
+udevadm control --reload-rules
+# save a partition at the beginning for future flagging purposes
+sfdisk -C 524288 -H 2 -S 32 -L /dev/sda <<EOF
+,16
+,10240
+,10240
+,10240
+EOF
+mkfs.btrfs -mraid10 -L root /dev/sda2 /dev/sda3 /dev/sda4
+btrfs device scan
+set -e
+mkdir -p /sysroot
+mount /dev/sda4 /sysroot
+cp -a -t /sysroot /source/*
+umount /sysroot
+echo "dracut-root-block-created" >/dev/sda1
+poweroff -f
diff --git a/test/TEST-15-BTRFSRAID/hard-off.sh b/test/TEST-15-BTRFSRAID/hard-off.sh
new file mode 100755
index 0000000..12c3d5a
--- /dev/null
+++ b/test/TEST-15-BTRFSRAID/hard-off.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+getarg rd.shell || poweroff -f
+getarg failme && poweroff -f
diff --git a/test/TEST-15-BTRFSRAID/test-init b/test/TEST-15-BTRFSRAID/test-init
new file mode 100755
index 0000000..8f7cdf3
--- /dev/null
+++ b/test/TEST-15-BTRFSRAID/test-init
@@ -0,0 +1,11 @@
+#!/bin/sh
+export PATH=/sbin:/bin:/usr/sbin:/usr/bin
+exec >/dev/console 2>&1
+echo "dracut-root-block-success" >/dev/sda1
+export TERM=linux
+export PS1='initramfs-test:\w\$ '
+[ -f /etc/fstab ] || ln -s /proc/mounts /etc/fstab
+stty sane
+echo "made it to the rootfs! Powering down."
+mount -n -o remount,ro /
+poweroff -f
diff --git a/test/TEST-15-BTRFSRAID/test.sh b/test/TEST-15-BTRFSRAID/test.sh
new file mode 100755
index 0000000..96ecd2e
--- /dev/null
+++ b/test/TEST-15-BTRFSRAID/test.sh
@@ -0,0 +1,82 @@
+#!/bin/bash
+TEST_DESCRIPTION="root filesystem on multiple device btrfs"
+
+KVERSION=${KVERSION-$(uname -r)}
+
+# Uncomment this to debug failures
+#DEBUGFAIL="rd.shell"
+DISKIMAGE=/var/tmp/TEST-15-BTRFSRAID-root.img
+test_run() {
+ $testdir/run-qemu -hda $DISKIMAGE -m 256M -nographic \
+ -net none -kernel /boot/vmlinuz-$KVERSION \
+ -append "root=LABEL=root rw quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \
+ -initrd initramfs.testing
+ grep -m 1 -q dracut-root-block-success $DISKIMAGE || return 1
+}
+
+test_setup() {
+ # Create the blank file to use as a root filesystem
+ dd if=/dev/null of=$DISKIMAGE bs=1M seek=1024
+
+ kernel=$KVERSION
+ # Create what will eventually be our root filesystem onto an overlay
+ (
+ initdir=overlay/source
+ . $basedir/dracut-functions
+ dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
+ /lib/terminfo/l/linux mount dmesg ifconfig dhclient mkdir cp ping dhclient
+ inst "$basedir/modules.d/40network/dhclient-script" "/sbin/dhclient-script"
+ inst "$basedir/modules.d/40network/ifup" "/sbin/ifup"
+ dracut_install grep
+ inst ./test-init /sbin/init
+ find_binary plymouth >/dev/null && dracut_install plymouth
+ (cd "$initdir"; mkdir -p dev sys proc etc var/run tmp )
+ cp -a /etc/ld.so.conf* $initdir/etc
+ sudo ldconfig -r "$initdir"
+ )
+
+ # second, install the files needed to make the root filesystem
+ (
+ initdir=overlay
+ . $basedir/dracut-functions
+ dracut_install sfdisk mkfs.btrfs poweroff cp umount
+ inst_hook initqueue 01 ./create-root.sh
+ inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
+ )
+
+ # create an initramfs that will create the target root filesystem.
+ # We do it this way so that we do not risk trashing the host mdraid
+ # devices, volume groups, encrypted partitions, etc.
+ $basedir/dracut -l -i overlay / \
+ -m "dash btrfs udev-rules base rootfs-block kernel-modules" \
+ -d "piix ide-gd_mod ata_piix btrfs sd_mod" \
+ --nomdadmconf \
+ -f initramfs.makeroot $KVERSION || return 1
+ rm -rf overlay
+ # Invoke KVM and/or QEMU to actually create the target filesystem.
+ $testdir/run-qemu -hda $DISKIMAGE -m 256M -nographic -net none \
+ -kernel "/boot/vmlinuz-$kernel" \
+ -append "root=LABEL=root rw quiet console=ttyS0,115200n81 selinux=0" \
+ -initrd initramfs.makeroot || return 1
+ grep -m 1 -q dracut-root-block-created $DISKIMAGE || return 1
+ (
+ initdir=overlay
+ . $basedir/dracut-functions
+ dracut_install poweroff shutdown
+ inst_hook emergency 000 ./hard-off.sh
+ inst ./cryptroot-ask /sbin/cryptroot-ask
+ inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
+ )
+ sudo $basedir/dracut -l -i overlay / \
+ -o "plymouth network" \
+ -a "debug" \
+ -d "piix ide-gd_mod ata_piix btrfs sd_mod" \
+ -f initramfs.testing $KVERSION || return 1
+}
+
+test_cleanup() {
+ rm -fr overlay mnt
+ rm -f $DISKIMAGE initramfs.makeroot initramfs.testing
+}
+
+. $testdir/test-functions

View File

@ -1,21 +0,0 @@
From 8a29368bf1077757d160535e381c6f6de32a95fb Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 20 Jul 2011 17:21:02 +0200
Subject: [PATCH] dracut.logrotate: remove "yearly"
logrotate would only rotate yearly with it
---
dracut.logrotate | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/dracut.logrotate b/dracut.logrotate
index e7d4f0a..76bdd80 100644
--- a/dracut.logrotate
+++ b/dracut.logrotate
@@ -2,6 +2,5 @@
missingok
notifempty
size 30k
- yearly
create 0600 root root
}

View File

@ -1,32 +0,0 @@
From e45ffb5d1fddf751f50bc268846d81659120be62 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 20 Jul 2011 17:24:33 +0200
Subject: [PATCH] dracut-logger: create logfile with 0600 permissions
---
dracut-logger | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/dracut-logger b/dracut-logger
index 3bcce83..a5a3ee9 100755
--- a/dracut-logger
+++ b/dracut-logger
@@ -106,6 +106,7 @@ __DRACUT_LOGGER__=1
# @warning Function sets global variables @var maxloglvl and @syslogfacility.
# See file doc comment for details.
dlog_init() {
+ local __oldumask
# Skip initialization if it's already done.
[ -n "$maxloglvl" ] && return 0
@@ -118,7 +119,10 @@ dlog_init() {
if [ -z "$fileloglvl" ]; then
[ -w "$logfile" ] && fileloglvl=4 || fileloglvl=0
elif [ $fileloglvl -gt 0 ]; then
+ __oldumask=$(umask)
+ umask 0377
! [ -e "$logfile" ] && >"$logfile"
+ umask $__oldumask
if [ -w "$logfile" -a -f "$logfile" ]; then
# Mark new run in the log file
echo >>"$logfile"

View File

@ -1,22 +0,0 @@
From 34b22d6049e416c12f75e53bfc8a142024751d0e Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 20 Jul 2011 17:49:29 +0200
Subject: [PATCH] 90dmsquash-live: optionally install eject
---
modules.d/90dmsquash-live/module-setup.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/modules.d/90dmsquash-live/module-setup.sh b/modules.d/90dmsquash-live/module-setup.sh
index e1a8996..8ed633f 100755
--- a/modules.d/90dmsquash-live/module-setup.sh
+++ b/modules.d/90dmsquash-live/module-setup.sh
@@ -27,7 +27,7 @@ install() {
inst losetup
inst grep
- dracut_install eject
+ dracut_install -o eject
inst blockdev
type -P checkisomd5 >/dev/null && inst checkisomd5

View File

@ -1,35 +0,0 @@
From 2560da6be28e244ddf5c84ab3ada69c1dfacc796 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 20 Jul 2011 19:04:54 +0200
Subject: [PATCH] enable shutdown module by default
---
dracut.conf.d/fedora.conf.example | 2 +-
modules.d/99shutdown/module-setup.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dracut.conf.d/fedora.conf.example b/dracut.conf.d/fedora.conf.example
index 8ca67d4..eddbf0f 100644
--- a/dracut.conf.d/fedora.conf.example
+++ b/dracut.conf.d/fedora.conf.example
@@ -2,6 +2,6 @@
# i18n
i18n_vars="/etc/sysconfig/keyboard:KEYTABLE-KEYMAP /etc/sysconfig/i18n:SYSFONT-FONT,FONTACM-FONT_MAP,FONT_UNIMAP"
-add_dracutmodules+=" rpmversion shutdown "
+add_dracutmodules+=" rpmversion "
stdloglvl=3
prefix=/run/initramfs
diff --git a/modules.d/99shutdown/module-setup.sh b/modules.d/99shutdown/module-setup.sh
index c4d2bb5..ae402ef 100755
--- a/modules.d/99shutdown/module-setup.sh
+++ b/modules.d/99shutdown/module-setup.sh
@@ -3,7 +3,7 @@
# ex: ts=8 sw=4 sts=4 et filetype=sh
check() {
- return 255
+ return 0
}
depends() {

View File

@ -1,31 +0,0 @@
From 4456861f7edc8861a32bdd8ca3d3e49f602837e8 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 20 Jul 2011 19:06:08 +0200
Subject: [PATCH] 90dm/dm-shutdown.sh: put shutdown in function
---
modules.d/90dm/dm-shutdown.sh | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/modules.d/90dm/dm-shutdown.sh b/modules.d/90dm/dm-shutdown.sh
index 026eb26..3e668f8 100644
--- a/modules.d/90dm/dm-shutdown.sh
+++ b/modules.d/90dm/dm-shutdown.sh
@@ -1,2 +1,15 @@
-echo "Disassembling device-mapper devices"
-dmsetup -v remove_all
+#!/bin/sh
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+# ex: ts=8 sw=4 sts=4 et filetype=sh
+_do_dm_shutdown() {
+ local ret
+ info "Disassembling device-mapper devices"
+ dmsetup -v remove_all
+ ret=$?
+#info "dmsetup ls --tree"
+#dmsetup ls --tree 2>&1 | vinfo
+ return $ret
+}
+
+_do_dm_shutdown
+

View File

@ -1,30 +0,0 @@
From 8e448cadf9fe979ac951b3ca6b5d3a5eecc150c2 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 20 Jul 2011 19:06:26 +0200
Subject: [PATCH] 90mdraid/md-shutdown.sh: put shutdown in function
---
modules.d/90mdraid/md-shutdown.sh | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/modules.d/90mdraid/md-shutdown.sh b/modules.d/90mdraid/md-shutdown.sh
index f07f621..aa89bf6 100644
--- a/modules.d/90mdraid/md-shutdown.sh
+++ b/modules.d/90mdraid/md-shutdown.sh
@@ -1,2 +1,14 @@
-echo "Disassembling mdraid devices."
-mdadm -v --stop --scan
+#!/bin/sh
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+# ex: ts=8 sw=4 sts=4 et filetype=sh
+_do_md_shutdown() {
+ local ret
+ info "Disassembling mdraid devices."
+ mdadm -v --stop --scan
+ ret=$?
+#info "cat /proc/mdstat"
+# cat /proc/mdstat | vinfo
+ return $ret
+}
+
+_do_md_shutdown

View File

@ -1,99 +0,0 @@
From ceaf49d735b2395897253ae05f6a3b55e09eb252 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 20 Jul 2011 19:08:25 +0200
Subject: [PATCH] TEST-10-RAID: extend test case to shutdown
---
test/TEST-10-RAID/test-init | 13 +++++++++++--
test/TEST-10-RAID/test.sh | 17 +++++++++--------
2 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/test/TEST-10-RAID/test-init b/test/TEST-10-RAID/test-init
index 8f7cdf3..029084a 100755
--- a/test/TEST-10-RAID/test-init
+++ b/test/TEST-10-RAID/test-init
@@ -1,11 +1,20 @@
#!/bin/sh
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
+strstr() { [ "${1#*$2*}" != "$1" ]; }
+CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
+plymouth --quit
exec >/dev/console 2>&1
echo "dracut-root-block-success" >/dev/sda1
export TERM=linux
export PS1='initramfs-test:\w\$ '
-[ -f /etc/fstab ] || ln -s /proc/mounts /etc/fstab
+[ -f /etc/mtab ] || ln -sfn /proc/mounts /etc/mtab
+[ -f /etc/fstab ] || ln -sfn /proc/mounts /etc/fstab
stty sane
-echo "made it to the rootfs! Powering down."
+echo "made it to the rootfs!"
+strstr "$CMDLINE" "rd.shell" && sh -i
+echo "Powering down."
mount -n -o remount,ro /
+if [ -e /lib/systemd/systemd-shutdown ]; then
+ exec /lib/systemd/systemd-shutdown poweroff
+fi
poweroff -f
diff --git a/test/TEST-10-RAID/test.sh b/test/TEST-10-RAID/test.sh
index 0b3fc0c..fe95437 100755
--- a/test/TEST-10-RAID/test.sh
+++ b/test/TEST-10-RAID/test.sh
@@ -5,18 +5,18 @@ KVERSION=${KVERSION-$(uname -r)}
# Uncomment this to debug failures
#DEBUGFAIL="rd.shell"
-
+DISKIMAGE=/var/tmp/TEST-10-RAID-root.img
test_run() {
- $testdir/run-qemu -hda root.ext2 -m 256M -nographic \
+ $testdir/run-qemu -hda $DISKIMAGE -m 256M -nographic \
-net none -kernel /boot/vmlinuz-$KVERSION \
-append "root=/dev/dracut/root rw quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \
-initrd initramfs.testing
- grep -m 1 -q dracut-root-block-success root.ext2 || return 1
+ grep -m 1 -q dracut-root-block-success $DISKIMAGE || return 1
}
test_setup() {
# Create the blank file to use as a root filesystem
- dd if=/dev/zero of=root.ext2 bs=1M count=40
+ dd if=/dev/null of=$DISKIMAGE bs=1M seek=40
kernel=$KVERSION
# Create what will eventually be our root filesystem onto an overlay
@@ -28,9 +28,10 @@ test_setup() {
inst "$basedir/modules.d/40network/dhclient-script" "/sbin/dhclient-script"
inst "$basedir/modules.d/40network/ifup" "/sbin/ifup"
dracut_install grep
+ dracut_install /lib/systemd/systemd-shutdown
inst ./test-init /sbin/init
find_binary plymouth >/dev/null && dracut_install plymouth
- (cd "$initdir"; mkdir -p dev sys proc etc var/run tmp )
+ (cd "$initdir"; mkdir -p dev sys proc etc var/run tmp run)
cp -a /etc/ld.so.conf* $initdir/etc
sudo ldconfig -r "$initdir"
)
@@ -54,11 +55,11 @@ test_setup() {
-f initramfs.makeroot $KVERSION || return 1
rm -rf overlay
# Invoke KVM and/or QEMU to actually create the target filesystem.
- $testdir/run-qemu -hda root.ext2 -m 256M -nographic -net none \
+ $testdir/run-qemu -hda $DISKIMAGE -m 256M -nographic -net none \
-kernel "/boot/vmlinuz-$kernel" \
-append "root=/dev/dracut/root rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \
-initrd initramfs.makeroot || return 1
- grep -m 1 -q dracut-root-block-created root.ext2 || return 1
+ grep -m 1 -q dracut-root-block-created $DISKIMAGE || return 1
(
initdir=overlay
. $basedir/dracut-functions
@@ -76,7 +77,7 @@ test_setup() {
test_cleanup() {
rm -fr overlay mnt
- rm -f root.ext2 initramfs.makeroot initramfs.testing
+ rm -f $DISKIMAGE initramfs.makeroot initramfs.testing
}
. $testdir/test-functions

View File

@ -1,21 +0,0 @@
From 00d89f51701a89543c67715beedc70b903244f08 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 20 Jul 2011 21:10:58 +0200
Subject: [PATCH] TEST-10-RAID/test-init: turn off debug for shutdown
---
test/TEST-10-RAID/test-init | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/test/TEST-10-RAID/test-init b/test/TEST-10-RAID/test-init
index 029084a..4c8c9e1 100755
--- a/test/TEST-10-RAID/test-init
+++ b/test/TEST-10-RAID/test-init
@@ -14,6 +14,7 @@ echo "made it to the rootfs!"
strstr "$CMDLINE" "rd.shell" && sh -i
echo "Powering down."
mount -n -o remount,ro /
+echo " rd.debug=0 " > /run/initramfs/etc/cmdline
if [ -e /lib/systemd/systemd-shutdown ]; then
exec /lib/systemd/systemd-shutdown poweroff
fi

View File

@ -1,98 +0,0 @@
From f47e0234987e7e6cfb2439e90658cb5c3b8bdef8 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 20 Jul 2011 21:11:36 +0200
Subject: [PATCH] shutdown: fixed check_shutdown loop
---
modules.d/90dm/dm-shutdown.sh | 11 ++++++-----
modules.d/90mdraid/md-shutdown.sh | 9 ++++++---
modules.d/99shutdown/shutdown | 24 ++++++++++++++----------
3 files changed, 26 insertions(+), 18 deletions(-)
diff --git a/modules.d/90dm/dm-shutdown.sh b/modules.d/90dm/dm-shutdown.sh
index 3e668f8..80d80d0 100644
--- a/modules.d/90dm/dm-shutdown.sh
+++ b/modules.d/90dm/dm-shutdown.sh
@@ -3,13 +3,14 @@
# ex: ts=8 sw=4 sts=4 et filetype=sh
_do_dm_shutdown() {
local ret
+ local final=$1
info "Disassembling device-mapper devices"
dmsetup -v remove_all
ret=$?
-#info "dmsetup ls --tree"
-#dmsetup ls --tree 2>&1 | vinfo
+ if [ "x$final" != "x" ]; then
+ info "dmsetup ls --tree"
+ dmsetup ls --tree 2>&1 | vinfo
+ fi
return $ret
}
-
-_do_dm_shutdown
-
+_do_dm_shutdown $1
diff --git a/modules.d/90mdraid/md-shutdown.sh b/modules.d/90mdraid/md-shutdown.sh
index aa89bf6..bc36166 100644
--- a/modules.d/90mdraid/md-shutdown.sh
+++ b/modules.d/90mdraid/md-shutdown.sh
@@ -3,12 +3,15 @@
# ex: ts=8 sw=4 sts=4 et filetype=sh
_do_md_shutdown() {
local ret
+ local final=$1
info "Disassembling mdraid devices."
mdadm -v --stop --scan
ret=$?
-#info "cat /proc/mdstat"
-# cat /proc/mdstat | vinfo
+ if [ "x$final" != "x" ]; then
+ info "cat /proc/mdstat"
+ cat /proc/mdstat | vinfo
+ fi
return $ret
}
-_do_md_shutdown
+_do_md_shutdown $1
diff --git a/modules.d/99shutdown/shutdown b/modules.d/99shutdown/shutdown
index bff29b9..a31a95d 100755
--- a/modules.d/99shutdown/shutdown
+++ b/modules.d/99shutdown/shutdown
@@ -64,21 +64,25 @@ while [ $_cnt -le 40 ]; do
done
[ $_cnt -ge 40 ] && umount_a
-check_finished() {
- local f
- for f in $hookdir/shutdown/*.sh; do
- [ -e "$f" ] || continue
- ( . "$f" ) || return 1
+_check_shutdown() {
+ local __f
+ local __s=1
+ for __f in $hookdir/shutdown/*.sh; do
+ [ -e "$__f" ] || continue
+ ( . "$__f" $1 )
+ if [ $? -eq 0 ]; then
+ rm -f $__f
+ __s=0
+ fi
done
- return 0
+ return $__s
}
_cnt=0
-while [ $_cnt -le 40 ]; do
- check_finished 2>/dev/null && break
- _cnt=$(($_cnt+1))
+while _check_shutdown; do
+:
done
-[ $_cnt -ge 40 ] && check_finished
+_check_shutdown final
getarg 'rd.break=shutdown' && emergency_shell -n cmdline "Break before shutdown"
[ "$1" = "reboot" ] && reboot -f -d -n --no-wall

View File

@ -1,73 +0,0 @@
From 9e7f4955895c1064e3bdd03f5f781efc9b98d5d6 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 20 Jul 2011 21:12:17 +0200
Subject: [PATCH] dracut-lib.sh: fixed getargs()
if $1 has a "=<value>", we want the exact match
if cmdline argument has no "=<value>", we assume "=1"
---
modules.d/99base/dracut-lib.sh | 31 ++++++++++++++++++++++++-------
1 files changed, 24 insertions(+), 7 deletions(-)
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index 10025bd..c2202f1 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -45,19 +45,36 @@ _getcmdline() {
}
_dogetarg() {
- local _o _val
+ local _o _val _doecho
unset _val
unset _o
+ unset _doecho
_getcmdline
for _o in $CMDLINE; do
- if [ "$_o" = "$1" ]; then
- return 0;
+ if [ "${_o%%=*}" = "${1%=}" ]; then
+ if [ -n "${1#*=}" -a "${1#*=*}" != "${1}" ]; then
+ # if $1 has a "=<value>", we want the exact match
+ if [ "$_o" = "$1" ]; then
+ _val="1";
+ unset _doecho
+ fi
+ continue
+ fi
+
+ if [ "${_o#*=}" = "$_o" ]; then
+ # if cmdline argument has no "=<value>", we assume "=1"
+ _val="1";
+ unset _doecho
+ continue
+ fi
+
+ _val=${_o#*=};
+ _doecho=1
fi
- [ "${_o%%=*}" = "${1%=}" ] && _val=${_o#*=};
done
if [ -n "$_val" ]; then
- echo $_val;
+ [ "x$_doecho" != "x" ] && echo $_val;
return 0;
fi
return 1;
@@ -67,13 +84,13 @@ getarg() {
set +x
while [ $# -gt 0 ]; do
case $1 in
- -y) if _dogetarg $2; then
+ -y) if _dogetarg $2 >/dev/null; then
echo 1
[ "$RD_DEBUG" = "yes" ] && set -x
return 0
fi
shift 2;;
- -n) if _dogetarg $2; then
+ -n) if _dogetarg $2 >/dev/null; then
echo 0;
[ "$RD_DEBUG" = "yes" ] && set -x
return 1

View File

@ -1,24 +0,0 @@
From b1b678427e0a158487a2a3ef5a1be39f891a1cc3 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 20 Jul 2011 21:38:07 +0200
Subject: [PATCH] 99base/dracut-lib.sh: fix previous getargs patch
patch 9e7f4955895c1064e3bdd03f5f781efc9b98d5d6 ignored
"getargs key=value"
---
modules.d/99base/dracut-lib.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index c2202f1..6807b53 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -52,7 +52,7 @@ _dogetarg() {
_getcmdline
for _o in $CMDLINE; do
- if [ "${_o%%=*}" = "${1%=}" ]; then
+ if [ "${_o%%=*}" = "${1%%=*}" ]; then
if [ -n "${1#*=}" -a "${1#*=*}" != "${1}" ]; then
# if $1 has a "=<value>", we want the exact match
if [ "$_o" = "$1" ]; then

View File

@ -1,23 +0,0 @@
From 8570b544e96d150263c639b9411270488a95ad2b Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 20 Jul 2011 21:40:50 +0200
Subject: [PATCH] TEST-10-RAID/test-init: add comment for rd.break=shutdown
---
test/TEST-10-RAID/test-init | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/test/TEST-10-RAID/test-init b/test/TEST-10-RAID/test-init
index 4c8c9e1..02c0d1d 100755
--- a/test/TEST-10-RAID/test-init
+++ b/test/TEST-10-RAID/test-init
@@ -14,7 +14,8 @@ echo "made it to the rootfs!"
strstr "$CMDLINE" "rd.shell" && sh -i
echo "Powering down."
mount -n -o remount,ro /
-echo " rd.debug=0 " > /run/initramfs/etc/cmdline
+#echo " rd.break=shutdown " >> /run/initramfs/etc/cmdline
+echo " rd.debug=0 " >> /run/initramfs/etc/cmdline
if [ -e /lib/systemd/systemd-shutdown ]; then
exec /lib/systemd/systemd-shutdown poweroff
fi

View File

@ -1,52 +0,0 @@
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

@ -1,22 +0,0 @@
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

@ -1,62 +0,0 @@
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

@ -1,21 +0,0 @@
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

@ -1,23 +0,0 @@
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

@ -1,76 +0,0 @@
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

View File

@ -1,50 +0,0 @@
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

@ -1,30 +0,0 @@
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

@ -1,94 +0,0 @@
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

@ -1,653 +0,0 @@
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

@ -1,29 +0,0 @@
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

@ -1,330 +0,0 @@
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

@ -1,29 +0,0 @@
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

@ -1,45 +0,0 @@
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

@ -1,577 +0,0 @@
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

@ -1,31 +0,0 @@
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

@ -1,29 +0,0 @@
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

@ -1,22 +0,0 @@
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

@ -1,23 +0,0 @@
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

@ -1,25 +0,0 @@
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

@ -1,26 +0,0 @@
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

@ -1,36 +0,0 @@
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

@ -1,36 +0,0 @@
From d609c64209af738540f629bccecdef8c6bafa91d Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 10 Aug 2011 20:03:21 +0200
Subject: [PATCH] dracut-lib.sh: fixed getargs() for empty arguments
---
modules.d/99base/dracut-lib.sh | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index 80c1f84..dec5d92 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -142,11 +142,19 @@ _dogetargs() {
}
getargs() {
- local _val
- unset _val
set +x
+ local _val _nval
+ unset _val
+ unset _nval
while [ $# -gt 0 ]; do
- _val="$_val $(_dogetargs $1)"
+ _nval=$(_dogetargs $1)
+ if [ -n "$_nval" ]; then
+ if [ -n "$_val" ]; then
+ _val="$_val $_nval"
+ else
+ _val="$_nval"
+ fi
+ fi
shift
done
if [ -n "$_val" ]; then

View File

@ -7,8 +7,8 @@
%endif
Name: dracut
Version: 011
Release: 41.git20110810
Version: 013
Release: 1%{dist}
Summary: Initramfs generator using udev
%if 0%{?fedora}
@ -22,46 +22,6 @@ URL: https://dracut.wiki.kernel.org/
# Source can be generated by
# http://git.kernel.org/?p=boot/dracut/dracut.git;a=snapshot;h=%{version};sf=tgz
Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar.bz2
Patch1: 0001-dracut.spec-remove-noreplace-for-01-dist.conf.patch
Patch2: 0002-add-TEST-15-BTRFSRAID.patch
Patch3: 0003-dracut.logrotate-remove-yearly.patch
Patch4: 0004-dracut-logger-create-logfile-with-0600-permissions.patch
Patch5: 0005-90dmsquash-live-optionally-install-eject.patch
Patch6: 0006-enable-shutdown-module-by-default.patch
Patch7: 0007-90dm-dm-shutdown.sh-put-shutdown-in-function.patch
Patch8: 0008-90mdraid-md-shutdown.sh-put-shutdown-in-function.patch
Patch9: 0009-TEST-10-RAID-extend-test-case-to-shutdown.patch
Patch10: 0010-TEST-10-RAID-test-init-turn-off-debug-for-shutdown.patch
Patch11: 0011-shutdown-fixed-check_shutdown-loop.patch
Patch12: 0012-dracut-lib.sh-fixed-getargs.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
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
Patch40: 0040-dracut-lib.sh-fixed-getargs-for-empty-arguments.patch
BuildArch: noarch
BuildRequires: dash bash
@ -195,46 +155,6 @@ This package contains tools to assemble the local initrd and host configuration.
%prep
%setup -q -n %{name}-%{version}
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -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
%patch40 -p1
%build
make
@ -328,9 +248,13 @@ 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
%{_datadir}/dracut/modules.d/99fs-lib
%{_datadir}/dracut/modules.d/99shutdown
%config(noreplace) /etc/logrotate.d/dracut_log
%attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/dracut.log
@ -341,6 +265,7 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/dracut/modules.d/40network
%{_datadir}/dracut/modules.d/95fcoe
%{_datadir}/dracut/modules.d/95iscsi
%{_datadir}/dracut/modules.d/90livenet
%{_datadir}/dracut/modules.d/95nbd
%{_datadir}/dracut/modules.d/95nfs
%{_datadir}/dracut/modules.d/45ifcfg
@ -368,6 +293,9 @@ rm -rf $RPM_BUILD_ROOT
%dir /var/lib/dracut/overlay
%changelog
* Fri Aug 12 2011 Harald Hoyer <harald@redhat.com> 013-1
- fixed symlink creation for lorax
* Wed Aug 10 2011 Harald Hoyer <harald@redhat.com> 011-41.git20110810
- fixed getargs() for empty args

View File

@ -1 +1 @@
52b399efcee701ddbb63f92f407c91f6 dracut-011.tar.bz2
9dc9a2799aa8ac2fe8c4844706de2783 dracut-013.tar.bz2