Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#24689 - [initscripts] optimize kernel cmdline parsing

Attached to Project: Arch Linux
Opened by Matthias Dienstbier (fs4000) - Saturday, 11 June 2011, 15:26 GMT
Last edited by Tom Gundersen (tomegun) - Sunday, 12 June 2011, 20:36 GMT
Task Type General Gripe
Category Arch Projects
Status Closed
Assigned To Tom Gundersen (tomegun)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Currently we do this to check for forcefsck:

for cmdarg in $(< /proc/cmdline); do
[[ "$cmdarg" == forcefsck ]] && FORCEFSCK="-- -f" && break
done

shouldn't this do almost the same but easier:

if grep -qw forcefsck /proc/cmdline; then
FORCEFSCK="-- -f"
fi

The only problem might be, that grep also returns true for something like "forcefsck=no" as it treats '=' as a non-word constituent character.
This task depends upon

Closed by  Tom Gundersen (tomegun)
Sunday, 12 June 2011, 20:36 GMT
Reason for closing:  None
Additional comments about closing:  Asked for patch.
Comment by Jan de Groot (JGC) - Sunday, 12 June 2011, 09:48 GMT
Your change adds a call to grep, which is an external binary. Launching external binaries takes some overhead that might be bigger than what you're trying to optimize.
Comment by Tom Gundersen (tomegun) - Sunday, 12 June 2011, 20:36 GMT
Jan is probably right. However, if you want people to comment on this, then submit a patch to arch-projects@archlinux.org.

Loading...