Commit a861dd6c authored by Mike Hibler's avatar Mike Hibler

The Joy of Sed.

We were parsing the disk number out with:

  dunit=`echo $disk | sed -e 's/..\([0-7]\)/\1/'`

which works fine with "ad0", giving a dunit of "0"
but with "ada0" you get a dunit of "a0"

And, after misinterpreting through another sed command:

dunit=`echo $dunit | sed -e 'y/01234567/abcdefgh/'`

we get "aa" instead of "a". Append that to "sd" and your disk
becomes "sdaa" instead of "sda". Next thing you know I'm blaming
Emacs for inserting an extra character in /etc/fstab!
parent 9461993c
...@@ -848,8 +848,14 @@ dolinux() { ...@@ -848,8 +848,14 @@ dolinux() {
dunit=`expr $dunit - 24` dunit=`expr $dunit - 24`
lrootdev="8${dunit}${part}" lrootdev="8${dunit}${part}"
;; ;;
# SATA, new names
dunit=`echo $disk | sed -e 's/ada\([0-9][0-9]*\)$/\1/'`
da[0-7]|ada[0-7]) da[0-7])
dtype="sd" dtype="sd"
lrootdev="8${dunit}${part}" lrootdev="8${dunit}${part}"
;; ;;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment