Bug 683849 - incorrect basename in mkinitrd usage message
Summary: incorrect basename in mkinitrd usage message
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: dracut
Version: rawhide
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Harald Hoyer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-10 13:55 UTC by vadimk
Modified: 2011-03-10 15:07 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-03-10 15:07:13 UTC
Type: ---


Attachments (Terms of Use)

Description vadimk 2011-03-10 13:55:51 UTC
Description of problem:
incorrect basename in mkinitrd usage message

Version-Release number of selected component (if applicable):
008

How reproducible:
always

Steps to Reproduce:
1. run mkinitrd -h

  
Actual results:
# mkinitrd
usage: /usr/sbin [--version] [--help] [-v] [-f] [--preload <module>]
       [--image-version] [--with=<module>]
       <initrd-image> <kernel-version>



Expected results:
# mkinitrd
usage: mkinitrd [--version] [--help] [-v] [-f] [--preload <module>]
       [--image-version] [--with=<module>]
       <initrd-image> <kernel-version>

Additional info:
Responsible commit:
http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=commitdiff;h=644c5241d274128fe77c5e3faa82240a14ddbb93

Possible way to fix:
--- mkinitrd    2011-03-10 08:42:44.000000000 -0500
+++ mkinitrd.new        2011-03-10 08:42:20.037400416 -0500
@@ -6,11 +6,11 @@
 usage () {
     [[ $1 = '-n' ]] && cmd=echo || cmd=error
 
-    $cmd "usage: ${0%/*} [--version] [--help] [-v] [-f] [--preload <module>]"
+    $cmd "usage: ${0##*/} [--version] [--help] [-v] [-f] [--preload <module>]"
     $cmd "       [--image-version] [--with=<module>]"
     $cmd "       <initrd-image> <kernel-version>"
     $cmd ""
-    $cmd "       (ex: ${0%/*} /boot/initramfs-$kver.img $kver)"
+    $cmd "       (ex: ${0##*/} /boot/initramfs-$kver.img $kver)"
 
     [[ $1 = '-n' ]] && exit 0
     exit 1

Comment 1 Harald Hoyer 2011-03-10 15:07:13 UTC
Thanks! Will be pushed soon to upstream.


Note You need to log in before you can comment on or make changes to this bug.