NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Upgrading NetBSD in-place in a clean way



On 1/12/11 2:24 PM, Stefano Marinelli wrote:
Ok, let's suppose I want to upgrade a NetBSD machine without rebooting with 
sysinst and without having the possibility to use the build.sh script with the 
sources.
I'd do something like that:
1) download the daily (stable, for example) binaries (for example from 
http://nyftp.netbsd.org/pub/NetBSD-daily/netbsd-5-1/)
2) Untar all the sets on the file system I want to update
3) run etcupdate
4) reboot

Tried that in a test virtual machine and seems to work. But there's a problem: 
what if something has been removed? Untarring the sets doesn't remove the 
(stale) old files, while the etcupdate just deals with the config and startup 
files.
Is there a cleaner way to do it?


You're obviously going to get a lot of different responses to this; here's mine. :) I've been using this method for a long time, and am currently using a version of it in a script that downloads each autobuilt snapshot from releng.netbsd.org, installs, and runs tests against it. It works quite well.

1) download everything in <arch>/binary/sets to stable storage - /var/tmp (not /tmp - don't want it disappearing on reboot! 2) install kernel (say, kern-GENERIC.tgz) and modules sets using pax or tar, making sure to specify the "p" option which preserves permissions:
cd /
pax -zrpe -f /var/tmp/kern-GENERIC.tgz
pax -zrpe -f /var/tmp/modules.tgz
3) reboot so the new kernel is running (this is important during big jumps!)
4) cd /
5) untar all other sets (don't forget -p !)
6) etcupdate -al -s /var/tmp/etc.tgz /var/tmp/xetc.tgz
*** make sure you pay good attention the first few times you do this, and merge any needed
   changes!
7) run the postinstall command that etcupdate recommends (this removes obsolete bits)
 8) reboot
 9) \o/


Home | Main Index | Thread Index | Old Index