diff options
author | erdgeist <erdgeist@erdgeist.org> | 2013-05-17 22:36:03 +0000 |
---|---|---|
committer | erdgeist <erdgeist@erdgeist.org> | 2013-05-17 22:36:03 +0000 |
commit | e836630271343b14b3b3507b307b10e9b36ff08a (patch) | |
tree | ddb502eaab2d252453949d11bb2a564fa5a6245a | |
parent | fd1df9a99b64a67384bef26f4f416f0931393f3a (diff) |
apply freebsd-update on the newjail, as well
-rwxr-xr-x | ezjail-admin | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/ezjail-admin b/ezjail-admin index 785cf15..b3c56ca 100755 --- a/ezjail-admin +++ b/ezjail-admin | |||
@@ -992,8 +992,12 @@ setup|update) | |||
992 | 992 | ||
993 | # If ran from cron be kind to freebsds update servers and sleep first | 993 | # If ran from cron be kind to freebsds update servers and sleep first |
994 | [ -z "$TERM" -o "$TERM" = "dumb" ] && ezjail_urgency="cron" || ezjail_urgency="fetch" | 994 | [ -z "$TERM" -o "$TERM" = "dumb" ] && ezjail_urgency="cron" || ezjail_urgency="fetch" |
995 | [ "${ezjail_use_zfs}" = "YES" ] && zfs snapshot ${ezjail_jailzfs}/basejail@`date -v -7d +"%C%y%m%d_%H:%M:%S"` | 995 | if [ "${ezjail_use_zfs}" = "YES" ]; |
996 | zfs snapshot ${ezjail_jailzfs}/basejail@`date -v -7d +"%C%y%m%d_%H:%M:%S"` | ||
997 | zfs snapshot ${ezjail_jailzfs}/newjail@`date -v -7d +"%C%y%m%d_%H:%M:%S"` | ||
998 | fi | ||
996 | env PAGER=/bin/cat freebsd-update -b ${ezjail_jailbase} ${ezjail_urgency} install | 999 | env PAGER=/bin/cat freebsd-update -b ${ezjail_jailbase} ${ezjail_urgency} install |
1000 | env PAGER=/bin/cat freebsd-update -b ${ezjail_jailtemplate} ${ezjail_urgency} install | ||
997 | elif [ "${ezjail_installaction}" = "freebsd-upgrade" ]; then | 1001 | elif [ "${ezjail_installaction}" = "freebsd-upgrade" ]; then |
998 | [ -d "${ezjail_jailbase}" ] || exerr "Error: base jail does not exist.\n You cannot update a base jail until it is created.\n Please run '${ezjail_admin} update' or '${ezjail_admin} install' first." | 1002 | [ -d "${ezjail_jailbase}" ] || exerr "Error: base jail does not exist.\n You cannot update a base jail until it is created.\n Please run '${ezjail_admin} update' or '${ezjail_admin} install' first." |
999 | 1003 | ||
@@ -1007,9 +1011,11 @@ setup|update) | |||
1007 | ezjail_osversion_target="`uname -r`" | 1011 | ezjail_osversion_target="`uname -r`" |
1008 | 1012 | ||
1009 | # Finally run freebsd-update to upgrade our basejail | 1013 | # Finally run freebsd-update to upgrade our basejail |
1010 | env UNAME_r="${ezjail_osversion_source}" PAGER=/bin/cat freebsd-update -b ${ezjail_jailbase} -r ${ezjail_osversion_target} upgrade | 1014 | for DESTDIR in ${ezjail_jailbase} ${ezjail_jailtemplate}; do |
1011 | while [ $? -eq 0 ]; do | 1015 | env UNAME_r="${ezjail_osversion_source}" PAGER=/bin/cat freebsd-update -b ${DESTDIR} -r ${ezjail_osversion_target} upgrade |
1012 | env UNAME_r="${ezjail_osversion_source}" PAGER=/bin/cat freebsd-update -b ${ezjail_jailbase} -r ${ezjail_osversion_target} install | 1016 | while [ $? -eq 0 ]; do |
1017 | env UNAME_r="${ezjail_osversion_source}" PAGER=/bin/cat freebsd-update -b ${DESTDIR} -r ${ezjail_osversion_target} install | ||
1018 | done | ||
1013 | done | 1019 | done |
1014 | 1020 | ||
1015 | # Here we should write the file with the new osversion in case of success | 1021 | # Here we should write the file with the new osversion in case of success |