commit | be552617cb5a9e28da8f3834426d2ad62616c142 | [log] [tgz] |
---|---|---|
author | Jan Kundrát <jan.kundrat@cesnet.cz> | Mon May 21 22:45:32 2018 +0200 |
committer | Jan Kundrát <jan.kundrat@cesnet.cz> | Mon May 21 23:50:24 2018 +0200 |
tree | a45f313f000d12d81852d5d85766751005bb64e5 | |
parent | ff8479a0d775aa6feecb223f28d82fd6a217e2f5 [diff] |
Upgrade and fix U-Boot I want to have access to the Ethernet interfaces from within U-Boot for setting of persistent MAC addresses. There were some relevant changes in the latest master, and one also has to fix the Device Tree which still assumes that the board is a Clearfog Pro while we are using a Clearfog Base. The script_addr_r -> scriptaddr change is a bit misterious for me -- it seems that that variable was actually never part of upstream. It seems that I made a mistake during one of the reabses of my clearfog patch series... On the bright side, this makes it possible to persistently store Ethernet MAC addresses within the U-Boot environment: eth1addr=00:11:17:00:00:01 eth2addr=00:11:17:00:00:02 eth3addr=00:11:17:00:00:03 "eth1" is the left RJ-45, "eth2" is the right one, and "eth3" is the SFP slot. Change-Id: I887ffbf2e9c7fbab7baccd14b9b40ef42a566678
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:
./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
A Linux session will start. Run the following from the shell prompt:
mount /dev/sda1 /mnt; sh /mnt/usb-reflash-factory.sh