diff options
Diffstat (limited to 'chroot_file_list.sh')
-rwxr-xr-x | chroot_file_list.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/chroot_file_list.sh b/chroot_file_list.sh new file mode 100755 index 0000000..3a46a2b --- /dev/null +++ b/chroot_file_list.sh @@ -0,0 +1,35 @@ +#!/bin/sh +# You should probably have DSCIP_DISREGARD_COMMIT_CHECK set to true until you # +# get all the correct files in the chroot jail. # + +set -u + +# Defaults should allow anything to build, but is a bit excessive. Change to # +# needs. # +export CHROOT_FILES="/lib +/lib64 +/usr/include +/usr/lib64 +/usr/lib +/usr/local/lib +/usr/bin +/bin +" + +rm -rf "$WORKING_DIRECTORY"/jail +mkdir -p "$WORKING_DIRECTORY"/jail + +printf "%s" "$CHROOT_FILES" | + while IFS='' read -r directory + do + echo "Copying $directory into jail..." + if [ ! -L "$directory" ]; then + mkdir -p "$WORKING_DIRECTORY"/jail/"$directory" + fi + + if [ -L "$directory" ]; then + cp -r "$directory" "$WORKING_DIRECTORY"/jail/"$directory" + elif [ -d "$directory" ]; then + cp -r "$directory"/* "$WORKING_DIRECTORY"/jail/"$directory" + fi + done |