#!/bin/sh # # Ensure you've loaded the loop module with max_part=15 dd if=/dev/zero of=morpheus-boot.img bs=16M count=1 fdisk morpheus-boot.img <<< ' o n p 1 a 1 w' lodev=$(losetup -f --show morpheus-boot.img) || exit 1 partition="$lodev"p1 mkfs.ext2 -L MORPHEUS $partition || exit 1 mount $partition /mnt || exit 1 fakeroot cp -dar root/* /mnt extlinux --install /mnt/boot || exit 1 dd if=stuff/mbr.bin of=$lodev conv=notrunc bs=440 count=1 sync umount /mnt sleep 3 losetup -d $lodev