Permalink
Browse files

addon.d: add backup scripts for bootmenu and kernel modules

Change-Id: I7ba2df1f82ea2c9d156b633b03b65e339b60bbdf

Conflicts:

	custom_backup_list.txt
	custom_backup_release.txt
  • Loading branch information...
1 parent cd3c781 commit c3a776d8e734dce5591eaac43be803255b9d2f12 @tpruvot tpruvot committed with Quarx2k Apr 11, 2012
@@ -1,19 +1,3 @@
-lib/modules/act_gact.ko
-lib/modules/act_mirred.ko
-lib/modules/act_police.ko
-lib/modules/cls_u32.ko
-lib/modules/em_u32.ko
-lib/modules/ifb.ko
-lib/modules/kineto_gan.ko
-lib/modules/modem_pm_driver.ko
-lib/modules/netmux.ko
-lib/modules/netmux_linkdriver.ko
-lib/modules/output.ko
-lib/modules/pcbc.ko
-lib/modules/sch_htb.ko
-lib/modules/sch_ingress.ko
-lib/modules/sec.ko
-lib/modules/vpnclient.ko
bootmenu/config/overclock.conf
bootmenu/script/2nd-system.sh
etc/motorola/bp_nvm_default/File_GSM
View
@@ -74,11 +74,12 @@ PRODUCT_COPY_FILES += \
${device_path}/releasetools/addon.d/60-baseband.sh:system/addon.d/60-baseband.sh \
${device_path}/releasetools/addon.d/70-multiboot.sh:system/addon.d/70-multiboot.sh \
-# CM7 backup lists (deprecated)
-ifdef CM_RELEASE
- PRODUCT_COPY_FILES += ${device_path}/releasetools/custom_backup_release.txt:system/etc/custom_backup_list.txt
-else
- PRODUCT_COPY_FILES += ${device_path}/releasetools/custom_backup_list.txt:system/etc/custom_backup_list.txt
+# Backup kernel modules and bootmenu overclock config
+ifndef CM_RELEASE
+PRODUCT_COPY_FILES += \
+ ${device_path}/releasetools/addon.d/70-bootmenu.sh:system/addon.d/70-bootmenu.sh \
+ ${device_path}/releasetools/addon.d/70-modules.sh:system/addon.d/70-modules.sh \
+
endif
#end of jordan-blobs.mk
@@ -28,6 +28,7 @@ etc/motorola/bp_nvm_default/File_Audio2_AMR_WB
etc/motorola/bp_nvm_default/File_Audio3_AMR_WB
etc/motorola/bp_nvm_default/File_Audio4_AMR_WB
etc/motorola/bp_nvm_default/File_Audio5_AMR_WB
+etc/motorola/bp_nvm_default/generic_pds_init
EOF
}
@@ -0,0 +1,41 @@
+#!/sbin/sh
+#
+# /system/addon.d/70-bootmenu.sh
+# During a CM9 nightly upgrades, this script backs up bootmenu config,
+# /system is erased and reinstalled, then this script restore a backup list.
+#
+
+. /tmp/backuptool.functions
+
+list_files() {
+cat <<EOF
+bootmenu/config/overclock.conf
+EOF
+}
+
+case "$1" in
+ backup)
+ list_files | while read FILE DUMMY; do
+ backup_file $S/"$FILE"
+ done
+ ;;
+ restore)
+ list_files | while read FILE REPLACEMENT; do
+ R=""
+ [ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT"
+ [ -f "$C/$S/$FILE" ] && restore_file $S/"$FILE" "$R"
+ done
+ ;;
+ pre-backup)
+ # Stub
+ ;;
+ post-backup)
+ # Stub
+ ;;
+ pre-restore)
+ # Stub
+ ;;
+ post-restore)
+ # Stub
+ ;;
+esac
@@ -0,0 +1,56 @@
+#!/sbin/sh
+#
+# /system/addon.d/70-modules.sh
+# During a CM9 nightly upgrades, this script backs up kernel modules,
+# /system is erased and reinstalled, then this script restore a backup list.
+#
+
+. /tmp/backuptool.functions
+
+list_files() {
+cat <<EOF
+lib/modules/act_gact.ko
+lib/modules/act_mirred.ko
+lib/modules/act_police.ko
+lib/modules/cls_u32.ko
+lib/modules/em_u32.ko
+lib/modules/ifb.ko
+lib/modules/kineto_gan.ko
+lib/modules/modem_pm_driver.ko
+lib/modules/netmux.ko
+lib/modules/netmux_linkdriver.ko
+lib/modules/output.ko
+lib/modules/pcbc.ko
+lib/modules/sch_htb.ko
+lib/modules/sch_ingress.ko
+lib/modules/sec.ko
+lib/modules/vpnclient.ko
+EOF
+}
+
+case "$1" in
+ backup)
+ list_files | while read FILE DUMMY; do
+ backup_file $S/"$FILE"
+ done
+ ;;
+ restore)
+ list_files | while read FILE REPLACEMENT; do
+ R=""
+ [ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT"
+ [ -f "$C/$S/$FILE" ] && restore_file $S/"$FILE" "$R"
+ done
+ ;;
+ pre-backup)
+ # Stub
+ ;;
+ post-backup)
+ # Stub
+ ;;
+ pre-restore)
+ # Stub
+ ;;
+ post-restore)
+ # Stub
+ ;;
+esac

0 comments on commit c3a776d

Please sign in to comment.