summaryrefslogtreecommitdiff
path: root/ezjail-admin
diff options
context:
space:
mode:
authorPhilipp Wuensche <cryx-freebsd@h3q.com>2019-08-14 14:27:45 +0200
committerPhilipp Wuensche <cryx-freebsd@h3q.com>2019-08-14 14:27:45 +0200
commitaac83f659118689e773949aa139336a72b7c0546 (patch)
tree3cbe3aac1f6b190d85381f92a2faf8d55a471af2 /ezjail-admin
parentb418a79584b08ede5b665fc859fb6f3a01a4b044 (diff)
Add -K option to install, which can be used to upgrade basejail to a newer FreeBSD version without loosing old libs inside the basejail. Could replace "update -U".
Diffstat (limited to 'ezjail-admin')
-rwxr-xr-xezjail-admin7
1 files changed, 4 insertions, 3 deletions
diff --git a/ezjail-admin b/ezjail-admin
index 609907d..a58eece 100755
--- a/ezjail-admin
+++ b/ezjail-admin
@@ -42,7 +42,7 @@ case `uname -p` in amd64) ezjail_dirlist="${ezjail_dirlist} usr/lib32"; ezjail_b
42 42
43# Synopsis messages 43# Synopsis messages
44ezjail_usage_ezjailadmin="${ezjail_admin} v3.4.2\nUsage: ${ezjail_admin} [archive|config|console|create|delete|freeze|install|list|restore|snapshot|troubleshoot|update] {params}" 44ezjail_usage_ezjailadmin="${ezjail_admin} v3.4.2\nUsage: ${ezjail_admin} [archive|config|console|create|delete|freeze|install|list|restore|snapshot|troubleshoot|update] {params}"
45ezjail_usage_install="Usage: ${ezjail_admin} install [-mMpPsS] [-h host] [-r release]" 45ezjail_usage_install="Usage: ${ezjail_admin} install [-mMpPsSK] [-h host] [-r release]"
46ezjail_usage_create="Usage: ${ezjail_admin} create [-xbi] [-f flavour] [-r jailroot] [-s size] [-c bde|eli|zfs] [-C args] [-a archive] [-z parentzfs] jailname jailip" 46ezjail_usage_create="Usage: ${ezjail_admin} create [-xbi] [-f flavour] [-r jailroot] [-s size] [-c bde|eli|zfs] [-C args] [-a archive] [-z parentzfs] jailname jailip"
47ezjail_usage_delete="Usage: ${ezjail_admin} delete [-wf] jailname" 47ezjail_usage_delete="Usage: ${ezjail_admin} delete [-wf] jailname"
48ezjail_usage_update="Usage: ${ezjail_admin} update [-s sourcetree|sourceosversion] [-p] (-b|-i|-u|-U|-P)" 48ezjail_usage_update="Usage: ${ezjail_admin} update [-s sourcetree|sourceosversion] [-p] (-b|-i|-u|-U|-P)"
@@ -286,7 +286,7 @@ ezjail_splitworld() {
286 # directories with permission 0700 which is bad 286 # directories with permission 0700 which is bad
287 mkdir -p "${ezjail_jailbase}/usr" 287 mkdir -p "${ezjail_jailbase}/usr"
288 for dir in ${ezjail_dirlist}; do 288 for dir in ${ezjail_dirlist}; do
289 find ${dir} | cpio -d -p -v "${ezjail_jailbase}" || exerr "Error: Installation of ${dir} failed." 289 find ${dir} | cpio -d -p -v ${ezjail_keep_basejail} "${ezjail_jailbase}" || exerr "Error: Installation of ${dir} failed."
290 chflags -R noschg ${dir}; rm -r ${dir}; ln -s /basejail/${dir} ${dir} 290 chflags -R noschg ${dir}; rm -r ${dir}; ln -s /basejail/${dir} ${dir}
291 done 291 done
292 mkdir basejail 292 mkdir basejail
@@ -1067,7 +1067,7 @@ install)
1067 # Clean variables, prevent pollution 1067 # Clean variables, prevent pollution
1068 unset ezjail_release ezjail_installmanpages ezjail_installports ezjail_installsources ezjail_dir ezjail_ftpserverqueried ezjail_proto ezjail_disturi 1068 unset ezjail_release ezjail_installmanpages ezjail_installports ezjail_installsources ezjail_dir ezjail_ftpserverqueried ezjail_proto ezjail_disturi
1069 1069
1070 shift; while getopts :mMpPsSh:r: arg; do case ${arg} in 1070 shift; while getopts :mMpPsSh:Kr: arg; do case ${arg} in
1071 m) ezjail_installmanpages=" manpages";; 1071 m) ezjail_installmanpages=" manpages";;
1072 M) ezjail_installmanpages=" manpages"; unset ezjail_basesystem;; 1072 M) ezjail_installmanpages=" manpages"; unset ezjail_basesystem;;
1073 s) ezjail_installsources=" src";; 1073 s) ezjail_installsources=" src";;
@@ -1075,6 +1075,7 @@ install)
1075 p) ezjail_installports="YES";; 1075 p) ezjail_installports="YES";;
1076 P) ezjail_installports="YES"; unset ezjail_basesystem;; 1076 P) ezjail_installports="YES"; unset ezjail_basesystem;;
1077 h) ezjail_ftphost=${OPTARG};; 1077 h) ezjail_ftphost=${OPTARG};;
1078 K) ezjail_keep_basejail="-u";;
1078 r) ezjail_release=${OPTARG};; 1079 r) ezjail_release=${OPTARG};;
1079 ?) exerr ${ezjail_usage_install};; 1080 ?) exerr ${ezjail_usage_install};;
1080 esac; done; shift $(( ${OPTIND} - 1 )) 1081 esac; done; shift $(( ${OPTIND} - 1 ))