[OpenWrt-Devel] Raspberry Pi 2 sysupgrade
John Crispin
blogic at openwrt.org
Thu Jul 9 01:44:41 EDT 2015
On 08/07/2015 19:42, Bruno Randolf wrote:
> Hi!
>
> I have the below change to add rudimentary support for sysupgrade on the
> Raspberry Pi. I looked at the way platform_copy_config() is implemented
> for x86 and tried to do the same, but I get the following error on mount:
>
> mount: mounting /dev/mmcblk0p2 on /mnt failed: Device or resource busy
in that case its either still flushing the cache or has not been
properly unmounted i think. you could try adding the "partprobe" tool to
force a rescan of the table but i am not sure this is the problem here
>
> I believe I'd need some way to re-read the partition table after the dd
> command. How does it work on x86? Any ideas?
partprobe and i think fdisk had a feature for that aswell
>
> Also would it be OK to gzip the sdcard image to save space? It
> compresses from 76M to 11M.
>
ok, as there is not sysupgrade supported yet this change wont break
running installations
> Below is the diff, but this is not a properly formatted patch, yet.
>
> bruno
>
> 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 0000000..95ade38
> --- /dev/null
> +++ b/target/linux/brcm2708/base-files/lib/upgrade/platform.sh
> @@ -0,0 +1,19 @@
> +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
> +}
> +
> +## mount does not work. I think I'd need to re-read the partition table!
> +#platform_copy_config() {
> +# echo "*** platform_copy_config called" > /dev/console
> +# mount -t ext4 -o rw,noatime /dev/mmcblk0p2 /mnt
> +# cp -af "$CONF_TAR" /mnt/
> +# umount /mnt
> +# echo "*** platform_copy_config done" > /dev/console
> +#}
> diff --git a/target/linux/brcm2708/image/Makefile
> b/target/linux/brcm2708/image/Makefile
> index e70bdd0..095cf0d 100644
> --- a/target/linux/brcm2708/image/Makefile
> +++ b/target/linux/brcm2708/image/Makefile
> @@ -28,6 +28,7 @@ define Image/Build/RaspberryPi
> mcopy -i $(KDIR)/boot.img $(KDIR)/Image ::kernel.img # Copy
> OpenWrt built kernel
> ./gen_rpi_sdcard_img.sh
> $(BIN_DIR)/$(IMG_PREFIX)-sdcard-vfat-$(1).img $(KDIR)/boot.img
> $(KDIR)/root.$(1) \
> $(CONFIG_BRCM2708_SD_BOOT_PARTSIZE)
> $(CONFIG_TARGET_ROOTFS_PARTSIZE)
> + gzip -k -f $(BIN_DIR)/$(IMG_PREFIX)-sdcard-vfat-$(1).img
> endef
>
> define Image/Build
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list