All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

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() {
dunit=`expr $dunit - 24`
lrootdev="8${dunit}${part}"
;;
# SATA, new names
ada[0-9])
dtype="sd"
dunit=`echo $disk | sed -e 's/ada\([0-9][0-9]*\)$/\1/'`
lrootdev="8${dunit}${part}"
;;
# SCSI
da[0-7]|ada[0-7])
da[0-7])
dtype="sd"
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