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
MACHINE_ARCH=amd64
WORK_DIR=/opt
# Build sets
cd $WORK_DIR/src && /bin/sh ./build.sh -j 2 -u -m $MACHINE_ARCH \
-X $WORK_DIR/xsrc \
-O $WORK_DIR/obj.$MACHINE_ARCH -T $WORK_DIR/tools.$MACHINE_ARCH \
distribution sets 2>&1 | tee /scripts/log.$MACHINE_ARCH
# Build only kernel (requires tools)
cd $WORK_DIR/src && /bin/sh ./build.sh -j 2 -u -m $MACHINE_ARCH \
-X $WORK_DIR/xsrc \
-O $WORK_DIR/obj.$MACHINE_ARCH -T $WORK_DIR/tools.$MACHINE_ARCH \
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:
/opt/obj.amd64/releasedir/
This directory contains newly built NetBSD sets.
/opt/obj.amd64/sys/arch/amd64/compile/GENERIC
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:
#reboot
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
xserver
do
tar -zxvpf /opt/obj.amd64/releasedir/amd64/binary/sets/$i.tgz
done
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