Creating a chroot environment – the script.

2011-09-23 2 min read bash Fedora Learning Linux
Here is the script, very simple and effective 🙂 #!/bin/bash - #=============================================================================== # # FILE: mkchroot.sh # # USAGE: ./mkchroot.sh # # DESCRIPTION: Make a chroot environ and cd to it # # OPTIONS: --- # REQUIREMENTS: --- # BUGS: --- # NOTES: --- # AUTHOR: Amit Agarwal (aka), # CREATED: 09/03/2011 02:53:37 PM IST # Last modified: Sat Sep 03, 2011 03:11PM # REVISION: --- #=============================================================================== binaries=( bash2 ls cat vi vim sudo) #=== FUNCTION ================================================================ # NAME: copy_binary # DESCRIPTION: copy binary to chroot # PARAMETERS: # RETURNS: #=============================================================================== copy_binary () { cmd=`which $1` echo $cmd cp $cmd bin/ ldd $cmd while read line do while read ld do if [[ -f $ld ]] then echo copy $ld cp $ld lib/ if [[ -L $ld ]] then ld1=$( ls -l $ld |sed 's/. Continue reading

Creating a chroot environment in Fedora with bash and other utils.

2011-09-19 2 min read bash Fedora Learning Linux
[ad#ad-2] I am testing some of my scripts to work on a very old system and there the versions of the most popular applications are very old, real old :(. So, some of things that I am very used to since last couple of years, do not seem to work as expected and I need to keep verifying a lot of things on the server, very inconvinient to keep testing the script on the server (need to connect on VPN) just to test some very simple things. Continue reading