#!/bin/sh # adapt this line to point to your USB-device # Warning: all data from it will be lost in the process, # so make sure that it does not point to your harddisk! dev=/dev/sdc echo "part 1 - preparing the USB-stick" dd if=/dev/zero of=$dev bs=64k echo "create one bootable primary partition of type W95 FAT32 (LBA)" echo "n p 1 t c a 1 w" fdisk $dev mkfs.vfat -F 32 ${dev}1 mkdir -p /mnt/1 /mnt/2 echo "part 2 - installing the bootloader" mount -t vfat ${dev}1 /mnt/1 # the following line uses the grub files from the booted linux # you may use other sources instead cp -a /boot /mnt/1/ echo "(hd0) $dev" > /mnt/1/boot/grub/device.map # on opensuse-10.3 you need to call grub-install.unsupported instead grub-install --root-directory=/mnt/1 $dev echo "part 3 - adding the kernel and root fs" wget -nc http://ftp.gwdg.de/pub/linux/knoppix/KNOPPIX_V5.1.1CD-2007-01-04-DE.iso mount -o loop KNOPPIX_V5.1.1CD-2007-01-04-DE.iso /mnt/2 cd /mnt/2 cp -a --parent KNOPPIX/KNOPPIX KNOPPIX/modules /mnt/1 cp -a boot/isolinux/{linux,minirt.gz} /mnt/1/boot/ echo "you need to add kernel params and initrd to your boot/grub/menu.lst" grep -A2 "LABEL knoppix$" boot/isolinux/isolinux.cfg echo "and possibly clean it up" cd - umount /mnt/2 cat >>/mnt/1/boot/grub/menu.lst <