If it will change the root to an apps. dir. in the current running shell,
then all it`s deps. will be found, libs. and all the other files placed in the dir.
As I understand it, the specified dir. will become / for paths starting with / .
I`m not sure what will be different about relative paths, probably nothing.
### Of course if apps. were written with relative paths, then no problem.
From the Man. page for chroot:
Error running chroot in an app. dir.:chroot changes the root directory to that specified in path.
This directory will be used for path names beginning with /.
The root directory is inherited by all children of the current process.
Code: Select all
sh# chroot /mnt/sdb3/apps_Puppy/breakout2/LBreakout2
chroot: cannot run command `/bin/bash': No such file or directory
### And while trying to run the app.:
sh# chroot /mnt/sdb3/apps_Puppy/breakout2/LBreakout2 bin/lbreakout2
chroot: cannot change root directory to bin/lbreakout2: Not a directory
sh#
And in it is the /dir./file: bin/lbreakout2
### And this:
Code: Select all
cd /new-root
pivot_root . old-root
exec chroot . sh <dev/console >dev/console 2>&1
Code: Select all
sh-4.1# pivot_root . old-root
pivot_root: No such file or directory
sh-4.1# pivot_root . ../0
pivot_root: Invalid argument
sh-4.1# pivot_root --help
BusyBox v1.16.2 (2010-06-19 18:02:46 GMT-8) multi-call binary.
Usage: pivot_root NEW_ROOT PUT_OLD
Move the current root file system to PUT_OLD and make NEW_ROOT
the new root file system
............. Move the current root file system to PUT_OLD
### It`s rather unclear exactly what each of the 2 commands is doing.
.