diff options
author | Charadon <dev@iotib.net> | 2022-07-16 17:57:53 -0400 |
---|---|---|
committer | Charadon <dev@iotib.net> | 2022-07-16 17:57:53 -0400 |
commit | 0143ed2ff68a130e8e895f0d491ab271c2afdf5d (patch) | |
tree | 907090cece8e99fc2adc66257832fe4ab7d6206f /chroot_file_list.sh | |
parent | c9a15281b7328742a59c46eb3171754ce9e30bff (diff) | |
download | dscip-0143ed2ff68a130e8e895f0d491ab271c2afdf5d.tar.gz |
Added chroot feature, allowed all variables used in dscip to be used in the build scripts (such as CURRENT_COMMIT) and added some examples to the build scripts.
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 |