#!/bin/busybox sh #Install busybox path /bin/busybox --install -s rescue_shell() { echo "Something went wrong. Dropping to a shell." exec sh } # Mount the /proc and /sys filesystems. /bin/busybox mount -t proc none /proc sleep 1 /bin/busybox mount -t sysfs none /sys sleep 1 /bin/busybox mount -t devtmpfs none /dev sleep 1 echo -e "Enter luks password " /sbin/cryptsetup luksOpen /dev/sda3 cryptroot sleep 2 # Mount the root filesystem. /bin/busybox mount /dev/mapper/cryptroot /mnt/root || rescue_shell sleep 2 # Mount /boot partition /bin/busybox mount /dev/sda1 /mnt/root/boot || rescue_shell sleep 2 #Cleanup /bin/busybox mount -o move /proc /mnt/root/proc /bin/busybox mount -o move /sys /mnt/root/sys /bin/busybox mount -o move /dev /mnt/root/dev sleep 2 # Boot the real thing. exec /sbin/switch_root /mnt/root /sbin/init