#!/bin/bash # # Install the standalone boot files into the USB stick # ---------------------------------------------------- # # # 30-Aug-05 amo Date-of-Birth # 06-Sep-05 amo Change to TGZ with datecode ( 0829 or 0831 ) # 11-Sep-05 amo Working kanji-KDE + fvwm menu # # # fdisk -l /dev/sda # ------------------ # # # # note that different usb sticks will have different C/H/S info # # # # we want approximately the same sized block sizes per partition # # # # # Disk /dev/sda: 1048 MB, 1048576000 bytes # 255 heads, 63 sectors/track, 127 cylinders # Units = cylinders of 16065 * 512 = 8225280 bytes # # Device Boot Start End Blocks Id System # /dev/sda1 * 1 5 40131 83 Linux # /dev/sda2 6 13 64260 83 Linux # /dev/sda3 14 17 32130 83 Linux # /dev/sda4 18 127 883575 5 Extended # /dev/sda5 18 67 401593+ 83 Linux # /dev/sda6 68 71 32098+ 82 Linux swap # /dev/sda7 72 127 449788+ 83 Linux # # USB="/opt/USB.Maxnet" # #GZ="2005.0829" #GZ="2005.0831" TGZ="2005.0911" # # # --------------------------- # echo the command and run it, abort on errors # --------------------------- # function docmd() { cmd="$1" # echo "$cmd" eval "$cmd" stat=$? # if [ "$stat" != 0 ]; then echo "#" echo "# ERROR: Aborting.. " echo "#" # exit 1 # fi # } # docmd # # # Install the *.tgz file into the partition # ------------------------------------------- # function install_tgz() { part="$1" # umount /dev/$part # if [ "$part" = "sda1" ]; then # force it to ext3 or vfat docmd "mke2fs -j -q -m 0 /dev/$part" # elif [ "$part" = "sda6" ]; then # docmd "echo 'y' | mkfs.jfs -q /dev/$part" # else # sda2, sda3, sda5 # docmd "echo 'y' | mkfs.xfs -q /dev/$part" # # no xfs on rh, reiser needs too much space, use ext3 for now docmd "mke2fs -j -q -m 0 /dev/$part" # fi # echo "" docmd "mount /dev/$part /mnt/$part " df # docmd "cd /mnt/$part ; max.tar zxvfp $USB/$TGZ/$part.tgz " echo "" # } # install_tgz # # # docmd "cd $USB" # docmd "ls -la /mnt/sda1 /mnt/sda2 /mnt/sda3 /mnt/sda5 /mnt/sda6 > /dev/null " # # # # /dev/sda1 is formatted for /boot # ----------------- install_tgz sda1 # # # /dev/sda2 is formatted for initrd+rootfs # ---------------------- install_tgz sda2 # # # /dev/sda3 is formatted for /dev/loop1 ( X11 ) # ---------------------- install_tgz sda3 # # # /dev/sda5 is formatted for /dev/loop2 ( KDE ) # ---------------------- install_tgz sda5 # # # /dev/sda6 has User-Defined Changes # ---------------------------------- install_tgz sda6 # # # Apply Maxnet Customizations ( ip# and hostname ) # --------------------------- cd /mnt/sda6 max.tar zxpvf $USB/$TGZ/sda6.maxnet.tgz # # # make the USB stick bootable # --------------------------- docmd "lilo -v -C /etc/lilo.sda.2.4.31.conf" # # echo "#" docmd "# ls -laR /mnt/sda1 /mnt/sda2 /mnt/sda3 /mnt/sda5 /mnt/sda6" echo "#" # # # End of file