Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 174071 - x11-apps/xinit initscript reads nox falsely
Summary: x11-apps/xinit initscript reads nox falsely
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords: Inclusion
Depends on:
Blocks:
 
Reported: 2007-04-10 19:09 UTC by David Brigada
Modified: 2007-04-13 08:23 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to fix cmdline_opt function (xdm.diff,222 bytes, patch)
2007-04-10 19:10 UTC, David Brigada
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Brigada 2007-04-10 19:09:24 UTC
If I boot my computer, the xdm init script acts as though it saw "nox" on the kernel boot command line.  The cmdline_opt function doesn't return 1 if it doesn't find the nox option, so the script thinks it's there even though it isn't.  The simple fix is to add a return 1 at the end of the cmdline_opt script for the case where it doesn't find the parameter.
Comment 1 David Brigada 2007-04-10 19:10:08 UTC
Created attachment 115923 [details, diff]
Patch to fix cmdline_opt function

This fixes the issue
Comment 2 Donnie Berkholz (RETIRED) gentoo-dev 2007-04-10 20:16:18 UTC
I suppose that means the previous command returned some wonky value, so that's what the function ends up returning.
Comment 3 David Brigada 2007-04-10 23:46:41 UTC
(In reply to comment #2)
> I suppose that means the previous command returned some wonky value, so that's
> what the function ends up returning.
> 

Well, if you have no arguments for the for command, then the for command succeeds, and the function implicitly returns 0 (true).  If you have arguments, but they don't match, the function implicitly returns 1 (false).  If you have arguments that do match, the function explicitly runs the return 0.

I guess it's just kind of a particular of how shell scripting works.  I think the cmdline_opt function works properly as long as the user has at least one boot option, but fails if he doesn't.  This patch should fix the behavior for all.
Comment 4 Jakub Moc (RETIRED) gentoo-dev 2007-04-11 07:05:29 UTC
(In reply to comment #3)

> the cmdline_opt function works properly as long as the user has at least one
> boot option, but fails if he doesn't.  This patch should fix the behavior for
> all.

Well no, it doesn't work at all currently, xdm is never started.

$ cat /proc/cmdline 
root=/dev/hda9 root=/dev/ram0 init=/linuxrc real_root=/dev/hda9 video=vesafb:ywrap,mtrr,1024x768-24@100 splash=silent,theme:livecd-2006.1 CONSOLE=/dev/tty1 quiet fbcon=scrollback:128K hde=noprobe hdf=noprobe hdg=noprobe hdh=noprobe elevator=cfq

Comment 5 Jakub Moc (RETIRED) gentoo-dev 2007-04-12 20:46:55 UTC
*** Bug 174271 has been marked as a duplicate of this bug. ***
Comment 6 Roy Marples (RETIRED) gentoo-dev 2007-04-13 08:23:10 UTC
Fixed in -r3, sorry about that.