From: rjones Date: Thu, 19 Mar 2009 19:27:25 +0000 (+0000) Subject: Added examples directory. X-Git-Tag: 1.5~37 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=9a2ace44755434b1bec8b187f0d919fc4c374583;p=febootstrap.git Added examples directory. Added minimal-filesystem example. --- diff --git a/examples/.cvsignore b/examples/.cvsignore new file mode 100644 index 0000000..d9e4201 --- /dev/null +++ b/examples/.cvsignore @@ -0,0 +1,4 @@ +minimal +minimal-initrd.img +vmlinuz +zero \ No newline at end of file diff --git a/examples/README b/examples/README new file mode 100644 index 0000000..9660c0c --- /dev/null +++ b/examples/README @@ -0,0 +1,4 @@ +You should read and edit these scripts before running them! + +You don't need to be root, in fact, you *shouldn't* be root +when running these scripts! diff --git a/examples/minimal-filesystem.sh b/examples/minimal-filesystem.sh new file mode 100755 index 0000000..74a4c2c --- /dev/null +++ b/examples/minimal-filesystem.sh @@ -0,0 +1,44 @@ +#!/bin/sh - + +# Before running, make sure 'vmlinuz' in this examples directory is a +# bootable Linux kernel or a symlink to one. You can just use any +# kernel out of the /boot directory for this. +# +# eg: +# cd examples +# ln -s /boot/vmlinuz-NNN vmlinuz + +# This creates a very minimal filesystem, just containing bash and a +# few command line utilities. One of the joys of Fedora is that even +# this minimal install is still 200 MB ... + +../febootstrap -i bash -i coreutils fedora-10 ./minimal + +# Create the /init which is just a simple script to give users an +# interactive shell. + +( cd minimal && cat > init <<'__EOF__' +#!/bin/sh +echo; echo; echo +echo "Welcome to the minimal filesystem example" +echo; echo; echo +/bin/bash -i +__EOF__ +chmod +x init +) + +# Convert the filesystem to an initrd image. + +../febootstrap-to-initramfs ./minimal > minimal-initrd.img + +# This is needed because of crappiness with qemu. + +rm -f zero +dd if=/dev/zero of=zero bs=2048 count=1 + +# Now run qemu to boot this minimal system. + +qemu-system-$(arch) \ + -m 1024 \ + -kernel vmlinuz -initrd minimal-initrd.img \ + -hda zero -boot c