Bug 6566 - bootmisc.sh: syntax error: bad substitution
Summary: bootmisc.sh: syntax error: bad substitution
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 1.6
Hardware: x86 mips
: Medium normal
Target Milestone: 1.7 M2
Assignee: Ben Shelton
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2014-07-22 15:11 UTC by Maxin B. John (inactive)
Modified: 2014-07-31 11:30 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
Patch for proposed fix. (757 bytes, patch)
2014-07-22 20:09 UTC, Ben Shelton
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maxin B. John (inactive) 2014-07-22 15:11:04 UTC
Observed this syntax error while booting core-image-minimal on qemumips:  

hwclock: can't open '/dev/misc/rtc': No such file or directory
/etc/init.d/rc: /etc/rcS.d/S55bootmisc.sh: line 73: syntax error: bad substitution


Build Configuration:
BB_VERSION        = "1.23.1"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Ubuntu-14.04"
TARGET_SYS        = "mips-poky-linux"
MACHINE           = "qemumips"
DISTRO            = "poky"
DISTRO_VERSION    = "1.6+snapshot-20140722"
TUNE_FEATURES     = "o32 bigendian fpu-hard mips32"
TARGET_FPU        = ""

Introduced by the commit 00017b4dd895afff9ff613d511cea373f13a96ea

# checkbashisms ../meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
possible bashism in ../meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh line 73 (${foo:3[:1]}):
		date -u ${TIMESTAMP:4:8}${TIMESTAMP:0:4}.${TIMESTAMP:(-2)}
Comment 1 Ben Shelton 2014-07-22 17:47:07 UTC
This also occurs under x86 QEMU.  The issue is indeed the bashism pointed out by Maxin B. John.

I have a patch and have tested that it fixes the issue.
Comment 2 Ben Shelton 2014-07-22 20:09:24 UTC
Created attachment 2051 [details]
Patch for proposed fix.
Comment 3 Maxin B. John (inactive) 2014-07-23 10:57:33 UTC
This works fine for me. Thanks for fixing it!

Tested-by: Maxin B. John <maxin.john@enea.com>