Commit Graph

6 Commits (c354b54e555a76fa78404b57740372694e18d37e)

Author SHA1 Message Date
Victor Lowther 05469ee13e Remove all files on the initramfs before switching root
The code from pjones's tree did not include the recursive remove code,
so I readded it from the nash source code.
2009-03-08 11:39:31 -05:00
Victor Lowther faf882394b Simplify switch_root.c a bit
Shift some required functionality from switch_root.c to init.

String manipulation and filtering, and testing for the existence of init
is easier in the init script than in C.
2009-03-06 22:32:37 -06:00
Harald Hoyer 2394813bf3 mount move instead of umount and fix the search for fallback inits
chdir to newroot, then mount move instead of umount /dev, /sys, etc.
search for fallback init bins in current dirs
2009-03-06 11:53:49 +01:00
Harald Hoyer 63efe29bb3 use switch_root code from http://pjones.fedorapeople.org/mkstart/usr/lib/mkstart/switchroot.c 2009-03-06 10:57:12 +01:00
Harald Hoyer aedead8068 add \n to switch_root 2009-03-04 17:49:19 +01:00
Harald Hoyer c4da240717 replace switch_root shell script with binary
The switch_root shell script did not work with bash-4.0-2, because
"exec" gets the real path of the executable which is then
"/sysroot/lib/ld-linux.so.2" instread of "./lib/ld-linux.so.2".

Also the required chroot binary might live in /usr/bin, which can
be mounted later.

Here is the switch_root code from nash, which can be stripped down
further, but which works.

>From f1b1e4f8694104f007e4483c36b0bf40a5760167 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Date: Wed, 4 Mar 2009 13:41:07 +0100
Subject: [PATCH] replace switch_root shell script with binary

The switch_root shell script did not work with bash-4.0-2, because
"exec" gets the real path of the executable which is then
"/sysroot/lib/ld-linux.so.2" instead of "./lib/ld-linux.so.2".
Also the required chroot binary might live in /usr/bin, which can
be mounted later.

Here is the switch_root code from nash, which can be stripped down
further, but which works.
2009-03-04 17:23:03 +01:00