bash4 breaks firmware update scripts ( file not found)

Stephen Dowdy sdowdy at
Wed Mar 3 10:17:36 CST 2010


Good catch.
Looks like BASH is rectifying POSIX non-compliance.
The scripts i looked at, properly (and
i'm pleasantly surprised) attempt to do a little
bit of security sanitizing at the start.  They
use 'getconf PATH' to reset the PATH, blowing away
your external changes, and they don't put "." back
into it.  So, BASH4 is not breaking the script, the
script is broken. (so if PATH had . in it, it'd
still work in bash's "POSIX compliance" mode (#!/bin/sh)

It's not clear to me that "source" is POSIX compliant.
(maybe it is, but i thought dot-scripts needed to be
sourced only with ".")  (so, i'm thinking it's a bash-ism)

# checkbashisms 2>&1 | grep 'source'
possible bashism in /d1/src/Dell_BIOS/PER710/ line 1474 (should be '.', not 'source'):

There's plenty of other bashisms in those scripts (typset, let, ..)

details on 'dot' showing it DOES source from "." if in PATH.

Looks like Dell's got some script cleanup work to do.


Dominik L. Borkowski wrote, On 03/03/2010 08:18 AM:

> It seems that bash4 breaks most of the scripts used by SUU, and I was 
> wondering if anybody has suggestions on how to fix permanently.
> Behavior:
> * extract any firmware bin, for example NETW_FRMW_LX_R246418.BIN
> * run
> ./ 
> ./ line 124: source: file not found
> ./ line 1471: source: file not found
> another example:
> ./
> Collecting inventory...
> ./PV2XX: line 4: source: file not found
> ./PV2XX: line 5: source: file not found
> It seems that with bash 4, 'source' no longer searches current directory. 
> There are a couple of dirty hacks that seem to work:
> 1) change !/bin/sh to !/bin/bash in
> 2) provide './' path for all the sourced scripts in
> typeset -r _BUILDVER="./"
> I'm not sure whether there is a better way, other than trying to downgrade to 
> bash3. Considering that eventually other distributions will move to bash4, I 
> was wondering if this ought to be fixed upstream.
> Here's a relevant post regarding bash4 on their mailing list:
> Unfortunately, setting $PATH to include '.' doesn't seem to work.
> Cheers!

More information about the Linux-PowerEdge mailing list