Skip to content

Instantly share code, notes, and snippets.

@e-minguez
Last active November 6, 2018 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save e-minguez/0f637c4971f17ab05cc1d9ddbc5575f5 to your computer and use it in GitHub Desktop.
Save e-minguez/0f637c4971f17ab05cc1d9ddbc5575f5 to your computer and use it in GitHub Desktop.
netbsd pine

NetBSD image

sudo dd if=./NetBSD-evbarm-aarch64-201811042130Z-pine64.img of=/dev/sdb

First boot

  • Plug the microsd into the pine
  • Boot the pine and wait for a couple of reboots (disk expansion)
  • Login as root (no password)
  • Configure password for root user
passwd
  • Create user and add it to the wheel group
useradd -m -G wheel edu
passwd edu
  • Edit /etc/wpa_supplicant.conf with:
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
network={
        ssid="my favourite network"
        key_mgmt=WPA-PSK
        psk="hunter2"
}
  • Editing /etc/rc.conf to enable wpa_supplicant:
wpa_supplicant=YES
wpa_supplicant_flags="-i urtwn0 -c /etc/wpa_supplicant.conf"
  • Restart wpa_supplicant service:
chmod 600 /etc/wpa_supplicant.conf
/etc/rc.d/wpa_supplicant start
  • Verify it:
ifconfig urtwn0

Update to latest current

<jmcneill> Updated sets are on the autobuild server: http://nycdn.netbsd.org/pub/NetBSD-daily/HEAD/latest/evbarm-aarch64/binary/sets/
<jmcneill> Backup current (working) kernel: cp /netbsd /onetbsd
<jmcneill> Then take "./netbsd" from kern-GENERIC64.tgz and put it as /netbsd
<jmcneill> and you probably want to update the dtb in /boot/dtb/allwinner/ to match
<jmcneill> (latest dtb is in that same file)
<jmcneill> reboot with the new kernel, make sure it works..
<jmcneill> (you need to be running the new kernel for this latest step -- old kernel may not support new userland)
<jmcneill> then extract sets..
<jmcneill> for x in base comp games man misc modules tests text xbase xcomp xfont xserver; do tar -C / -zxvpf $x.tgz; done
<jmcneill> note that I skipped the debug sets (they are big) and etc/xetc sets (we upgrade those separately)
<jmcneill> To see what sets you have installed, ls /etc/mtree/set.*
<jmcneill> Then to update etc and xetc: etcupdate -s etc.tgz -s xetc.tgz
mkdir -p /root/tmp/kernel
cd /root/tmp/kernel
cp /netbsd /onetbsd
ftp https://nyftp.netbsd.org/pub/NetBSD-daily/HEAD/latest/evbarm-aarch64/binary/sets/kern-GENERIC64.tgz
tar xzvf /root/tmp/kernel/kern-GENERIC64.tgz
cp ./netbsd /netbsd
cp sun50i-a64-pine64* /boot/dtb/allwinner/
reboot

After reboot

mkdir -p /root/tmp/sets
cd /root/tmp/sets
for x in base comp games man misc modules tests text xbase xcomp xfont xserver; do ftp https://nyftp.netbsd.org/pub/NetBSD-daily/HEAD/latest/evbarm-aarch64/binary/sets/$x.tgz; done
for x in base comp games man misc modules tests text xbase xcomp xfont xserver; do tar -C / -zxvpf $x.tgz; done

/etc/ configuration

for x in etc xetc; do ftp https://nyftp.netbsd.org/pub/NetBSD-daily/HEAD/latest/evbarm-aarch64/binary/sets/$x.tgz; done
etcupdate -s etc.tgz -s xetc.tgz

Verify everything works, then clean up and reboot

rm -Rf /root/tmp
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment