Bug 6566

Summary: bootmisc.sh: syntax error: bad substitution
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Maxin B. John (inactive) <maxin.baby.john>
Component: coreAssignee: Ben Shelton <ben.shelton>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: meta.mr.watcher, meta.watcher
Version: 1.6   
Target Milestone: 1.7 M2   
Hardware: x86   
OS: mips   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
Patch for proposed fix. none

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>