From 495ad90ae8f221c495aa617c86c990072a6e51c4 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Mon, 7 Oct 2019 19:26:40 +0200 Subject: [PATCH 1/3] Add mods for nymea --- .gitignore | 3 -- config | 4 ++ export-image/prerun.sh | 2 + stage2/04-nymea/00-run-chroot.sh | 67 ++++++++++++++++++++++++++++++++ stage2/04-nymea/05-packages | 4 ++ stage3/SKIP | 0 stage3/SKIP_IMAGES | 0 stage4/SKIP | 0 stage4/SKIP_IMAGES | 0 stage5/SKIP | 0 stage5/SKIP_IMAGES | 0 11 files changed, 77 insertions(+), 3 deletions(-) create mode 100644 config create mode 100755 stage2/04-nymea/00-run-chroot.sh create mode 100644 stage2/04-nymea/05-packages create mode 100644 stage3/SKIP create mode 100644 stage3/SKIP_IMAGES create mode 100644 stage4/SKIP create mode 100644 stage4/SKIP_IMAGES create mode 100644 stage5/SKIP create mode 100644 stage5/SKIP_IMAGES diff --git a/.gitignore b/.gitignore index a6883c2049..96a23b6acf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,6 @@ deploy/* work/* -config postrun.sh -SKIP -SKIP_IMAGES .pc *-pc apt-cacher-ng/ diff --git a/config b/config new file mode 100644 index 0000000000..58d87ad5c3 --- /dev/null +++ b/config @@ -0,0 +1,4 @@ +IMG_NAME=nymea-buster +FIRST_USER_NAME="nymea" +FIRST_USER_PASS="nymea" +ENABLE_SSH=1 diff --git a/export-image/prerun.sh b/export-image/prerun.sh index cecde32bed..28175b9f0f 100755 --- a/export-image/prerun.sh +++ b/export-image/prerun.sh @@ -39,6 +39,8 @@ BOOT_LENGTH=$(echo "$PARTED_OUT" | grep -e '^1:' | cut -d':' -f 4 | tr -d B) ROOT_OFFSET=$(echo "$PARTED_OUT" | grep -e '^2:' | cut -d':' -f 2 | tr -d B) ROOT_LENGTH=$(echo "$PARTED_OUT" | grep -e '^2:' | cut -d':' -f 4 | tr -d B) +sleep 5 + BOOT_DEV=$(losetup --show -f -o "${BOOT_OFFSET}" --sizelimit "${BOOT_LENGTH}" "${IMG_FILE}") ROOT_DEV=$(losetup --show -f -o "${ROOT_OFFSET}" --sizelimit "${ROOT_LENGTH}" "${IMG_FILE}") echo "/boot: offset $BOOT_OFFSET, length $BOOT_LENGTH" diff --git a/stage2/04-nymea/00-run-chroot.sh b/stage2/04-nymea/00-run-chroot.sh new file mode 100755 index 0000000000..1b300da38a --- /dev/null +++ b/stage2/04-nymea/00-run-chroot.sh @@ -0,0 +1,67 @@ +# Add nymea repository +echo -e "\n## nymea repo\ndeb http://repository.nymea.io buster main raspbian\n#deb-src http://repository.nymea.io buster main raspbian" | tee /etc/apt/sources.list.d/nymea.list +wget -qO - http://repository.nymea.io/repository-pubkey.gpg | apt-key add - + +# Set repository priority (prefer packages from raspbian section) +cat </etc/apt/preferences.d/nymea +Package: * +Pin: release c=raspbian +Pin-Priority: 700 + +Package: * +Pin: origin repository.nymea.io c=main +Pin-Priority: 500 +EOM + +apt-get update + +cat < /etc/motd + _ __ _ _ _ __ ___ ___ __ _ + | '_ \| | | | '_ \` _ \ / _ \/ _\` | + | | | | |_| | | | | | | __/ (_| | + |_| |_|\__, |_| |_| |_|\___|\__,_| + __/ | + |___/ + +EOM + + +cat < /etc/machine-info +PRETTY_HOSTNAME=nymea +EOM + +cat < /etc/issue.net +nymea - nymea.io | Debian GNU/Linux 10 +EOM + +cat < /etc/issue +nymea - nymea.io | Debian GNU/Linux 10 \n \l +EOM + +# Change hostname to nymea +echo nymea > /etc/hostname +sed -i 's/localhost/localhost nymea/' /etc/hosts + +# Enable i2c +echo dtparam=i2c_arm=on >> /boot/config.txt +echo i2c-dev >> /etc/modules + +# Rotate internal display by default +echo lcd_rotate=2 >> /boot/config.txt + +# Enable fake KMS driver +echo dtoverlay=vc4-fkms-v3d >> /boot/config.txt + +# Get away with the low voltage warning +echo avoid_warnings=1 >> /boot/config.txt + +# Drop packages conflicting with network-manager +apt-get purge --yes openresolv dhcpcd5 + +# Disable BlueZ plugins QtBluetooth can't deal with +mkdir /etc/systemd/system/bluetooth.service.d +cat < /etc/systemd/system/bluetooth.service.d/01-disable-battery-plugin.conf +[Service] +ExecStart= +ExecStart=/usr/lib/bluetooth/bluetoothd --noplugin=battery,sap +EOM diff --git a/stage2/04-nymea/05-packages b/stage2/04-nymea/05-packages new file mode 100644 index 0000000000..993bb3cc3b --- /dev/null +++ b/stage2/04-nymea/05-packages @@ -0,0 +1,4 @@ +nymea +nymea-plugins +nymea-networkmanager +nymea-app-kiosk diff --git a/stage3/SKIP b/stage3/SKIP new file mode 100644 index 0000000000..e69de29bb2 diff --git a/stage3/SKIP_IMAGES b/stage3/SKIP_IMAGES new file mode 100644 index 0000000000..e69de29bb2 diff --git a/stage4/SKIP b/stage4/SKIP new file mode 100644 index 0000000000..e69de29bb2 diff --git a/stage4/SKIP_IMAGES b/stage4/SKIP_IMAGES new file mode 100644 index 0000000000..e69de29bb2 diff --git a/stage5/SKIP b/stage5/SKIP new file mode 100644 index 0000000000..e69de29bb2 diff --git a/stage5/SKIP_IMAGES b/stage5/SKIP_IMAGES new file mode 100644 index 0000000000..e69de29bb2 From 4cde595452d2f5ebfd3eca31c0ccfbf44e812c76 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Sat, 11 Jan 2020 14:54:48 +0100 Subject: [PATCH 2/3] move to the rpi component of the nymea repo --- stage2/04-nymea/00-run-chroot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stage2/04-nymea/00-run-chroot.sh b/stage2/04-nymea/00-run-chroot.sh index 1b300da38a..033da0e422 100755 --- a/stage2/04-nymea/00-run-chroot.sh +++ b/stage2/04-nymea/00-run-chroot.sh @@ -1,5 +1,5 @@ # Add nymea repository -echo -e "\n## nymea repo\ndeb http://repository.nymea.io buster main raspbian\n#deb-src http://repository.nymea.io buster main raspbian" | tee /etc/apt/sources.list.d/nymea.list +echo -e "\n## nymea repo\ndeb http://repository.nymea.io buster rpi\n#deb-src http://repository.nymea.io buster rpi" | tee /etc/apt/sources.list.d/nymea.list wget -qO - http://repository.nymea.io/repository-pubkey.gpg | apt-key add - # Set repository priority (prefer packages from raspbian section) From 442413dd0944c60f493f090cb61098345c00c5c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Thu, 4 Jun 2020 13:21:41 +0200 Subject: [PATCH 3/3] Enable UART 1 for RaspbeeII --- stage2/04-nymea/00-run-chroot.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stage2/04-nymea/00-run-chroot.sh b/stage2/04-nymea/00-run-chroot.sh index 033da0e422..3a2dc65645 100755 --- a/stage2/04-nymea/00-run-chroot.sh +++ b/stage2/04-nymea/00-run-chroot.sh @@ -55,6 +55,9 @@ echo dtoverlay=vc4-fkms-v3d >> /boot/config.txt # Get away with the low voltage warning echo avoid_warnings=1 >> /boot/config.txt +# Enable ttyS0 uart on GPIO header +echo enable_uart=1 >> /boot/config.txt + # Drop packages conflicting with network-manager apt-get purge --yes openresolv dhcpcd5