sysupdate - an addition for etcupdate(8) (Update #3)
I wanted to update a few machines with latest netbsd-5 and -current today, and found that there's a certain lack of tools to aid in the process: we have etcupdate(8) and postinstall(8), but nothing to help extract the userland sets (let alone do the same thing for the kernel, esp. now that modules must be put into place, too).
To save me from re-typing the same commands, I've hacked a script "sysupdate" that's intended to run with a new kernel booted, and which will then 1) extract all the sets where mtree files are in /etc/mtree, and 2) run etcupdate for etc (and xetc, if in /etc/mtree).
Here's an example run:
% sh ~/tmp/sysupdate -s /usr/cvs/src-current/obj.i386/releasedir/i386/binary/sets -n
---------------------------------------------------------------------------
Updating your userland now!
---------------------------------------------------------------------------
New userland: NetBSD 5.99.23 (GENERIC) #0: Sun Jan 3 02:13:00 CET 2010
Current kernel: NetBSD vmnetbsd6 5.99.23 NetBSD 5.99.23 (GENERIC) #0:
Sun Jan 3 02:13:00 CET 2010 feyrer%mini.local@localhost
:/usr/cvs/src-current/obj.i386/sys/arch/i386/compile/GENERIC i386
Really update? (y/N) y
Updating sets...
Extracting base.tgz
tar -plzx -C / -f base.tgz
Extracting comp.tgz
tar -plzx -C / -f comp.tgz
Extracting games.tgz
tar -plzx -C / -f games.tgz
Extracting man.tgz
tar -plzx -C / -f man.tgz
Extracting misc.tgz
tar -plzx -C / -f misc.tgz
Extracting modules.tgz
tar -plzx -C / -f modules.tgz
Extracting tests.tgz
tar -plzx -C / -f tests.tgz
Extracting text.tgz
tar -plzx -C / -f text.tgz
Extracting xbase.tgz
tar -plzx -C / -f xbase.tgz
Extracting xcomp.tgz
tar -plzx -C / -f xcomp.tgz
Extracting xfont.tgz
tar -plzx -C / -f xfont.tgz
Extracting xserver.tgz
tar -plzx -C / -f xserver.tgz
Updating etc files...
etcupdate -s /usr/cvs/src-current/obj.i386/releasedir/i386/binary/sets/etc.tgz \
-s /usr/cvs/src-current/obj.i386/releasedir/i386/binary/sets/xetc.tgz
Done.
%
The script is available
in the current-users@ mailing list archive.
Update:
Chavdar Ivanov tells me that there's a package
pkgsrc/sysutils/etcmanage that comes with a script INSTALL-NetBSD
which does the same as mine (plus more). Seems that's not established
enough that it's the communicated way for updating (yet?).
Given that the script uses perl, maybe that's some time off. :-P
Another option that uses toosl that come with NetBSD
out of the box (ksh!) is available
here - thanks to Dalibor Gudzic
for the hint and the script!
Update #2:
Asmodehn sent me mail that he also has
made a script for performing system updates.
How about someone collect all these into one, and import something
into NetBSD that at least provides minimal functionality?
Update #3:
I'll place updates of the script
at my software page.
[Tags: etcupdate, postinstall, sysupdate]
|