implement #20: added -s parameter to base command to instal scripts

This commit is contained in:
2024-09-18 10:30:55 +02:00
parent cf812919cb
commit cafc20e743
2 changed files with 59 additions and 50 deletions

View File

@@ -143,7 +143,7 @@ For an overview of the provided commands, here's the usage screen:
Usage: ./jaildk <command> <command-args>
Building Jails:
base -b <name> [-w] - build a new base
base -b <name> [-w] [-s <script>] - build a new base
build <jail> -m <mode> [-b <base>] [-v <version>] - install a build chroot of a jail
create - create a new jail from a template
clone -s <src> -d <dst> [-o <v>] [-n <v>] - clone an existing jail or jail version

View File

@@ -831,6 +831,8 @@ Build a base directory from bsd install media. Options:
build stuff. Use this if you want to use the ports
collection.
-f force mode, remove any old dist files.
-s <script> install additional scripts to /usr/bin, separate multiple
scripts with whitespace.
"
}
@@ -840,11 +842,13 @@ jaildk_base() {
base=""
force=""
rw=""
scripts=""
OPTIND=1; while getopts "b:wf" arg; do
OPTIND=1; while getopts "b:wfs:" arg; do
case $arg in
w) rw=1;;
b) base=${OPTARG};;
s) scripts="${OPTARG}";;
f) force=1;;
*) usage_base;;
esac
@@ -927,7 +931,8 @@ var/tmp"
if test -d "$basedir"; then
echo "base $basedir already exist!"
exit 1
else
fi
ex mkdir -p $basedir
if test -e /usr/freebsd-dist/MANIFEST; then
@@ -972,6 +977,11 @@ var/tmp"
ex ln -s /tmp $basedir/var/cache
ex ln -s /tmp $basedir/var/run
# any scripts?
for script in $scripts; do
ex install -m 755 $script -o root -g wheel $basedir/usr/bin/$script
done
if test -n "$rw"; then
echo "You have choosen to create a build base with ports support"
echo -n "Want to fetch the ports collection now [Yn]? "
@@ -982,7 +992,6 @@ var/tmp"
;;
esac
fi
fi
}
clone() {