This is a yocto project (https://www.yoctoproject.org/) layer containing recipes to build an image that can run on a galleon ntp appliance.
This README file contains information on the contents of the meta-ntpserver layer. Please see the corresponding sections below for details.
Dependencies
URI: http://git.yoctoproject.org/git/poky layers: meta, meta-poky, meta-yocto-bsp branch: mickledore
URI: http://git.openembedded.org/meta-openembedded layers: meta-oe, meta-python, meta-networking branch: mickledore
Patches
Please submit any patches against the meta-ntpserver layer to the maintainer.
Maintainer: Thomas Stewart thomas@stewarts.org.uk
Using
This layer contains both a distro (ntpserver) and machine (gallean). It's desgined to ceate an eng image for a galleon ntp appliance. However further machines could be added.
To use this the base and dependency repos needs to be created:
git clone http://git.yoctoproject.org/git/poky -b mickledore
cd poky
git clone http://git.openembedded.org/meta-openembedded -b mickledore
git clone https://github.com/thomasdstewart/meta-ntpserver.git
. oe-init-build-env
bitbake-layers add-layer $PWD/../meta-openembedded/meta-oe
bitbake-layers add-layer $PWD/../meta-openembedded/meta-python
bitbake-layers add-layer $PWD/../meta-openembedded/meta-networking
bitbake-layers add-layer $PWD/../meta-ntpserver
This adds an image called ntpserver-image. It expects some configuration to be defined in build/conf/local.conf. Add the following to local.conf:
echo 'MACHINE = "galleon"' >> conf/local.conf
echo 'DISTRO = "ntpserver"' >> conf/local.conf
echo 'ROOT_PASSWORD_HASH = "\$5\$XdEvu3X0DbgNUKqa\$AeAvbpYFcve1nRKoDnXCCRB8Mu8USDQ0Yxqdac94Qq6"' >> conf/local.conf
echo 'hostname_pn-base-files = "ntpserver"' >> conf/local.conf
Password hashes can be set with: "printf "%q" $(mkpasswd -m sha256crypt password)". Modify the meta-ntpserver/recipes-core/server/ntp.conf file to suite needs.
To build run:
bitbake ntpserver-image
It should produce a working image located in the build dir here:
tmp/work/galleon-poky-linux/ntpserver-image/1.0-r0/deploy-ntpserver-image-image-complete/ntpserver-image-galleon.wic
To test this with qemu the following can be used:
runqemu-gen-tapdevs # following advice to run sudo runqemu-gen-tapdevs
runqemu wic nographic
Which runs something like:
tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-i386 -device virtio-net-pci,netdev=net0,mac=52:54:00:12:34:02 -netdev tap,id=net0,ifname=tap0,script=no,downscript=no -object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0 -drive if=none,id=hd,file=build/tmp/deploy/images/galleon/ntpserver-image-galleon-20230602072302.rootfs.wic,format=raw -device virtio-scsi-pci,id=scsi -device scsi-hd,drive=hd -m 256 -serial mon:stdio -serial null -nographic
Which can be written to a USB stick with something like:
pv tmp/work/galleon-poky-linux/ntpserver-image/1.0-r0/deploy-ntpserver-image-image-complete/ntpserver-image-galleon.wic | sudo dd bs=1M of=/dev/sdb
Once booted from the USB sticl on the real hardware dd the usb to the onboard compact flash with something like:
dd if=/dev/sdb of=/dev/sda_remove_ bs=1M count=200
Post install modifications can be made by remounting rw
mount -o remount,rw /
# do modification
mount -o remount,ro /
Static IP's can be configured to override /lib/systemd/network/80-wired.network in /etc/systemd/network/0-wired.network to override like:
[Match]
Name=en*
[Network]
Address=192.168.0.10/24
Gateway=192.168.0.1
DNS=192.168.0.1
To test gps, telnet to localhost port 2947 and type "?WATCH={"enable":true,"json":true};", eg
# telnet localhost 2947
Connected to localhost
{"class":"VERSION","release":"3.19","rev":"3.19","proto_major":3,"proto_minor":14}
?WATCH={"enable":true,"json":true};
{"class":"DEVICES","devices":[{"class":"DEVICE","path":"/dev/ttyS1","driver":"NMEA0183","activated":"2019-11-28T17:50:07.156Z","flags":1,"native":0,"bps":4800,"parity":"N","stopbits":1,"cycle":1.00}]}
{"class":"WATCH","enable":true,"json":true,"nmea":false,"raw":0,"scaled":false,"timing":false,"split24":false,"pps":false}
{"class":"TPV","device":"/dev/ttyS1","mode":2,"time":"2019-11-28T17:50:08.000Z","ept":0.005,"lat":51.594600000,"lon":-0.254036667,"track":38.9000,"speed":0.000}
{"class":"TPV","device":"/dev/ttyS1","mode":2,"time":"2019-11-28T17:50:09.000Z","ept":0.005,"lat":51.594600000,"lon":-0.254031667,"track":38.9000,"speed":0.000}
{"class":"TPV","device":"/dev/ttyS1","mode":2,"time":"2019-11-28T17:50:10.000Z","ept":0.005,"lat":51.594600000,"lon":-0.254028333,"track":38.9000,"speed":0.000}
Galleon Hardware
Galleon Motherboard: VIA EPIA EK http://cdn.viaembedded.com/eol_products/docs/epia-ek/datasheet/VIA+EPIA+EK_datasheet_v090217.pdf
Escape after bios beep loads boot menu Delete after bios beep gets into the bios tapping cap lock on during post pauses the systlinux menu
LCD seems to be HD44780 clone https://uk.rs-online.com/web/p/lcd-monochrome-displays/7200222/ https://cdn.sparkfun.com/assets/9/d/4/e/f/SerLCD_v2_5ApplicationNote_r1_2.pdf
TODO
- switch to ntpsec - existing packge depends on x11
- OTA updates
- https://wiki.yoctoproject.org/wiki/System_Update
- https://github.com/sbabic/meta-swupdate
- https://github.com/sbabic/meta-swupdate-boards
- https://github.com/sbabic/meta-swupdate-boards
- https://stackoverflow.com/questions/60724524/step-by-step-walk-through-on-how-to-use-swupdate-on-raspberry-pi-or-any-embedded
- https://stackoverflow.com/questions/66873032/meta-swupdate-yocto-gub-instead-of-u-boot-bootloader
Links
Yocto Project Development Tasks Manual https://www.yoctoproject.org/docs/3.0/dev-manual/dev-manual.html
Yocto Project Reference Manual https://www.yoctoproject.org/docs/3.0/ref-manual/ref-manual.html
Yocto Project Board Support Package (BSP) Developer's Guide https://www.yoctoproject.org/docs/3.0/bsp-guide/bsp-guide.html
cgit of poky http://git.yoctoproject.org/cgit.cgi/poky/tree/
cgit of meta-openembedded http://git.openembedded.org/meta-openembedded/tree/
OpenEmbedded Layer Index https://layers.openembedded.org/
YOCTO Meta-layer: How to add support for a custom board (or OpenRex) https://www.imx6rex.com/open-rex/software/yocto-meta-layer-how-to-add-support-for-a-custom-board-or-openrex/