1
0
mirror of git://git.2f30.org/morpheus.git synced 2024-06-25 23:58:33 +00:00
morpheus/create-bootable
2013-09-17 19:04:01 +01:00

34 lines
505 B
Bash
Executable File

#!/bin/sh
#
# Ensure you've loaded the loop module with max_part=15
img=morpheus-x86_64-0.0.img
dd if=/dev/zero of=$img bs=256M count=1
fdisk $img <<< '
o
n
p
1
a
1
w'
lodev=$(losetup -f --show $img) || exit 1
partition="$lodev"p1
mkfs.ext2 -L MORPHEUS $partition || exit 1
mount $partition /mnt || exit 1
rmdir /mnt/lost+found
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