summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/Makefile.am23
-rw-r--r--examples/README10
-rwxr-xr-xexamples/guestfs-test.sh73
-rwxr-xr-xexamples/minimal-filesystem.sh66
4 files changed, 0 insertions, 172 deletions
diff --git a/examples/Makefile.am b/examples/Makefile.am
deleted file mode 100644
index 08fb42b..0000000
--- a/examples/Makefile.am
+++ /dev/null
@@ -1,23 +0,0 @@
-# febootstrap Makefile.am
-# (C) Copyright 2009 Red Hat Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-#
-# Written by Richard W.M. Jones <rjones@redhat.com>
-
-EXTRA_DIST = \
- README \
- minimal-filesystem.sh \
- guestfs-test.sh
diff --git a/examples/README b/examples/README
deleted file mode 100644
index c52e7b0..0000000
--- a/examples/README
+++ /dev/null
@@ -1,10 +0,0 @@
-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!
-
-If you want to run the scripts without installing febootstrap,
-then you need to make your $PATH point to the top build
-directory, eg:
-
- PATH=$(pwd)/..:$PATH
diff --git a/examples/guestfs-test.sh b/examples/guestfs-test.sh
deleted file mode 100755
index f253969..0000000
--- a/examples/guestfs-test.sh
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/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
-#
-# Also make 'guest-image' be a symlink to a virtual machine disk image.
-
-# This is a realistic example for 'libguestfs', which contains a
-# selection of command-line tools, LVM, NTFS and an NFS server.
-
-set -e
-
-if [ $(id -u) -eq 0 ]; then
- echo "Don't run this script as root. Read instructions in script first."
- exit 1
-fi
-
-if [ ! -e vmlinuz -o ! -e guest-image ]; then
- echo "Read instructions in script first."
- exit 1
-fi
-
-febootstrap \
- -i bash \
- -i coreutils \
- -i lvm2 \
- -i ntfs-3g \
- -i nfs-utils \
- -i util-linux-ng \
- -i MAKEDEV \
- fedora-10 ./guestfs $1
-
-echo -n "Before minimization: "; du -sh guestfs
-febootstrap-minimize --all ./guestfs
-echo -n "After minimization: "; du -sh guestfs
-
-# Create the /init which will scan for and enable all LVM volume groups.
-
-create_init ()
-{
- cat > /init <<'__EOF__'
-#!/bin/sh
-PATH=/sbin:/usr/sbin:$PATH
-MAKEDEV mem null port zero core full ram tty console fd \
- hda hdb hdc hdd sda sdb sdc sdd loop sd
-mount -t proc /proc /proc
-mount -t sysfs /sys /sys
-mount -t devpts -o gid=5,mode=620 /dev/pts /dev/pts
-modprobe sata_nv pata_acpi ata_generic
-lvm vgscan --ignorelockingfailure
-lvm vgchange -ay --ignorelockingfailure
-/bin/bash -i
-__EOF__
- chmod +x init
-}
-export -f create_init
-febootstrap-run ./guestfs -- bash -c create_init
-
-# Convert the filesystem to an initrd image.
-
-febootstrap-to-initramfs ./guestfs > guestfs-initrd.img
-
-# Now run qemu to boot this guestfs system.
-
-qemu-system-$(arch) \
- -m 256 \
- -kernel vmlinuz -initrd guestfs-initrd.img \
- -hda guest-image -boot c
diff --git a/examples/minimal-filesystem.sh b/examples/minimal-filesystem.sh
deleted file mode 100755
index e1766a9..0000000
--- a/examples/minimal-filesystem.sh
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/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 ...
-
-set -e
-
-if [ $(id -u) -eq 0 ]; then
- echo "Don't run this script as root. Read instructions in script first."
- exit 1
-fi
-
-if [ ! -e vmlinuz ]; then
- echo "Read instructions in script first."
- exit 1
-fi
-
-febootstrap -i bash -i coreutils fedora-10 ./minimal $1
-
-# ... but let's minimize it aggressively.
-
-echo -n "Before minimization: "; du -sh minimal
-febootstrap-minimize --all --pack-executables ./minimal
-echo -n "After minimization: "; du -sh minimal
-
-# Create the /init which is just a simple script to give users an
-# interactive shell.
-
-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
-}
-export -f create_init
-febootstrap-run ./minimal -- bash -c create_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 256 \
- -kernel vmlinuz -initrd minimal-initrd.img \
- -hda zero -boot c