X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;ds=sidebyside;f=examples%2Fminimal-filesystem.sh;h=497d20966c9e132524edcf1a82ea1d781c349b3b;hb=6e19bf07700264ef7006f778cd555354e0b42fca;hp=9a0f5757124d387aee51291938f2326ed73e14e3;hpb=2c02cadef79f6e488f203ecc7e0d1eda0fafe849;p=febootstrap.git diff --git a/examples/minimal-filesystem.sh b/examples/minimal-filesystem.sh index 9a0f575..497d209 100755 --- a/examples/minimal-filesystem.sh +++ b/examples/minimal-filesystem.sh @@ -12,6 +12,8 @@ # few command line utilities. One of the joys of Fedora is that even # this minimal install is still 200 MB ... +set -e + if [ $(id -u) -eq 0 ]; then echo "Don't run this script as root. Read instructions in script first." exit 1 @@ -33,15 +35,19 @@ echo -n "After minimization: "; du -sh minimal # Create the /init which is just a simple script to give users an # interactive shell. -( cd minimal && cat > init <<'__EOF__' +create_init () +{ + 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 -) + chmod +x /init +} +export -f create_init +../febootstrap-run ./minimal -- bash -c create_init # Convert the filesystem to an initrd image. @@ -55,6 +61,6 @@ dd if=/dev/zero of=zero bs=2048 count=1 # Now run qemu to boot this minimal system. qemu-system-$(arch) \ - -m 128 \ + -m 256 \ -kernel vmlinuz -initrd minimal-initrd.img \ -hda zero -boot c