1CDLinuxであるPepoLinuxをUSBメモリやHDDへインストールして起動できるようにしたものです。
USBメモリだけでなくFAT32のファイルシステムならdevice指定を変更すればHDDへもインストールできます。
簡単なスクリプトなので他へも転用できると思います。
2011.11.22 by Yamauchi Isamu
- #!/bin/sh
- # pepousb-install ; install for PepoLinux form CD to USB devices
- # licence GPLv2 ; this scripts designed by IZAMUKARERA 2007.1.7 update 2011.11.3
- NU=/dev/null
- MNT=/var/tmp/pepotmp.$$
- echo -n "input usb device eg:/dev/sdb1-->"
- read G
- if [ -z "$G" ] ;then
- USBDEV="/dev/sdb1"
- else
- USBDEV="$G"
- fi
- if [ ! -e "$USBDEV" ];then
- echo $USBDEV not found!
- exit -1
- fi
- CDMNT=`cat /etc/mtab|awk '/iso9660/{print $2}'`
- if [ -z "$CDMNT" ] ;then
- echo "Please mount PepoLinux-CD and try once!"
- exit
- fi
- mkdir -p $MNT
- mount -t vfat $USBDEV $MNT 1>$NU 2>$NU
- USBMNT=`cat /etc/mtab|awk '/vfat/{print $2}'`
- if [ -z "$USBMNT" ] ;then
- echo "Please $USBDEV format vfat or device not found or manually mount o
- r etc.--> try once!"
- exit
- fi
- umount $USBMNT
- echo -n "next step usb device all files destroy (y/n)-->"
- read G
- [ "Xy" != "X$G" ] && exit
- # make usb-PepoLinux
- mount -t vfat $USBDEV $MNT 1>$NU 2>$NU
- cp -a $CDMNT/* $MNT/ 1>$NU 2>$NU
- tUSBDEV=`echo -en $USBDEV | sed s/[0-9]$//`
- cat /boot/grub/device.map | grep -v hda | echo "(hd0) $tUSBDEV" >$MNT/boot/grub/
- device.map
- grub-install --no-floppy --root-directory=$MNT $tUSBDEV
- sync
- umount $MNT
- rm -rf $MNT
- echo done!
[PageInfo]
LastUpdate: 2011-11-24 12:01:45, ModifiedBy: pepolinux
[License]
GNU Free Documentation License
[Permissions]
view:all, edit:doc editors, delete/config:doc editors