Bug 254141

Summary: /sbin/weak-modules invalid "-dry-run" option
Product: Red Hat Enterprise Linux 5 Reporter: Jan Lieskovsky <jlieskov>
Component: module-init-toolsAssignee: Jon Masters <jcm>
Status: CLOSED ERRATA QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: 5.1   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2008-0386 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-05-21 16:48:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jan Lieskovsky 2007-08-24 13:20:36 UTC
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 Program Management 2007-10-16 03:44:17 UTC
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 16:48:53 UTC
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