dracut/quiet_options.patch
Robert Milasan 1c955cd93d Accepting request 201996 from home:mvyskocil
- Mark /etc/dracut.conf.d/02-early-microcode.conf as config file

Add following entry to .changes of trenn@suse.de
"""
- Build host only images for default paths in SUSE for faster build and
  smaller images. Imply --force in this case as well.
  * suse_host_only.patch
"""
It was not documented

- Tagged all patches per policy
- Add extension .patch to all patches per policy

OBS-URL: https://build.opensuse.org/request/show/201996
OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=59
2013-10-03 07:37:56 +00:00

62 lines
1.8 KiB
Diff

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