]> git.friedersdorff.com Git - max/initramfs.git/blob - init
More changes
[max/initramfs.git] / init
1 #!/bin/busybox sh
2
3 rescue_shell() {
4         /bin/busybox echo "Something went wrong. Dropping you to a shell"
5         /bin/busybox --install -s
6         exec /bin/sh
7 }
8
9 # Mount filesystems 
10 /bin/busybox mount -t devtmpfs none /dev || rescue_shell
11 /bin/busybox mount -t proc none /proc || rescue_shell
12 /bin/busybox mount -t sysfs none /sys || rescue_shell
13 #/bin/busybox echo 0 > /proc/sys/kernel/printk || rescue_shell
14
15 # Unlock luks device
16 /sbin/cryptsetup -T 5 luksOpen /dev/sdb3 lukssdb3 || rescue_shell
17
18 # Create LVM nodes /dev/main/root etc
19 /sbin/lvm vgscan --mknodes || rescue_shell
20 /sbin/lvm lvchange -a ly main/root || rescue_shell
21 /sbin/lvm lvchange -a ly main/home || rescue_shell
22 /sbin/lvm lvchange -a ly main/swap || rescue_shell
23 /sbin/lvm vgscan --mknodes || rescue_shell
24
25 # Mount root fs
26 /bin/busybox mount -o ro /dev/main/root /mnt/root || rescue_shell
27
28 # Unmount filesystems
29 /bin/busybox umount /dev || rescue_shell
30
31 # Boot system
32 exec /bin/busybox switch_root /mnt/root /sbin/init || rescue_shell