summaryrefslogtreecommitdiff
path: root/target/linux/x86/olpc/base-files/lib/upgrade
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2009-11-03 01:02:39 +0000
committerFlorian Fainelli <florian@openwrt.org>2009-11-03 01:02:39 +0000
commite49c2d769162c261a035db1a979f639b20effd47 (patch)
tree4286407f29abcbd533e439ccccd20e8d4a184cb5 /target/linux/x86/olpc/base-files/lib/upgrade
parenta4db9ed4529ba632d80f4d55eafc89c9c23851d2 (diff)
downloadmtk-20170518-e49c2d769162c261a035db1a979f639b20effd47.zip
mtk-20170518-e49c2d769162c261a035db1a979f639b20effd47.tar.gz
mtk-20170518-e49c2d769162c261a035db1a979f639b20effd47.tar.bz2
merge the olpc target with the x86 target, both tested and running
SVN-Revision: 18279
Diffstat (limited to 'target/linux/x86/olpc/base-files/lib/upgrade')
-rw-r--r--target/linux/x86/olpc/base-files/lib/upgrade/platform.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/target/linux/x86/olpc/base-files/lib/upgrade/platform.sh b/target/linux/x86/olpc/base-files/lib/upgrade/platform.sh
new file mode 100644
index 0000000..ffd0b93
--- /dev/null
+++ b/target/linux/x86/olpc/base-files/lib/upgrade/platform.sh
@@ -0,0 +1,27 @@
+platform_check_image() {
+ [ "$ARGC" -gt 1 ] && return 1
+
+ case "$(get_magic_word "$1")" in
+ 48eb) return 0;;
+ *)
+ echo "Invalid image type"
+ return 1
+ ;;
+ esac
+}
+
+platform_do_upgrade() {
+ get_image "$1" > /dev/hda
+ sync
+}
+
+x86_prepare_ext2() {
+ # if we're running from ext2, we need to make sure that we have a mtd
+ # partition that points to the active rootfs partition.
+ # however this only matters if we actually need to preserve the config files
+ [ "$SAVE_CONFIG" -eq 1 ] && return 0
+ grep rootfs /proc/mtd >/dev/null || {
+ echo /dev/hda2,65536,rootfs > /sys/module/block2mtd/parameters/block2mtd
+ }
+}
+append sysupgrade_pre_upgrade x86_prepare_ext2