From be09c944bc361468bc350d7db04f4276126db46d Mon Sep 17 00:00:00 2001 From: vdromanov Date: Tue, 20 Aug 2024 15:18:13 +0300 Subject: [PATCH] Feature/firstboot reconfigure (#175) * introduce wb-firstboot service * migrate udev rules install to wb-firstboot.d * bump version * migrate to wb-prepare.d * migrate to wb-prepare.d * rm of_magic * Revert "rm of_magic" This reverts commit baa3f2441708cb3dc21853bd77c08502273f4db3. --- configs/etc/wb-prepare.d/01udev-rules | 43 +++++++++++++++++++++++++++ debian/changelog | 6 ++++ debian/control | 2 +- debian/wb-configs.postinst | 40 +------------------------ 4 files changed, 51 insertions(+), 40 deletions(-) create mode 100755 configs/etc/wb-prepare.d/01udev-rules diff --git a/configs/etc/wb-prepare.d/01udev-rules b/configs/etc/wb-prepare.d/01udev-rules new file mode 100755 index 0000000..b33a285 --- /dev/null +++ b/configs/etc/wb-prepare.d/01udev-rules @@ -0,0 +1,43 @@ +#!/bin/bash + +. /usr/lib/wb-utils/wb_env.sh +wb_source "of" + +RULES_DST_DIR=/etc/udev/rules.d +RULES_DIR=/usr/share/wb-configs/udev/ + +# Args: +# - rules file (e.g. "99-wb-uart") +# - suffix (e.g. "wb5") +install_rules() { + ucf --debconf-ok "$RULES_DIR/$1.rules.$2" "$RULES_DST_DIR/$1.rules" +} + +if of_machine_match "wirenboard,wirenboard-85x"; then + install_rules 99-wb-uart wb85x + install_rules 99-wb-ethernet wb8xx +elif of_machine_match "wirenboard,wirenboard-84x"; then + install_rules 99-wb-uart wb84x + install_rules 99-wb-ethernet wb8xx +elif of_machine_match "wirenboard,wirenboard-720"; then + install_rules 99-wb-uart wb72 + install_rules 99-wb-ethernet wb72 +elif of_machine_match "contactless,imx6ul-wirenboard670"; then + install_rules 99-wb-uart wb67 + install_rules 99-wb-ethernet wb6 +elif of_machine_match "contactless,imx6ul-wirenboard60"; then + install_rules 99-wb-uart wb6 + install_rules 99-wb-ethernet wb6 +elif of_machine_match "contactless,imx28-wirenboard50"; then + install_rules 99-wb-uart wb5 +elif of_machine_match "contactless,imx23-wirenboard41"; then + install_rules 99-wb-uart wb4 +elif of_machine_match "contactless,imx23-wirenboard32"; then + install_rules 99-wb-uart wb3 +elif of_machine_match "contactless,imx23-wirenboard28"; then + install_rules 99-wb-uart wb2 +else + install_rules 99-wb-uart default +fi + +udevadm trigger # apply new udev rules diff --git a/debian/changelog b/debian/changelog index 700bea2..a7ec9ec 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +wb-configs (3.29.0) stable; urgency=medium + + * migrate udev rules installation to wb-prepare.d + + -- Vladimir Romanov Thu, 08 Aug 2024 16:42:08 +0300 + wb-configs (3.28.0) stable; urgency=medium * add wb-uart udev rules for wb85x diff --git a/debian/control b/debian/control index 4a68dcc..1dd075a 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Homepage: https://github.com/wirenboard/wb-configs Package: wb-configs Architecture: all -Depends: ${shlibs:Depends}, ${misc:Depends}, ucf, wb-utils (>= 4.11.0), inotify-tools, mosquitto (>= 1.4.7-1), watchdog (>= 5.15), +Depends: ${shlibs:Depends}, ${misc:Depends}, ucf, wb-utils (>= 4.23.0~~), inotify-tools, mosquitto (>= 1.4.7-1), watchdog (>= 5.15), linux-image-wb2 | linux-image-wb6 (>= 5.10.35-wb127~~) | linux-image-wb7 (>= 5.10.35-wb127~~) | linux-image-wb8, fcgiwrap, wb-update-manager, sudo, pigz Pre-Depends: wb-update-manager diff --git a/debian/wb-configs.postinst b/debian/wb-configs.postinst index 3912166..98ab9db 100644 --- a/debian/wb-configs.postinst +++ b/debian/wb-configs.postinst @@ -89,45 +89,7 @@ if [ "$1" = "configure" ]; then fi #DEBHELPER# - -RULES_DST_DIR=/etc/udev/rules.d -RULES_DIR=/usr/share/wb-configs/udev/ - -# Args: -# - rules file (e.g. "99-wb-uart") -# - suffix (e.g. "wb5") -install_rules() { - ucf --debconf-ok "$RULES_DIR/$1.rules.$2" "$RULES_DST_DIR/$1.rules" -} - -if of_machine_match "wirenboard,wirenboard-85x"; then - install_rules 99-wb-uart wb85x - install_rules 99-wb-ethernet wb8xx -elif of_machine_match "wirenboard,wirenboard-84x"; then - install_rules 99-wb-uart wb84x - install_rules 99-wb-ethernet wb8xx -elif of_machine_match "wirenboard,wirenboard-720"; then - install_rules 99-wb-uart wb72 - install_rules 99-wb-ethernet wb72 -elif of_machine_match "contactless,imx6ul-wirenboard670"; then - install_rules 99-wb-uart wb67 - install_rules 99-wb-ethernet wb6 -elif of_machine_match "contactless,imx6ul-wirenboard60"; then - install_rules 99-wb-uart wb6 - install_rules 99-wb-ethernet wb6 -elif of_machine_match "contactless,imx28-wirenboard50"; then - install_rules 99-wb-uart wb5 -elif of_machine_match "contactless,imx23-wirenboard41"; then - install_rules 99-wb-uart wb4 -elif of_machine_match "contactless,imx23-wirenboard32"; then - install_rules 99-wb-uart wb3 -elif of_machine_match "contactless,imx23-wirenboard28"; then - install_rules 99-wb-uart wb2 -else - install_rules 99-wb-uart default -fi - -udevadm trigger # apply new udev rules +. /etc/wb-prepare.d/01udev-rules # install hw-specific udev rules if dpkg-query -s rsyslog >/dev/null 2>/dev/null; then rm -f /etc/logrotate.d/messages