Embed presentation
Download to read offline
NetBSD workshop Jun Ebihara jun@soum.co.jp jun@netbsd.org
OverView in 4hours ●くろまる Install NetBSD/i386 on VirtualBox – Make earmv6hf cross-compiling toolchain – Make RPI kernel ●くろまる Install NetBSD/earmv6hf on RPI – Play RPI with NetBSD – Feel difference between your favorite environment ●くろまる Copy your RPI kernel to RPI – Update NetBSD-current kernel ●くろまる Boot RPI with your cross-compiled kernel
Hardwares ●くろまる Windows 10 PC with VirtualBox ●くろまる Raspberry PI – MicroSD Card: 4 or 8GB class 10 – HDMI Display – USB Keyboard/mouse – USB power supply – Ethernet Cable ●くろまる Internet access via Ethernet Cable – RPI get IP address via DHCP – RPI set time via NTP
Pre-Downloading ●くろまる NetBSD-7.0.1.i386.iso ●くろまる src.tar.gz ●くろまる VirtualBox ●くろまる Rawrite32.exe ●くろまる RPI Image – 2016年07月29日-netbsd-earmv6hf.img.gz
VirtualBox ●くろまる NetBSD on VirtualBox ●くろまる NetBSD-7.0.1-i386.iso ●くろまる cd /usr ●くろまる ftp http://cdn.netbsd.org/pub/NetBSD/NetBSD-current/tar_files/src.tar.gz ●くろまる tar xzvf src.tar.gz
NetBSD RPI Image ●くろまる on Windows ●くろまる http://cdn.netbsd.org/pub/NetBSD/misc/jun/raspberry- pi/2016-07-29-earmv6hf/2016-07-29-netbsd-raspi- earmv6hf.img.gz ●くろまる http://www.netbsd.org/~martin/rawrite32/download.html ●くろまる Use rawrite32 to write RPI image to microSD ●くろまる Connect RPI: ●くろまる Boot ●くろまる Wait 10 min to resize partition
Using RPI image ●くろまる Login: root ●くろまる startx ●くろまる medit ●くろまる mikutter ●くろまる mlterm-fb ●くろまる omxplayer & youtube-dl – pkg_add omxplayer – pkg_add youtube-dl
PaX ●くろまる Some application exec failed on starting ●くろまる sysctl -a |grep pax – security.pax.mprotect.enabled = 1 – security.pax.mprotect.global = 1 – security.pax.mprotect.ptrace = 1 – security.pax.mprotect.debug = 1 – security.pax.segvguard.enabled = 1 – security.pax.segvguard.global = 1 ●くろまる Loooose protection: (bad manner) – sysctl -w security.pax.mprotect.enabled=0
NTP time setting ●くろまる ntpq -p ●くろまる /etc/rc.d/ntpd stop ●くろまる /etc/rc.d/ntpdate start ●くろまる /etc/rc.d/ntpd start ●くろまる ntpq -p
Reboot and / mount failed ●くろまる Power supply cut down failure – make file system damaged ●くろまる Reboot but / read only access ●くろまる drop on single usermode – df – fsck /dev/ld0a – reboot ●くろまる /etc/fstab – add "log,noatime" – man 5 fstab
/etc/rc.conf ●くろまる sshd=YES ●くろまる ntpd=YES ●くろまる hostname=nandemoii
Kernel cross build ●くろまる cd /usr/src ●くろまる ./build.sh -j 6 -u -U -m evbarm -a earmv6hf tools ●くろまる ./build.sh -j 6 -u -U -m evbarm -a earmv6hf kernel=RPI ●くろまる Copy netbsd.bin to /boot/kernel.img
Kernel cross build for RPI2 ●くろまる cd /usr/src ●くろまる ./build.sh -j 6 -u -U -m evbarm -a earmv6hf tools ●くろまる ./build.sh -j 6 -u -U -m evbarm -a earmv6hf kernel=RPI2 ●くろまる Copy netbsd.bin to /boot/kernel7.img ●くろまる src/sys/arch/arm/broadcom/bcm2835_bsc.c:91 – if (strcmp(aaa->aaa_name, "bcmbsc") != 0) return 0; – + if (aaa->aaa_addr == BCM2835_BSC0_BASE) – + return 0;