Raspberry Pi 4 Model B

LibreELEC

DISK=/dev/sda
# download
wget $(curl -s 'https://libreelec.tv/raspberry-pi-4/' | grep -o '[^"]*/LibreELEC-RPi4\.arm-[0-9.]*\.img\.gz[^"]*')
# copy
dd if=LibreELEC-RPi4.arm-*.img of=${DISK} bs=4M status=progress conv=fsync
# expand a storage
echo ", +" | ./sfdisk -N 2 ${DISK}
e2fsck ${DISK}2
resize2fs ${DISK}2
e2fsck ${DISK}2

Controlling PWR and ACT LEDs

none                No trigger
kbd-scrolllock      Keyboard scroll lock
kbd-numlock         Keyboard num lock
kbd-capslock        Keyboard caps lock
kbd-kanalock        Keyboard kana lock
kbd-shiftlock       Keyboard shift
kbd-altgrlock       Keyboard altgr
kbd-ctrllock        Keyboard ctrl
kbd-altlock         Keyboard alt
kbd-shiftllock      Keyboard left shift
kbd-shiftrlock      Keyboard right shift
kbd-ctrlllock       Keyboard left ctrl
kbd-ctrlrlock       Keyboard right ctrl
timer               Flash at 1 second intervals
oneshot             Flash only once
heartbeat           Flash like a heartbeat (1-0-1-00000)
backlight           Always on
gpio                Flash when a certain GPIO is high???
cpu0                Flash on cpu0 usage
cpu1                Flash on cpu1 usage
cpu2                Flash on cpu2 usage
cpu3                Flash on cpu3 usage
default-on          Always on (except for the halt/power-off)
[input]             Default state for PWR (under-voltage detect)
panic               Flash on kernel panic
[mmc0]              Flash on mmc0 (primary SD Card interface) activity; default for ACT
mmc1                Flash on mmc1 (secondary SD Card interface) activity
rfkill0             Flash on wifi activity
rfkill1             Flash on bluetooth activity

Boot-time

cat <<END >/boot/config.txt
# SD Card activity
dtparam=act_led_trigger=mmc0
dtparam=act_led_activelow=off
# hearbeat flashing (running) or always on (halt)
dtparam=pwr_led_trigger=heartbeat
dtparam=pwr_led_activelow=off
END

Run-time

## ACT LED
cat /sys/class/leds/led0/trigger
echo mmc0 > /sys/class/leds/led0/trigger
## PWR LED
cat /sys/class/leds/led1/trigger
echo heartbeat > /sys/class/leds/led1/trigger

Power Button

cat <<END >/boot/config.txt
# power-up/power-down by shorting pins 5 and 6 (GPIO3 and GND) together
dtoverlay=gpio-shutdown
END

 Share!

 
comments powered by Disqus