1
0
mirror of git://git.2f30.org/morpheus.git synced 2024-06-27 08:18:36 +00:00
morpheus/create-bootable

36 lines
525 B
Plaintext
Raw Normal View History

2013-09-16 11:23:55 +00:00
#!/bin/sh
#
# Ensure you've loaded the loop module with max_part=15
2013-09-20 10:20:41 +00:00
. ./prepare-env
img=morpheus-$arch-$version.img
2013-09-17 18:04:01 +00:00
2013-09-26 19:39:37 +00:00
dd if=/dev/zero of=$img bs=512M count=1
2013-09-17 18:04:01 +00:00
fdisk $img <<< '
2013-09-16 11:23:55 +00:00
o
n
p
1
a
1
2013-09-16 11:23:55 +00:00
w'
2013-09-17 18:04:01 +00:00
lodev=$(losetup -f --show $img) || exit 1
2013-09-16 11:23:55 +00:00
partition="$lodev"p1
mkfs.ext2 -L MORPHEUS $partition || exit 1
2013-09-16 11:23:55 +00:00
mount $partition /mnt || exit 1
2013-09-17 13:19:04 +00:00
rmdir /mnt/lost+found
2013-09-16 11:23:55 +00:00
2013-09-25 15:53:19 +00:00
fakeroot cp -ar root/* /mnt
extlinux --install /mnt/boot || exit 1
2013-09-16 11:23:55 +00:00
2013-09-16 18:43:29 +00:00
dd if=stuff/mbr.bin of=$lodev conv=notrunc bs=440 count=1
2013-09-16 12:58:37 +00:00
sync
2013-09-16 11:23:55 +00:00
umount /mnt
sleep 3
losetup -d $lodev