From 86b1f0ef352205029457cc75e525f86aa70239e5 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Tue, 6 Feb 2024 13:57:43 +0100 Subject: fix env vars + sysfs + led demo --- rootfs/bin/helloled | 9 +++++++++ rootfs/etc/fstab | 1 + rootfs/etc/init.d/rcS | 7 +++---- rootfs/etc/inittab | 2 +- rootfs/etc/profile | 1 - 5 files changed, 14 insertions(+), 6 deletions(-) create mode 100755 rootfs/bin/helloled diff --git a/rootfs/bin/helloled b/rootfs/bin/helloled new file mode 100755 index 0000000..877faab --- /dev/null +++ b/rootfs/bin/helloled @@ -0,0 +1,9 @@ +#!/bin/sh +BRIGHTNESS=0 +while true ; do + BRIGHTNESS=$(( ( $BRIGHTNESS + 1 ) % 2 )) + for i in $(seq 0 3) ; do + echo $BRIGHTNESS > "/sys/class/leds/beaglebone:green:usr$i/brightness" + done + sleep 0.5 +done diff --git a/rootfs/etc/fstab b/rootfs/etc/fstab index e84b78a..a474c4a 100644 --- a/rootfs/etc/fstab +++ b/rootfs/etc/fstab @@ -1 +1,2 @@ proc /proc proc defaults 0 0 +sysfs /sys sysfs defaults 0 0 diff --git a/rootfs/etc/init.d/rcS b/rootfs/etc/init.d/rcS index be9ca09..59e0fe0 100755 --- a/rootfs/etc/init.d/rcS +++ b/rootfs/etc/init.d/rcS @@ -1,5 +1,4 @@ #!/bin/sh -# mount all drives in /etc/fstab -/bin/mount -a -# set the system hostname -/bin/hostname -F /etc/hostname +mount -a +hostname -F /etc/hostname +syslogd diff --git a/rootfs/etc/inittab b/rootfs/etc/inittab index 805a39d..3f0c41a 100644 --- a/rootfs/etc/inittab +++ b/rootfs/etc/inittab @@ -4,5 +4,5 @@ ::restart:/sbin/init # put a shell on ttyS0 (serial header on board) -ttyS0::respawn:/bin/sh +ttyS0::respawn:-/bin/sh diff --git a/rootfs/etc/profile b/rootfs/etc/profile index 8e38c52..431ef69 100644 --- a/rootfs/etc/profile +++ b/rootfs/etc/profile @@ -1,6 +1,5 @@ # /etc/profile umask 022 -cd "$HOME" export PATH="$PATH:/usr/bin" export LD_LIBRARY_PATH="/lib" -- cgit v1.2.3