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..1b0430c57b --- /dev/null +++ b/config @@ -0,0 +1,5 @@ +IMG_NAME=nymea-bullseye +FIRST_USER_NAME="nymea" +FIRST_USER_PASS="nymea" +ENABLE_SSH=1 +STAGE_LIST="stage0 stage1 stage2 nymea nymea-kiosk" diff --git a/nymea-kiosk/00-sys-tweaks/00-run-chroot.sh b/nymea-kiosk/00-sys-tweaks/00-run-chroot.sh new file mode 100755 index 0000000000..490bb84baa --- /dev/null +++ b/nymea-kiosk/00-sys-tweaks/00-run-chroot.sh @@ -0,0 +1,11 @@ +# Rotate internal display by default +echo lcd_rotate=2 >> /boot/config.txt + +# Enable fake KMS driver, the real kms causes issues +sed -i 's/vc4-kms-v3d/vc4-fkms-v3d/' /boot/config.txt + +# Get away with the low voltage warning +echo avoid_warnings=1 >> /boot/config.txt + +# Hide console log messages and blinking cursor and activate the splash +sed -i "s/console=tty1/console=tty3 quiet vt.global_cursor_default=0 splash/" "/boot/cmdline.txt" diff --git a/nymea-kiosk/01-packages/05-packages b/nymea-kiosk/01-packages/05-packages new file mode 100644 index 0000000000..069072ccb7 --- /dev/null +++ b/nymea-kiosk/01-packages/05-packages @@ -0,0 +1,2 @@ +nymea-app-kiosk-wayland +nymea-splashscreen diff --git a/nymea-kiosk/EXPORT_IMAGE b/nymea-kiosk/EXPORT_IMAGE new file mode 100644 index 0000000000..0e5cb739ad --- /dev/null +++ b/nymea-kiosk/EXPORT_IMAGE @@ -0,0 +1,4 @@ +IMG_SUFFIX="-kiosk" +if [ "${USE_QEMU}" = "1" ]; then + export IMG_SUFFIX="${IMG_SUFFIX}-qemu" +fi diff --git a/nymea-kiosk/prerun.sh b/nymea-kiosk/prerun.sh new file mode 100755 index 0000000000..9acd13cbd3 --- /dev/null +++ b/nymea-kiosk/prerun.sh @@ -0,0 +1,5 @@ +#!/bin/bash -e + +if [ ! -d "${ROOTFS_DIR}" ]; then + copy_previous +fi diff --git a/nymea/00-sys-tweaks/00-run-chroot.sh b/nymea/00-sys-tweaks/00-run-chroot.sh new file mode 100755 index 0000000000..d1145110cf --- /dev/null +++ b/nymea/00-sys-tweaks/00-run-chroot.sh @@ -0,0 +1,70 @@ +# Add nymea repository +echo -e "\n## nymea repo\ndeb http://repository.nymea.io bullseye rpi\n#deb-src http://repository.nymea.io bullseye rpi" | tee /etc/apt/sources.list.d/nymea.list +wget -qO - http://repository.nymea.io/Repository.key | apt-key add - + +# Set repository priority (prefer packages from raspbian section) +cat </etc/apt/preferences.d/nymea +Package: * +Pin: release c=raspios +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 11 +EOM + +cat < /etc/issue +nymea - nymea.io | Debian GNU/Linux 11 \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 + +# Enable UART (For RaspBee and similar headers) +echo enable_uart=1 >> /boot/config.txt +sed -i 's/console=serial0,115200 //' /boot/cmdline.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/libexec/bluetooth/bluetoothd --noplugin=battery,sap +EOM diff --git a/nymea/01-packages/05-packages b/nymea/01-packages/05-packages new file mode 100644 index 0000000000..ea81ec00a0 --- /dev/null +++ b/nymea/01-packages/05-packages @@ -0,0 +1,42 @@ +nymea +nymea-plugin-anel +nymea-plugin-aqi +nymea-plugin-bose +nymea-plugin-datetime +nymea-plugin-daylightsensor +nymea-plugin-denon +nymea-plugin-doorbird +nymea-plugin-flowercare +nymea-plugin-fronius +nymea-plugin-gpio +nymea-plugin-homeconnect +nymea-plugin-keba +nymea-plugin-kodi +nymea-plugin-lifx +nymea-plugin-mailnotification +nymea-plugin-mystrom +nymea-plugin-nanoleaf +nymea-plugin-netatmo +nymea-plugin-networkdetector +nymea-plugin-openuv +nymea-plugin-openweathermap +nymea-plugin-philipshue +nymea-plugin-pushbullet +nymea-plugin-pushnotifications +nymea-plugin-shelly +nymea-plugin-sma +nymea-plugin-solarlog +nymea-plugin-somfytahoma +nymea-plugin-sonos +nymea-plugin-tado +nymea-plugin-tasmota +nymea-plugin-telegram +nymea-plugin-tplink +nymea-plugin-unifi +nymea-plugin-yamahaavr +nymea-plugins-zigbee +nymea-plugins-zwave +nymea-plugins-genericthings +nymea-networkmanager +nymea-experience-plugin-energy +systemd-timesyncd diff --git a/nymea/EXPORT_IMAGE b/nymea/EXPORT_IMAGE new file mode 100644 index 0000000000..33379117ac --- /dev/null +++ b/nymea/EXPORT_IMAGE @@ -0,0 +1,4 @@ +IMG_SUFFIX="-core" +if [ "${USE_QEMU}" = "1" ]; then + export IMG_SUFFIX="${IMG_SUFFIX}-qemu" +fi diff --git a/nymea/prerun.sh b/nymea/prerun.sh new file mode 100755 index 0000000000..9acd13cbd3 --- /dev/null +++ b/nymea/prerun.sh @@ -0,0 +1,5 @@ +#!/bin/bash -e + +if [ ! -d "${ROOTFS_DIR}" ]; then + copy_previous +fi diff --git a/stage2/SKIP_IMAGES b/stage2/SKIP_IMAGES new file mode 100644 index 0000000000..e69de29bb2 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