summaryrefslogtreecommitdiff
path: root/cleopatre/buildroot/docs/README.diskimage
diff options
context:
space:
mode:
authorlefranc2008-08-01 09:25:43 +0000
committerlefranc2008-08-01 09:25:43 +0000
commit9a2bcc0b92b392f1f21cd26927515e4d49bc128e (patch)
treed0bd193c764606c4c6e4b4568ef08d0ff3324b72 /cleopatre/buildroot/docs/README.diskimage
parentd0cc0304ed6eaf72116743e13e5b3b3cbfd878bb (diff)
- import of buildroot original sources (20080729 version)
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@2704 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cleopatre/buildroot/docs/README.diskimage')
-rw-r--r--cleopatre/buildroot/docs/README.diskimage37
1 files changed, 37 insertions, 0 deletions
diff --git a/cleopatre/buildroot/docs/README.diskimage b/cleopatre/buildroot/docs/README.diskimage
new file mode 100644
index 0000000000..67a0aad4f0
--- /dev/null
+++ b/cleopatre/buildroot/docs/README.diskimage
@@ -0,0 +1,37 @@
+# Sample for i386 to create a 6MB disk-image
+
+# create an image file
+dd if=/dev/zero bs=512 count=$((6*1024*1024/512)) of=img
+# create a partition (optional)
+echo -e "n\np\n1\n\nw\n" | \
+ ~/src/busybox/busybox fdisk -C 16065 -H 255 -S 63 ./img
+# as root, associate the image with a look-device:
+# The offset of 512 comes from the the layout of the image. See
+# ~/src/busybox/busybox fdisk -C 16065 -H 255 -S 63 -l ./img for the start
+# block and multiply this with the block size (==512).
+~/src/busybox/busybox losetup -o 512 /dev/loop/0 /path/to/the/img
+# create some filesystem on it, for example ext2
+mkfs.ext2 -m0 -Lslash /dev/loop/0
+# mount it and copy your stuff to it
+~/src/busybox/busybox mount -oloop,rw /dev/loop/0 /media/l0
+~/src/busybox/busybox mkdir -p /media/l0/boot/grub
+~/src/busybox/busybox cp -a project_build_i386/root/boot/grub/stage? /media/l0/boot/grub/
+~/src/busybox/busybox cp -a project_build_i386/root/boot/bzImage /media/l0/boot/
+~/src/busybox/busybox cat > /media/l0/boot/grub/menu.lst <<EOF
+title=GNU/Linux
+root (hd0,0)
+kernel /boot/bzImage
+EOF
+# finally unmount the dist and disassociate the loopdev
+~/src/busybox/busybox umount /media/l0
+~/src/busybox/busybox losetup -d /dev/loop/0
+# now install grub from the chroot
+~/src/busybox/busybox losetup /dev/loop/0 /path/to/the/img
+project_build_i386/root/usr/sbin/grub --device-map=/dev/null
+device (hd0) img
+geometry (hd0) 16065 255 63
+root (hd0,0)
+setup (hd0)
+quit
+# finally boot the thing
+/opt/qemu-trunk_ggi-2.2.2/bin/qemu -snapshot -hda img -boot c