basebuilder_pel7x64builder0
6 years ago
554 changed files with 38892 additions and 0 deletions
@ -0,0 +1,26 @@
@@ -0,0 +1,26 @@
|
||||
From ffecc452321bbef2c0e1efca09c2077775448141 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Fri, 13 Sep 2013 16:33:01 +0200 |
||||
Subject: [PATCH] dracut.sh: harden host_modalias reading |
||||
|
||||
Some weird PPC driver make their modulias unreadable |
||||
|
||||
$ cat /sys/devices/vio/4000/modalias |
||||
cat: /sys/devices/vio/4000/modalias: No such device |
||||
--- |
||||
dracut.sh | 2 +- |
||||
1 file changed, 1 insertion(+), 1 deletion(-) |
||||
|
||||
diff --git a/dracut.sh b/dracut.sh |
||||
index bd905e32..fd278466 100755 |
||||
--- a/dracut.sh |
||||
+++ b/dracut.sh |
||||
@@ -921,7 +921,7 @@ if [[ $hostonly ]]; then |
||||
declare -A host_modalias |
||||
find /sys/devices/ -name modalias -print > "$initdir/.modalias" |
||||
while read m; do |
||||
- host_modalias["$(<"$m")"]=1 |
||||
+ modalias="$(<"$m")" && [[ $modalias ]] && host_modalias["$modalias"]=1 |
||||
done < "$initdir/.modalias" |
||||
rm -f -- "$initdir/.modalias" |
||||
|
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
From da63c0de561ce9ed158cc2438a1cc5fbb38c3758 Mon Sep 17 00:00:00 2001 |
||||
From: WANG Chao <chaowang@redhat.com> |
||||
Date: Fri, 13 Sep 2013 22:28:44 +0800 |
||||
Subject: [PATCH] ifup: do not dhcp on network interface of secondary stack |
||||
|
||||
Configure cmdline to: |
||||
ip=br0:dhcp bridge=br0:bond0 bond=bond0:eth0 |
||||
|
||||
By default ifup bond0 will run dhcp on bond0, which is wrong. bond0 |
||||
isn't the top interface. we should really run dhcp on br0. |
||||
|
||||
So if we ifup an network interface on secondary stack, we should not |
||||
dhcp. Fix this issue with this patch. |
||||
--- |
||||
modules.d/40network/ifup.sh | 7 +++++++ |
||||
1 file changed, 7 insertions(+) |
||||
|
||||
diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh |
||||
index 32616470..9f6f4494 100755 |
||||
--- a/modules.d/40network/ifup.sh |
||||
+++ b/modules.d/40network/ifup.sh |
||||
@@ -336,6 +336,13 @@ for p in $(getargs ip=); do |
||||
exit 0 |
||||
done |
||||
|
||||
+# netif isn't the top stack? Then we should exit here. |
||||
+# eg. netif is bond0. br0 is on top of it. dhcp br0 is correct but dhcp |
||||
+# bond0 doesn't make sense. |
||||
+if [ -n "$DO_BOND_SETUP" -o -n "$DO_TEAM_SETUP" -o -n "$DO_VLAN_SETUP" ]; then |
||||
+ exit 0 |
||||
+fi |
||||
+ |
||||
# no ip option directed at our interface? |
||||
if [ ! -e /tmp/setup_net_${netif}.ok ]; then |
||||
do_dhcp -4 |
@ -0,0 +1,28 @@
@@ -0,0 +1,28 @@
|
||||
From af34b260474c551a45a6fa4ae8719622f1e35910 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Fri, 13 Sep 2013 17:34:18 +0200 |
||||
Subject: [PATCH] dracut.sh: also search uevent's for MODALIAS |
||||
|
||||
--- |
||||
dracut.sh | 8 ++++++++ |
||||
1 file changed, 8 insertions(+) |
||||
|
||||
diff --git a/dracut.sh b/dracut.sh |
||||
index fd278466..ce39151c 100755 |
||||
--- a/dracut.sh |
||||
+++ b/dracut.sh |
||||
@@ -923,6 +923,14 @@ if [[ $hostonly ]]; then |
||||
while read m; do |
||||
modalias="$(<"$m")" && [[ $modalias ]] && host_modalias["$modalias"]=1 |
||||
done < "$initdir/.modalias" |
||||
+ find /sys/devices/ -name uevent -print > "$initdir/.modalias" |
||||
+ while read m; do |
||||
+ while read line; do |
||||
+ [[ "$line" != MODALIAS\=* ]] && continue |
||||
+ modalias="${line##MODALIAS=}" && [[ $modalias ]] && host_modalias["$modalias"]=1 |
||||
+ done < "$m" |
||||
+ done < "$initdir/.modalias" |
||||
+ |
||||
rm -f -- "$initdir/.modalias" |
||||
|
||||
# check /proc/modules |
@ -0,0 +1,32 @@
@@ -0,0 +1,32 @@
|
||||
From 72ce014bc79933379cb864cef665114ac5d4ccfa Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Fri, 13 Sep 2013 17:51:29 +0200 |
||||
Subject: [PATCH] dracut.sh: we don't need to read the modalias files |
||||
|
||||
udev does only parse the uevent MODALIAS line, so whatever is in the |
||||
modalias files would not trigger any module load. |
||||
--- |
||||
dracut.sh | 5 +---- |
||||
1 file changed, 1 insertion(+), 4 deletions(-) |
||||
|
||||
diff --git a/dracut.sh b/dracut.sh |
||||
index ce39151c..196b3ad4 100755 |
||||
--- a/dracut.sh |
||||
+++ b/dracut.sh |
||||
@@ -919,15 +919,12 @@ if [[ $hostonly ]]; then |
||||
fi |
||||
# record all host modaliases |
||||
declare -A host_modalias |
||||
- find /sys/devices/ -name modalias -print > "$initdir/.modalias" |
||||
- while read m; do |
||||
- modalias="$(<"$m")" && [[ $modalias ]] && host_modalias["$modalias"]=1 |
||||
- done < "$initdir/.modalias" |
||||
find /sys/devices/ -name uevent -print > "$initdir/.modalias" |
||||
while read m; do |
||||
while read line; do |
||||
[[ "$line" != MODALIAS\=* ]] && continue |
||||
modalias="${line##MODALIAS=}" && [[ $modalias ]] && host_modalias["$modalias"]=1 |
||||
+ break |
||||
done < "$m" |
||||
done < "$initdir/.modalias" |
||||
|
@ -0,0 +1,118 @@
@@ -0,0 +1,118 @@
|
||||
From 96f48da50cdc049c635cca8466b38084a3de0f48 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Tue, 17 Sep 2013 12:23:20 -0500 |
||||
Subject: [PATCH] Add option to turn on/off prelinking |
||||
|
||||
--prelink, --noprelink |
||||
|
||||
do_prelink=[yes|no] |
||||
--- |
||||
dracut.8.asc | 6 ++++++ |
||||
dracut.conf.5.asc | 3 +++ |
||||
dracut.sh | 34 ++++++++++++++++++++++------------ |
||||
3 files changed, 31 insertions(+), 12 deletions(-) |
||||
|
||||
diff --git a/dracut.8.asc b/dracut.8.asc |
||||
index ee9d8de2..76fc75c4 100644 |
||||
--- a/dracut.8.asc |
||||
+++ b/dracut.8.asc |
||||
@@ -269,6 +269,12 @@ example: |
||||
**--nostrip**:: |
||||
do not strip binaries in the initramfs |
||||
|
||||
+**--prelink**:: |
||||
+ prelink binaries in the initramfs (default) |
||||
+ |
||||
+**--noprelink**:: |
||||
+ do not prelink binaries in the initramfs |
||||
+ |
||||
**--hardlink**:: |
||||
hardlink files in the initramfs (default) |
||||
|
||||
diff --git a/dracut.conf.5.asc b/dracut.conf.5.asc |
||||
index a32516c4..63991d4f 100644 |
||||
--- a/dracut.conf.5.asc |
||||
+++ b/dracut.conf.5.asc |
||||
@@ -67,6 +67,9 @@ Configuration files must have the extension .conf; other extensions are ignored. |
||||
*do_strip=*"__{yes|no}__":: |
||||
Strip binaries in the initramfs (default=yes) |
||||
|
||||
+*do_prelink=*"__{yes|no}__":: |
||||
+ Prelink binaries in the initramfs (default=yes) |
||||
+ |
||||
*hostonly=*"__{yes|no}__":: |
||||
Host-Only mode: Install only what is needed for booting the local host |
||||
instead of a generic host and generate host-specific configuration. |
||||
diff --git a/dracut.sh b/dracut.sh |
||||
index 196b3ad4..177e66d5 100755 |
||||
--- a/dracut.sh |
||||
+++ b/dracut.sh |
||||
@@ -97,6 +97,8 @@ Creates initial ramdisk images for preloading modules |
||||
--kernel-cmdline [PARAMETERS] Specify default kernel command line parameters |
||||
--strip Strip binaries in the initramfs |
||||
--nostrip Do not strip binaries in the initramfs |
||||
+ --prelink Prelink binaries in the initramfs |
||||
+ --noprelink Do not prelink binaries in the initramfs |
||||
--hardlink Hardlink files in the initramfs |
||||
--nohardlink Do not hardlink files in the initramfs |
||||
--prefix [DIR] Prefix initramfs files with [DIR] |
||||
@@ -315,6 +317,8 @@ TEMP=$(unset POSIXLY_CORRECT; getopt \ |
||||
--long kernel-cmdline: \ |
||||
--long strip \ |
||||
--long nostrip \ |
||||
+ --long prelink \ |
||||
+ --long noprelink \ |
||||
--long hardlink \ |
||||
--long nohardlink \ |
||||
--long noprefix \ |
||||
@@ -394,6 +398,8 @@ while :; do |
||||
--no-early-microcode) early_microcode_l="no";; |
||||
--strip) do_strip_l="yes";; |
||||
--nostrip) do_strip_l="no";; |
||||
+ --prelink) do_prelink_l="yes";; |
||||
+ --noprelink) do_prelink_l="no";; |
||||
--hardlink) do_hardlink_l="yes";; |
||||
--nohardlink) do_hardlink_l="no";; |
||||
--noprefix) prefix_l="/";; |
||||
@@ -651,6 +657,8 @@ stdloglvl=$((stdloglvl + verbosity_mod_l)) |
||||
[[ $drivers_dir_l ]] && drivers_dir=$drivers_dir_l |
||||
[[ $do_strip_l ]] && do_strip=$do_strip_l |
||||
[[ $do_strip ]] || do_strip=yes |
||||
+[[ $do_prelink_l ]] && do_prelink=$do_prelink_l |
||||
+[[ $do_prelink ]] || do_prelink=yes |
||||
[[ $do_hardlink_l ]] && do_hardlink=$do_hardlink_l |
||||
[[ $do_hardlink ]] || do_hardlink=yes |
||||
[[ $prefix_l ]] && prefix=$prefix_l |
||||
@@ -1251,18 +1259,20 @@ if [[ $kernel_only != yes ]]; then |
||||
fi |
||||
fi |
||||
|
||||
-PRELINK_BIN="$(command -v prelink)" |
||||
-if [[ $UID = 0 ]] && [[ $PRELINK_BIN ]]; then |
||||
- if [[ $DRACUT_FIPS_MODE ]]; then |
||||
- dinfo "*** Installing prelink files ***" |
||||
- inst_multiple -o prelink /etc/prelink.conf /etc/prelink.conf.d/*.conf /etc/prelink.cache |
||||
- else |
||||
- dinfo "*** Pre-linking files ***" |
||||
- inst_multiple -o prelink /etc/prelink.conf /etc/prelink.conf.d/*.conf |
||||
- chroot "$initdir" "$PRELINK_BIN" -a |
||||
- rm -f -- "$initdir/$PRELINK_BIN" |
||||
- rm -fr -- "$initdir"/etc/prelink.* |
||||
- dinfo "*** Pre-linking files done ***" |
||||
+if [[ $do_prelink == yes ]]; then |
||||
+ PRELINK_BIN="$(command -v prelink)" |
||||
+ if [[ $UID = 0 ]] && [[ $PRELINK_BIN ]]; then |
||||
+ if [[ $DRACUT_FIPS_MODE ]]; then |
||||
+ dinfo "*** Installing prelink files ***" |
||||
+ inst_multiple -o prelink /etc/prelink.conf /etc/prelink.conf.d/*.conf /etc/prelink.cache |
||||
+ else |
||||
+ dinfo "*** Pre-linking files ***" |
||||
+ inst_multiple -o prelink /etc/prelink.conf /etc/prelink.conf.d/*.conf |
||||
+ chroot "$initdir" "$PRELINK_BIN" -a |
||||
+ rm -f -- "$initdir/$PRELINK_BIN" |
||||
+ rm -fr -- "$initdir"/etc/prelink.* |
||||
+ dinfo "*** Pre-linking files done ***" |
||||
+ fi |
||||
fi |
||||
fi |
||||
|
@ -0,0 +1,32 @@
@@ -0,0 +1,32 @@
|
||||
From 764b5209942dc435c7c611b0008975aa13738374 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Wed, 2 Oct 2013 12:36:25 +0200 |
||||
Subject: [PATCH] add /etc/system-fips for dracut-fips subpackage |
||||
|
||||
--- |
||||
dracut.spec | 5 +++++ |
||||
1 file changed, 5 insertions(+) |
||||
|
||||
diff --git a/dracut.spec b/dracut.spec |
||||
index 87340d7a..b1cf9fef 100644 |
||||
--- a/dracut.spec |
||||
+++ b/dracut.spec |
||||
@@ -271,6 +271,10 @@ echo 'hostonly="no"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-generic-i |
||||
echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-rescue.conf |
||||
%endif |
||||
|
||||
+%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} |
||||
+> $RPM_BUILD_ROOT/etc/system-fips |
||||
+%endif |
||||
+ |
||||
# create compat symlink |
||||
mkdir -p $RPM_BUILD_ROOT/sbin |
||||
ln -s /usr/bin/dracut $RPM_BUILD_ROOT/sbin/dracut |
||||
@@ -413,6 +417,7 @@ rm -rf -- $RPM_BUILD_ROOT |
||||
%defattr(-,root,root,0755) |
||||
%{dracutlibdir}/modules.d/01fips |
||||
%{dracutlibdir}/dracut.conf.d/40-fips.conf |
||||
+%config(missingok) /etc/system-fips |
||||
%endif |
||||
|
||||
%files fips-aesni |
@ -0,0 +1,69 @@
@@ -0,0 +1,69 @@
|
||||
From 4b1aa19fa0fad0e607961995dbbe971be2ef9f81 Mon Sep 17 00:00:00 2001 |
||||
From: Thomas Renninger <trenn@suse.de> |
||||
Date: Fri, 27 Sep 2013 20:10:37 +0200 |
||||
Subject: [PATCH] dracut: Generlize microcode early cpio usage |
||||
|
||||
ACPI early table override also may need to place files into an early cpio. |
||||
Reflect this in variable and file names. |
||||
This change is renaming only and does not introduce any real change. |
||||
|
||||
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> |
||||
Signed-off-by: Thomas Renninger <trenn@suse.de> |
||||
--- |
||||
dracut.sh | 17 +++++++++-------- |
||||
1 file changed, 9 insertions(+), 8 deletions(-) |
||||
|
||||
diff --git a/dracut.sh b/dracut.sh |
||||
index 177e66d5..b3b80886 100755 |
||||
--- a/dracut.sh |
||||
+++ b/dracut.sh |
||||
@@ -704,9 +704,9 @@ readonly initdir="$(mktemp --tmpdir="$TMPDIR/" -d -t initramfs.XXXXXX)" |
||||
} |
||||
|
||||
if [[ $early_microcode = yes ]]; then |
||||
- readonly microcode_dir="$(mktemp --tmpdir="$TMPDIR/" -d -t early_microcode.XXXXXX)" |
||||
- [ -d "$microcode_dir" ] || { |
||||
- printf "%s\n" "dracut: mktemp --tmpdir=\"$TMPDIR/\" -d -t early_microcode.XXXXXX failed." >&2 |
||||
+ readonly early_cpio_dir="$(mktemp --tmpdir="$TMPDIR/" -d -t early_cpio.XXXXXX)" |
||||
+ [ -d "$early_cpio_dir" ] || { |
||||
+ printf "%s\n" "dracut: mktemp --tmpdir=\"$TMPDIR/\" -d -t early_cpio.XXXXXX failed." >&2 |
||||
exit 1 |
||||
} |
||||
fi |
||||
@@ -715,7 +715,7 @@ trap ' |
||||
ret=$?; |
||||
[[ $outfile ]] && [[ -f $outfile.$$ ]] && rm -f -- "$outfile.$$"; |
||||
[[ $keep ]] && echo "Not removing $initdir." >&2 || { [[ $initdir ]] && rm -rf -- "$initdir"; }; |
||||
- [[ $keep ]] && echo "Not removing $microcode_dir." >&2 || { [[ $microcode_dir ]] && rm -Rf -- "$microcode_dir"; }; |
||||
+ [[ $keep ]] && echo "Not removing $early_cpio_dir." >&2 || { [[ $early_cpio_dir ]] && rm -Rf -- "$early_cpio_dir"; }; |
||||
[[ $_dlogdir ]] && rm -Rf -- "$_dlogdir"; |
||||
exit $ret; |
||||
' EXIT |
||||
@@ -1311,7 +1311,7 @@ if [[ $early_microcode = yes ]]; then |
||||
dinfo "*** Generating early-microcode cpio image ***" |
||||
ucode_dir=(amd-ucode intel-ucode) |
||||
ucode_dest=(AuthenticAMD.bin GenuineIntel.bin) |
||||
- _dest_dir="$microcode_dir/d/kernel/x86/microcode" |
||||
+ _dest_dir="$early_cpio_dir/d/kernel/x86/microcode" |
||||
_dest_idx="0 1" |
||||
mkdir -p $_dest_dir |
||||
if [[ $hostonly ]]; then |
||||
@@ -1331,14 +1331,15 @@ if [[ $early_microcode = yes ]]; then |
||||
fi |
||||
done |
||||
done |
||||
- (cd "$microcode_dir/d"; find . -print0 | cpio --null -o -H newc --quiet >../ucode.cpio) |
||||
+ create_early_cpio="yes" |
||||
fi |
||||
|
||||
rm -f -- "$outfile" |
||||
dinfo "*** Creating image file ***" |
||||
-if [[ $early_microcode = yes ]]; then |
||||
+if [[ $create_early_cpio = yes ]]; then |
||||
# The microcode blob is _before_ the initramfs blob, not after |
||||
- mv $microcode_dir/ucode.cpio $outfile.$$ |
||||
+ (cd "$early_cpio_dir/d"; find . -print0 | cpio --null -o -H newc --quiet >../early.cpio) |
||||
+ mv $early_cpio_dir/early.cpio $outfile.$$ |
||||
fi |
||||
if ! ( umask 077; cd "$initdir"; find . -print0 | cpio --null -R 0:0 -H newc -o --quiet| \ |
||||
$compress >> "$outfile.$$"; ); then |
@ -0,0 +1,44 @@
@@ -0,0 +1,44 @@
|
||||
From ff33b576767d5e020c9f2685a0f5b0acb35a781c Mon Sep 17 00:00:00 2001 |
||||
From: Thomas Renninger <trenn@suse.de> |
||||
Date: Fri, 27 Sep 2013 20:10:38 +0200 |
||||
Subject: [PATCH] dracut: Do not create early_cpio if no suitable microcode |
||||
exist in hostonly case |
||||
|
||||
Intel microcodes only exist for very specific family/model/stepping CPUs. |
||||
If no microcode gets added, there is no need to create an empty |
||||
(only directories) cpio later that gets glued to the initrd. |
||||
|
||||
This also fixes: |
||||
|
||||
*** Constructing GenuineIntel.bin **** |
||||
cat: /lib/firmware/intel-ucode/06-3c-03: No such file or directory |
||||
|
||||
in hostonly mode if there is no suitable microcode for the CPU. |
||||
|
||||
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> |
||||
Signed-off-by: Thomas Renninger <trenn@suse.de> |
||||
--- |
||||
dracut.sh | 5 ++++- |
||||
1 file changed, 4 insertions(+), 1 deletion(-) |
||||
|
||||
diff --git a/dracut.sh b/dracut.sh |
||||
index b3b80886..e43227e8 100755 |
||||
--- a/dracut.sh |
||||
+++ b/dracut.sh |
||||
@@ -1326,12 +1326,15 @@ if [[ $early_microcode = yes ]]; then |
||||
dinfo "*** Constructing ${ucode_dest[$idx]} ****" |
||||
if [[ $hostonly ]]; then |
||||
_src=$(get_ucode_file) |
||||
+ if ! [[ -r $_fwdir/$_fw/$_src ]];then |
||||
+ break; |
||||
+ fi |
||||
fi |
||||
cat $_fwdir/$_fw/$_src > $_dest_dir/${ucode_dest[$idx]} |
||||
+ create_early_cpio="yes" |
||||
fi |
||||
done |
||||
done |
||||
- create_early_cpio="yes" |
||||
fi |
||||
|
||||
rm -f -- "$outfile" |
@ -0,0 +1,45 @@
@@ -0,0 +1,45 @@
|
||||
From ebc7f823c0013dfe7fcefe82db48bf4832f5dcec Mon Sep 17 00:00:00 2001 |
||||
From: Thomas Renninger <trenn@suse.de> |
||||
Date: Fri, 27 Sep 2013 20:10:39 +0200 |
||||
Subject: [PATCH] dracut: Implement ACPI table overriding |
||||
|
||||
An example config file for this feature could be: |
||||
|
||||
/etc/dracut.conf.d/03-acpi-override.conf |
||||
|
||||
with this content: |
||||
acpi_override="yes" |
||||
acpi_table_dir="/etc/dracut.conf.d/acpi_tables" |
||||
|
||||
Then all files ending with *.aml will be put into the early cpio |
||||
(kernel/firmware/acpi) and will be used to replace the BIOS provided tables |
||||
if the kernel supports this feature. |
||||
|
||||
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> |
||||
Signed-off-by: Thomas Renninger <trenn@suse.de> |
||||
--- |
||||
dracut.sh | 11 +++++++++++ |
||||
1 file changed, 11 insertions(+) |
||||
|
||||
diff --git a/dracut.sh b/dracut.sh |
||||
index e43227e8..b4b3e13d 100755 |
||||
--- a/dracut.sh |
||||
+++ b/dracut.sh |
||||
@@ -1337,6 +1337,17 @@ if [[ $early_microcode = yes ]]; then |
||||
done |
||||
fi |
||||
|
||||
+if [[ $acpi_override = yes ]] && [[ -d $acpi_table_dir ]]; then |
||||
+ dinfo "*** Packaging ACPI tables to override BIOS provided ones ***" |
||||
+ _dest_dir="$early_cpio_dir/d/kernel/firmware/acpi" |
||||
+ mkdir -p $_dest_dir |
||||
+ for table in $acpi_table_dir/*.aml; do |
||||
+ dinfo " Adding ACPI table: $table" |
||||
+ cp $table $_dest_dir |
||||
+ create_early_cpio="yes" |
||||
+ done |
||||
+fi |
||||
+ |
||||
rm -f -- "$outfile" |
||||
dinfo "*** Creating image file ***" |
||||
if [[ $create_early_cpio = yes ]]; then |
@ -0,0 +1,37 @@
@@ -0,0 +1,37 @@
|
||||
From 54011e3591216503dd93d1028ff209a6a4851a57 Mon Sep 17 00:00:00 2001 |
||||
From: Thomas Renninger <trenn@suse.de> |
||||
Date: Fri, 27 Sep 2013 20:10:40 +0200 |
||||
Subject: [PATCH] dracut.conf.5.asc: Add ACPI table override and uncompressed |
||||
cpio doc |
||||
|
||||
Signed-off-by: Thomas Renninger <trenn@suse.de> |
||||
--- |
||||
dracut.conf.5.asc | 15 +++++++++++++++ |
||||
1 file changed, 15 insertions(+) |
||||
|
||||
diff --git a/dracut.conf.5.asc b/dracut.conf.5.asc |
||||
index 63991d4f..c9c854a9 100644 |
||||
--- a/dracut.conf.5.asc |
||||
+++ b/dracut.conf.5.asc |
||||
@@ -125,6 +125,21 @@ If chrooted to another root other than the real root device, use --fstab and pro |
||||
*no_kernel=*"{yes|no}":: |
||||
Do not install kernel drivers and firmware files (default=no) |
||||
|
||||
+*acpi_override=*"{yes|no}":: |
||||
+ [WARNING] ONLY USE THIS IF YOU KNOW WHAT YOU ARE DOING! + |
||||
+ Override BIOS provided ACPI tables. For further documentation read |
||||
+ Documentation/acpi/initrd_table_override.txt in the kernel sources. |
||||
+ Search for ACPI table files (must have .aml suffix) in acpi_table_dir= |
||||
+ directory (see below) and add them to a separate uncompressed cpio |
||||
+ archive. This cpio archive gets glued (concatenated, uncompressed one |
||||
+ must be the first one) to the compressed cpio archive. The first, |
||||
+ uncompressed cpio archive is for data which the kernel must be able |
||||
+ to access very early (and cannot make use of uncompress alogrithms yet) |
||||
+ like microcode or ACPI tables (default=no). |
||||
+ |
||||
+*acpi_table_dir=*"__<dir>__":: |
||||
+ Directory to search for ACPI tables if acpi_override= is set to yes. |
||||
+ |
||||
*early_microcode=*"{yes|no}":: |
||||
Combine early microcode with ramdisk (default=no) |
||||
|
@ -0,0 +1,22 @@
@@ -0,0 +1,22 @@
|
||||
From eaa4d30d5abd753bd08322e4b7e5ebd8a52dd75a Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Wed, 2 Oct 2013 12:47:34 +0200 |
||||
Subject: [PATCH] dracut-bash-completion.sh: add --prelink --noprelink |
||||
|
||||
--- |
||||
dracut-bash-completion.sh | 2 +- |
||||
1 file changed, 1 insertion(+), 1 deletion(-) |
||||
|
||||
diff --git a/dracut-bash-completion.sh b/dracut-bash-completion.sh |
||||
index f822058d..d796c358 100644 |
||||
--- a/dracut-bash-completion.sh |
||||
+++ b/dracut-bash-completion.sh |
||||
@@ -34,7 +34,7 @@ _dracut() { |
||||
--local --hostonly --no-hostonly --fstab --help --bzip2 --lzma |
||||
--xz --no-compress --gzip --list-modules --show-modules --keep |
||||
--printsize --regenerate-all --noimageifnotneeded --early-microcode |
||||
- --no-early-microcode --print-cmdline' |
||||
+ --no-early-microcode --print-cmdline --prelink --noprelink' |
||||
|
||||
[ARG]='-a -m -o -d -I -k -c -L --kver --add --force-add --add-drivers |
||||
--omit-drivers --modules --omit --drivers --filesystems --install |
@ -0,0 +1,64 @@
@@ -0,0 +1,64 @@
|
||||
From cf9f56be9c0ab44e5ae5d5abde01151b33206fc2 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Wed, 2 Oct 2013 12:48:11 +0200 |
||||
Subject: [PATCH] dracut.sh: bail out early, if destination dir is not |
||||
writeable |
||||
|
||||
--- |
||||
dracut.sh | 36 +++++++++++++++++++----------------- |
||||
1 file changed, 19 insertions(+), 17 deletions(-) |
||||
|
||||
diff --git a/dracut.sh b/dracut.sh |
||||
index b4b3e13d..e135dfc8 100755 |
||||
--- a/dracut.sh |
||||
+++ b/dracut.sh |
||||
@@ -824,9 +824,25 @@ if [[ -d $srcmods ]]; then |
||||
} |
||||
fi |
||||
|
||||
-if [[ -f $outfile && ! $force && ! $print_cmdline ]]; then |
||||
- dfatal "Will not override existing initramfs ($outfile) without --force" |
||||
- exit 1 |
||||
+if [[ ! $print_cmdline ]]; then |
||||
+ if [[ -f $outfile && ! $force ]]; then |
||||
+ dfatal "Will not override existing initramfs ($outfile) without --force" |
||||
+ exit 1 |
||||
+ fi |
||||
+ |
||||
+ outdir=${outfile%/*} |
||||
+ [[ $outdir ]] || outdir="/" |
||||
+ |
||||
+ if [[ ! -d "$outdir" ]]; then |
||||
+ dfatal "Can't write to $outdir: Directory $outdir does not exist or is not accessible." |
||||
+ exit 1 |
||||
+ elif [[ ! -w "$outdir" ]]; then |
||||
+ dfatal "No permission to write to $outdir." |
||||
+ exit 1 |
||||
+ elif [[ -f "$outfile" && ! -w "$outfile" ]]; then |
||||
+ dfatal "No permission to write $outfile." |
||||
+ exit 1 |
||||
+ fi |
||||
fi |
||||
|
||||
# Need to be able to have non-root users read stuff (rpcbind etc) |
||||
@@ -1041,20 +1057,6 @@ if [[ $print_cmdline ]]; then |
||||
exit 0 |
||||
fi |
||||
|
||||
-outdir=${outfile%/*} |
||||
-[[ $outdir ]] || outdir="/" |
||||
- |
||||
-if [[ ! -d "$outdir" ]]; then |
||||
- dfatal "Can't write to $outdir: Directory $outdir does not exist or is not accessible." |
||||
- exit 1 |
||||
-elif [[ ! -w "$outdir" ]]; then |
||||
- dfatal "No permission to write to $outdir." |
||||
- exit 1 |
||||
-elif [[ -f "$outfile" && ! -w "$outfile" ]]; then |
||||
- dfatal "No permission to write $outfile." |
||||
- exit 1 |
||||
-fi |
||||
- |
||||
# Create some directory structure first |
||||
[[ $prefix ]] && mkdir -m 0755 -p "${initdir}${prefix}" |
||||
|
@ -0,0 +1,44 @@
@@ -0,0 +1,44 @@
|
||||
From d87da4c7776d0e16b8ce6c3a583d21209c3db144 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Wed, 2 Oct 2013 12:48:57 +0200 |
||||
Subject: [PATCH] dracut-logger.sh: do not log to syslog/kmsg/journal for UID |
||||
!= 0 |
||||
|
||||
Don't clutter the system log with user actions. |
||||
|
||||
Also check, if systemd-cat works, before using it. |
||||
--- |
||||
dracut-logger.sh | 10 ++++++++-- |
||||
1 file changed, 8 insertions(+), 2 deletions(-) |
||||
|
||||
diff --git a/dracut-logger.sh b/dracut-logger.sh |
||||
index b052581e..f679dc94 100755 |
||||
--- a/dracut-logger.sh |
||||
+++ b/dracut-logger.sh |
||||
@@ -140,11 +140,16 @@ dlog_init() { |
||||
fi |
||||
fi |
||||
|
||||
+ if (( $UID != 0 )); then |
||||
+ kmsgloglvl=0 |
||||
+ sysloglvl=0 |
||||
+ fi |
||||
+ |
||||
if (( $sysloglvl > 0 )); then |
||||
if [[ -d /run/systemd/journal ]] \ |
||||
&& type -P systemd-cat &>/dev/null \ |
||||
- && (( $UID == 0 )) \ |
||||
- && systemctl is-active systemd-journald.socket &>/dev/null; then |
||||
+ && systemctl --quiet is-active systemd-journald.socket &>/dev/null \ |
||||
+ && { echo "dracut-$DRACUT_VERSION" | systemd-cat -t 'dracut' &>/dev/null; } ; then |
||||
readonly _dlogdir="$(mktemp --tmpdir="$TMPDIR/" -d -t dracut-log.XXXXXX)" |
||||
readonly _systemdcatfile="$_dlogdir/systemd-cat" |
||||
mkfifo "$_systemdcatfile" |
||||
@@ -153,6 +158,7 @@ dlog_init() { |
||||
exec 15>"$_systemdcatfile" |
||||
elif ! [ -S /dev/log -a -w /dev/log ] || ! command -v logger >/dev/null; then |
||||
# We cannot log to syslog, so turn this facility off. |
||||
+ kmsgloglvl=$sysloglvl |
||||
sysloglvl=0 |
||||
ret=1 |
||||
errmsg="No '/dev/log' or 'logger' included for syslog logging" |
@ -0,0 +1,43 @@
@@ -0,0 +1,43 @@
|
||||
From 32b970339f5439300fe6155352ec1f17c5e48d78 Mon Sep 17 00:00:00 2001 |
||||
From: Peter Rajnoha <prajnoha@redhat.com> |
||||
Date: Fri, 4 Oct 2013 10:41:24 +0200 |
||||
Subject: [PATCH] lvm/mdraid: Fix LVM on MD activation |
||||
|
||||
The 69-dm-lvm-metad.rules set some udev env. variables that makes it |
||||
possible to detect the right time to activate LVM on MD. The MD is very |
||||
similar to DM during activation - it's usable only after proper device |
||||
activation - the CHANGE event. We need to make a difference between a |
||||
CHANGE event that comes from this activation and CHANGE event that is |
||||
the outcome of the WATCH udev rule (otherwise we'd end up with LVM |
||||
activation done on each CHANGE event - which is wrong). |
||||
|
||||
So we need the udev databse to be persistent during pivot to root fs |
||||
even for MD devices. |
||||
--- |
||||
modules.d/90lvm/module-setup.sh | 2 +- |
||||
modules.d/90mdraid/59-persistent-storage-md.rules | 1 + |
||||
2 files changed, 2 insertions(+), 1 deletion(-) |
||||
|
||||
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh |
||||
index 2ef9a514..f98ffffd 100755 |
||||
--- a/modules.d/90lvm/module-setup.sh |
||||
+++ b/modules.d/90lvm/module-setup.sh |
||||
@@ -82,7 +82,7 @@ install() { |
||||
} > "${initdir}/etc/lvm/lvm.conf" |
||||
fi |
||||
|
||||
- inst_rules 11-dm-lvm.rules |
||||
+ inst_rules 11-dm-lvm.rules 69-dm-lvm-metad.rules |
||||
# Gentoo ebuild for LVM2 prior to 2.02.63-r1 doesn't install above rules |
||||
# files, but provides the one below: |
||||
inst_rules 64-device-mapper.rules |
||||
diff --git a/modules.d/90mdraid/59-persistent-storage-md.rules b/modules.d/90mdraid/59-persistent-storage-md.rules |
||||
index bea93257..6ef858aa 100644 |
||||
--- a/modules.d/90mdraid/59-persistent-storage-md.rules |
||||
+++ b/modules.d/90mdraid/59-persistent-storage-md.rules |
||||
@@ -20,4 +20,5 @@ IMPORT{program}="/sbin/mdadm --detail --export $tempnode" |
||||
IMPORT BLKID |
||||
OPTIONS+="link_priority=100" |
||||
OPTIONS+="watch" |
||||
+OPTIONS+="db_persist" |
||||
LABEL="md_end" |
@ -0,0 +1,24 @@
@@ -0,0 +1,24 @@
|
||||
From a5659901e87ef70b3cf8ea8b254e3d0f9fa88d96 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Wed, 9 Oct 2013 09:50:15 +0200 |
||||
Subject: [PATCH] bcache: optionally install the tools and rules |
||||
|
||||
--- |
||||
modules.d/90bcache/module-setup.sh | 6 +++--- |
||||
1 file changed, 3 insertions(+), 3 deletions(-) |
||||
|
||||
diff --git a/modules.d/90bcache/module-setup.sh b/modules.d/90bcache/module-setup.sh |
||||
index b02b8b4e..a5a57edb 100755 |
||||
--- a/modules.d/90bcache/module-setup.sh |
||||
+++ b/modules.d/90bcache/module-setup.sh |
||||
@@ -27,7 +27,7 @@ installkernel() { |
||||
} |
||||
|
||||
install() { |
||||
- blkid -k | { while read line; do [[ $line == bcache ]] && exit 0; done; exit 1; } || inst_multiple probe-bcache |
||||
- inst_multiple ${udevdir}/bcache-register |
||||
- inst_rules 61-bcache.rules |
||||
+ blkid -k | { while read line; do [[ $line == bcache ]] && exit 0; done; exit 1; } || inst_multiple -o probe-bcache |
||||
+ inst_multiple -o ${udevdir}/bcache-register |
||||
+ inst_rules 61-bcache.rules 69-bcache.rules |
||||
} |
@ -0,0 +1,25 @@
@@ -0,0 +1,25 @@
|
||||
From 31b89c8c2bfb5a0336268cc66bd663429122feb3 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Fri, 4 Oct 2013 13:32:15 +0200 |
||||
Subject: [PATCH] dracut-functions.sh:inst_rules() do not install rules in CWD |
||||
|
||||
--- |
||||
dracut-functions.sh | 5 ++++- |
||||
1 file changed, 4 insertions(+), 1 deletion(-) |
||||
|
||||
diff --git a/dracut-functions.sh b/dracut-functions.sh |
||||
index cf33af56..45e09118 100755 |
||||
--- a/dracut-functions.sh |
||||
+++ b/dracut-functions.sh |
||||
@@ -882,7 +882,10 @@ inst_rules() { |
||||
fi |
||||
done |
||||
fi |
||||
- for r in '' ./ $dracutbasedir/rules.d/; do |
||||
+ for r in '' $dracutbasedir/rules.d/; do |
||||
+ # skip rules without an absolute path |
||||
+ [[ "${r}$_rule" != /* ]] && continue |
||||
+ |
||||
if [[ -f ${r}$_rule ]]; then |
||||
_found="${r}$_rule" |
||||
inst_rule_programs "$_found" |
@ -0,0 +1,30 @@
@@ -0,0 +1,30 @@
|
||||
From fdaa69db2061cc83845f631e6e3216e55b2eb235 Mon Sep 17 00:00:00 2001 |
||||
From: Alexander Tsoy <alexander@tsoy.me> |
||||
Date: Thu, 3 Oct 2013 14:54:42 +0400 |
||||
Subject: [PATCH] mdraid/module-setup.sh: install configs from |
||||
/etc/mdadm.conf.d |
||||
|
||||
/etc/mdadm.conf.d directory is supported since mdadm-3.3 |
||||
--- |
||||
modules.d/90mdraid/module-setup.sh | 8 ++++++++ |
||||
1 file changed, 8 insertions(+) |
||||
|
||||
diff --git a/modules.d/90mdraid/module-setup.sh b/modules.d/90mdraid/module-setup.sh |
||||
index 5df2274b..45767c67 100755 |
||||
--- a/modules.d/90mdraid/module-setup.sh |
||||
+++ b/modules.d/90mdraid/module-setup.sh |
||||
@@ -93,6 +93,14 @@ install() { |
||||
else |
||||
[ -f /etc/mdadm/mdadm.conf ] && inst /etc/mdadm/mdadm.conf /etc/mdadm.conf |
||||
fi |
||||
+ if [ -d /etc/mdadm.conf.d ]; then |
||||
+ local f |
||||
+ inst_dir /etc/mdadm.conf.d |
||||
+ for f in /etc/mdadm.conf.d/*.conf; do |
||||
+ [ -f "$f" ] || continue |
||||
+ inst "$f" |
||||
+ done |
||||
+ fi |
||||
fi |
||||
|
||||
inst_hook pre-udev 30 "$moddir/mdmon-pre-udev.sh" |
@ -0,0 +1,51 @@
@@ -0,0 +1,51 @@
|
||||
From 4fde4d06474cdf321958592edf3f856446927d29 Mon Sep 17 00:00:00 2001 |
||||
From: Alexander Tsoy <alexander@tsoy.me> |
||||
Date: Sun, 29 Sep 2013 01:31:01 +0400 |
||||
Subject: [PATCH] mdraid/module-setup.sh: fixes for mdadm-3.2.6+ |
||||
|
||||
mdadm-3.2.6+: |
||||
Incremental assembly rule contains "--offroot" arg. Update |
||||
regexp to catch this variant. |
||||
|
||||
mdadm-3.3+: |
||||
Rules was splitted into two files: 63-md-raid-arrays.rules |
||||
and 64-md-raid-assembly.rules. Install them both and edit |
||||
the latter. |
||||
--- |
||||
modules.d/90mdraid/module-setup.sh | 11 ++++++++++- |
||||
1 file changed, 10 insertions(+), 1 deletion(-) |
||||
|
||||
diff --git a/modules.d/90mdraid/module-setup.sh b/modules.d/90mdraid/module-setup.sh |
||||
index 45767c67..34aae1e3 100755 |
||||
--- a/modules.d/90mdraid/module-setup.sh |
||||
+++ b/modules.d/90mdraid/module-setup.sh |
||||
@@ -59,6 +59,7 @@ cmdline() { |
||||
} |
||||
|
||||
install() { |
||||
+ local rule rule_path |
||||
inst_multiple cat |
||||
inst_multiple -o mdmon |
||||
inst $(command -v partx) /sbin/partx |
||||
@@ -67,12 +68,20 @@ install() { |
||||
cmdline >> "${initdir}/etc/cmdline.d/90mdraid.conf" |
||||
echo >> "${initdir}/etc/cmdline.d/90mdraid.conf" |
||||
|
||||
+ # <mdadm-3.3 udev rule |
||||
inst_rules 64-md-raid.rules |
||||
+ # >=mdadm-3.3 udev rules |
||||
+ inst_rules 63-md-raid-arrays.rules 64-md-raid-assembly.rules |
||||
# remove incremental assembly from stock rules, so they don't shadow |
||||
# 65-md-inc*.rules and its fine-grained controls, or cause other problems |
||||
# when we explicitly don't want certain components to be incrementally |
||||
# assembled |
||||
- sed -i -r -e '/RUN\+?="[[:alpha:]/]*mdadm[[:blank:]]+(--incremental|-I)[[:blank:]]+(\$env\{DEVNAME\}|\$tempnode)"/d' "${initdir}${udevdir}/rules.d/64-md-raid.rules" |
||||
+ for rule in 64-md-raid.rules 64-md-raid-assembly.rules; do |
||||
+ rule_path="${initdir}${udevdir}/rules.d/${rule}" |
||||
+ [ -f "${rule_path}" ] && sed -i -r \ |
||||
+ -e '/RUN\+?="[[:alpha:]/]*mdadm[[:blank:]]+(--incremental|-I)[[:blank:]]+(\$env\{DEVNAME\}|\$tempnode|\$devnode)/d' \ |
||||
+ "${rule_path}" |
||||
+ done |
||||
|
||||
inst_rules "$moddir/65-md-incremental-imsm.rules" |
||||
|
@ -0,0 +1,240 @@
@@ -0,0 +1,240 @@
|
||||
From 1b827040f8b3e1e4fec19de76526fe0620654502 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Mon, 7 Oct 2013 14:24:36 +0200 |
||||
Subject: [PATCH] fcoe: add FCoE UEFI boot device support |
||||
|
||||
--- |
||||
modules.d/95fcoe/module-setup.sh | 1 + |
||||
modules.d/95fcoe/parse-uefifcoe.sh | 35 +++++++++ |
||||
modules.d/99base/module-setup.sh | 1 + |
||||
modules.d/99base/uefi-lib.sh | 155 +++++++++++++++++++++++++++++++++++++ |
||||
4 files changed, 192 insertions(+) |
||||
create mode 100755 modules.d/95fcoe/parse-uefifcoe.sh |
||||
create mode 100755 modules.d/99base/uefi-lib.sh |
||||
|
||||
diff --git a/modules.d/95fcoe/module-setup.sh b/modules.d/95fcoe/module-setup.sh |
||||
index d3c58cc6..08ba4eac 100755 |
||||
--- a/modules.d/95fcoe/module-setup.sh |
||||
+++ b/modules.d/95fcoe/module-setup.sh |
||||
@@ -32,6 +32,7 @@ install() { |
||||
inst "$moddir/fcoe-up.sh" "/sbin/fcoe-up" |
||||
inst "$moddir/fcoe-edd.sh" "/sbin/fcoe-edd" |
||||
inst "$moddir/fcoe-genrules.sh" "/sbin/fcoe-genrules.sh" |
||||
+ inst_hook cmdline 20 "$moddir/parse-uefifcoe.sh" |
||||
inst_hook cmdline 99 "$moddir/parse-fcoe.sh" |
||||
dracut_need_initqueue |
||||
} |
||||
diff --git a/modules.d/95fcoe/parse-uefifcoe.sh b/modules.d/95fcoe/parse-uefifcoe.sh |
||||
new file mode 100755 |
||||
index 00000000..e03bcb39 |
||||
--- /dev/null |
||||
+++ b/modules.d/95fcoe/parse-uefifcoe.sh |
||||
@@ -0,0 +1,35 @@ |
||||
+#!/bin/bash |
||||
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- |
||||
+# ex: ts=8 sw=4 sts=4 et filetype=sh |
||||
+ |
||||
+command -v getarg >/dev/null || . /lib/dracut-lib.sh |
||||
+command -v get_fcoe_boot_mac >/dev/null || . /lib/uefi-lib.sh |
||||
+command -v set_ifname >/dev/null || . /lib/net-lib.sh |
||||
+ |
||||
+print_fcoe_uefi_conf() |
||||
+{ |
||||
+ local mac dev vlan |
||||
+ mac=$(get_fcoe_boot_mac) |
||||
+ [ -z "$mac" ] && continue |
||||
+ dev=$(set_ifname fcoe $mac) |
||||
+ vlan=$(get_fcoe_boot_vlan) |
||||
+ if [ "$vlan" -ne "0" ]; then |
||||
+ case "$vlan" in |
||||
+ [0-9]*) |
||||
+ printf "%s\n" "vlan=$dev.$vlan:$dev" |
||||
+ dev="$dev.$vlan" |
||||
+ ;; |
||||
+ *) |
||||
+ printf "%s\n" "vlan=$vlan:$dev" |
||||
+ dev="$vlan" |
||||
+ ;; |
||||
+ esac |
||||
+ fi |
||||
+ # fcoe=eth0:nodcb |
||||
+ printf "%s\n" "$dev:nodcb" |
||||
+} |
||||
+ |
||||
+ |
||||
+if [ -e /sys/firmware/efi/vars/FcoeBootDevice-a0ebca23-5f9c-447a-a268-22b6c158c2ac/data ]; then |
||||
+ print_fcoe_uefi_conf > /etc/cmdline.d/40-fcoe-uefi.conf |
||||
+fi |
||||
diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh |
||||
index 52ce4004..d33a0fb4 100755 |
||||
--- a/modules.d/99base/module-setup.sh |
||||
+++ b/modules.d/99base/module-setup.sh |
||||
@@ -42,6 +42,7 @@ install() { |
||||
mkdir -p ${initdir}/tmp |
||||
|
||||
inst_simple "$moddir/dracut-lib.sh" "/lib/dracut-lib.sh" |
||||
+ inst_simple "$moddir/uefi-lib.sh" "/lib/uefi-lib.sh" |
||||
|
||||
if ! dracut_module_included "systemd"; then |
||||
inst_multiple switch_root || dfatal "Failed to install switch_root" |
||||
diff --git a/modules.d/99base/uefi-lib.sh b/modules.d/99base/uefi-lib.sh |
||||
new file mode 100755 |
||||
index 00000000..faedbac5 |
||||
--- /dev/null |
||||
+++ b/modules.d/99base/uefi-lib.sh |
||||
@@ -0,0 +1,155 @@ |
||||
+#!/bin/bash |
||||
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- |
||||
+# ex: ts=8 sw=4 sts=4 et filetype=sh |
||||
+# |
||||
+# Copyright 2013 Red Hat, Inc. All rights reserved. |
||||
+# Copyright 2013 Harald Hoyer <harald@redhat.com> |
||||
+# |
||||
+# This program is free software; you can redistribute it and/or modify |
||||
+# it under the terms of the GNU General Public License as published by |
||||
+# the Free Software Foundation; either version 2 of the License, or |
||||
+# (at your option) any later version. |
||||
+# |
||||
+# This program is distributed in the hope that it will be useful, |
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
+# GNU General Public License for more details. |
||||
+# |
||||
+# You should have received a copy of the GNU General Public License |
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||
+# |
||||
+ |
||||
+getbyte () { |
||||
+ local IFS= LC_CTYPE=C res c |
||||
+ read -r -n 1 -d '' c |
||||
+ res=$? |
||||
+ # the single quote in the argument of the printf |
||||
+ # yields the numeric value of $c (ASCII since LC_CTYPE=C) |
||||
+ [[ -n $c ]] && c=$(printf '%u' "'$c") || c=0 |
||||
+ printf "$c" |
||||
+ return $res |
||||
+} |
||||
+ |
||||
+getword () { |
||||
+ local b1 b2 val |
||||
+ b1=$(getbyte) || return 1 |
||||
+ b2=$(getbyte) || return 1 |
||||
+ (( val = b2 * 256 + b1 )) |
||||
+ echo $val |
||||
+ return 0 |
||||
+} |
||||
+ |
||||
+# Acpi(PNP0A08,0x0)/Pci(0x3,0x0)/Pci(0x0,0x0)/MAC(90E2BA265ED4,0x0)/Vlan(172)/Fibre(0x4EA06104A0CC0050,0x0) |
||||
+uefi_device_path() |
||||
+{ |
||||
+ local IFS= LC_CTYPE=C res tt len type hextype first |
||||
+ first=1 |
||||
+ |
||||
+ while :; do |
||||
+ type=$(getbyte) || return 1 |
||||
+ subtype=$(getbyte) || return 1 |
||||
+ len=$(getword) || return 1 |
||||
+ hextype=$(printf "%02x%02x" "$type" "$subtype") |
||||
+ if [[ $first == 1 ]]; then |
||||
+ first=0 |
||||
+ elif [[ $hextype != "7fff" ]]; then |
||||
+ printf "/" |
||||
+ fi |
||||
+ case $hextype in |
||||
+ 0101) |
||||
+ # PCI |
||||
+ tt=$(getword) |
||||
+ printf "PCI(0x%x,0x%x)" $(($tt / 256)) $(($tt & 255)) |
||||
+ ;; |
||||
+ 0201) |
||||
+ # ACPI |
||||
+ printf "Acpi(0x%x,0x%x)" $(($(getword) + $(getword) * 65536)) $(($(getword) + $(getword) * 65536)) |
||||
+ ;; |
||||
+ 0303) |
||||
+ # FIBRE |
||||
+ getword &>/dev/null |
||||
+ getword &>/dev/null |
||||
+ printf "Fibre(0x%x%x%x%x%x%x%x%x,0x%x)" \ |
||||
+ $(getbyte) $(getbyte) $(getbyte) $(getbyte) \ |
||||
+ $(getbyte) $(getbyte) $(getbyte) $(getbyte) \ |
||||
+ $(( $(getword) + $(getword) * 65536 + 4294967296 * ( $(getword) + $(getword) * 65536 ) )) |
||||
+ ;; |
||||
+ 030b) |
||||
+ # MAC |
||||
+ printf "MAC(%02x%02x%02x%02x%02x%02x," $(getbyte) $(getbyte) $(getbyte) $(getbyte) $(getbyte) $(getbyte) |
||||
+ read -r -N 26 tt || return 1 |
||||
+ printf "0x%x)" $(getbyte) |
||||
+ ;; |
||||
+ 0314) |
||||
+ # VLAN |
||||
+ printf "VLAN(%d)" $(getword) |
||||
+ ;; |
||||
+ 7fff) |
||||
+ # END |
||||
+ printf "\n" |
||||
+ return 0 |
||||
+ ;; |
||||
+ *) |
||||
+ printf "Unknown(Type:%d SubType:%d len=%d)" "$type" "$subtype" "$len" |
||||
+ read -r -N $(($len-4)) tt || return 1 |
||||
+ ;; |
||||
+ esac |
||||
+ done |
||||
+} |
||||
+ |
||||
+get_fcoe_boot_mac() |
||||
+{ |
||||
+ data=${1:-/sys/firmware/efi/vars/FcoeBootDevice-a0ebca23-5f9c-447a-a268-22b6c158c2ac/data} |
||||
+ [ -f $data ] || return 1 |
||||
+ local IFS= LC_CTYPE=C tt len type hextype |
||||
+ first=1 |
||||
+ |
||||
+ while :; do |
||||
+ type=$(getbyte) || return 1 |
||||
+ subtype=$(getbyte) || return 1 |
||||
+ len=$(getword) || return 1 |
||||
+ hextype=$(printf "%02x%02x" "$type" "$subtype") |
||||
+ case $hextype in |
||||
+ 030b) |
||||
+ # MAC |
||||
+ printf "%02x:%02x:%02x:%02x:%02x:%02x" $(getbyte) $(getbyte) $(getbyte) $(getbyte) $(getbyte) $(getbyte) |
||||
+ read -r -N 27 tt || return 1 |
||||
+ ;; |
||||
+ 7fff) |
||||
+ # END |
||||
+ return 0 |
||||
+ ;; |
||||
+ *) |
||||
+ read -r -N $(($len-4)) tt || return 1 |
||||
+ ;; |
||||
+ esac |
||||
+ done < $data |
||||
+} |
||||
+ |
||||
+get_fcoe_boot_vlan() |
||||
+{ |
||||
+ data=${1:-/sys/firmware/efi/vars/FcoeBootDevice-a0ebca23-5f9c-447a-a268-22b6c158c2ac/data} |
||||
+ [ -f $data ] || return 1 |
||||
+ local IFS= LC_CTYPE=C tt len type hextype |
||||
+ first=1 |
||||
+ |
||||
+ while :; do |
||||
+ type=$(getbyte) || return 1 |
||||
+ subtype=$(getbyte) || return 1 |
||||
+ len=$(getword) || return 1 |
||||
+ hextype=$(printf "%02x%02x" "$type" "$subtype") |
||||
+ case $hextype in |
||||
+ 0314) |
||||
+ # VLAN |
||||
+ printf "%d" $(getword) |
||||
+ ;; |
||||
+ 7fff) |
||||
+ # END |
||||
+ return 0 |
||||
+ ;; |
||||
+ *) |
||||
+ read -r -N $(($len-4)) tt || return 1 |
||||
+ ;; |
||||
+ esac |
||||
+ done < $data |
||||
+} |
@ -0,0 +1,94 @@
@@ -0,0 +1,94 @@
|
||||
From 4584826e9a25fdddb876f07875423196d9fc8840 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Mon, 7 Oct 2013 15:06:22 +0200 |
||||
Subject: [PATCH] rootfs-block: add support for the rootfallback= kernel |
||||
cmdline option |
||||
|
||||
--- |
||||
dracut.cmdline.7.asc | 6 +++++ |
||||
modules.d/95rootfs-block/module-setup.sh | 3 ++- |
||||
modules.d/95rootfs-block/rootfallback.sh | 46 ++++++++++++++++++++++++++++++++ |
||||
3 files changed, 54 insertions(+), 1 deletion(-) |
||||
create mode 100755 modules.d/95rootfs-block/rootfallback.sh |
||||
|
||||
diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc |
||||
index 09c47e85..4b2ab035 100644 |
||||
--- a/dracut.cmdline.7.asc |
||||
+++ b/dracut.cmdline.7.asc |
||||
@@ -69,6 +69,12 @@ rootfstype=ext3 |
||||
force mounting _/_ and _/usr_ (if it is a separate device) read-write. |
||||
See also ro option. |
||||
|
||||
+**rootfallback=**_<path to blockdevice>_:: |
||||
+ specify the block device to use as the root filesystem, if the normal root cannot be found. |
||||
+ This can only be a simple block device with a simple file system, for which the filesystem |
||||
+ driver is either compiled in, or added manually to the initramfs. |
||||
+ This parameter can be specified multiple times. |
||||
+ |
||||
**rd.auto** **rd.auto=1**:: |
||||
enable autoassembly of special devices like cryptoLUKS, dmraid, mdraid or lvm. |
||||
Default is off as of dracut version >= 024. |
||||
diff --git a/modules.d/95rootfs-block/module-setup.sh b/modules.d/95rootfs-block/module-setup.sh |
||||
index f066a79c..7e714eb0 100755 |
||||
--- a/modules.d/95rootfs-block/module-setup.sh |
||||
+++ b/modules.d/95rootfs-block/module-setup.sh |
||||
@@ -44,5 +44,6 @@ install() { |
||||
inst_hook pre-udev 30 "$moddir/block-genrules.sh" |
||||
inst_hook mount 99 "$moddir/mount-root.sh" |
||||
fi |
||||
-} |
||||
|
||||
+ inst_hook initqueue/timeout 99 "$moddir/rootfallback.sh" |
||||
+} |
||||
diff --git a/modules.d/95rootfs-block/rootfallback.sh b/modules.d/95rootfs-block/rootfallback.sh |
||||
new file mode 100755 |
||||
index 00000000..246ce9a4 |
||||
--- /dev/null |
||||
+++ b/modules.d/95rootfs-block/rootfallback.sh |
||||
@@ -0,0 +1,46 @@ |
||||
+#!/bin/sh |
||||
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- |
||||
+# ex: ts=8 sw=4 sts=4 et filetype=sh |
||||
+ |
||||
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh |
||||
+ |
||||
+for root in $(getargs rootfallback=); do |
||||
+ case "$root" in |
||||
+ block:LABEL=*|LABEL=*) |
||||
+ root="${root#block:}" |
||||
+ root="$(echo $root | sed 's,/,\\x2f,g')" |
||||
+ root="/dev/disk/by-label/${root#LABEL=}" |
||||
+ ;; |
||||
+ block:UUID=*|UUID=*) |
||||
+ root="${root#block:}" |
||||
+ root="${root#UUID=}" |
||||
+ root="$(echo $root | tr "[:upper:]" "[:lower:]")" |
||||
+ root="/dev/disk/by-uuid/${root#UUID=}" |
||||
+ ;; |
||||
+ block:PARTUUID=*|PARTUUID=*) |
||||
+ root="${root#block:}" |
||||
+ root="${root#PARTUUID=}" |
||||
+ root="$(echo $root | tr "[:upper:]" "[:lower:]")" |
||||
+ root="/dev/disk/by-partuuid/${root}" |
||||
+ ;; |
||||
+ block:PARTLABEL=*|PARTLABEL=*) |
||||
+ root="${root#block:}" |
||||
+ root="/dev/disk/by-partlabel/${root#PARTLABEL=}" |
||||
+ ;; |
||||
+ esac |
||||
+ |
||||
+ if ! [ -b "$root" ]; then |
||||
+ warn "Could not find rootfallback $root" |
||||
+ continue |
||||
+ fi |
||||
+ |
||||
+ if mount "$root" /sysroot; then |
||||
+ info "Mounted rootfallback $root" |
||||
+ exit 0 |
||||
+ else |
||||
+ warn "Failed to mount rootfallback $root" |
||||
+ exit 1 |
||||
+ fi |
||||
+done |
||||
+ |
||||
+[ -e "$job" ] && rm -f "$job" |
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
From 6ea78f9f4eb405e6743e8be67836f9134d11e77b Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Mon, 7 Oct 2013 15:06:50 +0200 |
||||
Subject: [PATCH] btrfs: use inst_hook to install the timeout hook |
||||
|
||||
--- |
||||
modules.d/90btrfs/module-setup.sh | 3 +-- |
||||
1 file changed, 1 insertion(+), 2 deletions(-) |
||||
|
||||
diff --git a/modules.d/90btrfs/module-setup.sh b/modules.d/90btrfs/module-setup.sh |
||||
index 638a0505..a2805946 100755 |
||||
--- a/modules.d/90btrfs/module-setup.sh |
||||
+++ b/modules.d/90btrfs/module-setup.sh |
||||
@@ -39,8 +39,7 @@ install() { |
||||
fi |
||||
|
||||
if ! dracut_module_included "systemd"; then |
||||
- inst_script "$moddir/btrfs_timeout.sh" \ |
||||
- /usr/lib/dracut/hooks/initqueue/timeout/btrfs_timeout.sh |
||||
+ inst_hook initqueue/timeout 10 "$moddir/btrfs_timeout.sh" |
||||
fi |
||||
|
||||
inst_multiple -o btrfsck btrfs-zero-log |
@ -0,0 +1,38 @@
@@ -0,0 +1,38 @@
|
||||
From 52d3c1b7267b6930fe6a835b4000546c5f106d0e Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Tue, 8 Oct 2013 10:30:00 +0200 |
||||
Subject: [PATCH] lvm: install thin utils for non-hostonly |
||||
|
||||
--- |
||||
modules.d/90lvm/module-setup.sh | 18 +++++++++++------- |
||||
1 file changed, 11 insertions(+), 7 deletions(-) |
||||
|
||||
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh |
||||
index f98ffffd..514addc1 100755 |
||||
--- a/modules.d/90lvm/module-setup.sh |
||||
+++ b/modules.d/90lvm/module-setup.sh |
||||
@@ -52,13 +52,17 @@ install() { |
||||
|
||||
inst lvm |
||||
|
||||
- get_host_lvs | while read line; do |
||||
- printf "%s" " rd.lvm.lv=$line" |
||||
- if ! [[ $_needthin ]]; then |
||||
- [[ "$(lvs --noheadings -o segtype ${line%%/*} 2>/dev/null)" == *thin* ]] && _needthin=1 |
||||
- fi |
||||
- done >> "${initdir}/etc/cmdline.d/90lvm.conf" |
||||
- echo >> "${initdir}/etc/cmdline.d/90lvm.conf" |
||||
+ if [[ $hostonly ]]; then |
||||
+ get_host_lvs | while read line; do |
||||
+ printf "%s" " rd.lvm.lv=$line" |
||||
+ if ! [[ $_needthin ]]; then |
||||
+ [[ "$(lvs --noheadings -o segtype ${line%%/*} 2>/dev/null)" == *thin* ]] && _needthin=1 |
||||
+ fi |
||||
+ done >> "${initdir}/etc/cmdline.d/90lvm.conf" |
||||
+ echo >> "${initdir}/etc/cmdline.d/90lvm.conf" |
||||
+ else |
||||
+ _needthin=1 |
||||
+ fi |
||||
|
||||
inst_rules "$moddir/64-lvm.rules" |
||||
|
@ -0,0 +1,38 @@
@@ -0,0 +1,38 @@
|
||||
From f0df0f3fcd0e79a697ec8bd45b9ce2e420f2820a Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Tue, 8 Oct 2013 15:03:40 +0200 |
||||
Subject: [PATCH] dracut.sh: do not bail out, if kernel modules dir is missing |
||||
|
||||
and only print a warning message |
||||
--- |
||||
dracut.sh | 11 ++++++----- |
||||
1 file changed, 6 insertions(+), 5 deletions(-) |
||||
|
||||
diff --git a/dracut.sh b/dracut.sh |
||||
index e135dfc8..d9533dd0 100755 |
||||
--- a/dracut.sh |
||||
+++ b/dracut.sh |
||||
@@ -496,17 +496,18 @@ if [[ $regenerate_all == "yes" ]]; then |
||||
((ret+=$?)) |
||||
done |
||||
exit $ret |
||||
-elif [[ $kernel ]]; then |
||||
- if ! [[ -d /lib/modules/$kernel ]] && [[ $no_kernel != yes ]]; then |
||||
- printf -- "Kernel version $kernel has no modules in /lib/modules/$kernel\n" >&2 |
||||
- exit 1 |
||||
- fi |
||||
fi |
||||
|
||||
if ! [[ $kernel ]]; then |
||||
kernel=$(uname -r) |
||||
fi |
||||
|
||||
+if [[ $kernel ]]; then |
||||
+ if ! [[ -d /lib/modules/$kernel ]] && [[ $no_kernel != yes ]]; then |
||||
+ printf -- "Kernel version $kernel has no module directory /lib/modules/$kernel\n" >&2 |
||||
+ fi |
||||
+fi |
||||
+ |
||||
if ! [[ $outfile ]]; then |
||||
[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id |
||||
|
@ -0,0 +1,47 @@
@@ -0,0 +1,47 @@
|
||||
From 86fff83927ad194def97c60c2eef80099ebb1238 Mon Sep 17 00:00:00 2001 |
||||
From: "Brian C. Lane" <bcl@redhat.com> |
||||
Date: Tue, 8 Oct 2013 15:13:44 +0200 |
||||
Subject: [PATCH] dmsquash-live: add /dev/mapper/live-base |
||||
|
||||
This is similar to the reason for adding the |
||||
/run/initramfs/live-baseloop symlink -- access to the original live |
||||
image without overlays. |
||||
|
||||
livemedia-creator does not create a osmin.img, so there is no mountable |
||||
device for it to use when rsyncing the live image to the target. It |
||||
needs a device that points to the original live image without overlays. |
||||
|
||||
Note that lmc won't be creating osmin.img, since really isn't needed any |
||||
longer. Its purpose was to provide a minimal image that could be dd'd to |
||||
the target. Now that we use rsync this is no longer necessary. |
||||
|
||||
The included patch adds a /dev/mapper/live-base device that Anaconda can |
||||
use whether or not there is an osmin present. |
||||
--- |
||||
modules.d/90dmsquash-live/dmsquash-live-root.sh | 6 +++--- |
||||
1 file changed, 3 insertions(+), 3 deletions(-) |
||||
|
||||
diff --git a/modules.d/90dmsquash-live/dmsquash-live-root.sh b/modules.d/90dmsquash-live/dmsquash-live-root.sh |
||||
index 8951f80c..5705e8df 100755 |
||||
--- a/modules.d/90dmsquash-live/dmsquash-live-root.sh |
||||
+++ b/modules.d/90dmsquash-live/dmsquash-live-root.sh |
||||
@@ -144,6 +144,9 @@ do_live_overlay() { |
||||
over=$OVERLAY_LOOPDEV |
||||
fi |
||||
echo 0 $sz snapshot $base $over p 8 | dmsetup create live-rw |
||||
+ |
||||
+ # Create a device that always points to a ro base image |
||||
+ echo 0 $sz linear $base 0 | dmsetup create --readonly live-base |
||||
} |
||||
|
||||
# live cd helper function |
||||
@@ -225,9 +228,6 @@ if [ -n "$ROOTFLAGS" ]; then |
||||
ROOTFLAGS="-o $ROOTFLAGS" |
||||
fi |
||||
|
||||
-if [ -b "$BASE_LOOPDEV" ]; then |
||||
- ln -s $BASE_LOOPDEV /run/initramfs/live-baseloop |
||||
-fi |
||||
ln -s /dev/mapper/live-rw /dev/root |
||||
printf 'mount %s /dev/mapper/live-rw %s\n' "$ROOTFLAGS" "$NEWROOT" > $hookdir/mount/01-$$-live.sh |
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,37 @@
@@ -0,0 +1,37 @@
|
||||
From 1a21ed8d1dbec162986fff9f30d5efc68107524e Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Wed, 16 Oct 2013 11:30:08 +0200 |
||||
Subject: [PATCH] lvm: fix thin recognition |
||||
|
||||
The global var setting was happening in a pipe and did not have an |
||||
effect. |
||||
|
||||
Use <<<$() instead. |
||||
|
||||
< <() cannot be used, because dracut is called in chroot's environments, |
||||
where /dev/fd does not point to /proc/self/fd, but bash wants |
||||
/dev/fd/<num> for this construct. |
||||
--- |
||||
modules.d/90lvm/module-setup.sh | 5 +++-- |
||||
1 file changed, 3 insertions(+), 2 deletions(-) |
||||
|
||||
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh |
||||
index 514addc1..50d9b98e 100755 |
||||
--- a/modules.d/90lvm/module-setup.sh |
||||
+++ b/modules.d/90lvm/module-setup.sh |
||||
@@ -53,12 +53,13 @@ install() { |
||||
inst lvm |
||||
|
||||
if [[ $hostonly ]]; then |
||||
- get_host_lvs | while read line; do |
||||
+ while read line; do |
||||
+ [[ -n "$line" ]] || continue |
||||
printf "%s" " rd.lvm.lv=$line" |
||||
if ! [[ $_needthin ]]; then |
||||
[[ "$(lvs --noheadings -o segtype ${line%%/*} 2>/dev/null)" == *thin* ]] && _needthin=1 |
||||
fi |
||||
- done >> "${initdir}/etc/cmdline.d/90lvm.conf" |
||||
+ done <<<$(get_host_lvs) >> "${initdir}/etc/cmdline.d/90lvm.conf" |
||||
echo >> "${initdir}/etc/cmdline.d/90lvm.conf" |
||||
else |
||||
_needthin=1 |
@ -0,0 +1,50 @@
@@ -0,0 +1,50 @@
|
||||
From 8e3620568cd4e2c7e8db52fcf3f6e25cc4608aaf Mon Sep 17 00:00:00 2001 |
||||
From: Marian Csontos <mcsontos@redhat.com> |
||||
Date: Fri, 18 Oct 2013 14:40:40 +0200 |
||||
Subject: [PATCH] dracut-functions.sh:check_block_and_slaves*() skip LVM |
||||
internal devs |
||||
|
||||
Not every device in /dev/mapper should be examined. |
||||
If it is an LVM device, touch only devices which have /dev/VG/LV symlink. |
||||
--- |
||||
dracut-functions.sh | 16 ++++++++++++++-- |
||||
1 file changed, 14 insertions(+), 2 deletions(-) |
||||
|
||||
diff --git a/dracut-functions.sh b/dracut-functions.sh |
||||
index 45e09118..2e6e8456 100755 |
||||
--- a/dracut-functions.sh |
||||
+++ b/dracut-functions.sh |
||||
@@ -579,7 +579,7 @@ host_fs_all() |
||||
check_block_and_slaves() { |
||||
local _x |
||||
[[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry. |
||||
- "$1" $2 && return |
||||
+ if ! lvm_internal_dev $2; then "$1" $2 && return; fi |
||||
check_vol_slaves "$@" && return 0 |
||||
if [[ -f /sys/dev/block/$2/../dev ]]; then |
||||
check_block_and_slaves $1 $(<"/sys/dev/block/$2/../dev") && return 0 |
||||
@@ -595,7 +595,7 @@ check_block_and_slaves() { |
||||
check_block_and_slaves_all() { |
||||
local _x _ret=1 |
||||
[[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry. |
||||
- if "$1" $2; then |
||||
+ if ! lvm_internal_dev $2 && "$1" $2; then |
||||
_ret=0 |
||||
fi |
||||
check_vol_slaves "$@" && return 0 |
||||
@@ -1672,3 +1672,15 @@ get_ucode_file () |
||||
printf "%02x-%02x-%02x" ${family} ${model} ${stepping} |
||||
fi |
||||
} |
||||
+ |
||||
+# Not every device in /dev/mapper should be examined. |
||||
+# If it is an LVM device, touch only devices which have /dev/VG/LV symlink. |
||||
+lvm_internal_dev() { |
||||
+ local dev_dm_dir=/sys/dev/block/$1/dm |
||||
+ [[ ! -f $dev_dm_dir/uuid || $(<$dev_dm_dir/uuid) != LVM-* ]] && return 1 # Not an LVM device |
||||
+ local DM_VG_NAME DM_LV_NAME DM_LV_LAYER |
||||
+ eval $(dmsetup splitname --nameprefixes --noheadings --rows "$(<$dev_dm_dir/name)" 2>/dev/null) |
||||
+ [[ ${DM_VG_NAME} ]] && [[ ${DM_LV_NAME} ]] || return 0 # Better skip this! |
||||
+ [[ ${DM_LV_LAYER} ]] || [[ ! -L /dev/${DM_VG_NAME}/${DM_LV_NAME} ]] |
||||
+} |
||||
+ |
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
From 9bd3573ddba40e4ee7b01f4e906126dbdc494f28 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Fri, 18 Oct 2013 15:34:44 +0200 |
||||
Subject: [PATCH] git2spec.pl: remove ".git$(date)" from release string |
||||
|
||||
--- |
||||
git2spec.pl | 3 +-- |
||||
1 file changed, 1 insertion(+), 2 deletions(-) |
||||
|
||||
diff --git a/git2spec.pl b/git2spec.pl |
||||
index 0d8adb4a..b8442951 100755 |
||||
--- a/git2spec.pl |
||||
+++ b/git2spec.pl |
||||
@@ -20,8 +20,7 @@ chomp($tag); |
||||
my @patches=&create_patches($tag, $pdir); |
||||
my $num=$#patches + 2; |
||||
$tag=~s/[^0-9]+?([0-9]+)/$1/; |
||||
-my $release="$num.git$datestr"; |
||||
-$release="1" if $num == 1; |
||||
+my $release="$num"; |
||||
|
||||
while(<>) { |
||||
if (/^Version:/) { |
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
From 88fc0b8750c827ecdeacd70893905db5d6c9b87d Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Fri, 18 Oct 2013 14:56:51 +0200 |
||||
Subject: [PATCH] kernel-modules(ARM): add mmc_block usb_storage to statis list |
||||
of kernel mods |
||||
|
||||
--- |
||||
modules.d/90kernel-modules/module-setup.sh | 2 +- |
||||
1 file changed, 1 insertion(+), 1 deletion(-) |
||||
|
||||
diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh |
||||
index e7e2ca07..366235ca 100755 |
||||
--- a/modules.d/90kernel-modules/module-setup.sh |
||||
+++ b/modules.d/90kernel-modules/module-setup.sh |
||||
@@ -48,7 +48,7 @@ installkernel() { |
||||
# arm specific modules |
||||
hostonly='' instmods sdhci_esdhc_imx mmci sdhci_tegra mvsdio omap omapdrm \ |
||||
omap_hsmmc panel-tfp410 sdhci_dove ahci_platform pata_imx sata_mv \ |
||||
- ehci-tegra |
||||
+ ehci-tegra mmc_block usb_storage |
||||
fi |
||||
|
||||
# install virtual machine support |
@ -0,0 +1,75 @@
@@ -0,0 +1,75 @@
|
||||
From 37e899aad1a9623d4932d689b4082832fa3660d8 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Mon, 21 Oct 2013 09:09:26 +0200 |
||||
Subject: [PATCH] lvm: always install thin utils for lvm |
||||
|
||||
--- |
||||
modules.d/90lvm/module-setup.sh | 34 ++++++++-------------------------- |
||||
1 file changed, 8 insertions(+), 26 deletions(-) |
||||
|
||||
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh |
||||
index 50d9b98e..f1c19a22 100755 |
||||
--- a/modules.d/90lvm/module-setup.sh |
||||
+++ b/modules.d/90lvm/module-setup.sh |
||||
@@ -22,7 +22,8 @@ depends() { |
||||
return 0 |
||||
} |
||||
|
||||
-get_host_lvs() { |
||||
+# called by dracut |
||||
+cmdline() { |
||||
local _activated |
||||
declare -A _activated |
||||
|
||||
@@ -35,35 +36,20 @@ get_host_lvs() { |
||||
eval $(dmsetup splitname --nameprefixes --noheadings --rows "$dev" 2>/dev/null) |
||||
[[ ${DM_VG_NAME} ]] && [[ ${DM_LV_NAME} ]] || return 1 |
||||
if ! [[ ${_activated[${DM_VG_NAME}/${DM_LV_NAME}]} ]]; then |
||||
- printf "%s\n" "${DM_VG_NAME}/${DM_LV_NAME} " |
||||
+ printf " rd.lvm.lv=%s\n" "${DM_VG_NAME}/${DM_LV_NAME} " |
||||
_activated["${DM_VG_NAME}/${DM_LV_NAME}"]=1 |
||||
fi |
||||
done |
||||
} |
||||
|
||||
-cmdline() { |
||||
- get_host_lvs | while read line; do |
||||
- printf " rd.lvm.lv=$line" |
||||
- done |
||||
-} |
||||
- |
||||
+# called by dracut |
||||
install() { |
||||
- local _i _needthin |
||||
+ local _i |
||||
|
||||
inst lvm |
||||
|
||||
- if [[ $hostonly ]]; then |
||||
- while read line; do |
||||
- [[ -n "$line" ]] || continue |
||||
- printf "%s" " rd.lvm.lv=$line" |
||||
- if ! [[ $_needthin ]]; then |
||||
- [[ "$(lvs --noheadings -o segtype ${line%%/*} 2>/dev/null)" == *thin* ]] && _needthin=1 |
||||
- fi |
||||
- done <<<$(get_host_lvs) >> "${initdir}/etc/cmdline.d/90lvm.conf" |
||||
- echo >> "${initdir}/etc/cmdline.d/90lvm.conf" |
||||
- else |
||||
- _needthin=1 |
||||
- fi |
||||
+ cmdline >> "${initdir}/etc/cmdline.d/90lvm.conf" |
||||
+ echo >> "${initdir}/etc/cmdline.d/90lvm.conf" |
||||
|
||||
inst_rules "$moddir/64-lvm.rules" |
||||
|
||||
@@ -99,9 +85,5 @@ install() { |
||||
|
||||
inst_libdir_file "libdevmapper-event-lvm*.so" |
||||
|
||||
- if [[ $_needthin ]]; then |
||||
- inst_multiple -o thin_dump thin_restore thin_check thin_repair |
||||
- fi |
||||
- |
||||
+ inst_multiple -o thin_dump thin_restore thin_check thin_repair |
||||
} |
||||
- |
@ -0,0 +1,33 @@
@@ -0,0 +1,33 @@
|
||||
From 8eee542b4014166ef52efc20ab499aed4fe231d3 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Mon, 21 Oct 2013 09:43:04 +0200 |
||||
Subject: [PATCH] dracut.spec: move /sbin/dracut to /usr/sbin/dracut |
||||
|
||||
--- |
||||
dracut.spec | 6 +++--- |
||||
1 file changed, 3 insertions(+), 3 deletions(-) |
||||
|
||||
diff --git a/dracut.spec b/dracut.spec |
||||
index 8dfc7535..596d7283 100644 |
||||
--- a/dracut.spec |
||||
+++ b/dracut.spec |
||||
@@ -276,8 +276,8 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ |
||||
%endif |
||||
|
||||
# create compat symlink |
||||
-mkdir -p $RPM_BUILD_ROOT/sbin |
||||
-ln -s /usr/bin/dracut $RPM_BUILD_ROOT/sbin/dracut |
||||
+mkdir -p $RPM_BUILD_ROOT%{_sbindir} |
||||
+ln -sr $RPM_BUILD_ROOT%{_bindir}/dracut $RPM_BUILD_ROOT%{_sbindir}/dracut |
||||
|
||||
%clean |
||||
rm -rf -- $RPM_BUILD_ROOT |
||||
@@ -287,7 +287,7 @@ rm -rf -- $RPM_BUILD_ROOT |
||||
%doc README HACKING TODO COPYING AUTHORS NEWS dracut.html dracut.png dracut.svg |
||||
%{_bindir}/dracut |
||||
# compat symlink |
||||
-/sbin/dracut |
||||
+%{_sbindir}/dracut |
||||
%{_datadir}/bash-completion/completions/dracut |
||||
%{_datadir}/bash-completion/completions/lsinitrd |
||||
%if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999 |
@ -0,0 +1,22 @@
@@ -0,0 +1,22 @@
|
||||
From 352a49a21d5093955e45c0ccb84c258d4b375aad Mon Sep 17 00:00:00 2001 |
||||
From: Alexander Tsoy <alexander@tsoy.me> |
||||
Date: Fri, 25 Oct 2013 17:06:44 +0200 |
||||
Subject: [PATCH] usrmount/module-setup.sh: fixed typo |
||||
|
||||
--- |
||||
modules.d/98usrmount/module-setup.sh | 2 +- |
||||
1 file changed, 1 insertion(+), 1 deletion(-) |
||||
|
||||
diff --git a/modules.d/98usrmount/module-setup.sh b/modules.d/98usrmount/module-setup.sh |
||||
index a6680693..1dde9376 100755 |
||||
--- a/modules.d/98usrmount/module-setup.sh |
||||
+++ b/modules.d/98usrmount/module-setup.sh |
||||
@@ -6,7 +6,7 @@ check() { |
||||
local _init |
||||
[[ $mount_needs ]] && return 1 |
||||
_init=$(readlink -f /sbin/init) |
||||
- [[ "$init" == "${init##/usr}" ]] && return 255 |
||||
+ [[ "$_init" == "${_init##/usr}" ]] && return 255 |
||||
return 0 |
||||
} |
||||
|
@ -0,0 +1,85 @@
@@ -0,0 +1,85 @@
|
||||
From ee916b72cc6ec89adf68d5b538044ebb5edcdbbd Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Wed, 30 Oct 2013 12:22:52 +0100 |
||||
Subject: [PATCH] Handle crypto modules with and without modaliases |
||||
|
||||
If new kernels have modules split out, handle the case, where modules |
||||
have to modalias and just install them. |
||||
|
||||
Also add the crypto drivers and names to host_modalias. |
||||
--- |
||||
dracut-functions.sh | 14 ++++++++++---- |
||||
dracut.sh | 5 +++++ |
||||
modules.d/01fips/fips.sh | 1 - |
||||
3 files changed, 15 insertions(+), 5 deletions(-) |
||||
|
||||
diff --git a/dracut-functions.sh b/dracut-functions.sh |
||||
index 2e6e8456..38095ba4 100755 |
||||
--- a/dracut-functions.sh |
||||
+++ b/dracut-functions.sh |
||||
@@ -1480,7 +1480,7 @@ dracut_kernel_post() { |
||||
|
||||
module_is_host_only() { |
||||
local _mod=$1 |
||||
- local _modenc a i |
||||
+ local _modenc a i _k _s _v _aliases |
||||
_mod=${_mod##*/} |
||||
_mod=${_mod%.ko} |
||||
_modenc=${_mod//-/_} |
||||
@@ -1497,19 +1497,25 @@ module_is_host_only() { |
||||
# this covers the case, where a new module is introduced |
||||
# or a module was renamed |
||||
# or a module changed from builtin to a module |
||||
+ |
||||
if [[ -d /lib/modules/$kernel_current ]]; then |
||||
# if the modinfo can be parsed, but the module |
||||
# is not loaded, then we can safely return 1 |
||||
modinfo -F filename "$_mod" &>/dev/null && return 1 |
||||
fi |
||||
|
||||
- # Finally check all modalias, if we install for a kernel |
||||
- # different from the current one |
||||
- for a in $(modinfo -k $kernel -F alias $_mod 2>/dev/null); do |
||||
+ _aliases=$(modinfo -k $kernel -F alias $_mod 2>/dev/null) |
||||
+ |
||||
+ # if the module has no aliases, install it |
||||
+ [[ $_aliases ]] || return 0 |
||||
+ |
||||
+ # finally check all modalias |
||||
+ for a in $_aliases; do |
||||
for i in "${!host_modalias[@]}"; do |
||||
[[ $i == $a ]] && return 0 |
||||
done |
||||
done |
||||
+ |
||||
fi |
||||
|
||||
return 1 |
||||
diff --git a/dracut.sh b/dracut.sh |
||||
index 173a259a..c6a388ab 100755 |
||||
--- a/dracut.sh |
||||
+++ b/dracut.sh |
||||
@@ -968,6 +968,11 @@ if [[ $hostonly ]]; then |
||||
|
||||
rm -f -- "$initdir/.modalias" |
||||
|
||||
+ while read _k _s _v; do |
||||
+ [ "$_k" != "name" -a "$_k" != "driver" ] && continue |
||||
+ host_modalias["$_v"]=1 |
||||
+ done </proc/crypto |
||||
+ |
||||
# check /proc/modules |
||||
declare -A host_modules |
||||
while read m rest; do |
||||
diff --git a/modules.d/01fips/fips.sh b/modules.d/01fips/fips.sh |
||||
index f0a4c5c2..98dd1c2f 100755 |
||||
--- a/modules.d/01fips/fips.sh |
||||
+++ b/modules.d/01fips/fips.sh |
||||
@@ -96,7 +96,6 @@ do_fips() |
||||
_found=0 |
||||
while read _k _s _v; do |
||||
[ "$_k" != "name" -a "$_k" != "driver" ] && continue |
||||
- [ "$_k" = "driver" ] && _v=$(str_replace "$_v" "_" "-") |
||||
[ "$_v" != "$_module" ] && continue |
||||
_found=1 |
||||
break |
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
From eb27e4cc31ff995c5e70442d559fd22377e8a211 Mon Sep 17 00:00:00 2001 |
||||
From: Kyle McMartin <kmcmarti@redhat.com> |
||||
Date: Wed, 30 Oct 2013 12:35:27 +0100 |
||||
Subject: [PATCH] fips: include crct10dif_generic |
||||
|
||||
Resolves: rhbz#1024455 |
||||
--- |
||||
modules.d/01fips/module-setup.sh | 2 +- |
||||
1 file changed, 1 insertion(+), 1 deletion(-) |
||||
|
||||
diff --git a/modules.d/01fips/module-setup.sh b/modules.d/01fips/module-setup.sh |
||||
index d08e3f74..1ab4999a 100755 |
||||
--- a/modules.d/01fips/module-setup.sh |
||||
+++ b/modules.d/01fips/module-setup.sh |
||||
@@ -13,7 +13,7 @@ depends() { |
||||
installkernel() { |
||||
local _fipsmodules _mod |
||||
_fipsmodules="aead aes_generic aes-x86_64 ansi_cprng arc4 blowfish camellia cast6 cbc ccm " |
||||
- _fipsmodules+="chainiv crc32c cryptomgr crypto_null ctr cts deflate des des3_ede dm-crypt dm-mod " |
||||
+ _fipsmodules+="chainiv crc32c crct10dif_generic cryptomgr crypto_null ctr cts deflate des des3_ede dm-crypt dm-mod " |
||||
_fipsmodules+="ecb eseqiv fcrypt gcm ghash_generic hmac khazad lzo md4 md5 michael_mic rmd128 " |
||||
_fipsmodules+="rmd160 rmd256 rmd320 rot13 salsa20 seed seqiv serpent sha1 sha224 sha256 sha256_generic " |
||||
_fipsmodules+="sha384 sha512 sha512_generic tcrypt tea tnepres twofish wp256 wp384 wp512 xeta xtea xts zlib" |
@ -0,0 +1,28 @@
@@ -0,0 +1,28 @@
|
||||
From ccad388c2578ba3e3539c87268a06c73f42b762f Mon Sep 17 00:00:00 2001 |
||||
From: Alexander Tsoy <alexander@tsoy.me> |
||||
Date: Wed, 9 Oct 2013 06:39:46 +0400 |
||||
Subject: [PATCH] resume: fix swap detection in hostonly |
||||
|
||||
Check for other possible fs types. This fixes swap detection when using |
||||
TuxOnIce kernel. |
||||
|
||||
Note that parse-resume.sh generate udev rules with support for |
||||
ID_FS_TYPE=suspend, but we do not include it here, because it is |
||||
libvolume_id thing and host_fs_types is populated using blkid. |
||||
--- |
||||
modules.d/95resume/module-setup.sh | 2 +- |
||||
1 file changed, 1 insertion(+), 1 deletion(-) |
||||
|
||||
diff --git a/modules.d/95resume/module-setup.sh b/modules.d/95resume/module-setup.sh |
||||
index 518ebf06..a1ddb460 100755 |
||||
--- a/modules.d/95resume/module-setup.sh |
||||
+++ b/modules.d/95resume/module-setup.sh |
||||
@@ -6,7 +6,7 @@ check() { |
||||
# No point trying to support resume, if no swap partition exist |
||||
[[ $hostonly ]] || [[ $mount_needs ]] && { |
||||
for fs in "${host_fs_types[@]}"; do |
||||
- [[ $fs = swap ]] && return 0 |
||||
+ [[ $fs =~ ^(swap|swsuspend|swsupend)$ ]] && return 0 |
||||
done |
||||
return 255 |
||||
} |
@ -0,0 +1,88 @@
@@ -0,0 +1,88 @@
|
||||
From c35826c0e7623852be8735acf8cc13e6bf829208 Mon Sep 17 00:00:00 2001 |
||||
From: Alexander Tsoy <alexander@tsoy.me> |
||||
Date: Wed, 9 Oct 2013 07:02:56 +0400 |
||||
Subject: [PATCH] resume: remove resume-genrules.sh |
||||
|
||||
parse-resume.sh already contains all the code from resume-genrules.sh. |
||||
Also parse-resume.sh is executed before resume-genrules.sh, so there is |
||||
no point to keep the latter. |
||||
|
||||
This fixes the following error messages: |
||||
dracut-initqueue: ln: failed to create symbolic link '/dev/resume': File exists |
||||
dracut-initqueue: rm: cannot remove '/lib/dracut/hooks/initqueue/settled/resume.sh': No such file or directory |
||||
dracut-initqueue: rm: cannot remove '/lib/dracut/hooks/initqueue/timeout/resume.sh': No such file or directory |
||||
--- |
||||
modules.d/95resume/module-setup.sh | 1 - |
||||
modules.d/95resume/resume-genrules.sh | 51 ----------------------------------- |
||||
2 files changed, 52 deletions(-) |
||||
delete mode 100755 modules.d/95resume/resume-genrules.sh |
||||
|
||||
diff --git a/modules.d/95resume/module-setup.sh b/modules.d/95resume/module-setup.sh |
||||
index a1ddb460..c4e93636 100755 |
||||
--- a/modules.d/95resume/module-setup.sh |
||||
+++ b/modules.d/95resume/module-setup.sh |
||||
@@ -30,7 +30,6 @@ install() { |
||||
inst_hook cmdline 10 "$moddir/parse-resume.sh" |
||||
else |
||||
inst_script "$moddir/parse-resume.sh" /lib/dracut/parse-resume.sh |
||||
- inst_hook pre-udev 30 "$moddir/resume-genrules.sh" |
||||
fi |
||||
|
||||
inst_script "$moddir/resume.sh" /lib/dracut/resume.sh |
||||
diff --git a/modules.d/95resume/resume-genrules.sh b/modules.d/95resume/resume-genrules.sh |
||||
deleted file mode 100755 |
||||
index c542c715..00000000 |
||||
--- a/modules.d/95resume/resume-genrules.sh |
||||
+++ /dev/null |
||||
@@ -1,51 +0,0 @@ |
||||
-#!/bin/sh |
||||
-# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- |
||||
-# ex: ts=8 sw=4 sts=4 et filetype=sh |
||||
- |
||||
-case "$splash" in |
||||
- quiet ) |
||||
- a_splash="-P splash=y" |
||||
- ;; |
||||
- * ) |
||||
- a_splash="-P splash=n" |
||||
- ;; |
||||
-esac |
||||
- |
||||
-if [ -n "$resume" ]; then |
||||
- { |
||||
- printf "KERNEL==\"%s\", ACTION==\"add|change\", SYMLINK+=\"/dev/resume\"\n" \ |
||||
- ${resume#/dev/}; |
||||
- printf "SYMLINK==\"%s\", ACTION==\"add|change\", SYMLINK+=\"/dev/resume\"\n" \ |
||||
- ${resume#/dev/}; |
||||
- } >> /etc/udev/rules.d/99-resume-link.rules |
||||
- |
||||
- { |
||||
- if [ -x /usr/sbin/resume ]; then |
||||
- printf "KERNEL==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue --finished --unique --name 00resume /usr/sbin/resume %s \'%s\'\"\n" \ |
||||
- ${resume#/dev/} "$a_splash" "$resume"; |
||||
- printf "SYMLINK==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue --finished --unique --name 00resume /usr/sbin/resume %s \'%s\'\"\n" \ |
||||
- ${resume#/dev/} "$a_splash" "$resume"; |
||||
- fi |
||||
- printf "KERNEL==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue --finished --unique --name 00resume echo %%M:%%m > /sys/power/resume\"\n" \ |
||||
- ${resume#/dev/}; |
||||
- printf "SYMLINK==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue --finished --unique --name 00resume echo %%M:%%m > /sys/power/resume\"\n" \ |
||||
- ${resume#/dev/}; |
||||
- } >> /etc/udev/rules.d/99-resume.rules |
||||
- |
||||
- printf '[ -e "%s" ] && { ln -s "%s" /dev/resume; rm "$job" "%s/initqueue/timeout/resume.sh"; }\n' \ |
||||
- "$resume" "$resume" "$hookdir" >> $hookdir/initqueue/settled/resume.sh |
||||
- |
||||
- printf 'warn "Cancelling resume operation. Device not found."; cancel_wait_for_dev /dev/resume; rm "$job" "%s/initqueue/settled/resume.sh";' \ |
||||
- "$hookdir" >> $hookdir/initqueue/timeout/resume.sh |
||||
- |
||||
- wait_for_dev "/dev/resume" |
||||
- |
||||
-elif ! getarg noresume; then |
||||
- { |
||||
- if [ -x /usr/sbin/resume ]; then |
||||
- printf "SUBSYSTEM==\"block\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue --finished --unique --name 00resume /usr/sbin/resume %s \$tempnode\"\n" "$a_splash" |
||||
- fi |
||||
- echo "SUBSYSTEM==\"block\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\"," \ |
||||
- " RUN+=\"/sbin/initqueue --finished --unique --name 00resume echo %M:%m > /sys/power/resume\""; |
||||
- } >> /etc/udev/rules.d/99-resume.rules |
||||
-fi |
@ -0,0 +1,61 @@
@@ -0,0 +1,61 @@
|
||||
From 65ba6c44d8f578a6fde7377cfcd7448202ba01e0 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Wed, 30 Oct 2013 17:36:54 +0100 |
||||
Subject: [PATCH] iscsi/nbd: do not try to mount the whole disk, if root= is |
||||
missing |
||||
|
||||
only mount the whole disk for root=dhcp |
||||
--- |
||||
modules.d/95iscsi/iscsiroot.sh | 11 ++--------- |
||||
modules.d/95nbd/nbdroot.sh | 2 +- |
||||
2 files changed, 3 insertions(+), 10 deletions(-) |
||||
|
||||
diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh |
||||
index 5181f523..738fff44 100755 |
||||
--- a/modules.d/95iscsi/iscsiroot.sh |
||||
+++ b/modules.d/95iscsi/iscsiroot.sh |
||||
@@ -40,14 +40,6 @@ modprobe crc32c 2>/dev/null |
||||
[ -e /sys/module/bnx2i ] && iscsiuio |
||||
|
||||
if getargbool 0 rd.iscsi.firmware -d -y iscsi_firmware ; then |
||||
- if [ -z "$root" -o -n "${root%%block:*}" ]; then |
||||
- # if root is not specified try to mount the whole iSCSI LUN |
||||
- printf 'ENV{DEVTYPE}!="partition", SYMLINK=="disk/by-path/*-iscsi-*-*", SYMLINK+="root"\n' >> /etc/udev/rules.d/99-iscsi-root.rules |
||||
- udevadm control --reload |
||||
- write_fs_tab /dev/root |
||||
- wait_for_dev /dev/root |
||||
- fi |
||||
- |
||||
for p in $(getargs rd.iscsi.param -d iscsi_param); do |
||||
iscsi_param="$iscsi_param --param $p" |
||||
done |
||||
@@ -55,6 +47,7 @@ if getargbool 0 rd.iscsi.firmware -d -y iscsi_firmware ; then |
||||
iscsistart -b $iscsi_param |
||||
echo 'started' > "/tmp/iscsistarted-iscsi" |
||||
echo 'started' > "/tmp/iscsistarted-firmware" |
||||
+ need_shutdown |
||||
exit 0 |
||||
fi |
||||
|
||||
@@ -137,7 +130,7 @@ handle_netroot() |
||||
|
||||
# FIXME $iscsi_protocol?? |
||||
|
||||
- if [ -z "$root" -o -n "${root%%block:*}" ]; then |
||||
+ if [ "$root" = "dhcp" ]; then |
||||
# if root is not specified try to mount the whole iSCSI LUN |
||||
printf 'SYMLINK=="disk/by-path/*-iscsi-*-%s", SYMLINK+="root"\n' $iscsi_lun >> /etc/udev/rules.d/99-iscsi-root.rules |
||||
udevadm control --reload |
||||
diff --git a/modules.d/95nbd/nbdroot.sh b/modules.d/95nbd/nbdroot.sh |
||||
index 823da0ea..2e9d9174 100755 |
||||
--- a/modules.d/95nbd/nbdroot.sh |
||||
+++ b/modules.d/95nbd/nbdroot.sh |
||||
@@ -97,7 +97,7 @@ done |
||||
|
||||
# If we didn't get a root= on the command line, then we need to |
||||
# add the udev rules for mounting the nbd0 device |
||||
-if [ -z "$root" -o -n "${root%%block:*}" -o "$root" = "block:/dev/root" ]; then |
||||
+if [ "$root" = "block:/dev/root" -o "$root" = "dhcp" ]; then |
||||
printf 'KERNEL=="nbd0", ENV{DEVTYPE}!="partition", ENV{ID_FS_TYPE}=="?*", SYMLINK+="root"\n' >> /etc/udev/rules.d/99-nbd-root.rules |
||||
udevadm control --reload |
||||
type write_fs_tab >/dev/null 2>&1 || . /lib/fs-lib.sh |
@ -0,0 +1,20 @@
@@ -0,0 +1,20 @@
|
||||
From 20ff2d37cc14f72a97325b12ebb7437efbaf0a8e Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Mon, 4 Nov 2013 17:29:15 +0100 |
||||
Subject: [PATCH] fips: also install /etc/system-fips in the initramfs |
||||
|
||||
--- |
||||
modules.d/01fips/module-setup.sh | 1 + |
||||
1 file changed, 1 insertion(+) |
||||
|
||||
diff --git a/modules.d/01fips/module-setup.sh b/modules.d/01fips/module-setup.sh |
||||
index 1ab4999a..35cfdc5a 100755 |
||||
--- a/modules.d/01fips/module-setup.sh |
||||
+++ b/modules.d/01fips/module-setup.sh |
||||
@@ -41,5 +41,6 @@ install() { |
||||
libssl.so 'hmaccalc/sha512hmac.hmac' libssl.so.10 |
||||
|
||||
inst_multiple -o prelink |
||||
+ inst_simple /etc/system-fips |
||||
} |
||||
|
@ -0,0 +1,43 @@
@@ -0,0 +1,43 @@
|
||||
From 03bf7758aa08e6533f438b4a60b4d5bd1847b1cd Mon Sep 17 00:00:00 2001 |
||||
From: Colin Guthrie <colin@mageia.org> |
||||
Date: Sat, 2 Nov 2013 11:26:30 +0000 |
||||
Subject: [PATCH] dracut-functions.sh: Avoid loading unnecessary 32-bit |
||||
libraries for 64-bit initrds |
||||
|
||||
Due to the 'inst_libdir_file "libnss_files*"' in the udev-rules module |
||||
this caues the /usr/lib/libnss_files-2.18.so* to be included. This is a |
||||
32-bit library and pulls in a 32-bit version of glibc also even on a |
||||
64-bit system. |
||||
|
||||
This is due to the fact that ldconfig -pN will print [/usr]/lib paths |
||||
from the cache as well as [/usr]/lib64. As we handle these paths |
||||
specifically we should ignore these results from the cache. |
||||
|
||||
Also there was a missing space when appending the ldconfig paths |
||||
onto our list meaning the last builtin and first ldconfig path |
||||
were unusable. |
||||
--- |
||||
dracut-functions.sh | 3 ++- |
||||
1 file changed, 2 insertions(+), 1 deletion(-) |
||||
|
||||
diff --git a/dracut-functions.sh b/dracut-functions.sh |
||||
index 38095ba4..2872516a 100755 |
||||
--- a/dracut-functions.sh |
||||
+++ b/dracut-functions.sh |
||||
@@ -65,6 +65,7 @@ ldconfig_paths() |
||||
printf "%s\n" ${d%/*}; |
||||
done |
||||
); do |
||||
+ [[ "$i" = "/lib" || "$i" = "/usr/lib" || "$i" = "/lib64" || "$i" = "/usr/lib64" ]] && continue |
||||
a["$i"]=1; |
||||
done; |
||||
printf "%s\n" ${!a[@]} |
||||
@@ -81,7 +82,7 @@ if ! [[ $libdirs ]] ; then |
||||
[[ -d /usr/lib ]] && libdirs+=" /usr/lib" |
||||
fi |
||||
|
||||
- libdirs+="$(ldconfig_paths)" |
||||
+ libdirs+=" $(ldconfig_paths)" |
||||
|
||||
export libdirs |
||||
fi |
@ -0,0 +1,27 @@
@@ -0,0 +1,27 @@
|
||||
From 52592ce022550fbf6c7576f5c8b8be1f2b6d72c8 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Mon, 11 Nov 2013 16:57:32 +0100 |
||||
Subject: [PATCH] systemd: do not exit the initqueue, if systemd asks a |
||||
password |
||||
|
||||
this prevents bailing out the initqueue, while passwords are still to be |
||||
asked |
||||
--- |
||||
modules.d/98systemd/dracut-initqueue.sh | 4 ++++ |
||||
1 file changed, 4 insertions(+) |
||||
|
||||
diff --git a/modules.d/98systemd/dracut-initqueue.sh b/modules.d/98systemd/dracut-initqueue.sh |
||||
index d7ebf2b2..64e81541 100755 |
||||
--- a/modules.d/98systemd/dracut-initqueue.sh |
||||
+++ b/modules.d/98systemd/dracut-initqueue.sh |
||||
@@ -52,6 +52,10 @@ while :; do |
||||
# no more udev jobs and queues empty. |
||||
sleep 0.5 |
||||
|
||||
+ for i in /run/systemd/ask-password/ask.*; do |
||||
+ [ -e "$i" ] && continue |
||||
+ done |
||||
+ |
||||
if [ $main_loop -gt $((2*$RDRETRY/3)) ]; then |
||||
for job in $hookdir/initqueue/timeout/*.sh; do |
||||
[ -e "$job" ] || break |
@ -0,0 +1,30 @@
@@ -0,0 +1,30 @@
|
||||
From 1dd604efb199af87ba0079eed809483559c9b04f Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Thu, 14 Nov 2013 10:07:04 +0100 |
||||
Subject: [PATCH] kernel-modules: add ohci-pci to the list of forced module |
||||
installs |
||||
|
||||
--- |
||||
modules.d/90kernel-modules/module-setup.sh | 9 ++++++--- |
||||
1 file changed, 6 insertions(+), 3 deletions(-) |
||||
|
||||
diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh |
||||
index 366235ca..510b43e1 100755 |
||||
--- a/modules.d/90kernel-modules/module-setup.sh |
||||
+++ b/modules.d/90kernel-modules/module-setup.sh |
||||
@@ -35,9 +35,12 @@ installkernel() { |
||||
return 0 |
||||
} |
||||
|
||||
- hostonly='' instmods sr_mod sd_mod scsi_dh ata_piix \ |
||||
- ehci-hcd ehci-pci ehci-platform ohci-hcd uhci-hcd xhci-hcd hid_generic \ |
||||
- unix |
||||
+ hostonly='' instmods \ |
||||
+ sr_mod sd_mod scsi_dh ata_piix hid_generic unix \ |
||||
+ ehci-hcd ehci-pci ehci-platform \ |
||||
+ ohci-hcd ohci-pci \ |
||||
+ uhci-hcd \ |
||||
+ xhci-hcd |
||||
|
||||
instmods yenta_socket scsi_dh_rdac scsi_dh_emc \ |
||||
atkbd i8042 usbhid hid-apple hid-sunplus hid-cherry hid-logitech \ |
@ -0,0 +1,36 @@
@@ -0,0 +1,36 @@
|
||||
From 05b79aaa9dde30d4f179303a81084b59898406b6 Mon Sep 17 00:00:00 2001 |
||||
From: Peter Rajnoha <prajnoha@redhat.com> |
||||
Date: Mon, 25 Nov 2013 14:38:00 +0100 |
||||
Subject: [PATCH] lvm: do not run pvscan for lvmetad update |
||||
|
||||
The lvmetad daemon is not yet running in initramfs so there's no |
||||
need to run pvscan (or instantiate any lvm2-pvscan systemd service). |
||||
If pvscan was called in this case (either directly or via systemd |
||||
instantiated service), it would fail because there's no lvmetad |
||||
daemon to update. This could cause confusion, especially in systemd |
||||
instantiated service which is run only once! |
||||
--- |
||||
modules.d/90lvm/module-setup.sh | 10 ++++++++++ |
||||
1 file changed, 10 insertions(+) |
||||
|
||||
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh |
||||
index f1c19a22..7e3d44fa 100755 |
||||
--- a/modules.d/90lvm/module-setup.sh |
||||
+++ b/modules.d/90lvm/module-setup.sh |
||||
@@ -74,6 +74,16 @@ install() { |
||||
fi |
||||
|
||||
inst_rules 11-dm-lvm.rules 69-dm-lvm-metad.rules |
||||
+ |
||||
+ # Do not run lvmetad update via pvscan in udev rule - lvmetad is not running yet in dracut! |
||||
+ if grep -q SYSTEMD_WANTS ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules; then |
||||
+ sed -i -e 's/^ENV{SYSTEMD_ALIAS}=.*/# No LVM pvscan in dracut - lvmetad is not running yet/' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules |
||||
+ sed -i -e 's/^ENV{ID_MODEL}=.*//' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules |
||||
+ sed -i -e 's/^ENV{SYSTEMD_WANTS}=.*//' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules |
||||
+ else |
||||
+ sed -i -e 's/.*lvm pvscan.*/# No LVM pvscan for in dracut - lvmetad is not running yet/' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules |
||||
+ fi |
||||
+ |
||||
# Gentoo ebuild for LVM2 prior to 2.02.63-r1 doesn't install above rules |
||||
# files, but provides the one below: |
||||
inst_rules 64-device-mapper.rules |
@ -0,0 +1,39 @@
@@ -0,0 +1,39 @@
|
||||
From e590f5beec5bc282898e38b8d1016288cfc4af9f Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Fri, 8 Nov 2013 15:06:18 +0100 |
||||
Subject: [PATCH] fips: fix RHEV vmlinuz check |
||||
|
||||
--- |
||||
modules.d/01fips/fips.sh | 12 ++++++------ |
||||
1 file changed, 6 insertions(+), 6 deletions(-) |
||||
|
||||
diff --git a/modules.d/01fips/fips.sh b/modules.d/01fips/fips.sh |
||||
index 98dd1c2f..7fa48f13 100755 |
||||
--- a/modules.d/01fips/fips.sh |
||||
+++ b/modules.d/01fips/fips.sh |
||||
@@ -60,8 +60,8 @@ do_rhevh_check() |
||||
KERNEL=$(uname -r) |
||||
kpath=${1} |
||||
|
||||
- # If we're on RHEV-H, the kernel is in /dev/.initramfs/live/vmlinuz0 |
||||
- HMAC_SUM_ORIG=$(cat /boot/.vmlinuz-${KERNEL}.hmac | while read a b; do printf "%s\n" $a; done) |
||||
+ # If we're on RHEV-H, the kernel is in /run/initramfs/live/vmlinuz0 |
||||
+ HMAC_SUM_ORIG=$(cat $NEWROOT/boot/.vmlinuz-${KERNEL}.hmac | while read a b; do printf "%s\n" $a; done) |
||||
HMAC_SUM_CALC=$(sha512hmac $kpath | while read a b; do printf "%s\n" $a; done || return 1) |
||||
if [ -z "$HMAC_SUM_ORIG" ] || [ -z "$HMAC_SUM_CALC" ] || [ "${HMAC_SUM_ORIG}" != "${HMAC_SUM_CALC}" ]; then |
||||
warn "HMAC sum mismatch" |
||||
@@ -111,10 +111,10 @@ do_fips() |
||||
rmmod tcrypt |
||||
|
||||
info "Checking integrity of kernel" |
||||
- if [ -e "$NEWROOT/dev/.initramfs/live/vmlinuz0" ]; then |
||||
- do_rhevh_check "$NEWROOT/dev/.initramfs/live/vmlinuz0" || return 1 |
||||
- elif [ -e "$NEWROOT/dev/.initramfs/live/isolinux/vmlinuz0" ]; then |
||||
- do_rhevh_check "$NEWROOT/dev/.initramfs/live/isolinux/vmlinuz0" || return 1 |
||||
+ if [ -e "/run/initramfs/live/vmlinuz0" ]; then |
||||
+ do_rhevh_check /run/initramfs/live/vmlinuz0 || return 1 |
||||
+ elif [ -e "/run/initramfs/live/isolinux/vmlinuz0" ]; then |
||||
+ do_rhevh_check /run/initramfs/live/isolinux/vmlinuz0 || return 1 |
||||
else |
||||
sha512hmac -c "/boot/.vmlinuz-${KERNEL}.hmac" || return 1 |
||||
fi |
@ -0,0 +1,28 @@
@@ -0,0 +1,28 @@
|
||||
From 15962471fed6c1f074f532d2e74c3583b1d38128 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Mon, 2 Dec 2013 10:30:52 +0100 |
||||
Subject: [PATCH] dracut.cmdline.7.asc: document "server-ip" of "ip=" parameter |
||||
|
||||
--- |
||||
dracut.cmdline.7.asc | 6 ++++-- |
||||
1 file changed, 4 insertions(+), 2 deletions(-) |
||||
|
||||
diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc |
||||
index 19bfb939..6a5fc8f6 100644 |
||||
--- a/dracut.cmdline.7.asc |
||||
+++ b/dracut.cmdline.7.asc |
||||
@@ -444,10 +444,12 @@ cannot be used in conjunction with the **ifname** argument for the |
||||
same <interface>. |
||||
===================== |
||||
|
||||
-**ip=**__<client-IP>__:__<server-IP>__:__<gateway-IP>__:__<netmask>__:__<client_hostname>__:__<interface>__:__{none|off|dhcp|on|any|dhcp6|auto6|ibft}__:[:[__<mtu>__][:__<macaddr>__]]:: |
||||
+**ip=**__<client-IP>__:[__<peer>__]:__<gateway-IP>__:__<netmask>__:__<client_hostname>__:__<interface>__:__{none|off|dhcp|on|any|dhcp6|auto6|ibft}__:[:[__<mtu>__][:__<macaddr>__]]:: |
||||
explicit network configuration. If you want do define a IPv6 address, put it |
||||
in brackets (e.g. [2001:DB8::1]). This parameter can be specified multiple |
||||
- times. |
||||
+ times. __<peer>__ is optional and is the address of the remote endpoint |
||||
+ for pointopoint interfaces and it may be followed by a slash and a decimal number, |
||||
+ encoding the network prefix length. |
||||
+ |
||||
===================== |
||||
<macaddr>::: optionally **set** <macaddr> on the <interface>. This |
@ -0,0 +1,31 @@
@@ -0,0 +1,31 @@
|
||||
From fb67162559469fedd84950eee6808962ceaf48a7 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Mon, 2 Dec 2013 10:32:00 +0100 |
||||
Subject: [PATCH] dracut.sh:_get_fs_type() if block device exists return early |
||||
|
||||
even, if no ID_FS_TYPE was found, return if the block device exists |
||||
--- |
||||
dracut.sh | 8 ++++---- |
||||
1 file changed, 4 insertions(+), 4 deletions(-) |
||||
|
||||
diff --git a/dracut.sh b/dracut.sh |
||||
index c6a388ab..5f14d503 100755 |
||||
--- a/dracut.sh |
||||
+++ b/dracut.sh |
||||
@@ -985,12 +985,12 @@ unset rest |
||||
|
||||
_get_fs_type() { |
||||
[[ $1 ]] || return |
||||
- if [[ -b /dev/block/$1 ]] && ID_FS_TYPE=$(get_fs_env "/dev/block/$1"); then |
||||
- host_fs_types["$(readlink -f "/dev/block/$1")"]="$ID_FS_TYPE" |
||||
+ if [[ -b /dev/block/$1 ]]; then |
||||
+ ID_FS_TYPE=$(get_fs_env "/dev/block/$1") && host_fs_types["$(readlink -f "/dev/block/$1")"]="$ID_FS_TYPE" |
||||
return 1 |
||||
fi |
||||
- if [[ -b $1 ]] && ID_FS_TYPE=$(get_fs_env "$1"); then |
||||
- host_fs_types["$(readlink -f "$1")"]="$ID_FS_TYPE" |
||||
+ if [[ -b $1 ]]; then |
||||
+ ID_FS_TYPE=$(get_fs_env "$1") && host_fs_types["$(readlink -f "$1")"]="$ID_FS_TYPE" |
||||
return 1 |
||||
fi |
||||
if fstype=$(find_dev_fstype "$1"); then |
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
From 243b8e14a2cdd317717ad8db5bb82aae9a8d7d14 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Mon, 2 Dec 2013 10:34:18 +0100 |
||||
Subject: [PATCH] network/net-lib.sh:wait_for_if_up() wait for "state UP" |
||||
|
||||
really wait for "state UP", otherwise it returns earlier than we want |
||||
--- |
||||
modules.d/40network/net-lib.sh | 2 +- |
||||
1 file changed, 1 insertion(+), 1 deletion(-) |
||||
|
||||
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh |
||||
index 88e72ece..0aa312a0 100644 |
||||
--- a/modules.d/40network/net-lib.sh |
||||
+++ b/modules.d/40network/net-lib.sh |
||||
@@ -443,7 +443,7 @@ wait_for_if_up() { |
||||
local li |
||||
while [ $cnt -lt 200 ]; do |
||||
li=$(ip -o link show up dev $1) |
||||
- [ -n "$li" ] && return 0 |
||||
+ [ -n "$li" ] && [ -z "${li##*state UP*}" ] && return 0 |
||||
sleep 0.1 |
||||
cnt=$(($cnt+1)) |
||||
done |
@ -0,0 +1,73 @@
@@ -0,0 +1,73 @@
|
||||
From 34397fe702ae21a3566e166b4001e8121766d5a7 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Mon, 2 Dec 2013 10:36:42 +0100 |
||||
Subject: [PATCH] network/net-lib.sh:iface_has_link() fixup |
||||
|
||||
Just echo'ing the flags IFF_UP|IFF_RUNNING does _not_ reflect the |
||||
carrier state immediately. So wait for it to really show up. |
||||
--- |
||||
modules.d/40network/net-lib.sh | 47 +++++++++++++++++++++--------------------- |
||||
1 file changed, 23 insertions(+), 24 deletions(-) |
||||
|
||||
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh |
||||
index 0aa312a0..7544401f 100644 |
||||
--- a/modules.d/40network/net-lib.sh |
||||
+++ b/modules.d/40network/net-lib.sh |
||||
@@ -28,30 +28,6 @@ iface_for_mac() { |
||||
done |
||||
} |
||||
|
||||
-iface_has_link() { |
||||
- local interface="$1" flags="" |
||||
- [ -n "$interface" ] || return 2 |
||||
- interface="/sys/class/net/$interface" |
||||
- [ -d "$interface" ] || return 2 |
||||
- flags=$(cat $interface/flags) |
||||
- echo $(($flags|0x41)) > $interface/flags # 0x41: IFF_UP|IFF_RUNNING |
||||
- [ "$(cat $interface/carrier)" = 1 ] || return 1 |
||||
- # XXX Do we need to reset the flags here? anaconda never bothered.. |
||||
-} |
||||
- |
||||
-find_iface_with_link() { |
||||
- local iface_path="" iface="" |
||||
- for iface_path in /sys/class/net/*; do |
||||
- iface=${iface_path##*/} |
||||
- str_starts "$iface" "lo" && continue |
||||
- if iface_has_link $iface; then |
||||
- echo "$iface" |
||||
- return 0 |
||||
- fi |
||||
- done |
||||
- return 1 |
||||
-} |
||||
- |
||||
# get the iface name for the given identifier - either a MAC, IP, or iface name |
||||
iface_name() { |
||||
case $1 in |
||||
@@ -483,3 +459,26 @@ type hostname >/dev/null 2>&1 || \ |
||||
hostname() { |
||||
cat /proc/sys/kernel/hostname |
||||
} |
||||
+ |
||||
+iface_has_link() { |
||||
+ local interface="$1" flags="" |
||||
+ [ -n "$interface" ] || return 2 |
||||
+ interface="/sys/class/net/$interface" |
||||
+ [ -d "$interface" ] || return 2 |
||||
+ linkup "$1" |
||||
+ [ "$(cat $interface/carrier)" = 1 ] || return 1 |
||||
+ # XXX Do we need to reset the flags here? anaconda never bothered.. |
||||
+} |
||||
+ |
||||
+find_iface_with_link() { |
||||
+ local iface_path="" iface="" |
||||
+ for iface_path in /sys/class/net/*; do |
||||
+ iface=${iface_path##*/} |
||||
+ str_starts "$iface" "lo" && continue |
||||
+ if iface_has_link $iface; then |
||||
+ echo "$iface" |
||||
+ return 0 |
||||
+ fi |
||||
+ done |
||||
+ return 1 |
||||
+} |
@ -0,0 +1,25 @@
@@ -0,0 +1,25 @@
|
||||
From 7aa989a4fd5c29da18e9e57fb94dec253516b0c4 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Mon, 2 Dec 2013 10:38:21 +0100 |
||||
Subject: [PATCH] network/ifup.sh: before doing dhcp, check, if the link has a |
||||
carrier |
||||
|
||||
--- |
||||
modules.d/40network/ifup.sh | 4 ++++ |
||||
1 file changed, 4 insertions(+) |
||||
|
||||
diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh |
||||
index 9f6f4494..2edcfe69 100755 |
||||
--- a/modules.d/40network/ifup.sh |
||||
+++ b/modules.d/40network/ifup.sh |
||||
@@ -87,6 +87,10 @@ do_dhcp() { |
||||
# dhclient-script will mark the netif up and generate the online |
||||
# event for nfsroot |
||||
# XXX add -V vendor class and option parsing per kernel |
||||
+ if ! iface_has_link $netif; then |
||||
+ echo "No carrier detected" |
||||
+ return 1 |
||||
+ fi |
||||
echo "Starting dhcp for interface $netif" |
||||
dhclient "$@" -1 -q -cf /etc/dhclient.conf -pf /tmp/dhclient.$netif.pid -lf /tmp/dhclient.$netif.lease $netif \ |
||||
|| echo "dhcp failed" |
@ -0,0 +1,39 @@
@@ -0,0 +1,39 @@
|
||||
From 32c431bb48601a699d8da0b2ff22299ab3888183 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Mon, 2 Dec 2013 10:39:36 +0100 |
||||
Subject: [PATCH] base/dracut-lib.sh:wait_for_dev() relax requirement |
||||
|
||||
Do not "require" the devices, but "want" them. This might boot more |
||||
systems, where: |
||||
- the UUID changed |
||||
- swap devices do not show up |
||||
--- |
||||
modules.d/99base/dracut-lib.sh | 8 ++++---- |
||||
1 file changed, 4 insertions(+), 4 deletions(-) |
||||
|
||||
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh |
||||
index 74d7d352..7249c589 100755 |
||||
--- a/modules.d/99base/dracut-lib.sh |
||||
+++ b/modules.d/99base/dracut-lib.sh |
||||
@@ -856,9 +856,9 @@ wait_for_dev() |
||||
|
||||
if [ -n "$DRACUT_SYSTEMD" ]; then |
||||
_name=$(dev_unit_name "$1") |
||||
- if ! [ -L ${PREFIX}/etc/systemd/system/initrd.target.requires/${_name}.device ]; then |
||||
- [ -d ${PREFIX}/etc/systemd/system/initrd.target.requires ] || mkdir -p ${PREFIX}/etc/systemd/system/initrd.target.requires |
||||
- ln -s ../${_name}.device ${PREFIX}/etc/systemd/system/initrd.target.requires/${_name}.device |
||||
+ if ! [ -L ${PREFIX}/etc/systemd/system/initrd.target.wants/${_name}.device ]; then |
||||
+ [ -d ${PREFIX}/etc/systemd/system/initrd.target.wants ] || mkdir -p ${PREFIX}/etc/systemd/system/initrd.target.wants |
||||
+ ln -s ../${_name}.device ${PREFIX}/etc/systemd/system/initrd.target.wants/${_name}.device |
||||
fi |
||||
|
||||
mkdir -p ${PREFIX}/etc/systemd/system/${_name}.device.d |
||||
@@ -878,7 +878,7 @@ cancel_wait_for_dev() |
||||
rm -f -- "$hookdir/emergency/80-${_name}.sh" |
||||
if [ -n "$DRACUT_SYSTEMD" ]; then |
||||
_name=$(dev_unit_name "$1") |
||||
- rm -f -- ${PREFIX}/etc/systemd/system/initrd.target.requires/${_name}.device |
||||
+ rm -f -- ${PREFIX}/etc/systemd/system/initrd.target.wants/${_name}.device |
||||
rm -f -- ${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf |
||||
/sbin/initqueue --onetime --unique --name daemon-reload systemctl daemon-reload |
||||
fi |
@ -0,0 +1,22 @@
@@ -0,0 +1,22 @@
|
||||
From 7f61e2c8957081d929a4f4fba8645b6b6e71d043 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Mon, 2 Dec 2013 11:05:21 +0100 |
||||
Subject: [PATCH] dracut.sh: skip crypt swaps with password files |
||||
|
||||
--- |
||||
dracut.sh | 2 ++ |
||||
1 file changed, 2 insertions(+) |
||||
|
||||
diff --git a/dracut.sh b/dracut.sh |
||||
index 5f14d503..b03522bf 100755 |
||||
--- a/dracut.sh |
||||
+++ b/dracut.sh |
||||
@@ -945,6 +945,8 @@ if [[ $hostonly ]]; then |
||||
[[ $_mapper = \#* ]] && continue |
||||
[[ "$_d" -ef /dev/mapper/"$_mapper" ]] || continue |
||||
[[ "$_o" ]] || _o="$_p" |
||||
+ # skip entries with password files |
||||
+ [[ "$_p" == /* ]] && [[ -f $_p ]] && continue 2 |
||||
# skip mkswap swap |
||||
[[ $_o == *swap* ]] && continue 2 |
||||
done < /etc/crypttab |
@ -0,0 +1,46 @@
@@ -0,0 +1,46 @@
|
||||
From 411d2aedd602d2b1c85b42bf6de2b18b5a7a249a Mon Sep 17 00:00:00 2001 |
||||
From: Hannes Reinecke <hare@suse.de> |
||||
Date: Fri, 29 Nov 2013 13:13:53 +0100 |
||||
Subject: [PATCH] Fixup script permissions |
||||
|
||||
Scripts with a shebang should be marked as executable. |
||||
|
||||
Signed-off-by: Hannes Reinecke <hare@suse.de> |
||||
--- |
||||
modules.d/03modsign/load-modsign-keys.sh | 0 |
||||
modules.d/03modsign/module-setup.sh | 0 |
||||
modules.d/40network/net-lib.sh | 0 |
||||
modules.d/40network/parse-vlan.sh | 0 |
||||
modules.d/50drm/module-setup.sh | 0 |
||||
modules.d/91crypt-loop/crypt-loop-lib.sh | 0 |
||||
modules.d/98pollcdrom/pollcdrom.sh | 0 |
||||
7 files changed, 0 insertions(+), 0 deletions(-) |
||||
mode change 100644 => 100755 modules.d/03modsign/load-modsign-keys.sh |
||||
mode change 100644 => 100755 modules.d/03modsign/module-setup.sh |
||||
mode change 100644 => 100755 modules.d/40network/net-lib.sh |
||||
mode change 100644 => 100755 modules.d/40network/parse-vlan.sh |
||||
mode change 100644 => 100755 modules.d/50drm/module-setup.sh |
||||
mode change 100644 => 100755 modules.d/91crypt-loop/crypt-loop-lib.sh |
||||
mode change 100644 => 100755 modules.d/98pollcdrom/pollcdrom.sh |
||||
|
||||
diff --git a/modules.d/03modsign/load-modsign-keys.sh b/modules.d/03modsign/load-modsign-keys.sh |
||||
old mode 100644 |
||||
new mode 100755 |
||||
diff --git a/modules.d/03modsign/module-setup.sh b/modules.d/03modsign/module-setup.sh |
||||
old mode 100644 |
||||
new mode 100755 |
||||
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh |
||||
old mode 100644 |
||||
new mode 100755 |
||||
diff --git a/modules.d/40network/parse-vlan.sh b/modules.d/40network/parse-vlan.sh |
||||
old mode 100644 |
||||
new mode 100755 |
||||
diff --git a/modules.d/50drm/module-setup.sh b/modules.d/50drm/module-setup.sh |
||||
old mode 100644 |
||||
new mode 100755 |
||||
diff --git a/modules.d/91crypt-loop/crypt-loop-lib.sh b/modules.d/91crypt-loop/crypt-loop-lib.sh |
||||
old mode 100644 |
||||
new mode 100755 |
||||
diff --git a/modules.d/98pollcdrom/pollcdrom.sh b/modules.d/98pollcdrom/pollcdrom.sh |
||||
old mode 100644 |
||||
new mode 100755 |
@ -0,0 +1,34 @@
@@ -0,0 +1,34 @@
|
||||
From ff3d291a68b912194a7f72a084359ab13853b753 Mon Sep 17 00:00:00 2001 |
||||
From: Hannes Reinecke <hare@suse.de> |
||||
Date: Fri, 29 Nov 2013 13:13:54 +0100 |
||||
Subject: [PATCH] Remove shebang from shell-completion files |
||||
|
||||
Shell-completion files are meant to be sourced, not executed. |
||||
So they shouldn't have a shebang at the start. |
||||
|
||||
Signed-off-by: Hannes Reinecke <hare@suse.de> |
||||
--- |
||||
dracut-bash-completion.sh | 2 +- |
||||
lsinitrd-bash-completion.sh | 2 +- |
||||
2 files changed, 2 insertions(+), 2 deletions(-) |
||||
|
||||
diff --git a/dracut-bash-completion.sh b/dracut-bash-completion.sh |
||||
index d796c358..9f359c6e 100644 |
||||
--- a/dracut-bash-completion.sh |
||||
+++ b/dracut-bash-completion.sh |
||||
@@ -1,4 +1,4 @@ |
||||
-#!/bin/bash |
||||
+# |
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- |
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh |
||||
# |
||||
diff --git a/lsinitrd-bash-completion.sh b/lsinitrd-bash-completion.sh |
||||
index 78ab1654..3df2965f 100644 |
||||
--- a/lsinitrd-bash-completion.sh |
||||
+++ b/lsinitrd-bash-completion.sh |
||||
@@ -1,4 +1,4 @@ |
||||
-#!/bin/bash |
||||
+# |
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- |
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh |
||||
# |
@ -0,0 +1,127 @@
@@ -0,0 +1,127 @@
|
||||
From dac45f997e6868ffba23610167c8bcb7476b0f96 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Thu, 5 Dec 2013 16:42:05 +0100 |
||||
Subject: [PATCH] i18n: introduce i18n_install_all, to install everything |
||||
|
||||
if i18n_install_all is set to "yes", then install all keyboard layouts |
||||
and fonts regardless of the hostonly setting. |
||||
|
||||
This way, people can switch keyboard layouts, without having to recreate |
||||
the initramfs. |
||||
--- |
||||
dracut.conf.5.asc | 14 ++++++++++++-- |
||||
dracut.conf.d/fedora.conf.example | 1 + |
||||
modules.d/10i18n/module-setup.sh | 31 +++++++++++++++++-------------- |
||||
3 files changed, 30 insertions(+), 16 deletions(-) |
||||
|
||||
diff --git a/dracut.conf.5.asc b/dracut.conf.5.asc |
||||
index c9c854a9..30b7e030 100644 |
||||
--- a/dracut.conf.5.asc |
||||
+++ b/dracut.conf.5.asc |
||||
@@ -122,10 +122,10 @@ If chrooted to another root other than the real root device, use --fstab and pro |
||||
*kernel_only=*"__{yes|no}__":: |
||||
Only install kernel drivers and firmware files. (default=no) |
||||
|
||||
-*no_kernel=*"{yes|no}":: |
||||
+*no_kernel=*"__{yes|no}__":: |
||||
Do not install kernel drivers and firmware files (default=no) |
||||
|
||||
-*acpi_override=*"{yes|no}":: |
||||
+*acpi_override=*"__{yes|no}__":: |
||||
[WARNING] ONLY USE THIS IF YOU KNOW WHAT YOU ARE DOING! + |
||||
Override BIOS provided ACPI tables. For further documentation read |
||||
Documentation/acpi/initrd_table_override.txt in the kernel sources. |
||||
@@ -158,6 +158,16 @@ If chrooted to another root other than the real root device, use --fstab and pro |
||||
*show_modules=*"__{yes|no}__":: |
||||
Print the name of the included modules to standard output during build. |
||||
|
||||
+*i18n_vars="__<variable mapping>__":: |
||||
+ Distribution specific variable mapping. |
||||
+ See dracut/modules.d/10i18n/README for a detailed description. |
||||
+ |
||||
+*i18n_default_font=*"__<fontname>__":: |
||||
+ The font <fontname> to install, if not specified otherwise. Default is "LatArCyrHeb-16". |
||||
+ |
||||
+*i18n_install_all=*"__{yes|no}__":: |
||||
+ Install everything regardless of generic or hostonly mode. |
||||
+ |
||||
Files |
||||
----- |
||||
_/etc/dracut.conf_:: |
||||
diff --git a/dracut.conf.d/fedora.conf.example b/dracut.conf.d/fedora.conf.example |
||||
index 1a56a864..495e8fb3 100644 |
||||
--- a/dracut.conf.d/fedora.conf.example |
||||
+++ b/dracut.conf.d/fedora.conf.example |
||||
@@ -3,6 +3,7 @@ |
||||
# i18n |
||||
i18n_vars="/etc/sysconfig/keyboard:KEYTABLE-KEYMAP /etc/sysconfig/i18n:SYSFONT-FONT,FONTACM-FONT_MAP,FONT_UNIMAP" |
||||
i18n_default_font="latarcyrheb-sun16" |
||||
+i18n_install_all="yes" |
||||
stdloglvl=3 |
||||
sysloglvl=5 |
||||
install_items+=" vi /etc/virc ps grep cat rm " |
||||
diff --git a/modules.d/10i18n/module-setup.sh b/modules.d/10i18n/module-setup.sh |
||||
index 2a837280..413ee123 100755 |
||||
--- a/modules.d/10i18n/module-setup.sh |
||||
+++ b/modules.d/10i18n/module-setup.sh |
||||
@@ -18,15 +18,11 @@ depends() { |
||||
|
||||
install() { |
||||
if dracut_module_included "systemd"; then |
||||
- [[ -f /etc/vconsole.conf ]] || return 0 |
||||
unset FONT |
||||
unset KEYMAP |
||||
- . /etc/vconsole.conf |
||||
- # if vconsole.conf has no settings, do not include anything |
||||
- [[ $FONT ]] || [[ $KEYMAP ]] || return 0 |
||||
+ [[ -f /etc/vconsole.conf ]] && . /etc/vconsole.conf |
||||
fi |
||||
|
||||
- inst_multiple -o $systemdutildir/systemd-vconsole-setup |
||||
KBDSUBDIRS=consolefonts,consoletrans,keymaps,unimaps |
||||
DEFAULT_FONT="${i18n_default_font:-LatArCyrHeb-16}" |
||||
I18N_CONF="/etc/locale.conf" |
||||
@@ -207,10 +203,20 @@ install() { |
||||
inst_simple ${kbddir}/unimaps/${FONT_UNIMAP}.uni |
||||
fi |
||||
|
||||
- mksubdirs ${initdir}${I18N_CONF} |
||||
- mksubdirs ${initdir}${VCONFIG_CONF} |
||||
- print_vars LC_ALL LANG >> ${initdir}${I18N_CONF} |
||||
- print_vars KEYMAP EXT_KEYMAPS UNICODE FONT FONT_MAP FONT_UNIMAP >> ${initdir}${VCONFIG_CONF} |
||||
+ if dracut_module_included "systemd" && [[ -f ${I18N_CONF} ]]; then |
||||
+ inst_simple ${I18N_CONF} |
||||
+ else |
||||
+ mksubdirs ${initdir}${I18N_CONF} |
||||
+ print_vars LC_ALL LANG >> ${initdir}${I18N_CONF} |
||||
+ fi |
||||
+ |
||||
+ if dracut_module_included "systemd" && [[ -f ${VCONFIG_CONF} ]]; then |
||||
+ inst_simple ${VCONFIG_CONF} |
||||
+ else |
||||
+ mksubdirs ${initdir}${VCONFIG_CONF} |
||||
+ print_vars KEYMAP EXT_KEYMAPS UNICODE FONT FONT_MAP FONT_UNIMAP >> ${initdir}${VCONFIG_CONF} |
||||
+ fi |
||||
+ |
||||
return 0 |
||||
} |
||||
|
||||
@@ -234,16 +240,13 @@ install() { |
||||
return 0 |
||||
} |
||||
|
||||
- if checks |
||||
- then |
||||
+ if checks; then |
||||
install_base |
||||
|
||||
- if [[ ${hostonly} ]] |
||||
- then |
||||
+ if [[ ${hostonly} ]] && ! [[ ${i18n_install_all} ]]; then |
||||
install_local_i18n || install_all_kbd |
||||
else |
||||
install_all_kbd |
||||
fi |
||||
fi |
||||
} |
||||
- |
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
From 90441c4476481e4e05edacf44903aeac2feecd6d Mon Sep 17 00:00:00 2001 |
||||
From: Vratislav Podzimek <vpodzime@redhat.com> |
||||
Date: Wed, 13 Nov 2013 13:20:39 +0100 |
||||
Subject: [PATCH] Run 'xz' and 'lzma' with multiple threads |
||||
|
||||
This speeds up compression a lot on multicore systems. |
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1029786 |
||||
|
||||
[Edited-by: Harald Hoyer: use getconf for cpu_count] |
||||
--- |
||||
dracut.sh | 6 ++++-- |
||||
1 file changed, 4 insertions(+), 2 deletions(-) |
||||
|
||||
diff --git a/dracut.sh b/dracut.sh |
||||
index b03522bf..59d3e4b2 100755 |
||||
--- a/dracut.sh |
||||
+++ b/dracut.sh |
||||
@@ -693,12 +693,14 @@ stdloglvl=$((stdloglvl + verbosity_mod_l)) |
||||
# eliminate IFS hackery when messing with fw_dir |
||||
fw_dir=${fw_dir//:/ } |
||||
|
||||
+cpu_count=$(getconf _NPROCESSORS_ONLN) |
||||
+ |
||||
# handle compression options. |
||||
[[ $compress ]] || compress="gzip" |
||||
case $compress in |
||||
bzip2) compress="bzip2 -9";; |
||||
- lzma) compress="lzma -9";; |
||||
- xz) compress="xz --check=crc32 --lzma2=dict=1MiB";; |
||||
+ lzma) compress="lzma -9 ${cpu_count:+-T$cpu_count}";; |
||||
+ xz) compress="xz --check=crc32 --lzma2=dict=1MiB ${cpu_count:+-T$cpu_count}";; |
||||
gzip) compress="gzip -9"; command -v pigz > /dev/null 2>&1 && compress="pigz -9";; |
||||
lzo) compress="lzop -9";; |
||||
lz4) compress="lz4 -9";; |
@ -0,0 +1,36 @@
@@ -0,0 +1,36 @@
|
||||
From d014032c62b22ef88be6123532b8f4fc545580ff Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Mon, 11 Nov 2013 16:57:09 +0100 |
||||
Subject: [PATCH] iscsi,nbd: do not fail in hostonly mode |
||||
|
||||
--- |
||||
modules.d/95iscsi/module-setup.sh | 2 +- |
||||
modules.d/95nbd/module-setup.sh | 2 +- |
||||
2 files changed, 2 insertions(+), 2 deletions(-) |
||||
|
||||
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh |
||||
index 502e8345..c6901c08 100755 |
||||
--- a/modules.d/95iscsi/module-setup.sh |
||||
+++ b/modules.d/95iscsi/module-setup.sh |
||||
@@ -23,7 +23,7 @@ check() { |
||||
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && { |
||||
pushd . >/dev/null |
||||
- for_each_host_dev_and_slaves is_iscsi || return 1 |
||||
+ for_each_host_dev_and_slaves is_iscsi || return 255 |
||||
popd >/dev/null |
||||
} |
||||
return 0 |
||||
diff --git a/modules.d/95nbd/module-setup.sh b/modules.d/95nbd/module-setup.sh |
||||
index 7b781803..3ac00f60 100755 |
||||
--- a/modules.d/95nbd/module-setup.sh |
||||
+++ b/modules.d/95nbd/module-setup.sh |
||||
@@ -14,7 +14,7 @@ check() { |
||||
|
||||
_rootdev=$(find_root_block_device) |
||||
[[ -b /dev/block/$_rootdev ]] || return 1 |
||||
- check_block_and_slaves is_nbd "$_rootdev" || return 1 |
||||
+ check_block_and_slaves is_nbd "$_rootdev" || return 255 |
||||
} |
||||
|
||||
return 0 |
@ -0,0 +1,22 @@
@@ -0,0 +1,22 @@
|
||||
From 8d7bd6af195ef6a7bd5caa89995084a8b484207c Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Sat, 2 Nov 2013 13:14:40 +0100 |
||||
Subject: [PATCH] dracut.sh: fixed PATH shortener |
||||
|
||||
--- |
||||
dracut.sh | 2 +- |
||||
1 file changed, 1 insertion(+), 1 deletion(-) |
||||
|
||||
diff --git a/dracut.sh b/dracut.sh |
||||
index 59d3e4b2..bb7e91e6 100755 |
||||
--- a/dracut.sh |
||||
+++ b/dracut.sh |
||||
@@ -533,7 +533,7 @@ for i in /usr/sbin /sbin /usr/bin /bin; do |
||||
if [ -L "$i" ]; then |
||||
rl=$(readlink -f $i) |
||||
fi |
||||
- if [[ "$NPATH" != "*:$rl*" ]] ; then |
||||
+ if [[ "$NPATH" != *:$rl* ]] ; then |
||||
NPATH+=":$rl" |
||||
fi |
||||
done |
@ -0,0 +1,21 @@
@@ -0,0 +1,21 @@
|
||||
From 5a36d29f8a63da9b62b5ee655f11f03e25dc5ef9 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Sat, 2 Nov 2013 13:20:32 +0100 |
||||
Subject: [PATCH] dracut.modules.7.asc: removed empty section |
||||
|
||||
--- |
||||
dracut.modules.7.asc | 1 - |
||||
1 file changed, 1 deletion(-) |
||||
|
||||
diff --git a/dracut.modules.7.asc b/dracut.modules.7.asc |
||||
index 4cb2aa15..17acdb4d 100644 |
||||
--- a/dracut.modules.7.asc |
||||
+++ b/dracut.modules.7.asc |
||||
@@ -10,7 +10,6 @@ dracut.modules - dracut modules |
||||
|
||||
DESCRIPTION |
||||
----------- |
||||
-== dracut Components |
||||
|
||||
dracut uses a modular system to build and extend the initramfs image. All |
||||
modules are located in _/usr/lib/dracut/modules.d_ or in _<git-src>/modules.d_. |
@ -0,0 +1,26 @@
@@ -0,0 +1,26 @@
|
||||
From 53b20afabbc034b4fe1e09f0b7d4f7d04f0584c5 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Thu, 5 Dec 2013 15:57:42 +0100 |
||||
Subject: [PATCH] lvm: install thin tools, only when needed in hostonly |
||||
|
||||
--- |
||||
modules.d/90lvm/module-setup.sh | 8 +++++++- |
||||
1 file changed, 7 insertions(+), 1 deletion(-) |
||||
|
||||
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh |
||||
index 7e3d44fa..877631bb 100755 |
||||
--- a/modules.d/90lvm/module-setup.sh |
||||
+++ b/modules.d/90lvm/module-setup.sh |
||||
@@ -95,5 +95,11 @@ install() { |
||||
|
||||
inst_libdir_file "libdevmapper-event-lvm*.so" |
||||
|
||||
- inst_multiple -o thin_dump thin_restore thin_check thin_repair |
||||
+ if [[ $hostonly ]] && type -P lvs &>/dev/null; then |
||||
+ for dev in "${!host_fs_types[@]}"; do |
||||
+ if [[ "$(lvs --noheadings -o segtype "$dev" 2>/dev/null)" == *thin* ]] ; then |
||||
+ inst_multiple -o thin_dump thin_restore thin_check thin_repair |
||||
+ fi |
||||
+ done |
||||
+ fi |
||||
} |
@ -0,0 +1,25 @@
@@ -0,0 +1,25 @@
|
||||
From a1e9e9364a98032a83e166173930c141c8baa4c6 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Thu, 5 Dec 2013 18:38:35 +0100 |
||||
Subject: [PATCH] systemd/dracut-initqueue.sh: fixed waiting in the loop if PW |
||||
asked |
||||
|
||||
continue the main loop instead of the for loop, if a password is |
||||
currently asked |
||||
--- |
||||
modules.d/98systemd/dracut-initqueue.sh | 2 +- |
||||
1 file changed, 1 insertion(+), 1 deletion(-) |
||||
|
||||
diff --git a/modules.d/98systemd/dracut-initqueue.sh b/modules.d/98systemd/dracut-initqueue.sh |
||||
index 64e81541..1e05dcd0 100755 |
||||
--- a/modules.d/98systemd/dracut-initqueue.sh |
||||
+++ b/modules.d/98systemd/dracut-initqueue.sh |
||||
@@ -53,7 +53,7 @@ while :; do |
||||
sleep 0.5 |
||||
|
||||
for i in /run/systemd/ask-password/ask.*; do |
||||
- [ -e "$i" ] && continue |
||||
+ [ -e "$i" ] && continue 2 |
||||
done |
||||
|
||||
if [ $main_loop -gt $((2*$RDRETRY/3)) ]; then |
@ -0,0 +1,22 @@
@@ -0,0 +1,22 @@
|
||||
From be10aecb17b1f71682cfc364553cf35f150a1045 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Tue, 10 Dec 2013 12:58:37 +0100 |
||||
Subject: [PATCH] base/rdsosreport.sh: add "ip a" output |
||||
|
||||
--- |
||||
modules.d/99base/rdsosreport.sh | 2 ++ |
||||
1 file changed, 2 insertions(+) |
||||
|
||||
diff --git a/modules.d/99base/rdsosreport.sh b/modules.d/99base/rdsosreport.sh |
||||
index bfa55bbb..5e11166e 100755 |
||||
--- a/modules.d/99base/rdsosreport.sh |
||||
+++ b/modules.d/99base/rdsosreport.sh |
||||
@@ -42,6 +42,8 @@ command -v dmsetup >/dev/null 2>/dev/null && dmsetup ls --tree |
||||
|
||||
cat /proc/mdstat |
||||
|
||||
+command -v ip >/dev/null 2>/dev/null && ip addr |
||||
+ |
||||
if command -v journalctl >/dev/null 2>/dev/null; then |
||||
journalctl -ab --no-pager -o short-monotonic |
||||
else |
@ -0,0 +1,31 @@
@@ -0,0 +1,31 @@
|
||||
From 793beab60c416e0edf7331fa2e6881b08f2bece0 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Fri, 13 Dec 2013 11:05:39 +0100 |
||||
Subject: [PATCH] lvm: fixed lvm thin check |
||||
|
||||
--- |
||||
modules.d/90lvm/module-setup.sh | 9 ++++++++- |
||||
1 file changed, 8 insertions(+), 1 deletion(-) |
||||
|
||||
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh |
||||
index 877631bb..f0c9b964 100755 |
||||
--- a/modules.d/90lvm/module-setup.sh |
||||
+++ b/modules.d/90lvm/module-setup.sh |
||||
@@ -97,9 +97,16 @@ install() { |
||||
|
||||
if [[ $hostonly ]] && type -P lvs &>/dev/null; then |
||||
for dev in "${!host_fs_types[@]}"; do |
||||
- if [[ "$(lvs --noheadings -o segtype "$dev" 2>/dev/null)" == *thin* ]] ; then |
||||
+ [ -e /sys/block/${dev#/dev/}/dm/name ] || continue |
||||
+ dev=$(</sys/block/${dev#/dev/}/dm/name) |
||||
+ eval $(dmsetup splitname --nameprefixes --noheadings --rows "$dev" 2>/dev/null) |
||||
+ [[ ${DM_VG_NAME} ]] && [[ ${DM_LV_NAME} ]] || continue |
||||
+ if [[ "$(lvs --noheadings -o segtype ${DM_VG_NAME} 2>/dev/null)" == *thin* ]] ; then |
||||
inst_multiple -o thin_dump thin_restore thin_check thin_repair |
||||
+ break |
||||
fi |
||||
done |
||||
+ else |
||||
+ inst_multiple -o thin_dump thin_restore thin_check thin_repair |
||||
fi |
||||
} |
@ -0,0 +1,232 @@
@@ -0,0 +1,232 @@
|
||||
From a34d3dcaa8947c8df6a3b809e42e6868d08ba649 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Mon, 16 Dec 2013 13:15:48 +0100 |
||||
Subject: [PATCH] test/TEST-17-LVM-THIN: add test case for lvm thin pools |
||||
|
||||
--- |
||||
test/TEST-17-LVM-THIN/.testdir | 1 + |
||||
test/TEST-17-LVM-THIN/99-idesymlinks.rules | 8 +++ |
||||
test/TEST-17-LVM-THIN/Makefile | 10 ++++ |
||||
test/TEST-17-LVM-THIN/create-root.sh | 31 +++++++++++ |
||||
test/TEST-17-LVM-THIN/finished-false.sh | 2 + |
||||
test/TEST-17-LVM-THIN/hard-off.sh | 3 + |
||||
test/TEST-17-LVM-THIN/test-init.sh | 17 ++++++ |
||||
test/TEST-17-LVM-THIN/test.sh | 88 ++++++++++++++++++++++++++++++ |
||||
8 files changed, 160 insertions(+) |
||||
create mode 100644 test/TEST-17-LVM-THIN/.testdir |
||||
create mode 100644 test/TEST-17-LVM-THIN/99-idesymlinks.rules |
||||
create mode 100644 test/TEST-17-LVM-THIN/Makefile |
||||
create mode 100755 test/TEST-17-LVM-THIN/create-root.sh |
||||
create mode 100755 test/TEST-17-LVM-THIN/finished-false.sh |
||||
create mode 100755 test/TEST-17-LVM-THIN/hard-off.sh |
||||
create mode 100755 test/TEST-17-LVM-THIN/test-init.sh |
||||
create mode 100755 test/TEST-17-LVM-THIN/test.sh |
||||
|
||||
diff --git a/test/TEST-17-LVM-THIN/.testdir b/test/TEST-17-LVM-THIN/.testdir |
||||
new file mode 100644 |
||||
index 00000000..9af2638c |
||||
--- /dev/null |
||||
+++ b/test/TEST-17-LVM-THIN/.testdir |
||||
@@ -0,0 +1 @@ |
||||
+TESTDIR="/var/tmp/dracut-test.uElZSK" |
||||
diff --git a/test/TEST-17-LVM-THIN/99-idesymlinks.rules b/test/TEST-17-LVM-THIN/99-idesymlinks.rules |
||||
new file mode 100644 |
||||
index 00000000..d557790a |
||||
--- /dev/null |
||||
+++ b/test/TEST-17-LVM-THIN/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-17-LVM-THIN/Makefile b/test/TEST-17-LVM-THIN/Makefile |
||||
new file mode 100644 |
||||
index 00000000..aad27059 |
||||
--- /dev/null |
||||
+++ b/test/TEST-17-LVM-THIN/Makefile |
||||
@@ -0,0 +1,10 @@ |
||||
+all: |
||||
+ @$(MAKE) -s --no-print-directory -C ../.. all |
||||
+ @V=$(V) 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-17-LVM-THIN/create-root.sh b/test/TEST-17-LVM-THIN/create-root.sh |
||||
new file mode 100755 |
||||
index 00000000..740704f6 |
||||
--- /dev/null |
||||
+++ b/test/TEST-17-LVM-THIN/create-root.sh |
||||
@@ -0,0 +1,31 @@ |
||||
+#!/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 |
||||
+rm -f -- /etc/lvm/lvm.conf |
||||
+udevadm control --reload |
||||
+# save a partition at the beginning for future flagging purposes |
||||
+sfdisk -C 2560 -H 2 -S 32 -L /dev/sda <<EOF |
||||
+,1 |
||||
+,800 |
||||
+,800 |
||||
+,800 |
||||
+EOF |
||||
+for i in sda2 sda3 sda4; do |
||||
+lvm pvcreate -ff -y /dev/$i ; |
||||
+done && \ |
||||
+lvm vgcreate dracut /dev/sda[234] && \ |
||||
+lvm lvcreate -l 16 -T dracut/mythinpool && \ |
||||
+lvm lvcreate -V1G -T dracut/mythinpool -n root && \ |
||||
+lvm vgchange -ay && \ |
||||
+mke2fs /dev/dracut/root && \ |
||||
+mkdir -p /sysroot && \ |
||||
+mount /dev/dracut/root /sysroot && \ |
||||
+cp -a -t /sysroot /source/* && \ |
||||
+umount /sysroot && \ |
||||
+sleep 1 && \ |
||||
+lvm lvchange -a n /dev/dracut/root && \ |
||||
+sleep 1 && \ |
||||
+echo "dracut-root-block-created" >/dev/sda1 |
||||
+poweroff -f |
||||
diff --git a/test/TEST-17-LVM-THIN/finished-false.sh b/test/TEST-17-LVM-THIN/finished-false.sh |
||||
new file mode 100755 |
||||
index 00000000..ecdbef95 |
||||
--- /dev/null |
||||
+++ b/test/TEST-17-LVM-THIN/finished-false.sh |
||||
@@ -0,0 +1,2 @@ |
||||
+#!/bin/sh |
||||
+exit 1 |
||||
diff --git a/test/TEST-17-LVM-THIN/hard-off.sh b/test/TEST-17-LVM-THIN/hard-off.sh |
||||
new file mode 100755 |
||||
index 00000000..12c3d5ac |
||||
--- /dev/null |
||||
+++ b/test/TEST-17-LVM-THIN/hard-off.sh |
||||
@@ -0,0 +1,3 @@ |
||||
+#!/bin/sh |
||||
+getarg rd.shell || poweroff -f |
||||
+getarg failme && poweroff -f |
||||
diff --git a/test/TEST-17-LVM-THIN/test-init.sh b/test/TEST-17-LVM-THIN/test-init.sh |
||||
new file mode 100755 |
||||
index 00000000..fd03aa5c |
||||
--- /dev/null |
||||
+++ b/test/TEST-17-LVM-THIN/test-init.sh |
||||
@@ -0,0 +1,17 @@ |
||||
+#!/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/mtab ] || ln -sfn /proc/mounts /etc/mtab |
||||
+[ -f /etc/fstab ] || ln -sfn /proc/mounts /etc/fstab |
||||
+stty sane |
||||
+echo "made it to the rootfs!" |
||||
+strstr "$CMDLINE" "rd.shell" && sh -i |
||||
+echo "Powering down." |
||||
+mount -n -o remount,ro / |
||||
+poweroff -f |
||||
diff --git a/test/TEST-17-LVM-THIN/test.sh b/test/TEST-17-LVM-THIN/test.sh |
||||
new file mode 100755 |
||||
index 00000000..0cfce199 |
||||
--- /dev/null |
||||
+++ b/test/TEST-17-LVM-THIN/test.sh |
||||
@@ -0,0 +1,88 @@ |
||||
+#!/bin/bash |
||||
+TEST_DESCRIPTION="root filesystem on LVM PV with thin pool" |
||||
+ |
||||
+KVERSION=${KVERSION-$(uname -r)} |
||||
+ |
||||
+# Uncomment this to debug failures |
||||
+#DEBUGFAIL="rd.break rd.shell" |
||||
+ |
||||
+test_run() { |
||||
+ $testdir/run-qemu \ |
||||
+ -hda $TESTDIR/root.ext2 \ |
||||
+ -m 256M -smp 2 -nographic \ |
||||
+ -net none -kernel /boot/vmlinuz-$KVERSION \ |
||||
+ -append "root=/dev/dracut/root rw rd.auto=1 quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \ |
||||
+ -initrd $TESTDIR/initramfs.testing |
||||
+ grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2 || return 1 |
||||
+} |
||||
+ |
||||
+test_setup() { |
||||
+ # Create the blank file to use as a root filesystem |
||||
+ dd if=/dev/null of=$TESTDIR/root.ext2 bs=1M seek=80 |
||||
+ |
||||
+ kernel=$KVERSION |
||||
+ # Create what will eventually be our root filesystem onto an overlay |
||||
+ ( |
||||
+ export initdir=$TESTDIR/overlay/source |
||||
+ . $basedir/dracut-functions.sh |
||||
+ inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip route \ |
||||
+ mount dmesg ifconfig dhclient mkdir cp ping dhclient |
||||
+ for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do |
||||
+ [ -f ${_terminfodir}/l/linux ] && break |
||||
+ done |
||||
+ inst_multiple -o ${_terminfodir}/l/linux |
||||
+ inst "$basedir/modules.d/40network/dhclient-script.sh" "/sbin/dhclient-script" |
||||
+ inst "$basedir/modules.d/40network/ifup.sh" "/sbin/ifup" |
||||
+ inst_multiple grep |
||||
+ inst_simple /etc/os-release |
||||
+ inst ./test-init.sh /sbin/init |
||||
+ find_binary plymouth >/dev/null && inst_multiple plymouth |
||||
+ (cd "$initdir"; mkdir -p dev sys proc etc var/run tmp ) |
||||
+ cp -a /etc/ld.so.conf* $initdir/etc |
||||
+ mkdir $initdir/run |
||||
+ sudo ldconfig -r "$initdir" |
||||
+ ) |
||||
+ |
||||
+ # second, install the files needed to make the root filesystem |
||||
+ ( |
||||
+ export initdir=$TESTDIR/overlay |
||||
+ . $basedir/dracut-functions.sh |
||||
+ inst_multiple sfdisk mke2fs poweroff cp umount |
||||
+ inst_hook initqueue 01 ./create-root.sh |
||||
+ inst_hook initqueue/finished 01 ./finished-false.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.sh -l -i $TESTDIR/overlay / \ |
||||
+ -m "dash lvm mdraid udev-rules base rootfs-block kernel-modules" \ |
||||
+ -d "piix ide-gd_mod ata_piix ext2 sd_mod" \ |
||||
+ -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 |
||||
+ rm -rf -- $TESTDIR/overlay |
||||
+ # Invoke KVM and/or QEMU to actually create the target filesystem. |
||||
+ $testdir/run-qemu -hda $TESTDIR/root.ext2 -m 256M -smp 2 -nographic -net none \ |
||||
+ -kernel "/boot/vmlinuz-$kernel" \ |
||||
+ -append "root=/dev/fakeroot rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ |
||||
+ -initrd $TESTDIR/initramfs.makeroot || return 1 |
||||
+ grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1 |
||||
+ ( |
||||
+ export initdir=$TESTDIR/overlay |
||||
+ . $basedir/dracut-functions.sh |
||||
+ inst_multiple poweroff shutdown |
||||
+ inst_hook emergency 000 ./hard-off.sh |
||||
+ inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules |
||||
+ ) |
||||
+ sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ |
||||
+ -o "plymouth network" \ |
||||
+ -a "debug" -I lvs \ |
||||
+ -d "piix ide-gd_mod ata_piix ext2 sd_mod" \ |
||||
+ -f $TESTDIR/initramfs.testing $KVERSION || return 1 |
||||
+} |
||||
+ |
||||
+test_cleanup() { |
||||
+ return 0 |
||||
+} |
||||
+ |
||||
+. $testdir/test-functions |
@ -0,0 +1,17 @@
@@ -0,0 +1,17 @@
|
||||
From 998f4bb72048e7c56d919ba43b8776d82e14b698 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Tue, 17 Dec 2013 13:36:55 +0100 |
||||
Subject: [PATCH] test/TEST-17-LVM-THIN: remove .testdir |
||||
|
||||
--- |
||||
test/TEST-17-LVM-THIN/.testdir | 1 - |
||||
1 file changed, 1 deletion(-) |
||||
delete mode 100644 test/TEST-17-LVM-THIN/.testdir |
||||
|
||||
diff --git a/test/TEST-17-LVM-THIN/.testdir b/test/TEST-17-LVM-THIN/.testdir |
||||
deleted file mode 100644 |
||||
index 9af2638c..00000000 |
||||
--- a/test/TEST-17-LVM-THIN/.testdir |
||||
+++ /dev/null |
||||
@@ -1 +0,0 @@ |
||||
-TESTDIR="/var/tmp/dracut-test.uElZSK" |
@ -0,0 +1,66 @@
@@ -0,0 +1,66 @@
|
||||
From 937456c65b0e641a6494a39acb5a001b2c9ed992 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Wed, 18 Dec 2013 12:26:05 +0100 |
||||
Subject: [PATCH] iscsi: do iscsi_firmware regardless of network |
||||
|
||||
Do the iscsi_firmware iscsistart at least once, even if the network is |
||||
not up, to activate offload HBA iSCSI. |
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1031160 |
||||
--- |
||||
modules.d/95iscsi/iscsiroot.sh | 12 +++++++----- |
||||
modules.d/95iscsi/parse-iscsiroot.sh | 2 +- |
||||
test/TEST-30-ISCSI/test.sh | 2 +- |
||||
3 files changed, 9 insertions(+), 7 deletions(-) |
||||
|
||||
diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh |
||||
index 738fff44..ef090f7f 100755 |
||||
--- a/modules.d/95iscsi/iscsiroot.sh |
||||
+++ b/modules.d/95iscsi/iscsiroot.sh |
||||
@@ -44,13 +44,15 @@ if getargbool 0 rd.iscsi.firmware -d -y iscsi_firmware ; then |
||||
iscsi_param="$iscsi_param --param $p" |
||||
done |
||||
|
||||
- iscsistart -b $iscsi_param |
||||
- echo 'started' > "/tmp/iscsistarted-iscsi" |
||||
- echo 'started' > "/tmp/iscsistarted-firmware" |
||||
- need_shutdown |
||||
- exit 0 |
||||
+ if ! [ -e /tmp/iscsistarted-firmware ] && iscsistart -b $iscsi_param; then |
||||
+ echo 'started' > "/tmp/iscsistarted-iscsi" |
||||
+ echo 'started' > "/tmp/iscsistarted-firmware" |
||||
+ need_shutdown |
||||
+ fi |
||||
+ [ "$netif" = dummy ] && exit 0 |
||||
fi |
||||
|
||||
+ |
||||
handle_netroot() |
||||
{ |
||||
local iscsi_initiator iscsi_target_name iscsi_target_ip iscsi_target_port |
||||
diff --git a/modules.d/95iscsi/parse-iscsiroot.sh b/modules.d/95iscsi/parse-iscsiroot.sh |
||||
index 0c8b524b..77bd9913 100755 |
||||
--- a/modules.d/95iscsi/parse-iscsiroot.sh |
||||
+++ b/modules.d/95iscsi/parse-iscsiroot.sh |
||||
@@ -64,7 +64,7 @@ if [ -n "$iscsi_firmware" ] ; then |
||||
netroot=${netroot:-iscsi} |
||||
modprobe -q iscsi_boot_sysfs 2>/dev/null |
||||
modprobe -q iscsi_ibft |
||||
- echo "[ -f '/tmp/iscsistarted-firmware' ]" > $hookdir/initqueue/finished/iscsi_firmware_started.sh |
||||
+ initqueue --onetime --settled /sbin/iscsiroot dummy "$netroot" "$NEWROOT" |
||||
fi |
||||
|
||||
# If it's not iscsi we don't continue |
||||
diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh |
||||
index 4c299564..f5977839 100755 |
||||
--- a/test/TEST-30-ISCSI/test.sh |
||||
+++ b/test/TEST-30-ISCSI/test.sh |
||||
@@ -69,7 +69,7 @@ do_test_run() { |
||||
|| return 1 |
||||
|
||||
run_client "netroot=iscsi" \ |
||||
- "root=LABEL=sysroot ip=192.168.50.101::192.168.50.1:255.255.255.0:iscsi-1:ens3:off" \ |
||||
+ "iscsi_firmware root=LABEL=sysroot ip=192.168.50.101::192.168.50.1:255.255.255.0:iscsi-1:ens3:off" \ |
||||
"netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target1 netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target2" \ |
||||
|| return 1 |
||||
return 0 |
@ -0,0 +1,127 @@
@@ -0,0 +1,127 @@
|
||||
From db110a036a13e5c99e073128ec8aa7b1fdc7e992 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Wed, 18 Dec 2013 12:28:51 +0100 |
||||
Subject: [PATCH] dracut-lib/wait_for_dev(): prevent systemd daemon-reload |
||||
|
||||
prevent a systemd daemon-reload, if it is not necessary to do. |
||||
--- |
||||
modules.d/98systemd/dracut-cmdline.sh | 2 -- |
||||
modules.d/98systemd/module-setup.sh | 2 ++ |
||||
modules.d/98systemd/rootfs-generator.sh | 30 ++++++++++++++++++++++++++++++ |
||||
modules.d/99base/dracut-lib.sh | 30 ++++++++++++++++++++++++------ |
||||
4 files changed, 56 insertions(+), 8 deletions(-) |
||||
create mode 100755 modules.d/98systemd/rootfs-generator.sh |
||||
|
||||
diff --git a/modules.d/98systemd/dracut-cmdline.sh b/modules.d/98systemd/dracut-cmdline.sh |
||||
index 50b8d6c9..36406d9d 100755 |
||||
--- a/modules.d/98systemd/dracut-cmdline.sh |
||||
+++ b/modules.d/98systemd/dracut-cmdline.sh |
||||
@@ -66,8 +66,6 @@ case "$root" in |
||||
rootok=1 ;; |
||||
esac |
||||
|
||||
-[ "${root%%:*}" = "block" ] && wait_for_dev "${root#block:}" |
||||
- |
||||
[ -z "$root" ] && die "No or empty root= argument" |
||||
[ -z "$rootok" ] && die "Don't know how to handle 'root=$root'" |
||||
|
||||
diff --git a/modules.d/98systemd/module-setup.sh b/modules.d/98systemd/module-setup.sh |
||||
index a5ac2a53..7b3dfa40 100755 |
||||
--- a/modules.d/98systemd/module-setup.sh |
||||
+++ b/modules.d/98systemd/module-setup.sh |
||||
@@ -178,6 +178,8 @@ install() { |
||||
inst_script "$moddir/dracut-mount.sh" /bin/dracut-mount |
||||
inst_script "$moddir/dracut-pre-pivot.sh" /bin/dracut-pre-pivot |
||||
|
||||
+ inst_script "$moddir/rootfs-generator.sh" /lib/systemd/system-generators/dracut-rootfs-generator |
||||
+ |
||||
inst_rules 99-systemd.rules |
||||
|
||||
for i in \ |
||||
diff --git a/modules.d/98systemd/rootfs-generator.sh b/modules.d/98systemd/rootfs-generator.sh |
||||
new file mode 100755 |
||||
index 00000000..3770c6b1 |
||||
--- /dev/null |
||||
+++ b/modules.d/98systemd/rootfs-generator.sh |
||||
@@ -0,0 +1,30 @@ |
||||
+#!/bin/sh |
||||
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- |
||||
+# ex: ts=8 sw=4 sts=4 et filetype=sh |
||||
+ |
||||
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh |
||||
+root=$(getarg root=) |
||||
+case "$root" in |
||||
+ block:LABEL=*|LABEL=*) |
||||
+ root="${root#block:}" |
||||
+ root="$(echo $root | sed 's,/,\\x2f,g')" |
||||
+ root="block:/dev/disk/by-label/${root#LABEL=}" |
||||
+ rootok=1 ;; |
||||
+ block:UUID=*|UUID=*) |
||||
+ root="${root#block:}" |
||||
+ root="block:/dev/disk/by-uuid/${root#UUID=}" |
||||
+ rootok=1 ;; |
||||
+ block:PARTUUID=*|PARTUUID=*) |
||||
+ root="${root#block:}" |
||||
+ root="block:/dev/disk/by-partuuid/${root#PARTUUID=}" |
||||
+ rootok=1 ;; |
||||
+ block:PARTLABEL=*|PARTLABEL=*) |
||||
+ root="${root#block:}" |
||||
+ root="block:/dev/disk/by-partlabel/${root#PARTLABEL=}" |
||||
+ rootok=1 ;; |
||||
+ /dev/*) |
||||
+ root="block:${root}" |
||||
+ rootok=1 ;; |
||||
+esac |
||||
+ |
||||
+[ "${root%%:*}" = "block" ] && wait_for_dev -n "${root#block:}" |
||||
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh |
||||
index 7249c589..a3476ab3 100755 |
||||
--- a/modules.d/99base/dracut-lib.sh |
||||
+++ b/modules.d/99base/dracut-lib.sh |
||||
@@ -846,7 +846,18 @@ dev_unit_name() |
||||
wait_for_dev() |
||||
{ |
||||
local _name |
||||
+ local _needreload |
||||
+ local _noreload |
||||
+ |
||||
+ if [ "$1" = "-n" ]; then |
||||
+ _noreload=1 |
||||
+ shift |
||||
+ fi |
||||
+ |
||||
_name="$(str_replace "$1" '/' '\x2f')" |
||||
+ |
||||
+ [ -e "${PREFIX}$hookdir/initqueue/finished/devexists-${_name}.sh" ] && return 0 |
||||
+ |
||||
printf '[ -e "%s" ]\n' $1 \ |
||||
>> "${PREFIX}$hookdir/initqueue/finished/devexists-${_name}.sh" |
||||
{ |
||||
@@ -859,14 +870,21 @@ wait_for_dev() |
||||
if ! [ -L ${PREFIX}/etc/systemd/system/initrd.target.wants/${_name}.device ]; then |
||||
[ -d ${PREFIX}/etc/systemd/system/initrd.target.wants ] || mkdir -p ${PREFIX}/etc/systemd/system/initrd.target.wants |
||||
ln -s ../${_name}.device ${PREFIX}/etc/systemd/system/initrd.target.wants/${_name}.device |
||||
+ _needreload=1 |
||||
fi |
||||
|
||||
- mkdir -p ${PREFIX}/etc/systemd/system/${_name}.device.d |
||||
- { |
||||
- echo "[Unit]" |
||||
- echo "JobTimeoutSec=3600" |
||||
- } > ${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf |
||||
- [ -z "$PREFIX" ] && /sbin/initqueue --onetime --unique --name daemon-reload systemctl daemon-reload |
||||
+ if ! [ -f ${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf ]; then |
||||
+ mkdir -p ${PREFIX}/etc/systemd/system/${_name}.device.d |
||||
+ { |
||||
+ echo "[Unit]" |
||||
+ echo "JobTimeoutSec=3600" |
||||
+ } > ${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf |
||||
+ _needreload=1 |
||||
+ fi |
||||
+ |
||||
+ if [ -z "$PREFIX" ] && [ "$_needreload" = 1 ] && [ -z "$_noreload" ]; then |
||||
+ /sbin/initqueue --onetime --unique --name daemon-reload systemctl daemon-reload |
||||
+ fi |
||||
fi |
||||
} |
||||
|
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
From 04220f9affcbd59dd8d95fd716bd9443eb2ea81d Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Thu, 19 Dec 2013 12:37:47 +0100 |
||||
Subject: [PATCH] kernel-modules: add more block driver |
||||
|
||||
e.g. nvme |
||||
--- |
||||
modules.d/90kernel-modules/module-setup.sh | 2 +- |
||||
1 file changed, 1 insertion(+), 1 deletion(-) |
||||
|
||||
diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh |
||||
index 510b43e1..f4db6aa8 100755 |
||||
--- a/modules.d/90kernel-modules/module-setup.sh |
||||
+++ b/modules.d/90kernel-modules/module-setup.sh |
||||
@@ -5,7 +5,7 @@ |
||||
installkernel() { |
||||
if [[ -z $drivers ]]; then |
||||
block_module_filter() { |
||||
- local _blockfuncs='ahci_init_controller|ata_scsi_ioctl|scsi_add_host|blk_init_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect' |
||||
+ local _blockfuncs='ahci_init_controller|ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect' |
||||
# subfunctions inherit following FDs |
||||
local _merge=8 _side2=9 |
||||
function bmf1() { |
@ -0,0 +1,22 @@
@@ -0,0 +1,22 @@
|
||||
From 9a177f8d51afd332fe6528d5cbe80d78d7b74a9e Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Thu, 19 Dec 2013 17:06:48 +0100 |
||||
Subject: [PATCH] network: include usbnet drivers |
||||
|
||||
--- |
||||
modules.d/40network/module-setup.sh | 2 +- |
||||
1 file changed, 1 insertion(+), 1 deletion(-) |
||||
|
||||
diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh |
||||
index d2833d0f..508dbab1 100755 |
||||
--- a/modules.d/40network/module-setup.sh |
||||
+++ b/modules.d/40network/module-setup.sh |
||||
@@ -23,7 +23,7 @@ installkernel() { |
||||
# Include wired net drivers, excluding wireless |
||||
|
||||
net_module_filter() { |
||||
- local _net_drivers='eth_type_trans|register_virtio_device' |
||||
+ local _net_drivers='eth_type_trans|register_virtio_device|usbnet_open' |
||||
local _unwanted_drivers='/(wireless|isdn|uwb)/' |
||||
local _ret |
||||
# subfunctions inherit following FDs |
@ -0,0 +1,22 @@
@@ -0,0 +1,22 @@
|
||||
From 866e663fbdedcf520388218151d0f666857b6f92 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Tue, 7 Jan 2014 16:39:48 +0100 |
||||
Subject: [PATCH] systemd/dracut-initqueue.sh: fstab is not a directory |
||||
|
||||
--- |
||||
modules.d/98systemd/dracut-initqueue.sh | 2 +- |
||||
1 file changed, 1 insertion(+), 1 deletion(-) |
||||
|
||||
diff --git a/modules.d/98systemd/dracut-initqueue.sh b/modules.d/98systemd/dracut-initqueue.sh |
||||
index 1e05dcd0..37bc18f1 100755 |
||||
--- a/modules.d/98systemd/dracut-initqueue.sh |
||||
+++ b/modules.d/98systemd/dracut-initqueue.sh |
||||
@@ -67,7 +67,7 @@ while :; do |
||||
|
||||
main_loop=$(($main_loop+1)) |
||||
if [ $main_loop -gt $RDRETRY ]; then |
||||
- if ! [ -d /sysroot/etc/fstab ] || ! [ -e /sysroot/sbin/init ] ; then |
||||
+ if ! [ -f /sysroot/etc/fstab ] || ! [ -e /sysroot/sbin/init ] ; then |
||||
action_on_fail "Could not boot." && break |
||||
fi |
||||
warn "Not all disks have been found." |
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
From 7faae1264db2d015135985c52bc2b8a2ae0636eb Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Tue, 7 Jan 2014 16:40:50 +0100 |
||||
Subject: [PATCH] iscsi/iscsiroot.sh: do not trust iscsistart return value |
||||
|
||||
--- |
||||
modules.d/95iscsi/iscsiroot.sh | 3 ++- |
||||
1 file changed, 2 insertions(+), 1 deletion(-) |
||||
|
||||
diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh |
||||
index ef090f7f..abdea5cf 100755 |
||||
--- a/modules.d/95iscsi/iscsiroot.sh |
||||
+++ b/modules.d/95iscsi/iscsiroot.sh |
||||
@@ -44,7 +44,8 @@ if getargbool 0 rd.iscsi.firmware -d -y iscsi_firmware ; then |
||||
iscsi_param="$iscsi_param --param $p" |
||||
done |
||||
|
||||
- if ! [ -e /tmp/iscsistarted-firmware ] && iscsistart -b $iscsi_param; then |
||||
+ if ! [ -e /tmp/iscsistarted-firmware ]; then |
||||
+ iscsistart -b $iscsi_param |
||||
echo 'started' > "/tmp/iscsistarted-iscsi" |
||||
echo 'started' > "/tmp/iscsistarted-firmware" |
||||
need_shutdown |
@ -0,0 +1,21 @@
@@ -0,0 +1,21 @@
|
||||
From ea9b961e8cffc30f131d62d21bcbd18b0482b7f6 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Wed, 8 Jan 2014 15:37:18 +0100 |
||||
Subject: [PATCH] dracut.sh: add missing piece for option --add-device |
||||
|
||||
--- |
||||
dracut.sh | 1 + |
||||
1 file changed, 1 insertion(+) |
||||
|
||||
diff --git a/dracut.sh b/dracut.sh |
||||
index bb7e91e6..9a6521ec 100755 |
||||
--- a/dracut.sh |
||||
+++ b/dracut.sh |
||||
@@ -307,6 +307,7 @@ TEMP=$(unset POSIXLY_CORRECT; getopt \ |
||||
--long add-fstab: \ |
||||
--long mount: \ |
||||
--long device: \ |
||||
+ --long add-device: \ |
||||
--long nofscks: \ |
||||
--long ro-mnt \ |
||||
--long kmoddir: \ |
@ -0,0 +1,26 @@
@@ -0,0 +1,26 @@
|
||||
From 82286609c9736a967f36f0d77cdc585da7f3f506 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Wed, 8 Jan 2014 15:38:44 +0100 |
||||
Subject: [PATCH] dracut.sh: add /boot/efi to device paths |
||||
|
||||
Add /boot/efi to device paths, so the filesystem driver is included |
||||
and it can be repaired in the initramfs. |
||||
--- |
||||
dracut.sh | 4 +++- |
||||
1 file changed, 3 insertions(+), 1 deletion(-) |
||||
|
||||
diff --git a/dracut.sh b/dracut.sh |
||||
index 9a6521ec..cf027e7d 100755 |
||||
--- a/dracut.sh |
||||
+++ b/dracut.sh |
||||
@@ -917,7 +917,9 @@ if [[ $hostonly ]]; then |
||||
"/usr/sbin" \ |
||||
"/usr/lib" \ |
||||
"/usr/lib64" \ |
||||
- "/boot"; |
||||
+ "/boot" \ |
||||
+ "/boot/efi" \ |
||||
+ ; |
||||
do |
||||
mp=$(readlink -f "$mp") |
||||
mountpoint "$mp" >/dev/null 2>&1 || continue |
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
From d1e9a5e3840b569aa8de6daba0e9ffd40b315a23 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Wed, 15 Jan 2014 14:35:53 +0100 |
||||
Subject: [PATCH] network: include all ethernet drivers |
||||
|
||||
--- |
||||
modules.d/40network/module-setup.sh | 8 ++++++-- |
||||
1 file changed, 6 insertions(+), 2 deletions(-) |
||||
|
||||
diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh |
||||
index 508dbab1..a5e796f4 100755 |
||||
--- a/modules.d/40network/module-setup.sh |
||||
+++ b/modules.d/40network/module-setup.sh |
||||
@@ -24,7 +24,7 @@ installkernel() { |
||||
|
||||
net_module_filter() { |
||||
local _net_drivers='eth_type_trans|register_virtio_device|usbnet_open' |
||||
- local _unwanted_drivers='/(wireless|isdn|uwb)/' |
||||
+ local _unwanted_drivers='/(wireless|isdn|uwb|net/ethernet|net/phy|net/team)/' |
||||
local _ret |
||||
# subfunctions inherit following FDs |
||||
local _merge=8 _side2=9 |
||||
@@ -64,7 +64,11 @@ installkernel() { |
||||
| net_module_filter | instmods |
||||
|
||||
#instmods() will take care of hostonly |
||||
- instmods =drivers/net/phy ecb arc4 bridge stp llc ipv6 bonding 8021q af_packet virtio_net =drivers/net/team |
||||
+ instmods \ |
||||
+ =drivers/net/phy \ |
||||
+ =drivers/net/team \ |
||||
+ =drivers/net/ethernet \ |
||||
+ ecb arc4 bridge stp llc ipv6 bonding 8021q af_packet virtio_net |
||||
} |
||||
|
||||
install() { |
@ -0,0 +1,43 @@
@@ -0,0 +1,43 @@
|
||||
From cb97abc7bb304a9eb8d6f6c29eaa62e9525117fb Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Fri, 17 Jan 2014 11:52:43 +0100 |
||||
Subject: [PATCH] dracut-install,dracut: fix ldd output parsing |
||||
|
||||
dracut-install could not handle output like: |
||||
/lib/$LIB/liblsp.so => /lib/lib64/liblsp.so (0x00007faf00727000) |
||||
|
||||
also unset LD_PRELOAD, so we get a clean environment |
||||
--- |
||||
dracut.sh | 1 + |
||||
install/dracut-install.c | 6 +++++- |
||||
2 files changed, 6 insertions(+), 1 deletion(-) |
||||
|
||||
diff --git a/dracut.sh b/dracut.sh |
||||
index cf027e7d..8d572a33 100755 |
||||
--- a/dracut.sh |
||||
+++ b/dracut.sh |
||||
@@ -545,6 +545,7 @@ export LC_ALL=C |
||||
export LANG=C |
||||
unset NPATH |
||||
unset LD_LIBRARY_PATH |
||||
+unset LD_PRELOAD |
||||
unset GREP_OPTIONS |
||||
|
||||
export DRACUT_LOG_LEVEL=warning |
||||
diff --git a/install/dracut-install.c b/install/dracut-install.c |
||||
index 6b9c613b..c5e4b05f 100644 |
||||
--- a/install/dracut-install.c |
||||
+++ b/install/dracut-install.c |
||||
@@ -391,7 +391,11 @@ static int resolve_deps(const char *src) |
||||
if (strstr(buf, destrootdir)) |
||||
break; |
||||
|
||||
- p = strchr(buf, '/'); |
||||
+ p = strstr(buf, "=>"); |
||||
+ if (!p) |
||||
+ p = buf; |
||||
+ |
||||
+ p = strchr(p, '/'); |
||||
if (p) { |
||||
for (q = p; *q && *q != ' ' && *q != '\n'; q++) ; |
||||
*q = '\0'; |
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
From aa6ab2747106225b562e9b87f13703d0dee5679f Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Fri, 17 Jan 2014 13:40:42 +0100 |
||||
Subject: [PATCH] systemd: add 71-seat.rules 73-seat-late.rules |
||||
|
||||
otherwise plymouth does not work |
||||
--- |
||||
modules.d/98systemd/module-setup.sh | 2 +- |
||||
1 file changed, 1 insertion(+), 1 deletion(-) |
||||
|
||||
diff --git a/modules.d/98systemd/module-setup.sh b/modules.d/98systemd/module-setup.sh |
||||
index 7b3dfa40..7178d2ba 100755 |
||||
--- a/modules.d/98systemd/module-setup.sh |
||||
+++ b/modules.d/98systemd/module-setup.sh |
||||
@@ -180,7 +180,7 @@ install() { |
||||
|
||||
inst_script "$moddir/rootfs-generator.sh" /lib/systemd/system-generators/dracut-rootfs-generator |
||||
|
||||
- inst_rules 99-systemd.rules |
||||
+ inst_rules 71-seat.rules 73-seat-late.rules 99-systemd.rules |
||||
|
||||
for i in \ |
||||
emergency.target \ |
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
From 254f437848ca7e73535a9a5bf21478b0a62568f4 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Fri, 17 Jan 2014 14:01:33 +0100 |
||||
Subject: [PATCH] systemd: add seat udev rules and mask loginctl |
||||
|
||||
--- |
||||
modules.d/98systemd/module-setup.sh | 3 +++ |
||||
1 file changed, 3 insertions(+) |
||||
|
||||
diff --git a/modules.d/98systemd/module-setup.sh b/modules.d/98systemd/module-setup.sh |
||||
index 7178d2ba..a99c699d 100755 |
||||
--- a/modules.d/98systemd/module-setup.sh |
||||
+++ b/modules.d/98systemd/module-setup.sh |
||||
@@ -180,6 +180,9 @@ install() { |
||||
|
||||
inst_script "$moddir/rootfs-generator.sh" /lib/systemd/system-generators/dracut-rootfs-generator |
||||
|
||||
+ inst_binary true |
||||
+ ln_r $(type -P true) "/usr/bin/loginctl" |
||||
+ ln_r $(type -P true) "/bin/loginctl" |
||||
inst_rules 71-seat.rules 73-seat-late.rules 99-systemd.rules |
||||
|
||||
for i in \ |
@ -0,0 +1,32 @@
@@ -0,0 +1,32 @@
|
||||
From 834f33440ff9890235908c46d1d24f4f72f0739c Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Fri, 17 Jan 2014 14:01:57 +0100 |
||||
Subject: [PATCH] systemd/module-setup.sh: make use of "ln_r" |
||||
|
||||
--- |
||||
modules.d/98systemd/module-setup.sh | 6 +++--- |
||||
1 file changed, 3 insertions(+), 3 deletions(-) |
||||
|
||||
diff --git a/modules.d/98systemd/module-setup.sh b/modules.d/98systemd/module-setup.sh |
||||
index a99c699d..511b883f 100755 |
||||
--- a/modules.d/98systemd/module-setup.sh |
||||
+++ b/modules.d/98systemd/module-setup.sh |
||||
@@ -160,15 +160,15 @@ install() { |
||||
egrep '^systemd-journal:' "$initdir/etc/passwd" 2>/dev/null >> "$initdir/etc/passwd" |
||||
egrep '^systemd-journal:' /etc/group >> "$initdir/etc/group" |
||||
|
||||
- ln -fs $systemdutildir/systemd "$initdir/init" |
||||
- ln -fs $systemdutildir/systemd "$initdir/sbin/init" |
||||
+ ln_r $systemdutildir/systemd "/init" |
||||
+ ln_r $systemdutildir/systemd "/sbin/init" |
||||
|
||||
inst_script "$moddir/dracut-emergency.sh" /bin/dracut-emergency |
||||
inst_simple "$moddir/emergency.service" ${systemdsystemunitdir}/emergency.service |
||||
inst_simple "$moddir/dracut-emergency.service" ${systemdsystemunitdir}/dracut-emergency.service |
||||
inst_simple "$moddir/emergency.service" ${systemdsystemunitdir}/rescue.service |
||||
|
||||
- ln -fs initrd.target "${initdir}${systemdsystemunitdir}/default.target" |
||||
+ ln_r "${systemdsystemunitdir}/initrd.target" "${systemdsystemunitdir}/default.target" |
||||
|
||||
inst_script "$moddir/dracut-cmdline.sh" /bin/dracut-cmdline |
||||
inst_script "$moddir/dracut-pre-udev.sh" /bin/dracut-pre-udev |
@ -0,0 +1,41 @@
@@ -0,0 +1,41 @@
|
||||
From 5183c9a58815970a5edc667cb6f531d7dace22ff Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Fri, 17 Jan 2014 14:37:55 +0100 |
||||
Subject: [PATCH] network: add rd.bootif=0 to ignore BOOTIF |
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1044623 |
||||
--- |
||||
dracut.cmdline.7.asc | 6 ++++++ |
||||
modules.d/40network/parse-ip-opts.sh | 2 +- |
||||
2 files changed, 7 insertions(+), 1 deletion(-) |
||||
|
||||
diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc |
||||
index 8ac53414..963ba074 100644 |
||||
--- a/dracut.cmdline.7.asc |
||||
+++ b/dracut.cmdline.7.asc |
||||
@@ -484,6 +484,12 @@ interface name. Better name it "bootnet" or "bluesocket". |
||||
specify network interface to use routing and netroot information from. |
||||
Required if multiple ip= lines are used. |
||||
|
||||
+**BOOTIF=**__<MAC>__:: |
||||
+ specify network interface to use routing and netroot information from. |
||||
+ |
||||
+**rd.bootif=0**:: |
||||
+ Disable BOOTIF parsing, which is provided by PXE |
||||
+ |
||||
**nameserver=**__<IP>__ [**nameserver=**__<IP>__ ...]:: |
||||
specify nameserver(s) to use |
||||
|
||||
diff --git a/modules.d/40network/parse-ip-opts.sh b/modules.d/40network/parse-ip-opts.sh |
||||
index 4bf286d8..7e735741 100755 |
||||
--- a/modules.d/40network/parse-ip-opts.sh |
||||
+++ b/modules.d/40network/parse-ip-opts.sh |
||||
@@ -108,7 +108,7 @@ for p in $(getargs ip=); do |
||||
done |
||||
|
||||
# put BOOTIF in IFACES to make sure it comes up |
||||
-if BOOTIF="$(getarg BOOTIF=)"; then |
||||
+if getargbool 1 "rd.bootif" && BOOTIF="$(getarg BOOTIF=)"; then |
||||
BOOTDEV=$(fix_bootif $BOOTIF) |
||||
IFACES="$BOOTDEV $IFACES" |
||||
fi |
@ -0,0 +1,49 @@
@@ -0,0 +1,49 @@
|
||||
From 9bdbbe90efb11dfb840f9e9de0daf6388fa0f47f Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Fri, 17 Jan 2014 14:45:15 +0100 |
||||
Subject: [PATCH] iscsi: call "iscsistart -b" until it succeeds |
||||
|
||||
--- |
||||
modules.d/95iscsi/iscsiroot.sh | 11 ++++++++++- |
||||
modules.d/95iscsi/parse-iscsiroot.sh | 2 +- |
||||
2 files changed, 11 insertions(+), 2 deletions(-) |
||||
|
||||
diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh |
||||
index abdea5cf..156003c0 100755 |
||||
--- a/modules.d/95iscsi/iscsiroot.sh |
||||
+++ b/modules.d/95iscsi/iscsiroot.sh |
||||
@@ -45,11 +45,20 @@ if getargbool 0 rd.iscsi.firmware -d -y iscsi_firmware ; then |
||||
done |
||||
|
||||
if ! [ -e /tmp/iscsistarted-firmware ]; then |
||||
- iscsistart -b $iscsi_param |
||||
+ if ! iscsistart -f | vinfo; then |
||||
+ warn "iscistart: Could not get list of targets from firmware." |
||||
+ exit 1 |
||||
+ fi |
||||
+ |
||||
+ if ! iscsistart -b $iscsi_param 2>&1 | vinfo; then |
||||
+ warn "\`iscsistart -b $iscsi_param\´ failed" |
||||
+ exit 1 |
||||
+ fi |
||||
echo 'started' > "/tmp/iscsistarted-iscsi" |
||||
echo 'started' > "/tmp/iscsistarted-firmware" |
||||
need_shutdown |
||||
fi |
||||
+ |
||||
[ "$netif" = dummy ] && exit 0 |
||||
fi |
||||
|
||||
diff --git a/modules.d/95iscsi/parse-iscsiroot.sh b/modules.d/95iscsi/parse-iscsiroot.sh |
||||
index 77bd9913..e463addb 100755 |
||||
--- a/modules.d/95iscsi/parse-iscsiroot.sh |
||||
+++ b/modules.d/95iscsi/parse-iscsiroot.sh |
||||
@@ -64,7 +64,7 @@ if [ -n "$iscsi_firmware" ] ; then |
||||
netroot=${netroot:-iscsi} |
||||
modprobe -q iscsi_boot_sysfs 2>/dev/null |
||||
modprobe -q iscsi_ibft |
||||
- initqueue --onetime --settled /sbin/iscsiroot dummy "$netroot" "$NEWROOT" |
||||
+ initqueue --settled /sbin/iscsiroot dummy "$netroot" "$NEWROOT" |
||||
fi |
||||
|
||||
# If it's not iscsi we don't continue |
@ -0,0 +1,55 @@
@@ -0,0 +1,55 @@
|
||||
From 779f980658ab223773ef065ac3f833aacd374c53 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Fri, 17 Jan 2014 15:27:47 +0100 |
||||
Subject: [PATCH] base/dracut-lib.sh: "halt" the machine in systemd mode for |
||||
die() |
||||
|
||||
and only go in emergency shell if "rd.debug" is specified |
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1053655 |
||||
--- |
||||
modules.d/99base/dracut-lib.sh | 19 ++++++++++++++++--- |
||||
1 file changed, 16 insertions(+), 3 deletions(-) |
||||
|
||||
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh |
||||
index a3476ab3..e74b93fa 100755 |
||||
--- a/modules.d/99base/dracut-lib.sh |
||||
+++ b/modules.d/99base/dracut-lib.sh |
||||
@@ -1,4 +1,4 @@ |
||||
-#!/bin/sh |
||||
+!/bin/sh |
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- |
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh |
||||
|
||||
@@ -430,8 +430,15 @@ die() { |
||||
echo "warn dracut: Refusing to continue"; |
||||
} >> $hookdir/emergency/01-die.sh |
||||
[ -d /run/initramfs ] || mkdir -p -- /run/initramfs |
||||
+ |
||||
> /run/initramfs/.die |
||||
- emergency_shell |
||||
+ |
||||
+ getargbool 0 "rd.debug=" && emergency_shell |
||||
+ |
||||
+ if [ -n "$DRACUT_SYSTEMD" ]; then |
||||
+ systemctl --no-block --force halt |
||||
+ fi |
||||
+ |
||||
exit 1 |
||||
} |
||||
|
||||
@@ -1045,7 +1052,13 @@ emergency_shell() |
||||
# cause a kernel panic |
||||
exit 1 |
||||
fi |
||||
- [ -e /run/initramfs/.die ] && exit 1 |
||||
+ |
||||
+ if [ -e /run/initramfs/.die ]; then |
||||
+ if [ -n "$DRACUT_SYSTEMD" ]; then |
||||
+ systemctl --no-block --force halt |
||||
+ fi |
||||
+ exit 1 |
||||
+ fi |
||||
} |
||||
|
||||
action_on_fail() |
@ -0,0 +1,19 @@
@@ -0,0 +1,19 @@
|
||||
From 9d47a90b12dd5aa34488be2d5e6ff082c6713b8d Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Fri, 17 Jan 2014 12:16:41 +0100 |
||||
Subject: [PATCH] systemd/rootfs-generator.sh: exit 0 |
||||
|
||||
--- |
||||
modules.d/98systemd/rootfs-generator.sh | 2 ++ |
||||
1 file changed, 2 insertions(+) |
||||
|
||||
diff --git a/modules.d/98systemd/rootfs-generator.sh b/modules.d/98systemd/rootfs-generator.sh |
||||
index 3770c6b1..555027f3 100755 |
||||
--- a/modules.d/98systemd/rootfs-generator.sh |
||||
+++ b/modules.d/98systemd/rootfs-generator.sh |
||||
@@ -28,3 +28,5 @@ case "$root" in |
||||
esac |
||||
|
||||
[ "${root%%:*}" = "block" ] && wait_for_dev -n "${root#block:}" |
||||
+ |
||||
+exit 0 |
@ -0,0 +1,22 @@
@@ -0,0 +1,22 @@
|
||||
From 0ab5e8adc8c7132c4f858bcfe7bd7f8c493282d9 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Fri, 17 Jan 2014 13:40:05 +0100 |
||||
Subject: [PATCH] systemd/rootfs-generator.sh: ignore legacy root=/dev/nfs |
||||
|
||||
--- |
||||
modules.d/98systemd/rootfs-generator.sh | 2 ++ |
||||
1 file changed, 2 insertions(+) |
||||
|
||||
diff --git a/modules.d/98systemd/rootfs-generator.sh b/modules.d/98systemd/rootfs-generator.sh |
||||
index 555027f3..9810026d 100755 |
||||
--- a/modules.d/98systemd/rootfs-generator.sh |
||||
+++ b/modules.d/98systemd/rootfs-generator.sh |
||||
@@ -22,6 +22,8 @@ case "$root" in |
||||
root="${root#block:}" |
||||
root="block:/dev/disk/by-partlabel/${root#PARTLABEL=}" |
||||
rootok=1 ;; |
||||
+ /dev/nfs) # ignore legacy /dev/nfs |
||||
+ ;; |
||||
/dev/*) |
||||
root="block:${root}" |
||||
rootok=1 ;; |
@ -0,0 +1,19 @@
@@ -0,0 +1,19 @@
|
||||
From d11012969527a027ad2db8d06e374fb8f04e7f45 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Mon, 20 Jan 2014 14:59:46 +0100 |
||||
Subject: [PATCH] dracut-lib.sh: fixed shebang |
||||
|
||||
--- |
||||
modules.d/99base/dracut-lib.sh | 2 +- |
||||
1 file changed, 1 insertion(+), 1 deletion(-) |
||||
|
||||
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh |
||||
index e74b93fa..cd628519 100755 |
||||
--- a/modules.d/99base/dracut-lib.sh |
||||
+++ b/modules.d/99base/dracut-lib.sh |
||||
@@ -1,4 +1,4 @@ |
||||
-!/bin/sh |
||||
+#!/bin/sh |
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- |
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh |
||||
|
@ -0,0 +1,147 @@
@@ -0,0 +1,147 @@
|
||||
From 6c7c8d8a071694efd0c7e450fa78e71224a8ced4 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Wed, 22 Jan 2014 17:05:22 +0100 |
||||
Subject: [PATCH] iscsi: more iscsiroot fixes |
||||
|
||||
handle iscsiroot with firmware more gracefully |
||||
--- |
||||
modules.d/95iscsi/iscsiroot.sh | 68 +++++++++++++++++++++++++----------- |
||||
modules.d/95iscsi/parse-iscsiroot.sh | 6 ++-- |
||||
2 files changed, 50 insertions(+), 24 deletions(-) |
||||
|
||||
diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh |
||||
index 156003c0..68687102 100755 |
||||
--- a/modules.d/95iscsi/iscsiroot.sh |
||||
+++ b/modules.d/95iscsi/iscsiroot.sh |
||||
@@ -31,36 +31,45 @@ iroot="$2" |
||||
# If it's not iscsi we don't continue |
||||
[ "${iroot%%:*}" = "iscsi" ] || exit 1 |
||||
|
||||
-iroot=${iroot#iscsi:} |
||||
+iroot=${iroot#iscsi} |
||||
+iroot=${iroot#:} |
||||
|
||||
# XXX modprobe crc32c should go in the cmdline parser, but I haven't yet |
||||
# figured out a way how to check whether this is built-in or not |
||||
modprobe crc32c 2>/dev/null |
||||
|
||||
-[ -e /sys/module/bnx2i ] && iscsiuio |
||||
- |
||||
-if getargbool 0 rd.iscsi.firmware -d -y iscsi_firmware ; then |
||||
- for p in $(getargs rd.iscsi.param -d iscsi_param); do |
||||
- iscsi_param="$iscsi_param --param $p" |
||||
- done |
||||
+if [ -e /sys/module/bnx2i ] && ! [ -e /tmp/iscsiuio-started ]; then |
||||
+ iscsiuio |
||||
+ > /tmp/iscsiuio-started |
||||
+fi |
||||
|
||||
+handle_firmware() |
||||
+{ |
||||
if ! [ -e /tmp/iscsistarted-firmware ]; then |
||||
- if ! iscsistart -f | vinfo; then |
||||
+ if ! iscsistart -f; then |
||||
warn "iscistart: Could not get list of targets from firmware." |
||||
- exit 1 |
||||
+ return 1 |
||||
fi |
||||
|
||||
- if ! iscsistart -b $iscsi_param 2>&1 | vinfo; then |
||||
+ for p in $(getargs rd.iscsi.param -d iscsi_param); do |
||||
+ iscsi_param="$iscsi_param --param $p" |
||||
+ done |
||||
+ |
||||
+ if ! iscsistart -b $iscsi_param; then |
||||
warn "\`iscsistart -b $iscsi_param\´ failed" |
||||
- exit 1 |
||||
fi |
||||
- echo 'started' > "/tmp/iscsistarted-iscsi" |
||||
- echo 'started' > "/tmp/iscsistarted-firmware" |
||||
+ |
||||
+ if [ -d /sys/class/iscsi_session ]; then |
||||
+ echo 'started' > "/tmp/iscsistarted-iscsi" |
||||
+ echo 'started' > "/tmp/iscsistarted-firmware" |
||||
+ else |
||||
+ return 1 |
||||
+ fi |
||||
+ |
||||
need_shutdown |
||||
fi |
||||
- |
||||
- [ "$netif" = dummy ] && exit 0 |
||||
-fi |
||||
+ return 0 |
||||
+} |
||||
|
||||
|
||||
handle_netroot() |
||||
@@ -171,21 +180,38 @@ handle_netroot() |
||||
|
||||
netroot_enc=$(str_replace "$1" '/' '\2f') |
||||
echo 'started' > "/tmp/iscsistarted-iscsi:${netroot_enc}" |
||||
- |
||||
} |
||||
|
||||
+ret=0 |
||||
+ |
||||
# loop over all netroot parameter |
||||
if getarg netroot; then |
||||
for nroot in $(getargs netroot); do |
||||
- [ "${netroot%%:*}" = "iscsi" ] || continue |
||||
- handle_netroot ${nroot##iscsi:} |
||||
+ [ "${nroot%%:*}" = "iscsi" ] || continue |
||||
+ nroot="${nroot##iscsi:}" |
||||
+ if [ -n "$nroot" ]; then |
||||
+ handle_netroot "$nroot" |
||||
+ ret=$(($ret + $?)) |
||||
+ fi |
||||
done |
||||
+ if getargbool 0 rd.iscsi.firmware -d -y iscsi_firmware ; then |
||||
+ handle_firmware |
||||
+ ret=$(($ret + $?)) |
||||
+ fi |
||||
else |
||||
- handle_netroot $iroot |
||||
+ if [ -n "$iroot" ]; then |
||||
+ handle_netroot "$iroot" |
||||
+ ret=$? |
||||
+ else |
||||
+ if getargbool 0 rd.iscsi.firmware -d -y iscsi_firmware ; then |
||||
+ handle_firmware |
||||
+ ret=$? |
||||
+ fi |
||||
+ fi |
||||
fi |
||||
|
||||
need_shutdown |
||||
|
||||
# now we have a root filesystem somewhere in /dev/sda* |
||||
# let the normal block handler handle root= |
||||
-exit 0 |
||||
+exit $ret |
||||
diff --git a/modules.d/95iscsi/parse-iscsiroot.sh b/modules.d/95iscsi/parse-iscsiroot.sh |
||||
index e463addb..4be9d561 100755 |
||||
--- a/modules.d/95iscsi/parse-iscsiroot.sh |
||||
+++ b/modules.d/95iscsi/parse-iscsiroot.sh |
||||
@@ -61,10 +61,10 @@ fi |
||||
|
||||
# iscsi_firmware does not need argument checking |
||||
if [ -n "$iscsi_firmware" ] ; then |
||||
- netroot=${netroot:-iscsi} |
||||
+ netroot=${netroot:-iscsi:} |
||||
modprobe -q iscsi_boot_sysfs 2>/dev/null |
||||
modprobe -q iscsi_ibft |
||||
- initqueue --settled /sbin/iscsiroot dummy "$netroot" "$NEWROOT" |
||||
+ initqueue --onetime --timeout "/sbin/iscsiroot dummy '$netroot' '$NEWROOT'" |
||||
fi |
||||
|
||||
# If it's not iscsi we don't continue |
||||
@@ -88,7 +88,7 @@ fi |
||||
|
||||
if [ -n "$netroot" ] && [ "$root" != "/dev/root" ] && [ "$root" != "dhcp" ]; then |
||||
if ! getargbool 1 rd.neednet >/dev/null || ! getarg "ip="; then |
||||
- initqueue --onetime --settled /sbin/iscsiroot dummy "$netroot" "$NEWROOT" |
||||
+ initqueue --onetime --settled "/sbin/iscsiroot dummy '$netroot' '$NEWROOT'" |
||||
fi |
||||
fi |
||||
|
@ -0,0 +1,22 @@
@@ -0,0 +1,22 @@
|
||||
From 56a5975f91cf897d09ac3b5b74342fff48e7aea3 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Fri, 24 Jan 2014 16:35:08 +0100 |
||||
Subject: [PATCH] iscsiroot: touch the right marker file |
||||
|
||||
--- |
||||
modules.d/95iscsi/iscsiroot.sh | 2 +- |
||||
1 file changed, 1 insertion(+), 1 deletion(-) |
||||
|
||||
diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh |
||||
index 68687102..60a180dd 100755 |
||||
--- a/modules.d/95iscsi/iscsiroot.sh |
||||
+++ b/modules.d/95iscsi/iscsiroot.sh |
||||
@@ -60,7 +60,7 @@ handle_firmware() |
||||
fi |
||||
|
||||
if [ -d /sys/class/iscsi_session ]; then |
||||
- echo 'started' > "/tmp/iscsistarted-iscsi" |
||||
+ echo 'started' > "/tmp/iscsistarted-iscsi:" |
||||
echo 'started' > "/tmp/iscsistarted-firmware" |
||||
else |
||||
return 1 |
@ -0,0 +1,32 @@
@@ -0,0 +1,32 @@
|
||||
From 3c4e663251aa64d7946e8a2c91a8bc5eae444182 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Fri, 24 Jan 2014 16:37:13 +0100 |
||||
Subject: [PATCH] lvm:lvm_scan.sh handle one LV at a time with lvchange |
||||
|
||||
--- |
||||
modules.d/90lvm/lvm_scan.sh | 12 +++++++----- |
||||
1 file changed, 7 insertions(+), 5 deletions(-) |
||||
|
||||
diff --git a/modules.d/90lvm/lvm_scan.sh b/modules.d/90lvm/lvm_scan.sh |
||||
index 85ecd4df..f87831c7 100755 |
||||
--- a/modules.d/90lvm/lvm_scan.sh |
||||
+++ b/modules.d/90lvm/lvm_scan.sh |
||||
@@ -107,11 +107,13 @@ fi |
||||
if [ -n "$LVS" ] ; then |
||||
info "Scanning devices $lvmdevs for LVM logical volumes $LVS" |
||||
lvm lvscan --ignorelockingfailure 2>&1 | vinfo |
||||
- if [ -z "$sysinit" ]; then |
||||
- lvm lvchange --yes -ay --ignorelockingfailure $nopoll --ignoremonitoring $LVS 2>&1 | vinfo |
||||
- else |
||||
- lvm lvchange --yes -ay $sysinit $LVS 2>&1 | vinfo |
||||
- fi |
||||
+ for LV in $LVS; do |
||||
+ if [ -z "$sysinit" ]; then |
||||
+ lvm lvchange --yes -ay --ignorelockingfailure $nopoll --ignoremonitoring $LV 2>&1 | vinfo |
||||
+ else |
||||
+ lvm lvchange --yes -ay $sysinit $LV 2>&1 | vinfo |
||||
+ fi |
||||
+ done |
||||
fi |
||||
|
||||
if [ -z "$LVS" -o -n "$VGS" ]; then |
@ -0,0 +1,31 @@
@@ -0,0 +1,31 @@
|
||||
From 74c9df58f25736aea0da8c56e15d047dc6a9cb5a Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Wed, 22 Jan 2014 11:48:45 +0100 |
||||
Subject: [PATCH] dracut-logger.sh: systemd-cat only understands prio 0-7 |
||||
|
||||
--- |
||||
dracut-logger.sh | 4 ++-- |
||||
1 file changed, 2 insertions(+), 2 deletions(-) |
||||
|
||||
diff --git a/dracut-logger.sh b/dracut-logger.sh |
||||
index f679dc94..70b0da4c 100755 |
||||
--- a/dracut-logger.sh |
||||
+++ b/dracut-logger.sh |
||||
@@ -154,7 +154,7 @@ dlog_init() { |
||||
readonly _systemdcatfile="$_dlogdir/systemd-cat" |
||||
mkfifo "$_systemdcatfile" |
||||
readonly _dlogfd=15 |
||||
- systemd-cat -t 'dracut' <"$_systemdcatfile" & |
||||
+ systemd-cat -t 'dracut' --level-prefix=true <"$_systemdcatfile" & |
||||
exec 15>"$_systemdcatfile" |
||||
elif ! [ -S /dev/log -a -w /dev/log ] || ! command -v logger >/dev/null; then |
||||
# We cannot log to syslog, so turn this facility off. |
||||
@@ -330,7 +330,7 @@ _do_dlog() { |
||||
|
||||
if (( $lvl <= $sysloglvl )); then |
||||
if [[ "$_dlogfd" ]]; then |
||||
- echo "<$(_dlvl2syslvl $lvl)>$msg" >&$_dlogfd |
||||
+ printf -- "<%s>%s\n" "$(($(_dlvl2syslvl $lvl) & 7))" "$msg" >&$_dlogfd |
||||
else |
||||
logger -t "dracut[$$]" -p $(_lvl2syspri $lvl) -- "$msg" |
||||
fi |
@ -0,0 +1,34 @@
@@ -0,0 +1,34 @@
|
||||
From dfaeee7341acba43367dd26bce9143d8a5c08ac5 Mon Sep 17 00:00:00 2001 |
||||
From: Koen Kooi <koen@dominion.thruhere.net> |
||||
Date: Fri, 10 Jan 2014 21:41:43 +0100 |
||||
Subject: [PATCH] Use builtin xz/lzma option to use all cores for multihreaded |
||||
compression |
||||
|
||||
This removes the dependency on 'getconf' as well, which is not installed by default on my embedded systems. |
||||
|
||||
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> |
||||
--- |
||||
dracut.sh | 6 ++---- |
||||
1 file changed, 2 insertions(+), 4 deletions(-) |
||||
|
||||
diff --git a/dracut.sh b/dracut.sh |
||||
index 8d572a33..ad57218d 100755 |
||||
--- a/dracut.sh |
||||
+++ b/dracut.sh |
||||
@@ -695,14 +695,12 @@ stdloglvl=$((stdloglvl + verbosity_mod_l)) |
||||
# eliminate IFS hackery when messing with fw_dir |
||||
fw_dir=${fw_dir//:/ } |
||||
|
||||
-cpu_count=$(getconf _NPROCESSORS_ONLN) |
||||
- |
||||
# handle compression options. |
||||
[[ $compress ]] || compress="gzip" |
||||
case $compress in |
||||
bzip2) compress="bzip2 -9";; |
||||
- lzma) compress="lzma -9 ${cpu_count:+-T$cpu_count}";; |
||||
- xz) compress="xz --check=crc32 --lzma2=dict=1MiB ${cpu_count:+-T$cpu_count}";; |
||||
+ lzma) compress="lzma -9 -T0";; |
||||
+ xz) compress="xz --check=crc32 --lzma2=dict=1MiB -T0";; |
||||
gzip) compress="gzip -9"; command -v pigz > /dev/null 2>&1 && compress="pigz -9";; |
||||
lzo) compress="lzop -9";; |
||||
lz4) compress="lz4 -9";; |
@ -0,0 +1,87 @@
@@ -0,0 +1,87 @@
|
||||
From a0b85db18e163a14144230ae67c43ac23246b7ea Mon Sep 17 00:00:00 2001 |
||||
From: Koen Kooi <koen@dominion.thruhere.net> |
||||
Date: Thu, 16 Jan 2014 11:00:54 +0100 |
||||
Subject: [PATCH] dracut-initramfs-restore,lsinitrd: add LZ4 support |
||||
|
||||
Dracut claims to have LZ4 support, but trying to use it will result in an xzcat failure at the end due to missing CAT support. |
||||
|
||||
The lz4 command chokes on '--', so abstract that out into the CAT select. |
||||
|
||||
Something similar will need to be done for LZO. |
||||
|
||||
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> |
||||
--- |
||||
dracut-initramfs-restore.sh | 2 ++ |
||||
lsinitrd.sh | 22 ++++++++++++---------- |
||||
2 files changed, 14 insertions(+), 10 deletions(-) |
||||
|
||||
diff --git a/dracut-initramfs-restore.sh b/dracut-initramfs-restore.sh |
||||
index ec5fe180..f29c8146 100644 |
||||
--- a/dracut-initramfs-restore.sh |
||||
+++ b/dracut-initramfs-restore.sh |
||||
@@ -20,6 +20,8 @@ if zcat "$IMG" | cpio -id --quiet >/dev/null; then |
||||
rm -f -- .need_shutdown |
||||
elif xzcat "$IMG" | cpio -id --quiet >/dev/null; then |
||||
rm -f -- .need_shutdown |
||||
+elif lz4 -d -c "$IMG" | cpio -id --quiet >/dev/null; then |
||||
+ rm -f -- .need_shutdown |
||||
else |
||||
# something failed, so we clean up |
||||
echo "Unpacking of $IMG to /run/initramfs failed" >&2 |
||||
diff --git a/lsinitrd.sh b/lsinitrd.sh |
||||
index 584c29a9..f9f243bb 100755 |
||||
--- a/lsinitrd.sh |
||||
+++ b/lsinitrd.sh |
||||
@@ -106,15 +106,17 @@ fi |
||||
read -N 6 bin < "$image" |
||||
case $bin in |
||||
$'\x1f\x8b'*) |
||||
- CAT="zcat";; |
||||
+ CAT="zcat --";; |
||||
BZh*) |
||||
- CAT="bzcat";; |
||||
+ CAT="bzcat --";; |
||||
$'\x71\xc7'*|070701) |
||||
- CAT="cat";; |
||||
+ CAT="cat --";; |
||||
+ $'\x04\x22'*) |
||||
+ CAT="lz4 -d -c";; |
||||
*) |
||||
- CAT="xzcat"; |
||||
+ CAT="xzcat --"; |
||||
if echo "test"|xz|xzcat --single-stream >/dev/null 2>&1; then |
||||
- CAT="xzcat --single-stream" |
||||
+ CAT="xzcat --single-stream --" |
||||
fi |
||||
;; |
||||
esac |
||||
@@ -126,7 +128,7 @@ if (( ${#filenames[@]} > 0 )); then |
||||
for f in ${!filenames[@]}; do |
||||
[[ $nofileinfo ]] || echo "initramfs:/$f" |
||||
[[ $nofileinfo ]] || echo "========================================================================" |
||||
- $CAT -- $image | cpio --extract --verbose --quiet --to-stdout $f 2>/dev/null |
||||
+ $CAT $image | cpio --extract --verbose --quiet --to-stdout $f 2>/dev/null |
||||
((ret+=$?)) |
||||
[[ $nofileinfo ]] || echo "========================================================================" |
||||
[[ $nofileinfo ]] || echo |
||||
@@ -134,16 +136,16 @@ if (( ${#filenames[@]} > 0 )); then |
||||
else |
||||
echo "Image: $image: $(du -h $image | while read a b; do echo $a;done)" |
||||
echo "========================================================================" |
||||
- version=$($CAT -- "$image" | cpio --extract --verbose --quiet --to-stdout -- '*lib/dracut/dracut-*' 2>/dev/null) |
||||
+ version=$($CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- '*lib/dracut/dracut-*' 2>/dev/null) |
||||
((ret+=$?)) |
||||
echo "$version with dracut modules:" |
||||
- $CAT -- "$image" | cpio --extract --verbose --quiet --to-stdout -- '*lib/dracut/modules.txt' 2>/dev/null |
||||
+ $CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- '*lib/dracut/modules.txt' 2>/dev/null |
||||
((ret+=$?)) |
||||
echo "========================================================================" |
||||
if [ "$sorted" -eq 1 ]; then |
||||
- $CAT -- "$image" | cpio --extract --verbose --quiet --list | sort -n -k5 |
||||
+ $CAT "$image" | cpio --extract --verbose --quiet --list | sort -n -k5 |
||||
else |
||||
- $CAT -- "$image" | cpio --extract --verbose --quiet --list | sort -k9 |
||||
+ $CAT "$image" | cpio --extract --verbose --quiet --list | sort -k9 |
||||
fi |
||||
((ret+=$?)) |
||||
echo "========================================================================" |
@ -0,0 +1,38 @@
@@ -0,0 +1,38 @@
|
||||
From b1cdf7c5d4df3221504c34010985254f4261b3dd Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Fri, 24 Jan 2014 11:55:27 +0100 |
||||
Subject: [PATCH] Revert "dmraid: let dmraid setup the partitions" |
||||
|
||||
This reverts commit fbf717086e8b02947a27f55d1759cccd1cb89e99. |
||||
|
||||
dmraid seems to use "p" as a seperator by default. |
||||
|
||||
Reverting to kpartx, until this is fixed. |
||||
--- |
||||
modules.d/90dmraid/dmraid.sh | 6 ++++-- |
||||
1 file changed, 4 insertions(+), 2 deletions(-) |
||||
|
||||
diff --git a/modules.d/90dmraid/dmraid.sh b/modules.d/90dmraid/dmraid.sh |
||||
index dfd0f1cb..3753ddd7 100755 |
||||
--- a/modules.d/90dmraid/dmraid.sh |
||||
+++ b/modules.d/90dmraid/dmraid.sh |
||||
@@ -27,7 +27,8 @@ if [ -n "$DM_RAIDS" ] || getargbool 0 rd.auto; then |
||||
for s in $SETS; do |
||||
if [ "${s##$r}" != "$s" ]; then |
||||
info "Activating $s" |
||||
- dmraid -ay -i --rm_partitions "$s" 2>&1 | vinfo |
||||
+ dmraid -ay -i -p --rm_partitions "$s" 2>&1 | vinfo |
||||
+ [ -e "/dev/mapper/$s" ] && kpartx -a "/dev/mapper/$s" 2>&1 | vinfo |
||||
udevsettle |
||||
fi |
||||
done |
||||
@@ -36,7 +37,8 @@ if [ -n "$DM_RAIDS" ] || getargbool 0 rd.auto; then |
||||
# scan and activate all DM RAIDS |
||||
for s in $SETS; do |
||||
info "Activating $s" |
||||
- dmraid -ay -i --rm_partitions "$s" 2>&1 | vinfo |
||||
+ dmraid -ay -i -p --rm_partitions "$s" 2>&1 | vinfo |
||||
+ [ -e "/dev/mapper/$s" ] && kpartx -a "/dev/mapper/$s" 2>&1 | vinfo |
||||
done |
||||
fi |
||||
|
@ -0,0 +1,22 @@
@@ -0,0 +1,22 @@
|
||||
From 0d4bb7ce8928b67a2e835931bc85f317feabd32e Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Fri, 24 Jan 2014 15:26:43 +0100 |
||||
Subject: [PATCH] dracut.sh: create early cpio dir for acpi tables |
||||
|
||||
--- |
||||
dracut.sh | 2 +- |
||||
1 file changed, 1 insertion(+), 1 deletion(-) |
||||
|
||||
diff --git a/dracut.sh b/dracut.sh |
||||
index ad57218d..55862751 100755 |
||||
--- a/dracut.sh |
||||
+++ b/dracut.sh |
||||
@@ -719,7 +719,7 @@ readonly initdir="$(mktemp --tmpdir="$TMPDIR/" -d -t initramfs.XXXXXX)" |
||||
exit 1 |
||||
} |
||||
|
||||
-if [[ $early_microcode = yes ]]; then |
||||
+if [[ $early_microcode = yes ]] || ( [[ $acpi_override = yes ]] && [[ -d $acpi_table_dir ]] ); then |
||||
readonly early_cpio_dir="$(mktemp --tmpdir="$TMPDIR/" -d -t early_cpio.XXXXXX)" |
||||
[ -d "$early_cpio_dir" ] || { |
||||
printf "%s\n" "dracut: mktemp --tmpdir=\"$TMPDIR/\" -d -t early_cpio.XXXXXX failed." >&2 |
@ -0,0 +1,26 @@
@@ -0,0 +1,26 @@
|
||||
From 87862728daaefd56708fe2100c22a90ebf361fac Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Fri, 24 Jan 2014 15:27:15 +0100 |
||||
Subject: [PATCH] dracut.sh: set file owners of early cpio files to 0:0 |
||||
|
||||
--- |
||||
dracut.sh | 4 ++-- |
||||
1 file changed, 2 insertions(+), 2 deletions(-) |
||||
|
||||
diff --git a/dracut.sh b/dracut.sh |
||||
index 55862751..0ac2b050 100755 |
||||
--- a/dracut.sh |
||||
+++ b/dracut.sh |
||||
@@ -1379,10 +1379,10 @@ rm -f -- "$outfile" |
||||
dinfo "*** Creating image file ***" |
||||
if [[ $create_early_cpio = yes ]]; then |
||||
# The microcode blob is _before_ the initramfs blob, not after |
||||
- (cd "$early_cpio_dir/d"; find . -print0 | cpio --null -o -H newc --quiet >../early.cpio) |
||||
+ (cd "$early_cpio_dir/d"; find . -print0 | cpio --null -R 0:0 -H newc -o --quiet >../early.cpio) |
||||
mv $early_cpio_dir/early.cpio $outfile.$$ |
||||
fi |
||||
-if ! ( umask 077; cd "$initdir"; find . -print0 | cpio --null -R 0:0 -H newc -o --quiet| \ |
||||
+if ! ( umask 077; cd "$initdir"; find . -print0 | cpio --null -R 0:0 -H newc -o --quiet | \ |
||||
$compress >> "$outfile.$$"; ); then |
||||
dfatal "dracut: creation of $outfile.$$ failed" |
||||
exit 1 |
@ -0,0 +1,190 @@
@@ -0,0 +1,190 @@
|
||||
From a3dc6a721873f0365612a5acee952a5f7d33853a Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Fri, 24 Jan 2014 15:27:51 +0100 |
||||
Subject: [PATCH] add skipcpio utility |
||||
|
||||
skipcpio skips a cpio archive at the beginning of a file. |
||||
|
||||
It is used for skipping an early cpio archive for lsinitrd. |
||||
--- |
||||
Makefile | 13 +++++- |
||||
skipcpio/skipcpio.c | 123 ++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||||
2 files changed, 135 insertions(+), 1 deletion(-) |
||||
create mode 100644 skipcpio/skipcpio.c |
||||
|
||||
diff --git a/Makefile b/Makefile |
||||
index e7da9484..5441d8f4 100644 |
||||
--- a/Makefile |
||||
+++ b/Makefile |
||||
@@ -40,7 +40,7 @@ manpages = $(man1pages) $(man5pages) $(man7pages) $(man8pages) |
||||
|
||||
.PHONY: install clean archive rpm testimage test all check AUTHORS doc dracut-version.sh |
||||
|
||||
-all: dracut-version.sh dracut-install |
||||
+all: dracut-version.sh dracut-install skipcpio/skipcpio |
||||
|
||||
DRACUT_INSTALL_OBJECTS = \ |
||||
install/dracut-install.o \ |
||||
@@ -61,8 +61,15 @@ install/dracut-install: $(DRACUT_INSTALL_OBJECTS) |
||||
dracut-install: install/dracut-install |
||||
ln -fs $< $@ |
||||
|
||||
+SKIPCPIO_OBJECTS= \ |
||||
+ skipcpio/skipcpio.o |
||||
+ |
||||
+skipcpio/skipcpio.o: skipcpio/skipcpio.c |
||||
+skipcpio/skipcpio: skipcpio/skipcpio.o |
||||
+ |
||||
indent: |
||||
indent -i8 -nut -br -linux -l120 install/dracut-install.c |
||||
+ indent -i8 -nut -br -linux -l120 skipcpio/skipcpio.c |
||||
|
||||
doc: $(manpages) dracut.html |
||||
|
||||
@@ -136,6 +143,9 @@ endif |
||||
if [ -f install/dracut-install ]; then \ |
||||
install -m 0755 install/dracut-install $(DESTDIR)$(pkglibdir)/dracut-install; \ |
||||
fi |
||||
+ if [ -f skipcpio/skipcpio ]; then \ |
||||
+ install -m 0755 skipcpio/skipcpio $(DESTDIR)$(pkglibdir)/skipcpio; \ |
||||
+ fi |
||||
mkdir -p $(DESTDIR)${prefix}/lib/kernel/install.d |
||||
install -m 0755 50-dracut.install $(DESTDIR)${prefix}/lib/kernel/install.d/50-dracut.install |
||||
install -m 0755 51-dracut-rescue.install $(DESTDIR)${prefix}/lib/kernel/install.d/51-dracut-rescue.install |
||||
@@ -155,6 +165,7 @@ clean: |
||||
$(RM) dracut-*.rpm dracut-*.tar.bz2 |
||||
$(RM) dracut-version.sh |
||||
$(RM) dracut-install install/dracut-install $(DRACUT_INSTALL_OBJECTS) |
||||
+ $(RM) skipcpio/skipcpio $(SKIPCPIO_OBJECTS) |
||||
$(RM) $(manpages) dracut.html |
||||
$(MAKE) -C test clean |
||||
|
||||
diff --git a/skipcpio/skipcpio.c b/skipcpio/skipcpio.c |
||||
new file mode 100644 |
||||
index 00000000..fbf391bf |
||||
--- /dev/null |
||||
+++ b/skipcpio/skipcpio.c |
||||
@@ -0,0 +1,123 @@ |
||||
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ |
||||
+ |
||||
+/* dracut-install.c -- install files and executables |
||||
+ |
||||
+ Copyright (C) 2012 Harald Hoyer |
||||
+ Copyright (C) 2012 Red Hat, Inc. All rights reserved. |
||||
+ |
||||
+ This program is free software: you can redistribute it and/or modify |
||||
+ under the terms of the GNU Lesser General Public License as published by |
||||
+ the Free Software Foundation; either version 2.1 of the License, or |
||||
+ (at your option) any later version. |
||||
+ |
||||
+ This program is distributed in the hope that it will be useful, but |
||||
+ WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
||||
+ Lesser General Public License for more details. |
||||
+ |
||||
+ You should have received a copy of the GNU Lesser General Public License |
||||
+ along with this program; If not, see <http://www.gnu.org/licenses/>. |
||||
+*/ |
||||
+ |
||||
+#define PROGRAM_VERSION_STRING "1" |
||||
+ |
||||
+#ifndef _GNU_SOURCE |
||||
+#define _GNU_SOURCE |
||||
+#endif |
||||
+ |
||||
+#include <stdbool.h> |
||||
+#include <stdio.h> |
||||
+#include <stdlib.h> |
||||
+#include <unistd.h> |
||||
+#include <string.h> |
||||
+ |
||||
+#define CPIO_END "TRAILER!!!" |
||||
+#define CPIO_ENDLEN (sizeof(CPIO_END)-1) |
||||
+ |
||||
+static char buf[CPIO_ENDLEN * 2 + 1]; |
||||
+ |
||||
+int main(int argc, char **argv) |
||||
+{ |
||||
+ FILE *f; |
||||
+ size_t s; |
||||
+ long pos = 0; |
||||
+ |
||||
+ if (argc != 2) { |
||||
+ fprintf(stderr, "Usage: %s <file>\n", argv[0]); |
||||
+ exit(1); |
||||
+ } |
||||
+ |
||||
+ f = fopen(argv[1], "r"); |
||||
+ |
||||
+ if (f == NULL) { |
||||
+ fprintf(stderr, "Cannot open file '%s'\n", argv[1]); |
||||
+ exit(1); |
||||
+ } |
||||
+ |
||||
+ s = fread(buf, 6, 1, f); |
||||
+ if (s <= 0) { |
||||
+ fprintf(stderr, "Read error from file '%s'\n", argv[1]); |
||||
+ fclose(f); |
||||
+ exit(1); |
||||
+ } |
||||
+ fseek(f, 0, SEEK_SET); |
||||
+ |
||||
+ /* check, if this is a cpio archive */ |
||||
+ if ((buf[0] == 0x71 && buf[1] == 0xc7) |
||||
+ || (buf[0] == '0' && buf[1] == '7' && buf[0] == '0' && buf[1] == '7' && buf[0] == '0' && buf[1] == '1')) { |
||||
+ |
||||
+ /* Search for CPIO_END */ |
||||
+ do { |
||||
+ char *h; |
||||
+ fseek(f, pos, SEEK_SET); |
||||
+ buf[sizeof(buf) - 1] = 0; |
||||
+ s = fread(buf, CPIO_ENDLEN, 2, f); |
||||
+ if (s <= 0) |
||||
+ break; |
||||
+ |
||||
+ h = strstr(buf, CPIO_END); |
||||
+ if (h) { |
||||
+ pos = (h - buf) + pos + CPIO_ENDLEN; |
||||
+ fseek(f, pos, SEEK_SET); |
||||
+ break; |
||||
+ } |
||||
+ pos += CPIO_ENDLEN; |
||||
+ } while (!feof(f)); |
||||
+ |
||||
+ if (feof(f)) { |
||||
+ /* CPIO_END not found, just cat the whole file */ |
||||
+ fseek(f, 0, SEEK_SET); |
||||
+ } else { |
||||
+ /* skip zeros */ |
||||
+ while (!feof(f)) { |
||||
+ size_t i; |
||||
+ |
||||
+ buf[sizeof(buf) - 1] = 0; |
||||
+ s = fread(buf, 1, sizeof(buf) - 1, f); |
||||
+ if (s <= 0) |
||||
+ break; |
||||
+ |
||||
+ for (i = 0; (i < s) && (buf[i] == 0); i++) ; |
||||
+ |
||||
+ if (buf[i] != 0) { |
||||
+ pos += i; |
||||
+ fseek(f, pos, SEEK_SET); |
||||
+ break; |
||||
+ } |
||||
+ |
||||
+ pos += s; |
||||
+ } |
||||
+ } |
||||
+ } |
||||
+ /* cat out the rest */ |
||||
+ while (!feof(f)) { |
||||
+ s = fread(buf, 1, sizeof(buf), f); |
||||
+ if (s <= 0) |
||||
+ break; |
||||
+ |
||||
+ s = fwrite(buf, 1, s, stdout); |
||||
+ if (s <= 0) |
||||
+ break; |
||||
+ } |
||||
+ fclose(f); |
||||
+} |
@ -0,0 +1,21 @@
@@ -0,0 +1,21 @@
|
||||
From eb7c58eced499d5e894971b451d8fb940c829393 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Fri, 24 Jan 2014 15:29:24 +0100 |
||||
Subject: [PATCH] dracut.sh: add early_cpio marker file to the early cpio |
||||
|
||||
--- |
||||
dracut.sh | 1 + |
||||
1 file changed, 1 insertion(+) |
||||
|
||||
diff --git a/dracut.sh b/dracut.sh |
||||
index 0ac2b050..58acb647 100755 |
||||
--- a/dracut.sh |
||||
+++ b/dracut.sh |
||||
@@ -1378,6 +1378,7 @@ fi |
||||
rm -f -- "$outfile" |
||||
dinfo "*** Creating image file ***" |
||||
if [[ $create_early_cpio = yes ]]; then |
||||
+ echo 1 > "$early_cpio_dir/d/early_cpio" |
||||
# The microcode blob is _before_ the initramfs blob, not after |
||||
(cd "$early_cpio_dir/d"; find . -print0 | cpio --null -R 0:0 -H newc -o --quiet >../early.cpio) |
||||
mv $early_cpio_dir/early.cpio $outfile.$$ |
@ -0,0 +1,147 @@
@@ -0,0 +1,147 @@
|
||||
From 815b9c16a4e90b67bab008da678d73faa74f8e0c Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Fri, 24 Jan 2014 15:30:22 +0100 |
||||
Subject: [PATCH] lsinitrd.sh: make use of the skipcpio utility |
||||
|
||||
With the skipcpio utility, the whole contents of an initramfs with an |
||||
early cpio image can be displayed. |
||||
--- |
||||
lsinitrd.sh | 96 +++++++++++++++++++++++++++++++++++++++++++++++-------------- |
||||
1 file changed, 75 insertions(+), 21 deletions(-) |
||||
|
||||
diff --git a/lsinitrd.sh b/lsinitrd.sh |
||||
index f9f243bb..70e12f81 100755 |
||||
--- a/lsinitrd.sh |
||||
+++ b/lsinitrd.sh |
||||
@@ -33,6 +33,9 @@ usage() |
||||
} >&2 |
||||
} |
||||
|
||||
+ |
||||
+[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut |
||||
+ |
||||
sorted=0 |
||||
declare -A filenames |
||||
|
||||
@@ -103,14 +106,72 @@ if ! [[ -f "$image" ]]; then |
||||
exit 1 |
||||
fi |
||||
|
||||
+extract_files() |
||||
+{ |
||||
+ (( ${#filenames[@]} == 1 )) && nofileinfo=1 |
||||
+ for f in ${!filenames[@]}; do |
||||
+ [[ $nofileinfo ]] || echo "initramfs:/$f" |
||||
+ [[ $nofileinfo ]] || echo "========================================================================" |
||||
+ $CAT $image | cpio --extract --verbose --quiet --to-stdout $f 2>/dev/null |
||||
+ ((ret+=$?)) |
||||
+ [[ $nofileinfo ]] || echo "========================================================================" |
||||
+ [[ $nofileinfo ]] || echo |
||||
+ done |
||||
+} |
||||
+ |
||||
+list_files() |
||||
+{ |
||||
+ echo "========================================================================" |
||||
+ if [ "$sorted" -eq 1 ]; then |
||||
+ $CAT "$image" | cpio --extract --verbose --quiet --list | sort -n -k5 |
||||
+ else |
||||
+ $CAT "$image" | cpio --extract --verbose --quiet --list | sort -k9 |
||||
+ fi |
||||
+ ((ret+=$?)) |
||||
+ echo "========================================================================" |
||||
+} |
||||
+ |
||||
+ |
||||
+if (( ${#filenames[@]} <= 0 )); then |
||||
+ echo "Image: $image: $(du -h $image | while read a b; do echo $a;done)" |
||||
+ echo "========================================================================" |
||||
+fi |
||||
+ |
||||
read -N 6 bin < "$image" |
||||
+case $bin in |
||||
+ $'\x71\xc7'*|070701) |
||||
+ CAT="cat --" |
||||
+ is_early=$(cpio --extract --verbose --quiet --to-stdout -- 'early_cpio' < "$image" 2>/dev/null) |
||||
+ if [[ "$is_early" ]]; then |
||||
+ if (( ${#filenames[@]} > 0 )); then |
||||
+ extract_files |
||||
+ else |
||||
+ echo "Early CPIO image" |
||||
+ list_files |
||||
+ fi |
||||
+ SKIP="$dracutbasedir/skipcpio" |
||||
+ if ! [[ -x $SKIP ]]; then |
||||
+ echo |
||||
+ echo "'$SKIP' not found, cannot display remaining contents!" >&2 |
||||
+ echo |
||||
+ exit 0 |
||||
+ fi |
||||
+ fi |
||||
+ ;; |
||||
+esac |
||||
+ |
||||
+if [[ $SKIP ]]; then |
||||
+ read -N 6 bin < <($SKIP "$image") |
||||
+fi |
||||
+ |
||||
case $bin in |
||||
$'\x1f\x8b'*) |
||||
CAT="zcat --";; |
||||
BZh*) |
||||
CAT="bzcat --";; |
||||
$'\x71\xc7'*|070701) |
||||
- CAT="cat --";; |
||||
+ CAT="cat --" |
||||
+ ;; |
||||
$'\x04\x22'*) |
||||
CAT="lz4 -d -c";; |
||||
*) |
||||
@@ -121,34 +182,27 @@ case $bin in |
||||
;; |
||||
esac |
||||
|
||||
+skipcpio() |
||||
+{ |
||||
+ $SKIP "$@" | $ORIG_CAT |
||||
+} |
||||
+ |
||||
+if [[ $SKIP ]]; then |
||||
+ ORIG_CAT="$CAT" |
||||
+ CAT=skipcpio |
||||
+fi |
||||
+ |
||||
ret=0 |
||||
|
||||
if (( ${#filenames[@]} > 0 )); then |
||||
- (( ${#filenames[@]} == 1 )) && nofileinfo=1 |
||||
- for f in ${!filenames[@]}; do |
||||
- [[ $nofileinfo ]] || echo "initramfs:/$f" |
||||
- [[ $nofileinfo ]] || echo "========================================================================" |
||||
- $CAT $image | cpio --extract --verbose --quiet --to-stdout $f 2>/dev/null |
||||
- ((ret+=$?)) |
||||
- [[ $nofileinfo ]] || echo "========================================================================" |
||||
- [[ $nofileinfo ]] || echo |
||||
- done |
||||
+ extract_files |
||||
else |
||||
- echo "Image: $image: $(du -h $image | while read a b; do echo $a;done)" |
||||
- echo "========================================================================" |
||||
- version=$($CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- '*lib/dracut/dracut-*' 2>/dev/null) |
||||
+ version=$($CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/dracut-*' 'usr/lib/dracut/dracut-*' 2>/dev/null) |
||||
((ret+=$?)) |
||||
echo "$version with dracut modules:" |
||||
$CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- '*lib/dracut/modules.txt' 2>/dev/null |
||||
((ret+=$?)) |
||||
- echo "========================================================================" |
||||
- if [ "$sorted" -eq 1 ]; then |
||||
- $CAT "$image" | cpio --extract --verbose --quiet --list | sort -n -k5 |
||||
- else |
||||
- $CAT "$image" | cpio --extract --verbose --quiet --list | sort -k9 |
||||
- fi |
||||
- ((ret+=$?)) |
||||
- echo "========================================================================" |
||||
+ list_files |
||||
fi |
||||
|
||||
exit $ret |
@ -0,0 +1,37 @@
@@ -0,0 +1,37 @@
|
||||
From ade113d75b07ba294facbe943b859624fa45efb9 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Tue, 28 Jan 2014 12:12:43 +0100 |
||||
Subject: [PATCH] network/dhclient-script.sh: set lease time |
||||
|
||||
The dracut dhclient-script.sh should set address lifetimes to the DHCP |
||||
lease time, so that other stuff (like NetworkManager!) knows that the |
||||
address is temporary and was created by DHCP. |
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1058519 |
||||
--- |
||||
modules.d/40network/dhclient-script.sh | 5 ++++- |
||||
1 file changed, 4 insertions(+), 1 deletion(-) |
||||
|
||||
diff --git a/modules.d/40network/dhclient-script.sh b/modules.d/40network/dhclient-script.sh |
||||
index 07c3d9be..70a2b710 100755 |
||||
--- a/modules.d/40network/dhclient-script.sh |
||||
+++ b/modules.d/40network/dhclient-script.sh |
||||
@@ -12,6 +12,7 @@ setup_interface() { |
||||
search=$(printf -- "$new_domain_search") |
||||
namesrv=$new_domain_name_servers |
||||
hostname=$new_host_name |
||||
+ lease_time=$new_dhcp_lease_time |
||||
|
||||
[ -f /tmp/net.$netif.override ] && . /tmp/net.$netif.override |
||||
|
||||
@@ -29,7 +30,9 @@ setup_interface() { |
||||
fi |
||||
fi |
||||
|
||||
- ip addr add $ip${mask:+/$mask} ${bcast:+broadcast $bcast} dev $netif |
||||
+ ip addr add $ip${mask:+/$mask} ${bcast:+broadcast $bcast} \ |
||||
+ valid_lft ${lease_time} preferred_lft ${lease_time} \ |
||||
+ dev $netif |
||||
|
||||
[ -n "$gw" ] && echo ip route add default via $gw dev $netif > /tmp/net.$netif.gw |
||||
|
@ -0,0 +1,26 @@
@@ -0,0 +1,26 @@
|
||||
From 37a18fda1146ac619165af8dbbbda3cbfb8ad18b Mon Sep 17 00:00:00 2001 |
||||
From: Stig Telfer <stelfer@cray.com> |
||||
Date: Fri, 24 Jan 2014 15:19:11 +0000 |
||||
Subject: [PATCH] dracut-lib.sh: bugfix for pidof function |
||||
|
||||
It appears there is a simple substitution error in the pidof shell function which causes it to fail to find processes. In my case, processes started by 95nfs are not terminated in the cleanup hook. This causes knock-on effects disturbing the root filesystem service dependencies. |
||||
|
||||
Enjoy, |
||||
Stig Telfer |
||||
--- |
||||
modules.d/99base/dracut-lib.sh | 2 +- |
||||
1 file changed, 1 insertion(+), 1 deletion(-) |
||||
|
||||
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh |
||||
index cd628519..61e5a81a 100755 |
||||
--- a/modules.d/99base/dracut-lib.sh |
||||
+++ b/modules.d/99base/dracut-lib.sh |
||||
@@ -969,7 +969,7 @@ if ! command -v pidof >/dev/null 2>/dev/null; then |
||||
for i in /proc/*/exe; do |
||||
[ -e "$i" ] || return 1 |
||||
if [ -n "$_exe" ]; then |
||||
- [ "$i" -ef "$_cmd" ] || continue |
||||
+ [ "$i" -ef "$_exe" ] || continue |
||||
else |
||||
_rl=$(readlink -f "$i"); |
||||
[ "${_rl%/$_cmd}" != "$_rl" ] || continue |
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
From 2f117f4db3425229f9a9b107682ad05b8ba613ea Mon Sep 17 00:00:00 2001 |
||||
From: Stig Telfer <stelfer@cray.com> |
||||
Date: Fri, 24 Jan 2014 15:48:32 +0000 |
||||
Subject: [PATCH] dracut-lib.sh: bugfix for pidof function |
||||
|
||||
In follow-up, the patch requires a second mod: kernel tasks have a /proc/.../exe that links to nothing and derails the for loop: |
||||
--- |
||||
modules.d/99base/dracut-lib.sh | 2 +- |
||||
1 file changed, 1 insertion(+), 1 deletion(-) |
||||
|
||||
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh |
||||
index 61e5a81a..d892c26d 100755 |
||||
--- a/modules.d/99base/dracut-lib.sh |
||||
+++ b/modules.d/99base/dracut-lib.sh |
||||
@@ -967,7 +967,7 @@ if ! command -v pidof >/dev/null 2>/dev/null; then |
||||
[ -z "$_cmd" ] && return 1 |
||||
_exe=$(type -P "$1") |
||||
for i in /proc/*/exe; do |
||||
- [ -e "$i" ] || return 1 |
||||
+ [ -e "$i" ] || continue |
||||
if [ -n "$_exe" ]; then |
||||
[ "$i" -ef "$_exe" ] || continue |
||||
else |
@ -0,0 +1,22 @@
@@ -0,0 +1,22 @@
|
||||
From f812e271cb9d51365b70f0ee82bb2fd30209ba06 Mon Sep 17 00:00:00 2001 |
||||
From: Harald Hoyer <harald@redhat.com> |
||||
Date: Tue, 28 Jan 2014 12:14:07 +0100 |
||||
Subject: [PATCH] iscsi/iscsiroot.sh: beautify warning |
||||
|
||||
--- |
||||
modules.d/95iscsi/iscsiroot.sh | 2 +- |
||||
1 file changed, 1 insertion(+), 1 deletion(-) |
||||
|
||||
diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh |
||||
index 60a180dd..8b743323 100755 |
||||
--- a/modules.d/95iscsi/iscsiroot.sh |
||||
+++ b/modules.d/95iscsi/iscsiroot.sh |
||||
@@ -56,7 +56,7 @@ handle_firmware() |
||||
done |
||||
|
||||
if ! iscsistart -b $iscsi_param; then |
||||
- warn "\`iscsistart -b $iscsi_param\´ failed" |
||||
+ warn "'iscsistart -b $iscsi_param' failed" |
||||
fi |
||||
|
||||
if [ -d /sys/class/iscsi_session ]; then |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue