From: Daniel Molkentin Date: Mon, 17 Aug 2020 13:46:17 +0000 (+0200) Subject: dracut.sh: Add --version X-Git-Tag: 051~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff2d8bdfb3a56d97bcac9750ff16c3437a96cbe7;p=thirdparty%2Fdracut.git dracut.sh: Add --version --- diff --git a/dracut.sh b/dracut.sh index 4d83d3ab6..2f2fadd1b 100755 --- a/dracut.sh +++ b/dracut.sh @@ -242,6 +242,7 @@ Creates initial ramdisk images for preloading modules --kernel-image [FILE] location of the kernel image --regenerate-all Regenerate all initramfs images at the default location for the kernel versions found on the system + --version Display version If [LIST] has multiple arguments, then you have to put these in quotes. @@ -252,6 +253,14 @@ For example: EOF } +long_version() { + [[ $dracutbasedir ]] || dracutbasedir=$dracutsysrootdir/usr/lib/dracut + if [[ -f $dracutbasedir/dracut-version.sh ]]; then + . $dracutbasedir/dracut-version.sh + fi + echo "dracut $DRACUT_VERSION" +} + # Fills up host_devs stack variable and makes sure there are no duplicates push_host_devs() { local _dev @@ -416,6 +425,7 @@ rearrange_params() --long no-hostonly-i18n \ --long hostonly-i18n \ --long no-machineid \ + --long version \ -- "$@") if (( $? != 0 )); then @@ -616,6 +626,7 @@ while :; do kernel_image_l="$2"; PARMS_TO_STORE+=" '$2'"; shift;; --no-machineid) machine_id_l="no";; + --version) long_version; exit 1 ;; --) shift; break;; *) # should not even reach this point