[ltp] Bootable usb for bios upgrades

Yves-Alexis Perez linux-thinkpad@linux-thinkpad.org
Mon, 13 Apr 2009 13:48:38 +0200


--=-EjFhu687m4TJUYNKjAi7
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On dim, 2009-04-12 at 13:06 -0300, Henrique de Moraes Holschuh wrote:
> On Sun, 12 Apr 2009, Yves-Alexis Perez wrote:
> > On dim, 2009-04-12 at 11:31 -0300, Henrique de Moraes Holschuh wrote:
> > > If someone writes a script that creates a bootable USB pendrive using
> > > FreeDos, I can get it shipped to the right hands in Japan.   If anyon=
e is
> > > interested into doing it, please make sure to use either the 2-clause=
 BSD or
> > > the MIT X license for the scripts.
> >=20
> > For the record, grml or sysrescuecd ships FreeDOS on their system (I
> > can't remember which one). Booting FreeDOS from a grub (or syslinux) on
> > a usb token should not be too hard.
> >=20
> > I don't exactly what's required and for who (you mean, have them
> > generate usb isos like they do for cd isos?), but that should be doable=
.
>=20
> Something that takes a standard Lenovo ISO image and massages it into
> something that can be written to the USB device to make it boot would be
> ideal.

Ok it's not yet a script, but at least it's an howto which could be at
least semi-automated. It could be added to the various methods at
http://www.thinkwiki.org/wiki/BIOS_Upgrade/X_Series

I tested it on my T61 and it seems to work (though my bios is already up
to date so it didn't upgrade in the end, but at least it did make the
checks).

Basically I took a look at makebootfat and that's what I'm using, along
with FreeDOS, using instructions from
http://wiki.fdos.org/Installation/BootDiskCreateUSB

Preparation:
You'll need makebootfat packages, but you'll need the makebootfat
sources too because you need the mbrfat.bin file and it's not included
in the binary package (#523891).
You'll need the FreeDOS kernel, and the FAT boot sectors, which are in
FreeDOS archives.
0) mkdir usb-bios && cd usb-bios
1) sudo apt-get install makebootfat
2) apt-get source makebootfat
3) wget http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributio=
ns/1.0/pkgs/unstablx.zip
3bis) wget http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distribu=
tions/1.0/pkgs/kernels.zip
4) unzip unstablx.zip
4bis) unzip kernels.zip

Steps:
1) Download the bootable cd iso for your bios upgrade. 7luj24uc.iso
here.
2) Mount the iso somewhere:
# sudo mount -o loop 7luj24uc.iso  /mnt/iso/
3) Copy the files on a writable folder
# mkdir 7LUJ24US
# cp -a /mnt/iso/* 7LUJ24US
4) Copy the FreeDOS kernel
# cp unstablx/bin/kernel.sys 7LUJ24US
3) Plug your usb key. Here it'll appear as /dev/sdb. Don't mount it.
4) Create the bootable usb disk
# makebootfat -o /dev/sdb -E 255 \=20
-1 source/ukernel/boot/fat12.bin \
-2 source/ukernel/boot/fat16.bin \
-3 source/ukernel/boot/fat32lba.bin \
-m makebootfat-1.4/mbrfat.bin \
7LUJ24US

You should be able to reboot and boot on the usb key and flash your
bios.
For the following times it should be enough to copy the =E2=80=9Cnew=E2=80=
=9D files from
the Lenovo cd iso directly to the usb key.
I'm not sure makebootfat can generate a file instead of directly writing
to the device. But I guess if we can start from an already bootable usb
iso it's easy to add new files to it.

Hope it can be helpful for X* users around. As always, use at your own
risks.

Cheers,
--=20
Yves-Alexis

--=-EjFhu687m4TJUYNKjAi7
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEABECAAYFAknjJpEACgkQTUTAIMXAW65IvwCgkcolQcJzfE3/8mENQe3JQPRd
TwMAoJX0gs/EqR/KZsPe6DzcJKBtowDe
=5O+K
-----END PGP SIGNATURE-----

--=-EjFhu687m4TJUYNKjAi7--