test-boot-realistic rule should boot the rescue shell.
[libguestfs.git] / appliance / init
1 #!/bin/sh
2 echo Starting /init script ...
3 PATH=/sbin:/usr/sbin:$PATH
4 mount -t tmpfs none /dev
5 mkdir /dev/pts /dev/shm /dev/mapper
6 MAKEDEV mem null port zero core full ram tty console fd \
7   hda hdb hdc hdd sda sdb sdc sdd loop sd
8 mknod /dev/ptmx c 5 2; chmod 0666 /dev/ptmx
9 mknod /dev/random c 1 8;  chmod 0666 /dev/random
10 mknod /dev/urandom c 1 9; chmod 0444 /dev/urandom
11 mount -t proc /proc /proc
12 mount -t sysfs /sys /sys
13 mount -t devpts -o gid=5,mode=620 /dev/pts /dev/pts
14 ln -sf /proc/self/fd/0 /dev/stdin
15 ln -sf /proc/self/fd/1 /dev/stdout
16 ln -sf /proc/self/fd/2 /dev/stderr
17 modprobe virtio_pci
18 modprobe virtio_net
19 modprobe dm_mod ||:
20 /sbin/ifconfig lo 127.0.0.1
21 /sbin/ifconfig eth0 10.0.2.10
22 /sbin/route add default gw 10.0.2.2
23 lvm vgscan --ignorelockingfailure
24 lvm vgchange -ay --ignorelockingfailure
25 if grep -sq guestfs_rescue=1 /proc/cmdline; then
26   bash -i
27 fi
28 exec guestfsd -f