End by running sh with job control
[rrq/tiniest.git] / init / init
1 #!/bin/sh
2 #
3 # This script is intended to be interpreted by busybox sh.
4 echo
5 echo "Starting..."
6 echo
7
8 mkdir /cdrom
9 mkdir /target
10
11 for M in proc:/proc devtmpfs:/dev devpts:/dev/pts sysfs:/sys ; do
12     mkdir -p ${M##*:}
13     mount -t ${M%%:*} ${M%%:*} ${M##*:}
14 done
15
16 for M in ata_piix sd_mod sr_mod isofs vfat xhci-pci usb_storage ; do
17     modprobe $M
18     sleep 1
19 done
20
21 #--- Automatic:
22 # cdrom t10_pi crc64_rocksoft crc64 crc_t10dif crct10dif_common libata
23 # scsi_mod scsi_common
24 #--- Other, not used:
25 # ata_generic nls_cp437 nls_ascii sg
26 #  ext4 jbd2 mbcache crc16
27 #-- input
28 # psmouse evdev
29 #-- network
30 # e1000
31
32 echo
33 echo "Continuing..."
34 echo
35
36 mount LABEL=TINIEST /cdrom
37 mount -t ramfs -o size=1G initrd /target
38
39 gunzip < $(find /cdrom -name initrd.gz ) | ( cd /target && cpio -i )
40 exec setsid cttyhack sh -i
41 exec /bin/sh
42 exec switch_root -c /dev/console /target /init