Date: 20 Oct 2013 21:19:02 -0000 From: Colin Percival <cperciva@freebsd.org> To: FreeBSD-gnats-submit@freebsd.org Subject: ports/183130: [new port] sysutils/firstboot-freebsd-update Message-ID: <20131020211902.41988.qmail@clamshell.daemonology.net> Resent-Message-ID: <201310202130.r9KLU29Z015574@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 183130 >Category: ports >Synopsis: [new port] sysutils/firstboot-freebsd-update >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Oct 20 21:30:02 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Colin Percival >Release: FreeBSD 9.2-RELEASE amd64 >Organization: >Environment: >Description: Using new "first boot" rc.d script functionality, this port (if enabled via firstboot_freebsd_update_enable="YES") downloads and installs FreeBSD updates when the system is first booted. >How-To-Repeat: >Fix: Please review that I did this right... I don't create ports very often. --- firstboot-freebsd-update.shar begins here --- # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # firstboot-freebsd-update/ # firstboot-freebsd-update/Makefile # firstboot-freebsd-update/files # firstboot-freebsd-update/files/firstboot_freebsd_update.in # firstboot-freebsd-update/pkg-descr # echo c - firstboot-freebsd-update/ mkdir -p firstboot-freebsd-update/ > /dev/null 2>&1 echo x - firstboot-freebsd-update/Makefile sed 's/^X//' >firstboot-freebsd-update/Makefile << '17c043314631ea708a0bcabf1575195e' X# X# $FreeBSD$ X XPORTNAME= firstboot-freebsd-update XPORTVERSION= 1.0 XCATEGORIES= sysutils XMASTER_SITES= # none XDISTFILES= # none X XMAINTAINER= cperciva@FreeBSD.org XCOMMENT= Update the system using freebsd-update when it first boots X XNO_WRKSUBDIR= yes XNO_BUILD= yes X XUSE_RC_SUBR= firstboot_freebsd_update X X.include <bsd.port.pre.mk> X X.if ( ${OSVERSION} < 1100001 ) XIGNORE= First boot rc.d scripts not supported on this version of FreeBSD X.endif X Xdo-fetch do-install: X @${DO_NADA} X X.include <bsd.port.post.mk> 17c043314631ea708a0bcabf1575195e echo c - firstboot-freebsd-update/files mkdir -p firstboot-freebsd-update/files > /dev/null 2>&1 echo x - firstboot-freebsd-update/files/firstboot_freebsd_update.in sed 's/^X//' >firstboot-freebsd-update/files/firstboot_freebsd_update.in << 'c159450f6ead99c4aa064ae8e00afcc1' X#!/bin/sh X X# KEYWORD: firstboot X# PROVIDE: firstboot_freebsd_update X# REQUIRE: syslogd NETWORKING X# BEFORE: LOGIN X X. /etc/rc.subr X Xname="firstboot_freebsd_update" Xrcvar=firstboot_freebsd_update_enable Xstart_cmd="firstboot_freebsd_update_run | logger -s -t 'freebsd-update'" Xstop_cmd=":" X Xfirstboot_freebsd_update_run() X{ X X freebsd-update fetch X if [ -e /var/db/freebsd-update/`echo / | sha256`-install ]; then X freebsd-update install X echo "Requesting reboot after installing updates." X touch ${firstboot_sentinel}-reboot X fi X} X Xload_rc_config $name Xrun_rc_command "$1" X c159450f6ead99c4aa064ae8e00afcc1 echo x - firstboot-freebsd-update/pkg-descr sed 's/^X//' >firstboot-freebsd-update/pkg-descr << '4951a4adafd890811cc8ce0f5f087778' XRun 'freebsd-update fetch' when the system first boots; and if updates are Xdownloaded, install them and request a reboot. X XObviously, this port is not useful after a system is already running; it is Xintended to be included as part of the installation or disk image building Xprocess. 4951a4adafd890811cc8ce0f5f087778 exit --- firstboot-freebsd-update.shar ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20131020211902.41988.qmail>