Browse Source

Merge tag 'JH7110_MM_v4.0.0-rc1' into vf2-devel

version JH7110_MM_v4.0.0-rc1 for JH7110 EVB board merge from tag JH7110_515_SDK_v4.0.0-rc1
Andy Hu 1 year ago
parent
commit
1a81c389fd
2 changed files with 23 additions and 0 deletions
  1. 22 0
      package/starfive/pm/S00hibernation
  2. 1 0
      package/starfive/pm/pm.mk

+ 22 - 0
package/starfive/pm/S00hibernation

@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# hibernation    This shell script to turn on swap partition and
+#                set the image_size as big as ram size.
+
+case "$1" in
+	start)
+		# Set the hibernation image_size as large as the ram size.
+		total_mem=$(cat /proc/meminfo | sed -n '1p')
+		echo $((${total_mem: 10: 15}*1024)) > /sys/power/image_size
+		swapon PARTLABEL="hibernation"
+		;;
+	stop)
+		swapoff PARTLABEL="hibernation"
+		;;
+	*)
+		echo "Usage: $0 {start|stop}"
+		exit 1
+esac
+
+exit 0
+

+ 1 - 0
package/starfive/pm/pm.mk

@@ -7,6 +7,7 @@ PM_LICENSE = GPL-2.0+
 
 define PM_INSTALL_TARGET_CMDS
 	install -m 0755 -D package/starfive/pm/S90cpufreq $(TARGET_DIR)/etc/init.d/
+	install -m 0755 -D package/starfive/pm/S00hibernation $(TARGET_DIR)/etc/init.d/
 endef
 
 $(eval $(generic-package))