diff options
| author | Ben Shelton <ben.shelton@ni.com> | 2014-07-23 11:22:44 -0500 | 
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-07-23 21:59:17 +0100 | 
| commit | 7c11b327a1cf116ccfd3df05e84845dbcb3d3fd8 (patch) | |
| tree | 42e05556a39ba9661482a1ec1ae99a477782e8f4 | |
| parent | 0cc5fa580d35b9740d16ba6cc76fd02c6b434d2a (diff) | |
| download | poky-7c11b327a1cf116ccfd3df05e84845dbcb3d3fd8.tar.gz | |
initscripts: fix bashism in bootmisc.sh
In the commit 'initscripts: save /etc/timestamp with seconds accuracy',
a bashism was introduced in the bootmisc.sh script in the code to set
the current date from the stored value in /etc/timestamp.  This causes
that operation to fail with the following message when /bin/sh is not
bash:
/etc/init.d/rc: /etc/rcS.d/S55bootmisc.sh: line 73: syntax error: bad substitution
Fixed by using pattern matching removal rather than bash-specific
substring expansion.
[YOCTO #6566]
(From OE-Core rev: c8a451adc71e4ce9ab963f61d7830c2d75aaffca)
Signed-off-by: Ben Shelton <ben.shelton@ni.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rwxr-xr-x | meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh | 6 | 
1 files changed, 5 insertions, 1 deletions
| diff --git a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh index ccc7f9f1f4..df553bc079 100755 --- a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh +++ b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh | |||
| @@ -70,7 +70,11 @@ then | |||
| 70 | read TIMESTAMP < /etc/timestamp | 70 | read TIMESTAMP < /etc/timestamp | 
| 71 | if [ ${TIMESTAMP} -gt $SYSTEMDATE ]; then | 71 | if [ ${TIMESTAMP} -gt $SYSTEMDATE ]; then | 
| 72 | # format the timestamp as date expects it (2m2d2H2M4Y.2S) | 72 | # format the timestamp as date expects it (2m2d2H2M4Y.2S) | 
| 73 | date -u ${TIMESTAMP:4:8}${TIMESTAMP:0:4}.${TIMESTAMP:(-2)} | 73 | TS_YR=${TIMESTAMP%??????????} | 
| 74 | TS_SEC=${TIMESTAMP#????????????} | ||
| 75 | TS_FIRST12=${TIMESTAMP%??} | ||
| 76 | TS_MIDDLE8=${TS_FIRST12#????} | ||
| 77 | date -u ${TS_MIDDLE8}${TS_YR}.${TS_SEC} | ||
| 74 | test -x /etc/init.d/hwclock.sh && /etc/init.d/hwclock.sh stop | 78 | test -x /etc/init.d/hwclock.sh && /etc/init.d/hwclock.sh stop | 
| 75 | fi | 79 | fi | 
| 76 | fi | 80 | fi | 
