SlideShare uma empresa Scribd logo
1 de 28
Baixar para ler offline
NetBSD workshop
Jun Ebihara
jun@soum.co.jp
jun@netbsd.org
OverView in 4hours
● Install NetBSD/amd64 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: Over 4GB 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.1.amd64.iso
● src.tar.gz
● VirtualBox
● Rawrite32.exe
● RPI Image
– 2017-07-15-netbsd-earmv6hf.img.gz or newer
– http://cdn.netbsd.org/pub/NetBSD/misc/jun/raspberry-pi
– http://mail-index.netbsd.org/port-arm/2017/07/13/msg004307.html
– https://github.com/ebijun/NetBSD/blob/master/RPI/RPIimage/READ
ME
VirtualBox
● NetBSD on VirtualBox
– Assign 2GB mem: Disk 10GB
● NetBSD-7.1-amd64.iso
● Set NetBSD source on /usr/src
– 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/2017-07-15-earmv6hf/2017-07-15-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 15 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
RPI:/boot
● Kernel
– kernel.img – kernel for RPI0/1
– kernel7.img – kernel for RPI2/3
● cmdline.txt
– root=ld0a console=fb
– Add -s to boot single user mode
● config.txt
– http://elinux.org/RPiconfig
– hdmi_group=2
– hdmi_mode=16
/etc/rc.conf
● rc_configred=YES
● sshd=YES
● ntpd=YES
● hostname=nandemoii
NetBSD source
● dhcpcd
● ftp
http://cdn.netbsd.org/pub/NetBSD/NetBSD-current
/tar_files/src.tar.gz
● tar xzvf src.tar.gz
● mv src /usr/src
● mkdir /usr/obj
Kernel cross build for RPI2
● cd /usr/src
● ./build.sh -u -U -m evbarm -a earmv6hf tools
● ./build.sh -u -U -m evbarm -a earmv6hf
kernel=RPI2
● Copy netbsd.bin to /boot/kernel7.img
● objdump -D netbsd.bin
● Copy netbsd.bin to RPI:/boot/kernel7.img
● Set over 2GB mem for VirtualBox,if failed
Kernel cross build for KOBO
● cd /usr/src
● ./build.sh -j 6 -u -U -m evbarm -a earmv7hf
tools
● ./build.sh -j 6 -u -U -m evbarm -a earmv7hf
kernel=KOBO
● Copy netbsd.bin to /boot/kernel7.img
● objdump -D netbsd.bin
Kernel cross build for NetWalker
● cd /usr/src
● ./build.sh -j 6 -u -U -m evbarm -a earmv7hf
tools
● ./build.sh -j 6 -u -U -m evbarm -a earmv7hf
kernel=NETWALKER
● Copy netbsd.bin to /boot/kernel7.img
● objdump -D netbsd.bin
Kernel cross build for earmv4
● cd /usr/src
● ./build.sh -j 6 -u -U -m hpcarm tools
● ./build.sh -j 6 -u -U -m hpcarm kernel=WZERO3
● Copy netbsd to MSDOS partition
● Copy
/usr/src/sys/arch/hpc/stand/binary/ARM/hpcboot.exe.uue
● Uudecode hpcboot.exe.uue
● objdump -D netbsd
Kernel cross build for mipsel
● cd /usr/src
● ./build.sh -j 6 -u -U -m hpcmips tools
● ./build.sh -j 6 -u -U -m hpcmips kernel=GENERIC
● Copy netbsd to MSDOS partition
● Copy
/usr/src/sys/arch/hpc/stand/binary/MIPS/hpcboot.exe.uue
● Uudecode hpcboot.exe.uue
● objdump -D netbsd
Kernel cross build for sh3
● cd /usr/src
● ./build.sh -j 6 -u -U -m hpcsh tools
● ./build.sh -j 6 -u -U -m hpcsh kernel=GENERIC
● Copy netbsd to MSDOS partition
● Copy
/usr/src/sys/arch/hpc/stand/binary/SH3/hpcboot.exe.uue
● uudecode hpcboot.exe.uue
● objdump -D netbsd
Kernel cross build for sh4
● cd /usr/src
● ./build.sh -j 6 -u -U -m dreamcast tools
● ./build.sh -j 6 -u -U -m dreamcast
kernel=GENERIC
● objdump -D netbsd
Paths
● /etc/mk.conf
● /usr/src
– obj → ln -s /usr/obj
● tooldir.NetBSD-8.99.1-amd64
– bin/nbmake-hpcmips
● destdir.hpcmips
● releasedir
– sys/arch/hpcmips/
● conf/GENERIC
● compile/obj/GENERIC/netbsd
● compile/obj/GENERIC/netbsd.bin
● compile/obj/GENERIC/netbsd.ub
CVS update
● cd /usr/src
● script 20170810.log
● cvs update -Pad
● exit
● grep -v Updating 20170810.log |more
MediaTek MT7620
● ELECOM WRH-300CR
● http://pastebin.com/n05jnhjs
● NetBSD/evbmips:
● /usr/src/sys/arch/evbmips/conf
● grep MT7620
– ZYXELKX
Kernel cross build for MT7620
● cd /usr/src
● ./build.sh -j 6 -u -U -m evbmips -a mipsel tools
● ./build.sh -j 6 -u -U -m evbmips -a mipsel
kernel=ZYXELKX
● objdump -D netbsd
OrangePI
● Allwinnler H
● earmv7hf
● https://github.com/jaredmcneill/netbsd-arm-
docs/wiki/Allwinner
Kernel cross build for OrangePI
● cd /usr/src
● ./build.sh -j 6 -u -U -m evbarm -a earmv7hf
tools
● ./build.sh -j 6 -u -U -m evbarm -a earmv7hf
kernel=SUNXI
● https://github.com/jaredmcneill/netbsd-arm-
docs/wiki/Allwinner
● objdump -D netbsd.bin
Uboot
● Armbian
– https://github.com/ebijun/NetBSD/blob/master/sunxi/u-boot
/Makefile
– apt-get install binutils-arm-none-eabi
– apt-get install gcc-arm-none-eabi
– apt-get install swig libpython-dev
– make ${BOARD}_defconfig;make
● pkgsrc/sysutils/u-boot-orangepi-plus2e
● dd if=u-boot-sunxi-with-spl.bin of=imagefile bs=1024
seek=8 conv=sync
dmesg
● https://github.com/ebijun/NetBSD/tree/master/
dmesg
● http://dmesgd.nycbug.org/index.cgi

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

vbsd2013
vbsd2013vbsd2013
vbsd2013
 
FUSE Filesystems
FUSE FilesystemsFUSE Filesystems
FUSE Filesystems
 
Linux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware ManagementLinux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware Management
 
Linux
LinuxLinux
Linux
 
Life Preserver - AsiaBSDCon2014
Life Preserver - AsiaBSDCon2014Life Preserver - AsiaBSDCon2014
Life Preserver - AsiaBSDCon2014
 
Porting Puppet to OpenBSD
Porting Puppet to OpenBSD Porting Puppet to OpenBSD
Porting Puppet to OpenBSD
 
eurobsd2013
eurobsd2013eurobsd2013
eurobsd2013
 
MongoDB Replication Cluster
MongoDB Replication ClusterMongoDB Replication Cluster
MongoDB Replication Cluster
 
LSA2 - PostgreSQL
LSA2 - PostgreSQLLSA2 - PostgreSQL
LSA2 - PostgreSQL
 
Look Into Libvirt Osier Yang
Look Into Libvirt Osier YangLook Into Libvirt Osier Yang
Look Into Libvirt Osier Yang
 
redis-benchmark with AMD RYZEN 1800X Intel Kaby Lake (i7-7700K) memo
redis-benchmark with AMD RYZEN 1800X Intel Kaby Lake (i7-7700K) memoredis-benchmark with AMD RYZEN 1800X Intel Kaby Lake (i7-7700K) memo
redis-benchmark with AMD RYZEN 1800X Intel Kaby Lake (i7-7700K) memo
 
Qemu x86 BIOS @ https://youtu.be/F71LGSrj9cc
Qemu x86 BIOS @ https://youtu.be/F71LGSrj9ccQemu x86 BIOS @ https://youtu.be/F71LGSrj9cc
Qemu x86 BIOS @ https://youtu.be/F71LGSrj9cc
 
BlankOn Server - Lesson Learned
BlankOn Server - Lesson LearnedBlankOn Server - Lesson Learned
BlankOn Server - Lesson Learned
 
MongoDB Shard Cluster
MongoDB Shard ClusterMongoDB Shard Cluster
MongoDB Shard Cluster
 
Recipe of a linux Live CD (archived)
Recipe of a linux Live CD (archived)Recipe of a linux Live CD (archived)
Recipe of a linux Live CD (archived)
 
Lpreservereurobsd2014
Lpreservereurobsd2014Lpreservereurobsd2014
Lpreservereurobsd2014
 
Deploying And Scaling Rails
Deploying And Scaling RailsDeploying And Scaling Rails
Deploying And Scaling Rails
 
Self 2013
Self 2013Self 2013
Self 2013
 
Cluster filesystems
Cluster filesystemsCluster filesystems
Cluster filesystems
 
Libvirt and bhyve under FreeBSD
Libvirt and bhyve under FreeBSDLibvirt and bhyve under FreeBSD
Libvirt and bhyve under FreeBSD
 

Semelhante a NetBSD workshop

Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Docker, Inc.
 
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Opersys inc.
 
High Availability != High-cost
High Availability != High-costHigh Availability != High-cost
High Availability != High-cost
normanmaurer
 

Semelhante a NetBSD workshop (20)

The Deck by Phil Polstra GrrCON2012
The Deck by Phil Polstra GrrCON2012The Deck by Phil Polstra GrrCON2012
The Deck by Phil Polstra GrrCON2012
 
An Introduction To Linux
An Introduction To LinuxAn Introduction To Linux
An Introduction To Linux
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux Developers
 
Qt native built for raspberry zero
Qt native built for  raspberry zeroQt native built for  raspberry zero
Qt native built for raspberry zero
 
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
 
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
 
Joomla on Raspberry Pi using Nginx - Nederlandse Linux Gebruikers Group novem...
Joomla on Raspberry Pi using Nginx - Nederlandse Linux Gebruikers Group novem...Joomla on Raspberry Pi using Nginx - Nederlandse Linux Gebruikers Group novem...
Joomla on Raspberry Pi using Nginx - Nederlandse Linux Gebruikers Group novem...
 
Bundling Packages and Deploying Applications with RPM
Bundling Packages and Deploying Applications with RPMBundling Packages and Deploying Applications with RPM
Bundling Packages and Deploying Applications with RPM
 
Qemu - Raspberry | while42 Singapore #2
Qemu - Raspberry | while42 Singapore #2Qemu - Raspberry | while42 Singapore #2
Qemu - Raspberry | while42 Singapore #2
 
qemu + gdb: The efficient way to understand/debug Linux kernel code/data stru...
qemu + gdb: The efficient way to understand/debug Linux kernel code/data stru...qemu + gdb: The efficient way to understand/debug Linux kernel code/data stru...
qemu + gdb: The efficient way to understand/debug Linux kernel code/data stru...
 
Installing nagios core_from_source
Installing nagios core_from_sourceInstalling nagios core_from_source
Installing nagios core_from_source
 
Bsdtw17: lightning talks/wip sessions
Bsdtw17: lightning talks/wip sessionsBsdtw17: lightning talks/wip sessions
Bsdtw17: lightning talks/wip sessions
 
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
 
RamDisk
RamDiskRamDisk
RamDisk
 
openbsd-as-nas.pdf
openbsd-as-nas.pdfopenbsd-as-nas.pdf
openbsd-as-nas.pdf
 
testing-nfs
testing-nfstesting-nfs
testing-nfs
 
High Availability != High-cost
High Availability != High-costHigh Availability != High-cost
High Availability != High-cost
 
Adhocr T-dose 2012
Adhocr T-dose 2012Adhocr T-dose 2012
Adhocr T-dose 2012
 
Polstra 44con2012
Polstra 44con2012Polstra 44con2012
Polstra 44con2012
 
Hacking and Forensics on the Go - 44CON 2012
Hacking and Forensics on the Go - 44CON 2012Hacking and Forensics on the Go - 44CON 2012
Hacking and Forensics on the Go - 44CON 2012
 

Último

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 

Último (20)

%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 

NetBSD workshop

  • 2. OverView in 4hours ● Install NetBSD/amd64 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. Hardwares ● Windows 10 PC with VirtualBox ● Raspberry PI – MicroSD Card: Over 4GB 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. Pre-Downloading ● NetBSD-7.1.amd64.iso ● src.tar.gz ● VirtualBox ● Rawrite32.exe ● RPI Image – 2017-07-15-netbsd-earmv6hf.img.gz or newer – http://cdn.netbsd.org/pub/NetBSD/misc/jun/raspberry-pi – http://mail-index.netbsd.org/port-arm/2017/07/13/msg004307.html – https://github.com/ebijun/NetBSD/blob/master/RPI/RPIimage/READ ME
  • 5. VirtualBox ● NetBSD on VirtualBox – Assign 2GB mem: Disk 10GB ● NetBSD-7.1-amd64.iso ● Set NetBSD source on /usr/src – cd /usr – ftp http://cdn.netbsd.org/pub/NetBSD/NetBSD-current/tar_files/src.tar .gz – tar xzvf src.tar.gz
  • 6. NetBSD RPI Image ● on Windows ● http://cdn.netbsd.org/pub/NetBSD/misc/jun/raspberry- pi/2017-07-15-earmv6hf/2017-07-15-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 15 min to resize partition
  • 7. Using RPI image ● Login: root ● startx ● medit ● mikutter ● mlterm-fb ● omxplayer & youtube-dl – pkg_add omxplayer – pkg_add youtube-dl
  • 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. NTP time setting ● ntpq -p ● /etc/rc.d/ntpd stop ● /etc/rc.d/ntpdate start ● /etc/rc.d/ntpd start ● ntpq -p
  • 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. RPI:/boot ● Kernel – kernel.img – kernel for RPI0/1 – kernel7.img – kernel for RPI2/3 ● cmdline.txt – root=ld0a console=fb – Add -s to boot single user mode ● config.txt – http://elinux.org/RPiconfig – hdmi_group=2 – hdmi_mode=16
  • 12. /etc/rc.conf ● rc_configred=YES ● sshd=YES ● ntpd=YES ● hostname=nandemoii
  • 13. NetBSD source ● dhcpcd ● ftp http://cdn.netbsd.org/pub/NetBSD/NetBSD-current /tar_files/src.tar.gz ● tar xzvf src.tar.gz ● mv src /usr/src ● mkdir /usr/obj
  • 14. Kernel cross build for RPI2 ● cd /usr/src ● ./build.sh -u -U -m evbarm -a earmv6hf tools ● ./build.sh -u -U -m evbarm -a earmv6hf kernel=RPI2 ● Copy netbsd.bin to /boot/kernel7.img ● objdump -D netbsd.bin ● Copy netbsd.bin to RPI:/boot/kernel7.img ● Set over 2GB mem for VirtualBox,if failed
  • 15. Kernel cross build for KOBO ● cd /usr/src ● ./build.sh -j 6 -u -U -m evbarm -a earmv7hf tools ● ./build.sh -j 6 -u -U -m evbarm -a earmv7hf kernel=KOBO ● Copy netbsd.bin to /boot/kernel7.img ● objdump -D netbsd.bin
  • 16. Kernel cross build for NetWalker ● cd /usr/src ● ./build.sh -j 6 -u -U -m evbarm -a earmv7hf tools ● ./build.sh -j 6 -u -U -m evbarm -a earmv7hf kernel=NETWALKER ● Copy netbsd.bin to /boot/kernel7.img ● objdump -D netbsd.bin
  • 17. Kernel cross build for earmv4 ● cd /usr/src ● ./build.sh -j 6 -u -U -m hpcarm tools ● ./build.sh -j 6 -u -U -m hpcarm kernel=WZERO3 ● Copy netbsd to MSDOS partition ● Copy /usr/src/sys/arch/hpc/stand/binary/ARM/hpcboot.exe.uue ● Uudecode hpcboot.exe.uue ● objdump -D netbsd
  • 18. Kernel cross build for mipsel ● cd /usr/src ● ./build.sh -j 6 -u -U -m hpcmips tools ● ./build.sh -j 6 -u -U -m hpcmips kernel=GENERIC ● Copy netbsd to MSDOS partition ● Copy /usr/src/sys/arch/hpc/stand/binary/MIPS/hpcboot.exe.uue ● Uudecode hpcboot.exe.uue ● objdump -D netbsd
  • 19. Kernel cross build for sh3 ● cd /usr/src ● ./build.sh -j 6 -u -U -m hpcsh tools ● ./build.sh -j 6 -u -U -m hpcsh kernel=GENERIC ● Copy netbsd to MSDOS partition ● Copy /usr/src/sys/arch/hpc/stand/binary/SH3/hpcboot.exe.uue ● uudecode hpcboot.exe.uue ● objdump -D netbsd
  • 20. Kernel cross build for sh4 ● cd /usr/src ● ./build.sh -j 6 -u -U -m dreamcast tools ● ./build.sh -j 6 -u -U -m dreamcast kernel=GENERIC ● objdump -D netbsd
  • 21. Paths ● /etc/mk.conf ● /usr/src – obj → ln -s /usr/obj ● tooldir.NetBSD-8.99.1-amd64 – bin/nbmake-hpcmips ● destdir.hpcmips ● releasedir – sys/arch/hpcmips/ ● conf/GENERIC ● compile/obj/GENERIC/netbsd ● compile/obj/GENERIC/netbsd.bin ● compile/obj/GENERIC/netbsd.ub
  • 22. CVS update ● cd /usr/src ● script 20170810.log ● cvs update -Pad ● exit ● grep -v Updating 20170810.log |more
  • 23. MediaTek MT7620 ● ELECOM WRH-300CR ● http://pastebin.com/n05jnhjs ● NetBSD/evbmips: ● /usr/src/sys/arch/evbmips/conf ● grep MT7620 – ZYXELKX
  • 24. Kernel cross build for MT7620 ● cd /usr/src ● ./build.sh -j 6 -u -U -m evbmips -a mipsel tools ● ./build.sh -j 6 -u -U -m evbmips -a mipsel kernel=ZYXELKX ● objdump -D netbsd
  • 25. OrangePI ● Allwinnler H ● earmv7hf ● https://github.com/jaredmcneill/netbsd-arm- docs/wiki/Allwinner
  • 26. Kernel cross build for OrangePI ● cd /usr/src ● ./build.sh -j 6 -u -U -m evbarm -a earmv7hf tools ● ./build.sh -j 6 -u -U -m evbarm -a earmv7hf kernel=SUNXI ● https://github.com/jaredmcneill/netbsd-arm- docs/wiki/Allwinner ● objdump -D netbsd.bin
  • 27. Uboot ● Armbian – https://github.com/ebijun/NetBSD/blob/master/sunxi/u-boot /Makefile – apt-get install binutils-arm-none-eabi – apt-get install gcc-arm-none-eabi – apt-get install swig libpython-dev – make ${BOARD}_defconfig;make ● pkgsrc/sysutils/u-boot-orangepi-plus2e ● dd if=u-boot-sunxi-with-spl.bin of=imagefile bs=1024 seek=8 conv=sync