Skip to contentSkip to conversation

branch, master, updated. 432196aef8002572e0a512f2d45344e181050177

dracut GIT [email protected] 1 participant 1 message Mar 16, 2011

lore
Share & tools
lore
#0 lore raw

The branch, master has been updated

       via  432196aef8002572e0a512f2d45344e181050177 (commit)
       via  46265a9d3e0a15e4e8d21995cdf0618691d4e394 (commit)
       via  19530529946617993995c7605f3d5d79357611f7 (commit)
      from  0afae1c7cea9487a2a043d9223ef38543f7c8bba (commit)

Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.

- Log ----------------------------------------------------------------- commit 432196aef8002572e0a512f2d45344e181050177

Author: Amadeusz Żołnowski <[email protected]>
Date:   Wed Mar 16 21:24:30 2011 +0100

dracut: script adjusted to new logging facility; -v changed

-v meaning has changed. Now it increases verbosity level. -q option has been added, which decreases verbosity level. Both options might be specified multiple times.

dracut +37 -27
index aaf6485..649637d 100755
@@ -67,8 +67,8 @@ Creates initial ramdisk images for preloading modules
                          4 - info (default)
                          5 - debug info (here starts lots of output)
                          6 - trace info (and even more)
-  -v, --verbose         Verbose output during the build process (info level)
-  -q, --quiet           Display only errors and fatal errors during build
+  -v, --verbose         Increase verbosity level (default is info(4))
+  -q, --quiet           Decrease verbosity level (default is info(4))
   -c, --conf [FILE]     Specify configuration file to use.
                          Default: /etc/dracut.conf
   --confdir [DIR]       Specify configuration directory to use *.conf files 
@@ -179,7 +179,7 @@ push_arg() {
 }
 
 kernel="unset"
-stdloglvl_l=0
+verbosity_mod_l=0
 
 while (($# > 0)); do
     case ${1%%=*} in
@@ -205,8 +205,8 @@ while (($# > 0)); do
         --lvmconf)     lvmconf_l="yes";;
         --nolvmconf)   lvmconf_l="no";;
         --debug)       debug="yes";;
-        -v|--verbose)  beverbose="yes";;
-        -q|--quiet)    bequiet="yes";;
+        -v|--verbose)  ((verbosity_mod_l++));;
+        -q|--quiet)    ((verbosity_mod_l--));;
         -l|--local)    allowlocal="yes" ;;
         -H|--hostonly) hostonly_l="yes" ;;
         --fstab)       use_fstab_l="yes" ;;
@@ -249,12 +249,6 @@ export PATH
     set -x
 }
 
-# For compatibility with -v behaviour. Set to info level.
-[[ $beverbose ]] && (( $stdloglvl_l < 4 )) && stdloglvl_l=4
-
-# When quiet, display only errors and fatal errors.
-[[ $bequiet ]] && (( $stdloglvl_l > 2 )) && stdloglvl_l=2
-
 [[ $dracutbasedir ]] || dracutbasedir=/usr/share/dracut
 
 [[ $allowlocal && -f "$(readlink -f ${0%/*})/dracut-functions" ]] && \
@@ -331,6 +325,10 @@ if [[ ${#fw_dir_l[@]} ]]; then
 fi
 
 [[ $stdloglvl_l ]] && stdloglvl=$stdloglvl_l
+stdloglvl=$((stdloglvl + verbosity_mod_l))
+((stdloglvl > 6)) && stdloglvl=6
+((stdloglvl < 0)) && stdloglvl=0
+
 [[ $drivers_dir_l ]] && drivers_dir=$drivers_dir_l
 [[ $do_strip_l ]] && do_strip=$do_strip_l
 [[ $hostonly_l ]] && hostonly=$hostonly_l
@@ -359,7 +357,7 @@ fi
 dracutfunctions=$dracutbasedir/dracut-functions
 export dracutfunctions
 
-dinfo "Executing $0 $dracut_args"
+ddebug "Executing $0 $dracut_args"
 
 [[ $do_list = yes ]] && {
     for mod in $dracutbasedir/modules.d/*; do
@@ -375,12 +373,13 @@ dinfo "Executing $0 $dracut_args"
 [[ $libdir ]] || for libdir in /lib64 /lib; do
     [[ -d $libdir ]] && break
 done || {
-    derror 'No lib directory?!!!'
+    dfatal 'No lib directory?!!!'
     exit 1
 }
+
 [[ $usrlibdir ]] || for usrlibdir in /usr/lib64 /usr/lib; do
     [[ -d $usrlibdir ]] && break
-done || dwarning 'No usr/lib directory!'
+done || dwarn 'No usr/lib directory!'
 
 # This is kinda legacy -- eventually it should go away.
 case $dracutmodules in
@@ -392,7 +391,7 @@ abs_outfile=$(readlink -f "$outfile") && outfile="$abs_outfile"
 srcmods="/lib/modules/$kernel/"
 [[ $drivers_dir ]] && {
     if vercmp $(modprobe --version | cut -d' ' -f3) lt 3.7; then
-        derror 'To use --kmoddir option module-init-tools >= 3.7 is required.'
+        dfatal 'To use --kmoddir option module-init-tools >= 3.7 is required.'
         exit 1
     fi
     srcmods="$drivers_dir"
@@ -400,19 +399,19 @@ srcmods="/lib/modules/$kernel/"
 export srcmods
 
 if [[ -f $outfile && ! $force ]]; then
-    derror "Will not override existing initramfs ($outfile) without --force"
+    dfatal "Will not override existing initramfs ($outfile) without --force"
     exit 1
 fi
 
 outdir=${outfile%/*}
 if [[ ! -d "$outdir" ]]; then
-    derror "Can't write $outfile: Directory $outdir does not exist."
+    dfatal "Can't write $outfile: Directory $outdir does not exist."
     exit 1
 elif [[ ! -w "$outdir" ]]; then
-    derror "No permission to write $outdir."
+    dfatal "No permission to write $outdir."
     exit 1
 elif [[ -f "$outfile" && ! -w "$outfile" ]]; then
-    derror "No permission to write $outfile."
+    dfatal "No permission to write $outfile."
     exit 1
 fi
 
@@ -452,7 +451,7 @@ check_module_dir
 for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
     mod=${moddir##*/}; mod=${mod#[0-9][0-9]}
     if strstr "$mods_to_load" " $mod "; then
-        dinfo "*** Sourcing module $mod"
+        dinfo "*** Including module: $mod ***"
         if [[ $kernel_only = yes ]]; then
             module_installkernel $mod
         else
@@ -465,13 +464,14 @@ for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
     fi
 done
 unset moddir
+dinfo "*** Including modules' done ***"
 
 ## final stuff that has to happen
 
 # generate module dependencies for the initrd
 if [[ -d $initdir/lib/modules/$kernel ]] && \
     ! depmod -a -b "$initdir" $kernel; then
-    derror "\"depmod -a $kernel\" failed."
+    dfatal "\"depmod -a $kernel\" failed."
     exit 1
 fi
 
@@ -480,6 +480,7 @@ while pop include_src src && pop include_target tgt; do
         if [[ -f $src ]]; then
             inst $src $tgt
         else
+            ddebug "Including directory: $src"
             mkdir -p "${initdir}/${tgt}"
             cp -a -t "${initdir}/${tgt}" "$src"/*
         fi
@@ -495,10 +496,18 @@ unset item
 
 # make sure that library links are correct and up to date
 dracut_install /etc/ld.so.conf /etc/ld.so.conf.d/*
-ldconfig -r "$initdir" || [[ $UID != "0" ]] && \
-    dinfo "ldconfig might need uid=0 (root) for chroot()"
+if ! ldconfig -r "$initdir"; then
+    if [[ $UID = 0 ]]; then
+        derror "ldconfig exited ungracefully"
+    else
+        derror "ldconfig might need uid=0 (root) for chroot()"
+    fi
+fi
 
-[[ $beverbose = yes ]] && (du -c "$initdir" | sort -n)
+if (($maxloglvl >= 5)); then
+    ddebug "Listing sizes of included files:"
+    du -c "$initdir" | sort -n | ddebug
+fi
 
 # strip binaries 
 if [[ $do_strip = yes ]] ; then
@@ -525,10 +534,11 @@ type hardlink &>/dev/null && {
 
 if ! ( cd "$initdir"; find . |cpio -R 0:0 -H newc -o --quiet | \
     $compress > "$outfile"; ); then 
-    derror "dracut: creation of $outfile failed"
+    dfatal "dracut: creation of $outfile failed"
     exit 1
 fi 
-dinfo "Wrote $outfile"
-dinfo $(ls -l "$outfile")
+
+dinfo "Wrote $outfile:"
+dinfo "$(ls -l "$outfile")"
 
 exit 0

commit 46265a9d3e0a15e4e8d21995cdf0618691d4e394

Author: Amadeusz Żołnowski <[email protected]>
Date:   Wed Mar 16 21:24:29 2011 +0100

dracut-logger: make $maxloglvl public

$maxloglvl might be useful to check, if expensive informational operation is going to be logged at all, before executing it.

dracut-logger +13 -13
index 0978d58..830ce1c 100755
@@ -76,9 +76,9 @@ __DRACUT_LOGGER__=1
 #   - @var kmsgloglvl - logging level to /dev/kmsg (only for boot-time)
 #   - @var logfile - log file which is used when @var fileloglvl is higher
 #   than 0
-# and one global internal variable @var _maxloglvl which <b>must not</b> be
-# overwritten. @_maxloglvl is set by dlog_init() and holds maximum logging level
-# of those three and indicates that dlog_init() was run.
+# and one global variable @var maxloglvl which <b>must not</b> be overwritten.
+# @var maxloglvl is set by dlog_init() and holds maximum logging level of those
+# three and indicates that dlog_init() was run.
 #
 # Logging level set by the variable means that messages from this logging level
 # and above (FATAL is the highest) will be shown. Logging levels may be set
@@ -101,11 +101,11 @@ __DRACUT_LOGGER__=1
 #   - @var kmsgloglvl = 0 (no logging)
 #   set to 0
 #
-# @warning Function sets global variable @var _maxloglvl for internal use. Don't
-# overwrite it.
+# @warning Function sets global variable @var maxloglvl. See file doc for
+# details.
 dlog_init() {
     # Skip initialization if it's already done.
-    [ -n "$_maxloglvl" ] && return 0
+    [ -n "$maxloglvl" ] && return 0
 
     local ret=0; local errmsg
 
@@ -144,12 +144,12 @@ dlog_init() {
         fi
     fi
 
-    local lvl
-    _maxloglvl=0
-    for lvl in $stdloglvl $sysloglvl $fileloglvl; do
-        [ $lvl -gt $_maxloglvl ] && _maxloglvl=$lvl
+    local lvl; local maxloglvl_l=0
+    for lvl in $stdloglvl $sysloglvl $fileloglvl $kmsgloglvl; do
+        [ $lvl -gt $maxloglvl_l ] && maxloglvl_l=$lvl
     done
-    export _maxloglvl
+    readonly maxloglvl=$maxloglvl_l
+    export maxloglvl
 
     [ -n "$errmsg" ] && derror "$errmsg"
 
@@ -251,11 +251,11 @@ _dlvl2klvl() {
 #   - @c INFO to @c info
 #   - @c DEBUG and @c TRACE both to @c debug
 _do_dlog() {
-    [ -z "$_maxloglvl" ] && return 0
+    [ -z "$maxloglvl" ] && return 0
     local lvl="$1"; shift
     local lvlc=$(_lvl2char "$lvl") || return 0
 
-    [ $lvl -le $_maxloglvl ] || return 0
+    [ $lvl -le $maxloglvl ] || return 0
 
     local msg="$lvlc: $*"
 

commit 19530529946617993995c7605f3d5d79357611f7

Author: Amadeusz Żołnowski <[email protected]>
Date:   Wed Mar 16 21:24:28 2011 +0100

dracut: install ld.so.conf* with dracut_install instead of cp

dracut +1 -1
index 10e86d0..aaf6485 100755
@@ -494,7 +494,7 @@ done
 unset item
 
 # make sure that library links are correct and up to date
-cp -ar /etc/ld.so.conf* "$initdir"/etc
+dracut_install /etc/ld.so.conf /etc/ld.so.conf.d/*
 ldconfig -r "$initdir" || [[ $UID != "0" ]] && \
     dinfo "ldconfig might need uid=0 (root) for chroot()"
 

-----------------------------------------------------------------------

Summary of changes:

 dracut        |   66 ++++++++++++++++++++++++++++++++------------------------
 dracut-logger |   26 +++++++++++-----------
 2 files changed, 51 insertions(+), 41 deletions(-)
Signature · 1 line
dracut - Initramfs generator using udev