- wget http://www.freedos.org/download/download/fdbasecd.iso
- qemu-img create -f raw upgrade_bios.img 100M (you can use dd to do this also)
- qemu-system-x86_64 -hda upgrade_bios.img -cdrom fdbasecd.iso -boot d
- Install FreeDOS onto the disk image.
- Shutdown the VM.
- wget http://downloads.dell.com/FOLDER01438023M/1/L322XA08.exe
- Become root (su or sudo -s)
- kpartx -sav upgrade_bios.img (will create /dev/loop[0-9]\+ and /dev/mapper/loop[0-9]\+p1)
- mount /dev/mapper/loop0p1 /mnt
- mkdir /mnt/bios
- cp L322XA08.exe /mnt/bios
- umount /mnt
- kpartx -sd upgrade_bios.img
- cp upgrade_bios.img /boot
- apt-get install syslinux
- Add following a script in /etc/grub.d to add entries to grub to boot to the image using memdisk from syslinux. The entries should look something like the following:
menuentry "Upgrade BIOS" { insmod part_msdos
insmod ext2
linux16 /usr/lib/syslinux/memdisk initrd16 /boot/upgrade_bios.img }
For example, here's my /etc/grub.d/25_memdisk_for_bios_upgrade:
#!/bin/sh set -e if [ -f /usr/lib/grub/grub-mkconfig_lib ]; then . /usr/lib/grub/grub-mkconfig_lib LX=linux16 else # no grub file, so we notify and exit gracefully echo "Cannot find grub config file, exiting." >&2 exit 0 fi # We need 16-bit boot, which isn't available on EFI. if [ -d /sys/firmware/efi ]; then exit 0 fi # We can't cope with loop-mounted devices here. case ${GRUB_DEVICE_BOOT} in /dev/loop/*|/dev/loop[0-9]) exit 0 ;; esac prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")" if test -e /boot/upgrade_bios.img ; then FREEDOSPATH=$( make_system_path_relative_to_its_root "/boot/upgrade_bios.img" ) echo "Found BIOS upgrade image: $FREEDOSPATH" >&2 cat << EOF menuentry "Upgrade BIOS" { EOF printf '%s\n' "${prepare_boot_cache}" cat << EOF $LX /usr/lib/syslinux/memdisk initrd16 $FREEDOSPATH } EOF fi - chmod 755 /etc/grub.d/25_memdisk_for_bios_upgrade
- update-grub
- Reboot computer and get into grub boot menu (in Ubuntu, you can hold Shift during the boot to for showing the grub menu)
- Select "Upgrade BIOS"
- Select 1st boot option from FreeDOS boot menu
- Wait for C:\> prompt
- cd BIOS
- Make sure your power is plugged in.
- run L322XA08.exe
- Wait for it to complete
- Reboot and celebrate if it works.
UPDATE (2013/10/19): Added script contents for /etc/grub.d/25_memdisk_for_bios_upgrade.
UPDATE (2013/11/09): Fixed the 25_memdisk_for_bios_upgrade script. Added some previously missing steps.
UPDATE (2013/12/21): Dell, if you ever read this, providing the baked freedos .img file with the BIOS upgrader inside as a download from your website would be super useful. Bonus points if you make the BIOS utility start with autoexec.bat and then restart the machine when it's done. That's exactly what I did to enable a similar image to be used to upgrade BIOSes on some Dell servers. It even worked over PXE.
UPDATE (2013/11/09): Fixed the 25_memdisk_for_bios_upgrade script. Added some previously missing steps.
UPDATE (2013/12/21): Dell, if you ever read this, providing the baked freedos .img file with the BIOS upgrader inside as a download from your website would be super useful. Bonus points if you make the BIOS utility start with autoexec.bat and then restart the machine when it's done. That's exactly what I did to enable a similar image to be used to upgrade BIOSes on some Dell servers. It even worked over PXE.
No comments:
Post a Comment