Bug 254141 - /sbin/weak-modules invalid "-dry-run" option
/sbin/weak-modules invalid "-dry-run" option
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: module-init-tools (Show other bugs)
5.1
All Linux
low Severity low
: ---
: ---
Assigned To: Jon Masters
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-08-24 09:20 EDT by Jan Lieskovsky
Modified: 2008-05-21 12:48 EDT (History)
0 users

See Also:
Fixed In Version: RHBA-2008-0386
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-05-21 12:48:53 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jan Lieskovsky 2007-08-24 09:20:36 EDT
Description of problem:
When you make some mistake by running "/sbin/weak-modules" the 
following help is displayed:

# /sbin/weak-modules -h
Usage: weak-modules [options] {--add-modules|--remove-modules}
weak-modules [options] {--add-kernel|--remove-kernel} {kernel-release}
--add-modules
        Add a list of modules read from standard input. Create
        symlinks in compatible kernel's weak-updates/ directory.
        The list of modules is read from standard input.

--remove-modules
        Remove compatibility symlinks from weak-updates/ directories
        for a list of modules.  The list of modules is read from
        standard input.

--add-kernel
        Add compatibility symlinks for all compatible modules to the
        specified or running kernel.

--remove-kernel
        Remove all compatibility symlinks for the specified or current
        kernel.

--no-initrd
        Do not generate an initrd.

--verbose
        Print the commands executed.

-dry-run
        Do not create/remove any files.

The problem is that in the help, the "-dry-run" option is listed, 
while "/sbin/weak-modules" accepts the common know two dash expression
of the dry run option (e.g. "--dry-run"). By specifying only "-dry-run"
you will always encounter problems, even with correct command line syntax
for "/bin/weak-modules".


Version-Release number of selected component (if applicable):
module-init-tools-3.3-0.pre3.1.28.el5.ia64

How reproducible:
Always

Steps to Reproduce:
1. Run command:

/sbin/weak-modules --no-initrd -dry-run --add-kernel `uname -r`

This form is proclaimed to be correct by the help.

2.
3.
  
Actual results: 
Error message is displayed:
# /sbin/weak-modules --no-initrd -dry-run --add-kernel `uname -r`
getopt: invalid option -- d
getopt: invalid option -- r
getopt: invalid option -- y
getopt: invalid option -- -
getopt: invalid option -- r
getopt: invalid option -- u
getopt: invalid option -- n
Usage: weak-modules [options] {--add-modules|--remove-modules}
weak-modules [options] {--add-kernel|--remove-kernel} {kernel-release}
--add-modules
        Add a list of modules read from standard input. Create
        symlinks in compatible kernel's weak-updates/ directory.
        The list of modules is read from standard input.

--remove-modules
        Remove compatibility symlinks from weak-updates/ directories
        for a list of modules.  The list of modules is read from
        standard input.

--add-kernel
        Add compatibility symlinks for all compatible modules to the
        specified or running kernel.

--remove-kernel
        Remove all compatibility symlinks for the specified or current
        kernel.

--no-initrd
        Do not generate an initrd.

--verbose
        Print the commands executed.

-dry-run
        Do not create/remove any files.


Expected results:
The common two dash ("--dry-run") should be listed in help. 
And "-dry-run" option is already now correctly handled as invalid option.

Additional info:

By running:

# /sbin/weak-modules --no-initrd --dry-run --add-kernel `uname -r`

everything is ok (=> it is enough to update the help page).
Comment 1 RHEL Product and Program Management 2007-10-15 23:44:17 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 6 errata-xmlrpc 2008-05-21 12:48:53 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2008-0386.html

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