maemo.org Bugzilla – Bug 6606
No getopts, called by init-functions (lsb-base)
Last modified: 2011-05-22 07:53:46 UTC
You need to log in before you can comment on or make changes to this bug.
SOFTWARE VERSION: 5.0/(1.2009.42-11) lsb-core 3.2-15osso2 EXACT STEPS LEADING TO PROBLEM: 1. Uh, build asterisk 1.6, install it, and... 2. /etc/init.d/asterisk start EXPECTED OUTCOME: Asterisk should start. ACTUAL OUTCOME: /etc/init.d/asterisk: line 212: getopts: not found /etc/init.d/asterisk: line 212: getopts: not found Starting Asterisk PBX: /etc/init.d/asterisk: line 212: getopts: not found /etc/init.d/asterisk: line 212: getopts: not found REPRODUCIBILITY: 100% EXTRA SOFTWARE INSTALLED: asterisk.... lsb-base OTHER COMMENTS: Ok, asterisk obviously isn't part of Core. I'm opening up this here because on "most" systems getopts is provided by bash, but maemo uses busybox instead. Busybox has a `getopt` command, but not getopts. I'm not sure how much difference there is between the two. Asterisk isn't running getopts itself, it is just doing: . /lib/lsb/init-functions init-functions is a part of the lsb-core package. init-functions is trying to call getopts, and that is where the fail comes in: while getopts fn:p: opt ; do HOWTO fix? Perhaps one of the following: 1) Fix lsb-core by changing init-functions to use getopt instead of getopts 2) Have lsb-core depend on bash... thx :) User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091105 Fedora/3.5.5-1.fc12 Firefox/3.5.5
It looks like getopts can also be enabled in the busybox build: CONFIG_ASH_GETOPTS: Enable getopts builtin in the ash shell. Builtin getopt to parse positional parameters Note, this is in addition to `getopt` (no "s") which is already built-in to busybox.
Ah, I meant lsb-base not lsb-core above. Sry for noise.
Confirmed, and this is a requirement according to <http://refspecs.freestandards.org/LSB_3.2.0/LSB-Core-generic/LSB-Core-generic/command.html>.
Harmattan (the version after Maemo5) will provide BusyBox 1.18 which includes getopts: ~ $ getopts /bin/sh: getopts: usage: getopts optstring var [arg] Closing as FIXED in Harmattan.
*** Bug 12238 has been marked as a duplicate of this bug. ***