From owner-svn-ports-head@FreeBSD.ORG Sun Oct 20 22:03:30 2013 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 81DF06BB; Sun, 20 Oct 2013 22:03:30 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6E70C23AA; Sun, 20 Oct 2013 22:03:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9KM3UVP003732; Sun, 20 Oct 2013 22:03:30 GMT (envelope-from swills@svn.freebsd.org) Received: (from swills@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9KM3T3K003695; Sun, 20 Oct 2013 22:03:29 GMT (envelope-from swills@svn.freebsd.org) Message-Id: <201310202203.r9KM3T3K003695@svn.freebsd.org> From: Steve Wills Date: Sun, 20 Oct 2013 22:03:29 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r331066 - in head/sysutils: . firstboot-freebsd-update firstboot-freebsd-update/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 22:03:30 -0000 Author: swills Date: Sun Oct 20 22:03:29 2013 New Revision: 331066 URL: http://svnweb.freebsd.org/changeset/ports/331066 Log: Run 'freebsd-update fetch' when the system first boots; and if updates are downloaded, install them and request a reboot. Obviously, this port is not useful after a system is already running; it is intended to be included as part of the installation or disk image building process. PR: ports/183130 Submitted by: cperciva@FreeBSD.org Added: head/sysutils/firstboot-freebsd-update/ head/sysutils/firstboot-freebsd-update/Makefile (contents, props changed) head/sysutils/firstboot-freebsd-update/files/ head/sysutils/firstboot-freebsd-update/files/firstboot_freebsd_update.in (contents, props changed) head/sysutils/firstboot-freebsd-update/pkg-descr (contents, props changed) Modified: head/sysutils/Makefile Modified: head/sysutils/Makefile ============================================================================== --- head/sysutils/Makefile Sun Oct 20 21:57:18 2013 (r331065) +++ head/sysutils/Makefile Sun Oct 20 22:03:29 2013 (r331066) @@ -242,6 +242,7 @@ SUBDIR += filetype SUBDIR += filewatcherd SUBDIR += finfo + SUBDIR += firstboot-freebsd-update SUBDIR += flasher SUBDIR += flashrom SUBDIR += flexbackup Added: head/sysutils/firstboot-freebsd-update/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/firstboot-freebsd-update/Makefile Sun Oct 20 22:03:29 2013 (r331066) @@ -0,0 +1,26 @@ +# $FreeBSD$ + +PORTNAME= firstboot-freebsd-update +PORTVERSION= 1.0 +CATEGORIES= sysutils +MASTER_SITES= # none +DISTFILES= # none + +MAINTAINER= cperciva@FreeBSD.org +COMMENT= Update the system using freebsd-update when it first boots + +NO_WRKSUBDIR= yes +NO_BUILD= yes + +USE_RC_SUBR= firstboot_freebsd_update + +.include + +.if ( ${OSVERSION} < 1100001 ) +IGNORE= first boot rc.d scripts not supported on this version of FreeBSD +.endif + +do-fetch do-install: + @${DO_NADA} + +.include Added: head/sysutils/firstboot-freebsd-update/files/firstboot_freebsd_update.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/firstboot-freebsd-update/files/firstboot_freebsd_update.in Sun Oct 20 22:03:29 2013 (r331066) @@ -0,0 +1,28 @@ +#!/bin/sh + +# KEYWORD: firstboot +# PROVIDE: firstboot_freebsd_update +# REQUIRE: syslogd NETWORKING +# BEFORE: LOGIN + +. /etc/rc.subr + +name="firstboot_freebsd_update" +rcvar=firstboot_freebsd_update_enable +start_cmd="firstboot_freebsd_update_run | logger -s -t 'freebsd-update'" +stop_cmd=":" + +firstboot_freebsd_update_run() +{ + + freebsd-update fetch + if [ -e /var/db/freebsd-update/`echo / | sha256`-install ]; then + freebsd-update install + echo "Requesting reboot after installing updates." + touch ${firstboot_sentinel}-reboot + fi +} + +load_rc_config $name +run_rc_command "$1" + Added: head/sysutils/firstboot-freebsd-update/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/firstboot-freebsd-update/pkg-descr Sun Oct 20 22:03:29 2013 (r331066) @@ -0,0 +1,6 @@ +Run 'freebsd-update fetch' when the system first boots; and if updates are +downloaded, install them and request a reboot. + +Obviously, this port is not useful after a system is already running; it is +intended to be included as part of the installation or disk image building +process.