Implement preos
This commit is contained in:
parent
eab540bd0f
commit
799ec72369
95 changed files with 9997 additions and 4 deletions
24
hacking/preos-sh/remote-exec.sh
Normal file
24
hacking/preos-sh/remote-exec.sh
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/sh
|
||||
|
||||
# echo $@
|
||||
# set -x
|
||||
|
||||
chroot="$1"; shift
|
||||
|
||||
script=$(mktemp "${chroot}/tmp/chroot-${0##*/}.XXXXXXXXXX")
|
||||
trap cleanup INT TERM EXIT
|
||||
cleanup() {
|
||||
[ $__cdist_debug ] || rm "$script"
|
||||
}
|
||||
|
||||
echo "#!/bin/sh -l" > "$script"
|
||||
echo "$@" >> "$script"
|
||||
chmod +x "$script"
|
||||
|
||||
relative_script="${script#$chroot}"
|
||||
|
||||
# ensure PATH is setup
|
||||
export PATH=$PATH:/bin:/usr/bin:/sbin:/usr/sbin
|
||||
|
||||
# run in chroot
|
||||
chroot "$chroot" "$relative_script"
|
||||
Loading…
Add table
Add a link
Reference in a new issue