NetBSD-Users archive

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

Re: Recovering from botched update? (NetBSD guide feedback also!)

Hi, this is how I usually update NetBSD on my machines:

1. Build all sets and kernel


# Build sets
cd $WORK_DIR/src && /bin/sh ./ -j 2 -u -m $MACHINE_ARCH \
       -X $WORK_DIR/xsrc \
       distribution sets 2>&1 | tee /scripts/log.$MACHINE_ARCH

# Build only kernel (requires tools)
cd $WORK_DIR/src && /bin/sh ./ -j 2 -u -m $MACHINE_ARCH \
       -X $WORK_DIR/xsrc \
       kernel=GENERIC 2>&1 | tee /scripts/log.$MACHINE_ARCH

Note: I usually redirect output with 'tee' to a log file, in case I need to 
inspect error messages later. You can omit it if you want.

If there were no errors, I end up with:

This directory contains newly built NetBSD sets.

This directory contains NetBSD kernel.

2. I test the kernel to make sure it boots without issues:

# mv /netbsd /netbsd.orig
# cp /opt/obj.amd64/sys/arch/amd64/compile/GENERIC/netbsd /netbsd
# reboot

3. If the machine boots new kernel OK, I reboot into a single user mode and 
unpack new sets:


Pass '-s' to netbsd bootloader to get into single user mode:
boot -s

Mount / read/write and directory containing NetBSD set and unpack them in /
# mount /
# cd /
# mount /opt

# for i in base comp etc games main misc tests text xbase xcomp xetc xfont 
        tar -zxvpf /opt/obj.amd64/releasedir/amd64/binary/sets/$i.tgz

4. When I unpacked all sets (making sure to pass -p flag to tar when 
unpacking) I run etcupdate(8) to update config files in /etc. I go through 
each question etcupdate asks me and tell it which files to keep as they are 
and which files to update. There are files (like /etc/rc.conf, password 
database and others) which don't need to be updated.

Home | Main Index | Thread Index | Old Index