Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
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
● Insta...
Hardwares
● Windows 10 PC with VirtualBox
● Raspberry PI
– MicroSD Card: 4 or 8GB class 10
– HDMI Display
– USB Keyboard/m...
Pre-Downloading
● NetBSD-7.0.1.i386.iso
● src.tar.gz
● VirtualBox
● Rawrite32.exe
● RPI Image
– 2016-07-29-netbsd-earmv6hf...
VirtualBox
● NetBSD on VirtualBox
● NetBSD-7.0.1-i386.iso
● cd /usr
● ftp
http://cdn.netbsd.org/pub/NetBSD/NetBSD-current/...
NetBSD RPI Image
● on Windows
● http://cdn.netbsd.org/pub/NetBSD/misc/jun/raspberry-
pi/2016-07-29-earmv6hf/2016-07-29-net...
Using RPI image
● Login: root
● startx
● medit
● mikutter
● mlterm-fb
● omxplayer & youtube-dl
– pkg_add omxplayer
– pkg_a...
PaX
● Some application exec failed on starting
● sysctl -a |grep pax
– security.pax.mprotect.enabled = 1
– security.pax.mp...
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
● dro...
/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 ...
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 e...
Upcoming SlideShare
Loading in …5
×

NetBSDworkshop

496 views

Published on

NetBSD workshop (4hours)

Published in: Software
  • Be the first to comment

  • Be the first to like this

NetBSDworkshop

  1. 1. NetBSD workshop Jun Ebihara jun@soum.co.jp jun@netbsd.org
  2. 2. 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
  3. 3. 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
  4. 4. Pre-Downloading ● NetBSD-7.0.1.i386.iso ● src.tar.gz ● VirtualBox ● Rawrite32.exe ● RPI Image – 2016-07-29-netbsd-earmv6hf.img.gz
  5. 5. 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
  6. 6. 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
  7. 7. Using RPI image ● Login: root ● startx ● medit ● mikutter ● mlterm-fb ● omxplayer & youtube-dl – pkg_add omxplayer – pkg_add youtube-dl
  8. 8. 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
  9. 9. NTP time setting ● ntpq -p ● /etc/rc.d/ntpd stop ● /etc/rc.d/ntpdate start ● /etc/rc.d/ntpd start ● ntpq -p
  10. 10. 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
  11. 11. /etc/rc.conf ● sshd=YES ● ntpd=YES ● hostname=nandemoii
  12. 12. 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
  13. 13. 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;

×