commit | bdaf934360db88a5da23e23083c1179b53347cd5 | [log] [tgz] |
---|---|---|
author | Jan Kundrát <jan.kundrat@cesnet.cz> | Fri Jan 12 18:18:35 2018 +0100 |
committer | Jan Kundrát <jan.kundrat@cesnet.cz> | Fri Jan 12 18:18:35 2018 +0100 |
tree | 2b64b9e06e8f63f8e688ccc7c592c758b181f033 | |
parent | 6fa8750539b0b31c196d7e98772edb0c63e8470e [diff] |
clearfog: Implement USB booting Here's how to load this from a possible bricked device: 1) Set the boot switches to 01001 (yes, it's different from what the doc says) 2) Load the bootloader via UART, e.g.: `./tools/kwboot -b ./u-boot-spl.kwb -t -p /dev/ttyUSB0` 3) Interrupt U-Boot's autoboot to get a prompt 4) Plug a USB flash with images/usb-flash.img loaded 5) One on the U-Boot prompt, execute: `usb start; fatload usb 0:1 00800000 usb-boot.scr; source 00800000` 6) Get a nice emergency shell Change-Id: Icef4badc9105bbed78ad949c060c0a46e9ff7f76
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 for targets which use a pre-generated Linaro toolchain (clearfog
, beaglebone
). Other targets take longer because one has to build a toolchain first. When the build finishes, the generated image to be dd
-ed to an SD card is at images/sdcard.img
.
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)
Also, we are building two different root filesystem instances (an EXT4 image and a tarball for RAUC). This is also currently broken, but we can work around that reasonably easily:
make -j32 target-finalize && make
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