1
0
mirror of git://git.2f30.org/morpheus.git synced 2024-06-30 18:41:22 +00:00
morpheus/create-bootable
2013-09-16 14:36:12 +01:00

30 lines
478 B
Bash
Executable File

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