Skip to content

Commit

Permalink
Feature/firstboot reconfigure (#175)
Browse files Browse the repository at this point in the history
* 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 baa3f24.
  • Loading branch information
vdromanov authored Aug 20, 2024
1 parent f9072f1 commit be09c94
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 40 deletions.
43 changes: 43 additions & 0 deletions configs/etc/wb-prepare.d/01udev-rules
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
wb-configs (3.29.0) stable; urgency=medium

* migrate udev rules installation to wb-prepare.d

-- Vladimir Romanov <[email protected]> Thu, 08 Aug 2024 16:42:08 +0300

wb-configs (3.28.0) stable; urgency=medium

* add wb-uart udev rules for wb85x
Expand Down
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
40 changes: 1 addition & 39 deletions debian/wb-configs.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit be09c94

Please sign in to comment.