Hi Guys,

I have heard a couple of times in this list about the problem of how to
convert from iso to usb installer. I made one small script to do this
conversion that I use myself and perhaps is useful to others. Assuming your
usb key was attached in sd1, you should call the script as:

./iso2usb /full/path/to/install.iso sd1

WARNING: This script makes modifications to the parition tables so make sure
the argument you are passing as USB is the correct one. Otherwise you can
wipe your root disk.

This script is not bullet-proof either, I do not make any errors check. It
was intended just as a proof of concept and works very well for me.

I higly recommend understanding the script before using.

Luis.

#!/bin/sh

ISO=$1
USB=$2

ISO_MNT=/tmp/iso/
USB_MNT=/tmp/usb/

# make temporary mount dirs
mkdir $ISO_MNT $USB_MNT

# mount iso
vnconfig svnd0 $ISO
mount /dev/svnd0c $ISO_MNT

# prepare and mount usb
dd if=/dev/zero of=/dev/${USB}c count=1 bs=1m
echo "reinit\nwrite\nquit\n" | fdisk -e $USB
echo "a\n\n\n\n\nw\nq\n" | disklabel -E $USB
newfs /dev/r${USB}a
mount /dev/${USB}a $USB_MNT

# copy data from iso to usb
cp -r $ISO_MNT/* $USB_MNT

# make usb bootable
cp /usr/mdec/boot $USB_MNT/boot
/usr/mdec/installboot -v $USB_MNT/boot /usr/mdec/biosboot $USB

# unmounting and cleaning everything
umount $ISO_MNT $USB_MNT
vnconfig -u svnd0

Reply via email to