better output while relocating sectors
[sysadmin-cookbook] / recepies / dell / flash-bios.sh
1 #!/bin/sh -x
2
3 system_id=`getSystemId | grep 'System ID:' | cut -d: -f2 | sed 's/ //g'`
4 version=`getSystemId | grep 'BIOS' | cut -d: -f2 | sed 's/ //g'`
5
6 dir=linux.dell.com/repo/firmware/bios-hdrs
7
8 bios=`ls -d $dir/*$system_id*/bios.hdr | cut -d/ -f 5 | iselect -a -t "System $system_id BIOS $version"`
9
10 test -z "$bios" && exit
11
12 bios="$dir/$bios/bios.hdr"
13
14 dellBiosUpdate -i -f $bios || exit
15 dellBiosUpdate -t -f $bios || exit
16
17 echo -n "ENTER to program bios and reboot or CTRL+C to abort ";
18 read
19
20 modprobe dell_rbu
21 dellBiosUpdate -u -f $bios
22 reboot