[PC-BSD Commits] r21582 - in pcbsd/current/src-sh/pc-extractoverlay: desktop-overlay/etc desktop-overlay/usr/sbin server-overlay/etc server-overlay/usr/sbin
svn at pcbsd.org
svn at pcbsd.org
Tue Feb 19 10:46:06 PST 2013
Author: kris
Date: 2013-02-19 18:46:06 +0000 (Tue, 19 Feb 2013)
New Revision: 21582
Added:
pcbsd/current/src-sh/pc-extractoverlay/server-overlay/etc/rc
Modified:
pcbsd/current/src-sh/pc-extractoverlay/desktop-overlay/etc/rc
pcbsd/current/src-sh/pc-extractoverlay/desktop-overlay/usr/sbin/freebsd-update
pcbsd/current/src-sh/pc-extractoverlay/server-overlay/usr/sbin/freebsd-update
Log:
Improvements to freebsd-update when doing --non-interactive
When doing kernel update, it will touch a file in /var
first, so that at the next bootup it will finish the upgrade process
Modified: pcbsd/current/src-sh/pc-extractoverlay/desktop-overlay/etc/rc
===================================================================
--- pcbsd/current/src-sh/pc-extractoverlay/desktop-overlay/etc/rc 2013-02-19 11:46:28 UTC (rev 21581)
+++ pcbsd/current/src-sh/pc-extractoverlay/desktop-overlay/etc/rc 2013-02-19 18:46:06 UTC (rev 21582)
@@ -96,6 +96,21 @@
unset files local_rc
+# Check if we are needing to finish up a freebsd-update
+if [ -e "/var/.freebsd-update-finish" ] ; then
+ TERM="cons25" ; export TERM
+ clear
+ echo "Installing FreeBSD updates... Please wait..."
+ /usr/sbin/freebsd-update --non-interactive install
+ if [ -e "/usr/local/bin/pc-softwaremanager" ] ; then
+ /usr/local/bin/pc-extractoverlay desktop
+ else
+ /usr/local/bin/pc-extractoverlay server
+ fi
+ echo "Press ENTER to continue"
+ read tmp
+fi
+
if [ "$fastboot_enable" = "YES" ]; then
# We are fast-booting
Modified: pcbsd/current/src-sh/pc-extractoverlay/desktop-overlay/usr/sbin/freebsd-update
===================================================================
--- pcbsd/current/src-sh/pc-extractoverlay/desktop-overlay/usr/sbin/freebsd-update 2013-02-19 11:46:28 UTC (rev 21581)
+++ pcbsd/current/src-sh/pc-extractoverlay/desktop-overlay/usr/sbin/freebsd-update 2013-02-19 18:46:06 UTC (rev 21582)
@@ -2367,7 +2367,9 @@
if [ "$NON_INTERACTIVE" = "yes" ] ; then
cat <<-EOF
The following file could not be merged automatically: ${F}
+Defaulting to the old copy.
EOF
+ cp merge/old/${F} merge/new/${F}
continue
fi
@@ -2816,6 +2818,9 @@
# Do we need to ask for a reboot now?
if [ -f $1/kernelfirst ] &&
[ -s INDEX-OLD -o -s INDEX-NEW ]; then
+ if [ "$NON_INTERACTIVE" = "yes" ] ; then
+ touch /var/.freebsd-update-finish
+ fi
cat <<-EOF
Kernel updates have been installed. Please reboot and run
@@ -3254,6 +3259,12 @@
export LC_ALL=C
get_params $@
+
+# Set PAGER to /bin/cat if non-interactive
+if [ "$NON_INTERACTIVE" = "yes" ] ; then
+ PAGER=/bin/cat
+fi
+
for COMMAND in ${COMMANDS}; do
cmd_${COMMAND}
done
Modified: pcbsd/current/src-sh/pc-extractoverlay/server-overlay/usr/sbin/freebsd-update
===================================================================
--- pcbsd/current/src-sh/pc-extractoverlay/server-overlay/usr/sbin/freebsd-update 2013-02-19 11:46:28 UTC (rev 21581)
+++ pcbsd/current/src-sh/pc-extractoverlay/server-overlay/usr/sbin/freebsd-update 2013-02-19 18:46:06 UTC (rev 21582)
@@ -2367,7 +2367,9 @@
if [ "$NON_INTERACTIVE" = "yes" ] ; then
cat <<-EOF
The following file could not be merged automatically: ${F}
+Defaulting to the old copy.
EOF
+ cp merge/old/${F} merge/new/${F}
continue
fi
@@ -2816,6 +2818,9 @@
# Do we need to ask for a reboot now?
if [ -f $1/kernelfirst ] &&
[ -s INDEX-OLD -o -s INDEX-NEW ]; then
+ if [ "$NON_INTERACTIVE" = "yes" ] ; then
+ touch /var/.freebsd-update-finish
+ fi
cat <<-EOF
Kernel updates have been installed. Please reboot and run
@@ -3254,6 +3259,12 @@
export LC_ALL=C
get_params $@
+
+# Set PAGER to /bin/cat if non-interactive
+if [ "$NON_INTERACTIVE" = "yes" ] ; then
+ PAGER=/bin/cat
+fi
+
for COMMAND in ${COMMANDS}; do
cmd_${COMMAND}
done
More information about the Commits
mailing list