From a5f1bed085aa7e3a2b5f3e8dfdbb4f40b7a1f7ac Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Sun, 15 Mar 2009 20:06:53 +0000
Subject: [PATCH] initram: start emergency shell if failed to switch to
 specified root

---
 initramfs-init | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/initramfs-init b/initramfs-init
index b0a8a75e05ce..6b9fe4df057e 100755
--- a/initramfs-init
+++ b/initramfs-init
@@ -125,6 +125,8 @@ if [ -n "$KOPT_root" ]; then
 	done
 	sync
 	exec /bin/busybox switch_root $NEWROOT $chart_init /sbin/init $KOPT_init_args
+	echo "initramfs emergency recovery shell launched"
+	exec /bin/busybox sh
 fi
 
 # locate boot media and mount it
-- 
GitLab