Browse Source

Removed ro in Recovery, mapping for low brightness working in recovery

Vincent-FK 3 years ago
parent
commit
95dc5578a6

+ 0 - 1
FunKey/board/funkey/rootfs-overlay/etc/current_battery_percentage

@@ -1 +0,0 @@
-100

+ 0 - 1
FunKey/board/funkey/rootfs-overlay/etc/current_brightness

@@ -1 +0,0 @@
-100

+ 0 - 1
FunKey/board/funkey/rootfs-overlay/etc/current_volume

@@ -1 +0,0 @@
-70

+ 0 - 1
Recovery/board/funkey/rootfs-overlay/etc/current_battery_percentage

@@ -1 +0,0 @@
-100

+ 0 - 1
Recovery/board/funkey/rootfs-overlay/etc/current_brightness

@@ -1 +0,0 @@
-100

+ 1 - 1
Recovery/board/funkey/rootfs-overlay/etc/issue

@@ -5,6 +5,6 @@
 |___|    |_____|__|__||__|\__||_____|___  |
          FUN ON A KEYCHAIN          |_____|
  -----------------------------------------------------
- Version 0.99 (Recovery)
+ Version 0.991 (Recovery)
  -----------------------------------------------------
 

+ 3 - 3
Recovery/board/funkey/rootfs-overlay/etc/os-release

@@ -1,9 +1,9 @@
 NAME="FunKey-OS Recovery"
-VERSION="0.99 (Khaki Kitten)"
+VERSION="0.991 (Khaki Kitten)"
 ID=funkey-recovery
 ID_LIKE=buildroot
-PRETTY_NAME="FunKey-OS Recovery 0.99"
-VERSION_ID="0.99"
+PRETTY_NAME="FunKey-OS Recovery 0.991"
+VERSION_ID="0.991"
 HOME_URL="https://www.funkey-project.com/"
 SUPPORT_URL="https://www.funkey-project.com/"
 BUG_REPORT_URL="https://www.funkey-project.com/"

+ 1 - 1
Recovery/board/funkey/rootfs-overlay/etc/sw-versions

@@ -1 +1 @@
-Recovery	0.99
+Recovery	0.991

+ 2 - 12
Recovery/board/funkey/rootfs-overlay/usr/local/sbin/brightness_get

@@ -1,6 +1,5 @@
 #!/bin/sh
 
-BRIGHTNESS_FILE=/etc/current_brightness
 BRIGHTNESS_DEFAULT_VALUE=100
 
 # Check args
@@ -9,20 +8,11 @@ if [ ${#} -ne 0 ]; then
     exit 1
 fi
 
-# Sanity check: File does not exist
-if [ ! -f ${BRIGHTNESS_FILE} ]; then
-    rw
-    echo ${BRIGHTNESS_DEFAULT_VALUE} > ${BRIGHTNESS_FILE}
-    ro
-fi
-
 # Sanity check: Check if integer
-brightness=$(cat ${BRIGHTNESS_FILE})
+brightness=$(fw_printenv | grep brightness= | cut -d'=' -f 2-)
 if ! [ ! "${brightness}" -ne "${brightness}" ] 2> /dev/null; then
-    rw
-    echo ${BRIGHTNESS_DEFAULT_VALUE} > ${BRIGHTNESS_FILE}
-    ro
     brightness=${BRIGHTNESS_DEFAULT_VALUE}
+	fw_setenv brightness ${brightness}
 fi
 echo ${brightness}
 exit 0

+ 2 - 5
Recovery/board/funkey/rootfs-overlay/usr/local/sbin/brightness_set

@@ -1,6 +1,5 @@
 #!/bin/sh
 
-BRIGHTNESS_FILE=/etc/current_brightness
 SYSTEM_BRIGHTNESS=/sys/class/backlight/backlight/brightness
 
 # Check args
@@ -22,9 +21,7 @@ let value/=10
 echo ${value} > ${SYSTEM_BRIGHTNESS}
 
 # Set new brightness value in brightness file
-if [ ${?} -eq 0 ]; then
-    rw
-    echo ${brightness_percentage} > ${BRIGHTNESS_FILE}
-    ro
+if [ ${?} -eq 0 -a $(brightness_get) -ne ${brightness_percentage} ]; then
+    fw_setenv brightness ${brightness_percentage}
 fi
 exit 0

+ 1 - 1
Recovery/board/funkey/rootfs-overlay/usr/local/sbin/menu

@@ -12,7 +12,7 @@ getkey() {
 menu_display () {
     local entry=${1}
 
-    clear_notif
+    #clear_notif
     case ${entry} in
 	0)
 

+ 6 - 0
Recovery/board/funkey/rootfs-overlay/usr/local/sbin/ro

@@ -1,3 +1,9 @@
 #!/bin/sh
 
+# Check that we are in RW
+mount | grep -q "ext4 (rw" || exit 1
+
+# Flush and mount in read only
 mount / -o remount,ro
+
+exit 0

+ 0 - 1
Recovery/package/FunKey-GPIO-Mapping/FunKey-GPIO-Mapping.mk

@@ -23,7 +23,6 @@ define FUNKEY_GPIO_MAPPING_INSTALL_TARGET_CMDS
 	$(INSTALL) -m 0755 $(@D)/funkey_gpio_management $(TARGET_DIR)/usr/local/sbin/funkey_gpio_management
 	$(INSTALL) -m 0755 $(@D)/termfix $(TARGET_DIR)/usr/local/sbin/termfix
 	$(INSTALL) -d -m 0755 $(TARGET_DIR)/etc
-	$(INSTALL) -m 0644 $(@D)/funkey_gpio_mapping.conf $(TARGET_DIR)/etc/funkey_gpio_mapping.conf
 	$(INSTALL) -d -m 0755 $(TARGET_DIR)/etc/init.d
 	$(INSTALL) -m 0755 $(FUNKEY_GPIO_MAPPING_PKGDIR)etc/init.d/S11funkey-gpio-management $(TARGET_DIR)/etc/init.d/S11funkey-gpio-management
 endef