Skip to content

Commit

Permalink
feat: Update Buildroot to 2020.02.6
Browse files Browse the repository at this point in the history
- wpa_supplicant changes for 2020.02.6:

  Force using wpa_supplicant daemon instead of dbus.
  The new wpa_supplicant version or Buildroot 2020.02.6 insist using
  dbus instead of the templated wpa_supplicant services! They are even
  deleted just before creating the filesystem image.
  Might be related to: buildroot/buildroot@c27708e

  Workaround: replace target service in /etc/systemd/system/wpa_supplicant.service
  to get the wpa_supplicant control socket back with a fixed wlan0 interface.

- Bluetooth console changes for 2020.02.6

  With the updated Bluez package the rfcomm serial console was no longer working due to pairing issues.
  The bt-agent is now required with NoInputNoOutput option to allow automatic pairing.

- Buildroot package cleanup:
  - Removed Bluetooth SAP plugin
  - Removed wpa_supplicant dbus support

- Clean up systemd services
  Use symlinks in overlay directory instead of creating them in the post build script.

- Setting QT env variables in profile.d

- Update scripts: Use Qt version in release download
  Since Qt versions are not always binary compatible, the installed Qt
  version is now specified in the GitHub release artifact.

- Using latest YIO component versions

This closes #3
  • Loading branch information
zehnm committed Sep 24, 2020
1 parent 13aacf2 commit 54cbc67
Show file tree
Hide file tree
Showing 36 changed files with 107 additions and 76 deletions.
28 changes: 8 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ Requirements:
- At least 4 GB RAM. More RAM = better file system caching.
- Fast CPU. More cores = quicker build times.
- Internet connection: packages will be downloaded during the build.
- 1+ GB microSD card
- Future images might be larger!
- 4 GB microSD card
- Recommended card: Samsung EVO Plus (64 and 128GB have much higher write speed!)
- See: [RPi microSD card performance comparison 2019](https://www.jeffgeerling.com/blog/2019/raspberry-pi-microsd-card-performance-comparison-2019)

Expand Down Expand Up @@ -176,6 +175,13 @@ Use [balenaEtcher](https://www.balena.io/etcher/) - available for Linux, macOS a

## Troubleshooting

If something doesn't work correctly, especially after changing any Buildroot configuration settings, do a clean rebuild:

make clean
make

Buildroot uses agressive caching and in many cases doesn't support incremental builds.

### Build Errors

#### make fails while downloading package
Expand All @@ -185,21 +191,3 @@ Error symptom: a package cannot be downloaded from <http://sources.buildroot.net
Cause: Buildroot source server is down or overloaded

Solution: try again the next day

#### journald fails to build

Error symptom:
```
../src/basic/build.h:4:10: fatal error: version.h: No such file or directory
#include "version.h"
^~~~~~~~~~~
...
ninja: build stopped: subcommand failed.
make[2]: *** [package/pkg-generic.mk:241: .../remote-os/rpi0/output/build/systemd-241/.stamp_built] Error 1
```

Cause: journald build bug when using many cores/threads (> 16)

Solution: reduce make parallelism

make BR2_JLEVEL=12
2 changes: 2 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#make BR2_JLEVEL=16 2>&1 | tee remote-os_build_$(date +"%Y%m%d_%H%M%S").log
make 2>&1 | tee remote-os_build_$(date +"%Y%m%d_%H%M%S").log
2 changes: 1 addition & 1 deletion buildroot
Submodule buildroot updated 5054 files
5 changes: 5 additions & 0 deletions overlay/etc/bluetooth/main.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Policy]
AutoEnable=true

[General]
DiscoverableTimeout = 0
5 changes: 5 additions & 0 deletions overlay/etc/profile.d/qt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export QT_VERSION=$QT_VERSION
export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/event0:rotate=90:invertx
export QT_QPA_EGLFS_PHYSICAL_WIDTH=46
export QT_QPA_EGLFS_PHYSICAL_HEIGHT=76
export QT_QPA_EGLFS_FORCE888=1
4 changes: 2 additions & 2 deletions overlay/etc/systemd/system/app.service
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Unit]
Description=Remote app
After=sharp-init.service
Description=YIO remote app
After=display-init.service

[Service]
Type=simple
Expand Down
2 changes: 1 addition & 1 deletion overlay/etc/systemd/system/backlight.service
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ DefaultDependencies=false

[Service]
Type=simple
ExecStart=/opt/yio/scripts/sharp-backlight-init.sh
ExecStart=/opt/yio/scripts/backlight-init
RemainAfterExit=yes

[Install]
Expand Down
14 changes: 14 additions & 0 deletions overlay/etc/systemd/system/bt-agent-marker.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=Simple Bluetooth agent for boot serial console activated with /boot/btconsole marker
After=bluetooth.service
PartOf=bluetooth.service
Requires=bluetooth.service
RequiresMountsFor=/boot
ConditionPathExists=/boot/btconsole

[Service]
Type=simple
ExecStart=/bin/bt-agent -c NoInputNoOutput

[Install]
WantedBy=bluetooth.target
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[Unit]
Description=RFCOMM service
Description=Bluetooth console activated with /boot/btconsole marker
After=bluetooth.service
Requires=bluetooth.service
PartOf=bluetooth.service
Requires=bluetooth.service bt-agent-marker.service
RequiresMountsFor=/boot
ConditionPathExists=/boot/btconsole

Expand All @@ -12,4 +13,4 @@ ExecStartPre=/bin/hciconfig hci0 piscan
ExecStart=/bin/rfcomm watch hci0 1 getty rfcomm0 115200 vt100

[Install]
WantedBy=multi-user.target
WantedBy=bluetooth.target
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[Unit]
Description=Sharp init
Description=YIO display init
After=network.target

[Service]
Type=simple
ExecStart=/opt/yio/scripts/sharp-init
ExecStart=/opt/yio/scripts/display-init
RemainAfterExit=yes

[Install]
Expand Down

This file was deleted.

16 changes: 16 additions & 0 deletions overlay/etc/systemd/system/wpa_supplicant.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Workaround: Buildroot 2020.02.6 insists on using dbus with wpa_supplicant and doesn't support interface templates anymore.
# It even deletes the wpa_supplicant@wlan0.service symlink in multi-user.target.wants just before creating the file system image.
# So we just put the template version with hard coded wlan0 interface name in its target place...
[Unit]
Description=WPA supplicant daemon (interface-specific version)
Requires=sys-subsystem-net-devices-wlan0.device
After=sys-subsystem-net-devices-wlan0.device
Before=network.target
Wants=network.target

[Service]
Type=simple
ExecStart=/usr/sbin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-wlan0.conf -iwlan0

[Install]
WantedBy=multi-user.target
8 changes: 3 additions & 5 deletions overlay/opt/yio/app-launch.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
#!/bin/bash

# This script is started by systemd and profile.d environment is not set!
. /etc/profile.d/yio.sh
. /etc/profile.d/qt.sh

${YIO_SCRIPT_DIR}/wifi-copy-config.sh

${YIO_SCRIPT_DIR}/firstrun.sh

export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/event0:rotate=90:invertx
export QT_QPA_EGLFS_PHYSICAL_WIDTH=46
export QT_QPA_EGLFS_PHYSICAL_HEIGHT=76
export QT_QPA_EGLFS_FORCE888=1

# check if something went wrong during the last app update
if [[ ! -d $YIO_APP_DIR ]] && [[ -d ${YIO_HOME}/app-previous ]]; then
echo "App directory missing '$YIO_APP_DIR'! Restoring previous app version: ${YIO_HOME}/app-previous"
Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 7 additions & 1 deletion overlay/opt/yio/scripts/lib/common.bash
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,13 @@ downloadRelease() {
if [[ $1 == web-configurator ]]; then
RELEASE_FILE="YIO-${1}-${2}.zip"
else
RELEASE_FILE="YIO-${1}-${2}-RPI0-release.tar"
if [[ -z $QT_VERSION ]]; then
log "WARN: Env variable QT_VERSION not defined"
OS_ARCH="RPI0-release"
else
OS_ARCH="RPI0-Qt$QT_VERSION"
fi
RELEASE_FILE="YIO-${1}-${2}-${OS_ARCH}.tar"
fi
log "Downloading ${1} GitHub release $2 to: ${3}/${RELEASE_FILE}"
curl -L --fail -o ${3}/${RELEASE_FILE} https://github.com/YIO-Remote/${1}/releases/download/${2}/${RELEASE_FILE}
Expand Down
15 changes: 7 additions & 8 deletions rpi0/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ BR2_CCACHE_DIR="$(HOME)/buildroot/ccache"
BR2_PACKAGE_OVERRIDE_FILE="$(BR2_EXTERNAL_BUILDROOT_SUBMODULE_PATH)/local.mk"
BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_BUILDROOT_SUBMODULE_PATH)/patch"
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_14=y
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_TARGET_GENERIC_HOSTNAME="yioremote"
BR2_TARGET_GENERIC_ISSUE="Welcome to YIO Remote"
Expand All @@ -20,12 +20,12 @@ BR2_ROOTFS_POST_BUILD_SCRIPT="$(BR2_EXTERNAL_BUILDROOT_SUBMODULE_PATH)/$(PROJECT
BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_BUILDROOT_SUBMODULE_PATH)/$(PROJECT_NAME)/post-image.sh"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/raspberrypi/linux/archive/raspberrypi-kernel_1.20190401-1.tar.gz"
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,64d0a9870ac14d5eb5253f67d984ae348eec1393)/linux-64d0a9870ac14d5eb5253f67d984ae348eec1393.tar.gz"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_BUILDROOT_SUBMODULE_PATH)/$(PROJECT_NAME)/kernel_config"
BR2_LINUX_KERNEL_LZO=y
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2708-rpi-0-w"
BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2708-rpi-zero-w"
BR2_PACKAGE_FFMPEG=y
BR2_PACKAGE_JQ=y
BR2_PACKAGE_FBV=y
Expand All @@ -45,7 +45,6 @@ BR2_PACKAGE_LIBZIP=y
BR2_PACKAGE_CA_CERTIFICATES=y
BR2_PACKAGE_GNUTLS=y
BR2_PACKAGE_LIBNSS=y
BR2_PACKAGE_OPENSSL=y
BR2_PACKAGE_LIBOPENSSL_ENGINES=y
BR2_PACKAGE_LIBDRM=y
BR2_PACKAGE_TIFF=y
Expand All @@ -59,7 +58,7 @@ BR2_PACKAGE_LIBVPX=y
BR2_PACKAGE_GLIB_NETWORKING=y
BR2_PACKAGE_LIBCGI=y
BR2_PACKAGE_LIBCURL=y
BR2_PACKAGE_CURL=y
BR2_PACKAGE_LIBCURL_CURL=y
BR2_PACKAGE_LIBCURL_GNUTLS=y
BR2_PACKAGE_LIBEVDEV=y
BR2_PACKAGE_AVAHI=y
Expand All @@ -76,7 +75,6 @@ BR2_PACKAGE_BLUEZ5_UTILS_EXPERIMENTAL=y
BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_HEALTH=y
BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_MIDI=y
BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_NFC=y
BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_SAP=y
BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_SIXAXIS=y
BR2_PACKAGE_BLUEZ5_UTILS_TEST=y
BR2_PACKAGE_CRDA=y
Expand All @@ -98,16 +96,17 @@ BR2_PACKAGE_NTP=y
BR2_PACKAGE_WPA_SUPPLICANT=y
BR2_PACKAGE_WPA_SUPPLICANT_AP_SUPPORT=y
BR2_PACKAGE_WPA_SUPPLICANT_WIFI_DISPLAY=y
BR2_PACKAGE_WPA_SUPPLICANT_AUTOSCAN=y
BR2_PACKAGE_WPA_SUPPLICANT_EAP=y
BR2_PACKAGE_WPA_SUPPLICANT_WPS=y
BR2_PACKAGE_WPA_SUPPLICANT_WPA3=y
BR2_PACKAGE_WPA_SUPPLICANT_CLI=y
BR2_PACKAGE_WPA_SUPPLICANT_WPA_CLIENT_SO=y
BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y
BR2_PACKAGE_BASH=y
# BR2_PACKAGE_SYSTEMD_HWDB is not set
# BR2_PACKAGE_SYSTEMD_MYHOSTNAME is not set
BR2_PACKAGE_SYSTEMD_RFKILL=y
BR2_PACKAGE_UTIL_LINUX_KILL=y
BR2_PACKAGE_UTIL_LINUX_RFKILL=y
BR2_PACKAGE_NANO=y
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
Expand Down
2 changes: 1 addition & 1 deletion rpi0/genimage.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ image boot.vfat {
# set volume name with mkfs.vfat parameter
extraargs = "-n \"YIO BOOT\""
files = {
"bcm2708-rpi-0-w.dtb",
"bcm2708-rpi-zero-w.dtb",
"config.txt",
"cmdline.txt",
"config.json",
Expand Down
16 changes: 4 additions & 12 deletions rpi0/post-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,6 @@ if [ -e ${TARGET_DIR}/etc/inittab ]; then
tty1::respawn:/sbin/getty -L tty1 0 vt100 # HDMI console' ${TARGET_DIR}/etc/inittab
fi

echo "Creating systemd services"
ln -fs ../../../../usr/lib/systemd/system/wpa_supplicant@.service $1/etc/systemd/system/multi-user.target.wants/wpa_supplicant@wlan0.service
ln -fs ../../../../usr/lib/systemd/system/backlight.service $1/etc/systemd/system/multi-user.target.wants/backlight.service
ln -fs ../../../../usr/lib/systemd/system/sharp-init.service $1/etc/systemd/system/multi-user.target.wants/sharp-init.service
ln -fs ../../../../usr/lib/systemd/system/app.service $1/etc/systemd/system/multi-user.target.wants/app.service


rm -rf $1/var/log/journal

#rm -r $1/etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service
#rm -r $1/etc/systemd/system/multi-user.target.wants/dhcpcd.service

# Determine build version
BUILD_VERSION=$("$SCRIPT_DIR/git-version.sh" "$BR2_EXTERNAL/version")

Expand All @@ -35,3 +23,7 @@ GIT_HASH=`cd $SCRIPT_DIR; git rev-parse HEAD`

echo "Setting Git hash in YIO env variable: $GIT_HASH"
sed -i "s/\$GIT_HASH/$GIT_HASH/g" $1/etc/profile.d/yio.sh

QT_VERSION=`$HOST_DIR/bin/qmake -query QT_VERSION`
echo "Setting Qt version in env variable: $QT_VERSION"
sed -i "s/\$QT_VERSION/$QT_VERSION/g" $1/etc/profile.d/qt.sh
18 changes: 9 additions & 9 deletions yio-remote/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if BR2_PACKAGE_YIO_REMOTE
# All YIO components have their own release channel and version numbers don't relate or indicate a compatible version!
config BR2_PACKAGE_YIO_REMOTE_SOFTWARE_VERSION_DEF
string
default "v0.6.0"
default "v0.6.1"
config BR2_PACKAGE_YIO_INTEGRATIONS_LIBRARY_VERSION_DEF
string
default "v0.5.1"
Expand All @@ -39,28 +39,28 @@ config BR2_PACKAGE_YIO_WEB_CONFIGURATOR_VERSION_DEF
default "v0.2.1"
config BR2_PACKAGE_YIO_INTEGRATION_DOCK_VERSION_DEF
string
default "v0.6.1"
default "v0.6.2"
config BR2_PACKAGE_YIO_INTEGRATION_HOMEASSISTANT_VERSION_DEF
string
default "v0.5.3"
default "v0.5.4"
config BR2_PACKAGE_YIO_INTEGRATION_HOMEY_VERSION_DEF
string
default "v0.5.1"
default "v0.5.2"
config BR2_PACKAGE_YIO_INTEGRATION_OPENHAB_VERSION_DEF
string
default "v0.5.1"
default "v0.5.2"
config BR2_PACKAGE_YIO_INTEGRATION_SPOTIFY_VERSION_DEF
string
default "v0.5.1"
default "v0.5.2"
config BR2_PACKAGE_YIO_INTEGRATION_BANGOLUFSEN_VERSION_DEF
string
default "v0.2.2"
default "v0.2.3"
config BR2_PACKAGE_YIO_INTEGRATION_OPENWEATHER_VERSION_DEF
string
default "v0.5.1"
default "v0.5.2"
config BR2_PACKAGE_YIO_INTEGRATION_ROON_VERSION_DEF
string
default "v0.4.1"
default "v0.4.2"

config BR2_PACKAGE_YIO_REMOTE_DEBUG
bool "Debug build"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sha256 3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986 LICENSE
none xxx yio-integration-bangolufsen-v0.2.2.tar.gz
none xxx yio-integration-bangolufsen-v0.2.3.tar.gz
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sha256 3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986 LICENSE
none xxx yio-integration-dock-v0.6.1.tar.gz
none xxx yio-integration-dock-v0.6.2.tar.gz
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sha256 3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986 LICENSE
none xxx yio-integration-homeassistant-v0.5.3.tar.gz
none xxx yio-integration-homeassistant-v0.5.4.tar.gz
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sha256 3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986 LICENSE
none xxx yio-integration-homey-v0.5.1.tar.gz
none xxx yio-integration-homey-v0.5.2.tar.gz
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sha256 3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986 LICENSE
none xxx yio-integration-openhab-v0.5.1.tar.gz
none xxx yio-integration-openhab-v0.5.2.tar.gz
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sha256 3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986 LICENSE
none xxx yio-integration-openweather-v0.5.1.tar.gz
none xxx yio-integration-openweather-v0.5.2.tar.gz
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sha256 3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986 LICENSE
none xxx yio-integration-roon-v0.4.1.tar.gz
none xxx yio-integration-roon-v0.4.2.tar.gz
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sha256 3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986 LICENSE
none xxx yio-integration-spotify-v0.5.1.tar.gz
none xxx yio-integration-spotify-v0.5.2.tar.gz

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sha256 3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986 LICENSE
none xxx yio-remote-software-v0.6.1.tar.gz

0 comments on commit 54cbc67

Please sign in to comment.