diff --git a/parts/files/leds/boot_40.service b/parts/files/leds/boot_40.service index 315dd71..4685b4d 100644 --- a/parts/files/leds/boot_40.service +++ b/parts/files/leds/boot_40.service @@ -2,7 +2,7 @@ Description=Boot Progress 40% [Service] Type=simple -ExecStart=/usr/bin/set-led 5 1 +ExecStart=/usr/bin/pinctrl set 5 op dh [Install] WantedBy=basic.target diff --git a/parts/files/leds/boot_60.service b/parts/files/leds/boot_60.service index 194870e..bb053c8 100644 --- a/parts/files/leds/boot_60.service +++ b/parts/files/leds/boot_60.service @@ -4,7 +4,7 @@ After=network.target [Service] Type=simple -ExecStart=/usr/bin/set-led 12 1 +ExecStart=/usr/bin/pinctrl set 12 op dh [Install] WantedBy=multi-user.target diff --git a/parts/files/leds/boot_80.service b/parts/files/leds/boot_80.service index 2ff604f..b58bf6a 100644 --- a/parts/files/leds/boot_80.service +++ b/parts/files/leds/boot_80.service @@ -5,8 +5,8 @@ After=runusb.service [Service] Type=forking -ExecStart=/usr/bin/set-led 6 1 -ExecStop=/usr/bin/set-led 6 0 +ExecStart=/usr/bin/pinctrl set 6 op dh +ExecStop=/usr/bin/pinctrl set 6 op dl RemainAfterExit=yes [Install] diff --git a/parts/files/leds/set-led b/parts/files/leds/set-led deleted file mode 100644 index 1666750..0000000 --- a/parts/files/leds/set-led +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -ex - -led_num="$1" -led_level="$2" - -echo "$led_num" > /sys/class/gpio/export -echo out > /sys/class/gpio/gpio${led_num}/direction -echo "$led_level" > /sys/class/gpio/gpio5/value -echo "$led_num" > /sys/class/gpio/unexport diff --git a/parts/robot.sh b/parts/robot.sh index 8545363..0aa8eb8 100755 --- a/parts/robot.sh +++ b/parts/robot.sh @@ -55,8 +55,6 @@ SUBSYSTEM=="usb", ATTRS{idVendor}=="1bda", ATTRS{idProduct}=="0011", GROUP="$gro EOF # Setup KCH leds triggered by systemd -cp /tmp/packer-files/leds/set-led /usr/bin/ -chmod +x /usr/bin/set-led cp /tmp/packer-files/leds/*.service /lib/systemd/system/ systemctl enable boot_40.service systemctl enable boot_60.service