chanes
This commit is contained in:
1 parent
33176cc555
commit
cd339a2807
4 files changed
+28
-41
No files matched your search
@@ -53,9 +53,11 @@ define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/root/
|
||||
$(INSTALL_BIN) ./files/luci-app-tailscale*.apk $(1)/root/
|
||||
|
||||
# Battery widget for LuCI
|
||||
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/view/admin_status/index
|
||||
$(INSTALL_DATA) ./files/battery.htm $(1)/usr/lib/lua/luci/view/admin_status/index/20_battery.htm
|
||||
|
||||
$(INSTALL_DIR) $(1)/lib/preinit
|
||||
$(INSTALL_BIN) ./files/preinit/05_dim_backlight $(1)/lib/preinit/05_dim_backlight
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/postinst
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
|
||||
dim_backlight() {
|
||||
(
|
||||
BL="/sys/class/backlight/backlight"
|
||||
|
||||
# Wait for backlight
|
||||
i=0
|
||||
while [ ! -d "$BL" ] && [ $i -lt 50 ]; do
|
||||
usleep 100000 # 100 ms
|
||||
i=$((i + 1))
|
||||
done
|
||||
|
||||
# Set backlight
|
||||
if [ -d "$BL" ]; then
|
||||
MAX_BRIGHTNESS=$(cat "$BL/max_brightness" 2>/dev/null || echo 1785)
|
||||
BRIGHTNESS_DIM=$((MAX_BRIGHTNESS / 8))
|
||||
echo 0 > "$BL/bl_power" 2>/dev/null
|
||||
echo $BRIGHTNESS_DIM > "$BL/brightness" 2>/dev/null
|
||||
fi
|
||||
) &
|
||||
}
|
||||
|
||||
boot_hook_add preinit_main dim_backlight
|
||||
@@ -64,10 +64,7 @@ define Package/router-display/install
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/button
|
||||
$(INSTALL_BIN) ./files/hotplugs/20_power_button $(1)/etc/hotplug.d/button/20_power_button
|
||||
|
||||
$(INSTALL_DIR) $(1)/lib/preinit
|
||||
$(INSTALL_BIN) ./files/preinit/05_display_logo $(1)/lib/preinit/05_display_logo
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(INSTALL_DIR) $(1)/etc/logos
|
||||
$(INSTALL_DATA) ./files/logos/boot_logo.fb $(1)/etc/logos/boot_logo.fb
|
||||
$(INSTALL_DATA) ./files/logos/poweroff_logo.fb $(1)/etc/logos/poweroff_logo.fb
|
||||
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
show_logo() {
|
||||
(
|
||||
FB="/dev/fb0"
|
||||
BL="/sys/class/backlight/backlight"
|
||||
LOGO="/etc/logos/boot_logo.fb"
|
||||
|
||||
# Wait for framebuffer
|
||||
i=0
|
||||
while [ ! -c "$FB" ] && [ $i -lt 50 ]; do
|
||||
usleep 100000 # 100 ms
|
||||
i=$((i + 1))
|
||||
done
|
||||
|
||||
# Show logo on framebuffer
|
||||
if [ -c "$FB" ] && [ -f "$LOGO" ]; then
|
||||
cat "$LOGO" > "$FB" 2>/dev/null
|
||||
fi
|
||||
|
||||
# Wait for backlight
|
||||
i=0
|
||||
while [ ! -d "$BL" ] && [ $i -lt 50 ]; do
|
||||
usleep 100000 # 100 ms
|
||||
i=$((i + 1))
|
||||
done
|
||||
|
||||
# Set backlight
|
||||
if [ -d "$BL" ]; then
|
||||
echo 0 > "$BL/bl_power" 2>/dev/null
|
||||
echo 1 > "$BL/brightness" 2>/dev/null
|
||||
fi
|
||||
) &
|
||||
}
|
||||
|
||||
boot_hook_add preinit_main show_logo
|
||||
Reference in new issue
Block a user