commit | 1c6643e401e86be83574483c6a5f3e79ceee3a82 | [log] [tgz] |
---|---|---|
author | Jan Kundrát <kundrat@cesnet.cz> | Fri Nov 01 19:39:34 2019 +0100 |
committer | Jan Kundrát <kundrat@cesnet.cz> | Fri Nov 01 20:44:35 2019 +0100 |
tree | f40436224492a9dc79649c6d1412f2aef9d04aae | |
parent | 68f98ad07546f49baa15a082413c2d2595bc6091 [diff] |
Remote systemd journald logging TL;DR: `echo DESTINATION=http://10.0.254.102 > /cfg/journald-remote` now activates sending of everything into a remote server. This was more complex than I expected (ha ha): - By default, this unit pulls in network-online.target, and that one is FUBAR on our systemd-networkd setup. That in turn leads to a "failed unit" check, which transitions the whole system into `degraded`, and that one leads to a slow and painful watchdog death. - Even if everything worked, this is a network thingy, and as such it's rather fragile -- it can die at any time (a broken connection terminates this service with a failure). That's once again something which leads to a `degraded` state. So, let's fix everything by: - auto-restarts (with a sufficient timeout, etc) - ignoring network, - some conditional enablement. This appears to work, which is awesome if you ask me. Change-Id: I83ae10d52b35eafd633e77b78b02580c041496b4
This repository contains CzechLight-specific bits for Buildroot. Buildroot is a tool which produces system images for flashing to embedded devices. They have a nice documentation which explains everything that one might need.
Everything is in Gerrit. One should not need to clone anything from anywhere else. The build will download source tarballs of various open source components, though.
TODO: Automate this via the CI system. I want to get the .img
files for testing of each change, eventually.
git clone ssh://$YOUR_LOGIN@cesnet.cz@gerrit.cesnet.cz:29418/CzechLight/br2-external czechlight pushd czechlight git submodule update --init --recursive popd mkdir build-clearfog cd build-clearfog ../czechlight/dev-setup-git.sh make czechlight_clearfog_defconfig make
A full rebuild takes between 30 and 45 minutes on a T460s laptop.
WARNING: Buildroot is fragile. It is not safe to perform incremental builds after changing an "important" setting. Please check their manual for details.
A significant amount of time is wasted in configure
steps which are not parallelized :( as of November 2017. This can be hacked by patching Buildroot's top-level Makefile
, but note that one cannot easily debug stuff afterwards.
diff --git a/Makefile b/Makefile index 79db7fe..905099a 100644 --- a/Makefile +++ b/Makefile @@ -114,7 +114,7 @@ endif # this top-level Makefile in parallel comment the ".NOTPARALLEL" line and # use the -j<jobs> option when building, e.g: # make -j$((`getconf _NPROCESSORS_ONLN`+1)) -.NOTPARALLEL: # absolute path TOPDIR := $(CURDIR)
Apart from the traditional way of re-flashing the SD card or the eMMC from scratch, it's also possible to use RAUC to update. This method preserves the U-Boot version and the U-Boot's environment. Apart from that, everything starting with the kernel and the DTB file and including the root FS is updated. Configuration stored in /cfg
is brought along and preserved as well.
To install an update:
# build node make rsync -avP images/update.raucb somewhere.example.org:path/to/web/root # target, perhaps via an USB console wget http://somewhere.example.org/update.raucb -O /tmp/update.raucb rauc install /tmp/update.raucb reboot
On development boards with a µSD card slot, simply dd
the images/sdcard.img
to the SD card and boot from there.
On a regular Clearfog Base with an eMMC, one has to bootstrap the device first. If recovering a totally bricked board, one can use the kwboot
command to upload the initial U-Boot via the console. Ensure that the jumpers are set to 0 1 0 0 1
(default for eMMC boot is 0 0 1 1 1
), and then use U-Boot's kwboot
tool:
./tools/kwboot -b ./u-boot-spl.kwb -t -p /dev/ttyUSB0
Once in U-Boot (a stock factory image is OK as well), plug a USB flash disk which contains images/usb-flash.img
and execute:
usb start; fatload usb 0:1 00800000 boot.scr; source 00800000
The system will boot and flash the eMMC from the USB drive. Once the status LED starts blinking in yellow, data are being transferred to the eMMC. The light changes to solid yellow in later phases of the flashing process. Once everything is done, the status LED shows a solid white light and the system reboots automatically.
Turn off power, remove the USB flash, re-jumper the board (0 0 1 1 1
), power-cycle, and configure MAC addresses and system type at the U-Boot prompt. The MAC addresses are find on the label at the front panel.
=> setenv eth1addr 00:11:17:01:00:4c => setenv eth2addr 00:11:17:01:00:4d => setenv eth3addr 00:11:17:01:00:4e => setenv czechlight sdn-roadm-line => saveenv Saving Environment to MMC... Writing to redundant MMC(0)... OK => boot
Once the system boots (which currently requires a reboot for some unknown reason -- fsck, perhaps?), configure hostname, plug in the network cable, and update SW:
# hostnamectl set-hostname line-DQ000OE6 # cp /etc/hostname /cfg/etc/ # vorvan-update