diff options
author | John Crispin <blogic@openwrt.org> | 2015-11-23 07:14:38 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2015-11-23 07:14:38 +0000 |
commit | fcfb5c515a931d83c1637527df6f54532619c3c4 (patch) | |
tree | b755a5bf98010489a49cbcc74c2236897e2aedb7 /target/linux/brcm2708/base-files | |
parent | cf0cf157401164d22422ec825e912afdb6f68418 (diff) | |
download | upstream-fcfb5c515a931d83c1637527df6f54532619c3c4.tar.gz upstream-fcfb5c515a931d83c1637527df6f54532619c3c4.tar.bz2 upstream-fcfb5c515a931d83c1637527df6f54532619c3c4.zip |
CC: brcm2708: Add sysupgrade support for Raspberry Pi
Also create .gz images if configured to do so.
This is equivalent, but different to what we have in trunk, as the image
creation has been rewritten there.
Signed-off-by: Bruno Randolf <br1@einfach.org>
git-svn-id: svn://svn.openwrt.org/openwrt/branches/chaos_calmer@47604 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/brcm2708/base-files')
-rw-r--r-- | target/linux/brcm2708/base-files/lib/preinit/79_move_config | 18 | ||||
-rw-r--r-- | target/linux/brcm2708/base-files/lib/upgrade/platform.sh | 17 |
2 files changed, 35 insertions, 0 deletions
diff --git a/target/linux/brcm2708/base-files/lib/preinit/79_move_config b/target/linux/brcm2708/base-files/lib/preinit/79_move_config new file mode 100644 index 0000000000..7bcea7bf6f --- /dev/null +++ b/target/linux/brcm2708/base-files/lib/preinit/79_move_config @@ -0,0 +1,18 @@ +#!/bin/sh +# Copyright (C) 2015 OpenWrt.org + +BOOTPART=/dev/mmcblk0p1 + +move_config() { + if [ -b $BOOTPART ]; then + insmod nls_cp437 + insmod nls_iso8859-1 + insmod fat + insmod vfat + mount -t vfat -o rw,noatime $BOOTPART /mnt + [ -f /mnt/sysupgrade.tgz ] && mv -f /mnt/sysupgrade.tgz / + umount /mnt + fi +} + +boot_hook_add preinit_mount_root move_config diff --git a/target/linux/brcm2708/base-files/lib/upgrade/platform.sh b/target/linux/brcm2708/base-files/lib/upgrade/platform.sh new file mode 100644 index 0000000000..3e1ee0067c --- /dev/null +++ b/target/linux/brcm2708/base-files/lib/upgrade/platform.sh @@ -0,0 +1,17 @@ +platform_check_image() { + # i know no way to verify the image + return 0; +} + +platform_do_upgrade() { + sync + get_image "$1" | dd of=/dev/mmcblk0 bs=2M conv=fsync + sleep 1 +} + +platform_copy_config() { + mount -t vfat -o rw,noatime /dev/mmcblk0p1 /mnt + cp -af "$CONF_TAR" /mnt/ + sync + umount /mnt +} |