- Add ACPI table override ability - Adjust mkinitrd-dracut.sh to SUSE mkinitrd: <none> : Before gives a "usage" error -> now scans /boot for kernels and builds corresponding inirtrds for them -i -k : Pass a list of kernels and initrd targets (not sure it was worth the hassle to be able to pass) -b : Boot directory to search for kernel images -d : Change root file system. Not tested whether dracut's behavior matches exactly what our mkinitrd does. -s : Dummy (should even be obsolete in latest mkinitrd) - Write caller and used parameters to syslog if mkinitrd is called. So that those can easily be fixed and checked for correctness. This should get reverted again before a bigger release. OBS-URL: https://build.opensuse.org/request/show/201877 OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=56
62 lines
1.8 KiB
Plaintext
62 lines
1.8 KiB
Plaintext
mkinitrd-dracut.sh: Implement --quiet|-q option
|
|
|
|
Dracut is rather verbose. This optional parameter is to limit the output
|
|
to the essential: For each generated initrd show the kernel, target and
|
|
possibly additional options passed to dracut.
|
|
|
|
Signed-off-by: Thomas Renninger <trenn@suse.de>
|
|
|
|
diff --git a/mkinitrd-dracut.sh b/mkinitrd-dracut.sh
|
|
index d8e92f3..803abc0 100755
|
|
--- a/mkinitrd-dracut.sh
|
|
+++ b/mkinitrd-dracut.sh
|
|
@@ -2,6 +2,7 @@
|
|
kver=$(uname -r)
|
|
|
|
boot_dir="/boot"
|
|
+quiet=0
|
|
|
|
error() { echo "$@" >&2; }
|
|
|
|
@@ -89,6 +90,7 @@ while (($# > 0)); do
|
|
--looppath*) ;;
|
|
--dsdt*) ;;
|
|
--bootchart) ;;
|
|
+ --quiet|-q) quiet=1;;
|
|
-b) read_arg boot_dir "$@" || shift $?
|
|
if [ ! -d $boot_dir ];then
|
|
error "Boot directory $boot_dir does not exist"
|
|
@@ -123,6 +125,7 @@ done
|
|
targets=( $targets )
|
|
[[ $kernels ]] && kernels=( $kernels )
|
|
|
|
+echo "Creating: target|kernel|dracut args|basicmodules "
|
|
for ((i=0 ; $i<${#targets[@]} ; i++)); do
|
|
|
|
if [[ $img_vers ]];then
|
|
@@ -132,9 +135,21 @@ for ((i=0 ; $i<${#targets[@]} ; i++)); do
|
|
fi
|
|
kernel="${kernels[$i]}"
|
|
|
|
- if [[ $basicmodules ]]; then
|
|
- dracut $dracut_args --add-drivers "$basicmodules" "$target" "$kernel"
|
|
+ # Duplicate code: No way found how to redirect output based on $quiet
|
|
+ if [[ $quiet == 1 ]];then
|
|
+ echo "$target|$kernel|$dracut_args|$basicmodules"
|
|
+ if [[ $basicmodules ]]; then
|
|
+ dracut $dracut_args --add-drivers "$basicmodules" "$target" \
|
|
+ "$kernel" &>/dev/null
|
|
+ else
|
|
+ dracut $dracut_args "$target" "$kernel" &>/dev/null
|
|
+ fi
|
|
else
|
|
- dracut $dracut_args "$target" "$kernel"
|
|
+ if [[ $basicmodules ]]; then
|
|
+ dracut $dracut_args --add-drivers "$basicmodules" "$target" \
|
|
+ "$kernel"
|
|
+ else
|
|
+ dracut $dracut_args "$target" "$kernel"
|
|
+ fi
|
|
fi
|
|
done
|