init (843B)
1 #!/bin/sh 2 export PATH="$PATH:/usr/bin:/bin:/usr/sbin:/sbin" 3 4 /bin/busybox mkdir -p /usr/bin /usr/sbin 5 /bin/busybox --install -s 6 7 mount -n -t proc proc /proc 8 mount -n -t sysfs sysfs /sys 9 mount -n -t devtmpfs devtmpfs /dev || 10 mount -n -t tmpfs tmpfs /dev 11 12 ln -sf /bin/kmod /bin/modprobe 13 14 modprobe -a sd_mod virtio ext4 9p overlay 15 16 # heh bottoms 17 mkdir /top /9p-bottom /qcow2-bottom 18 19 mount -t 9p -o trans=virtio,version=9p2000.L,msize=512000,cache=loose,posixacl host0 /9p-bottom 20 mount /dev/sda3 /qcow2-bottom 21 mount -t tmpfs none /top 22 23 mkdir -p /top/work /top/root 24 25 mount -t overlay overlay -o ro,lowerdir=/9p-bottom:/qcow2-bottom,upperdir=/top/root,workdir=/top/work /newroot 26 27 mount --move /proc /newroot/proc 28 mount --move /sys /newroot/sys 29 mount --move /dev /newroot/dev 30 31 exec switch_root -c /dev/ttyS0 /newroot /sbin/init