Difference between revisions of "OTA guide"
From ESS-WIKI
Weichih.lin (talk | contribs) |
|||
Line 1: | Line 1: | ||
= Compile OTA image = | = Compile OTA image = | ||
− | [[IoTGateway/BSP/Linux/iMX6/Yocto_LBV8_User_Guide#Get_BSP|After Get BSP]] | + | |
+ | [[IoTGateway/BSP/Linux/iMX6/Yocto_LBV8_User_Guide#Get_BSP|After Get BSP]] | ||
Checkout to '''OTA branch''' | Checkout to '''OTA branch''' | ||
+ | |||
cd sources/meta-advantech | cd sources/meta-advantech | ||
git checkout '''OTA''' | git checkout '''OTA''' | ||
Line 9: | Line 11: | ||
build recovery image | build recovery image | ||
+ | |||
bitbake '''initramfs-debug-image''' | bitbake '''initramfs-debug-image''' | ||
+ | |||
build minimal image with OTA functions | build minimal image with OTA functions | ||
+ | |||
bitbake '''core-image-full-cmdline''' | bitbake '''core-image-full-cmdline''' | ||
Line 22: | Line 27: | ||
Taken rom3420 as an example: | Taken rom3420 as an example: | ||
+ | |||
cp sources/meta-advantech/meta-WISE-PaaS/recipes-ota/ota-script/files/'''ota-package.sh''' build-3420/tmp/deploy/images/imx6qrom3420a1/ | cp sources/meta-advantech/meta-WISE-PaaS/recipes-ota/ota-script/files/'''ota-package.sh''' build-3420/tmp/deploy/images/imx6qrom3420a1/ | ||
− | * ota-package.sh | + | |
+ | *ota-package.sh | ||
+ | |||
Usage: ota-package.sh [OPTIONS] | Usage: ota-package.sh [OPTIONS] | ||
Line 34: | Line 42: | ||
-o <file> Output file | -o <file> Output file | ||
-h Show help | -h Show help | ||
+ | |||
So we run command as below: | So we run command as below: | ||
+ | |||
./ota-package.sh -k zImage -d imx6q-rom3420-a1.dtb -r core-image-full-cmdline-imx6qrom3420a1.ext4 -o update.zip | ./ota-package.sh -k zImage -d imx6q-rom3420-a1.dtb -r core-image-full-cmdline-imx6qrom3420a1.ext4 -o update.zip | ||
Line 40: | Line 50: | ||
cp '''update.zip''' /cache/ | cp '''update.zip''' /cache/ | ||
+ | |||
cd /tools/ | cd /tools/ | ||
/tools/do_update.sh update.zip | /tools/do_update.sh update.zip | ||
Line 48: | Line 59: | ||
14 bytes copied, 0.00918567 s, 1.5 kB/s | 14 bytes copied, 0.00918567 s, 1.5 kB/s | ||
Setup OK. Reboot to recovery image! | Setup OK. Reboot to recovery image! | ||
+ | |||
Then | Then | ||
+ | |||
reboot | reboot | ||
Line 94: | Line 107: | ||
which means system updates successfully | which means system updates successfully | ||
+ | [[Category:Editor]] |
Revision as of 08:19, 24 May 2017
Compile OTA image
Checkout to OTA branch
cd sources/meta-advantech git checkout OTA
After create a new build machine
build recovery image
bitbake initramfs-debug-image
build minimal image with OTA functions
bitbake core-image-full-cmdline
Make OTA SDcard
dd image to SD card
dd if=core-image-full-cmdline-imx6qrom3420a1.sdcard of=/dev/sdc;sync
Generate update.zip
Taken rom3420 as an example:
cp sources/meta-advantech/meta-WISE-PaaS/recipes-ota/ota-script/files/ota-package.sh build-3420/tmp/deploy/images/imx6qrom3420a1/
- ota-package.sh
Usage: ota-package.sh [OPTIONS] Generate package file to be used for OTA update on Yocto Linux -b <file> Bootloader image file -k <file> Kernel or Boot image file -d <file> DTB (device tree) file -r <file> Rootfs image file -o <file> Output file -h Show help
So we run command as below:
./ota-package.sh -k zImage -d imx6q-rom3420-a1.dtb -r core-image-full-cmdline-imx6qrom3420a1.ext4 -o update.zip
Update Manually
cp update.zip /cache/
cd /tools/ /tools/do_update.sh update.zip Write recovery command ... Write BCB ... 0+1 records in 0+1 records out 14 bytes copied, 0.00918567 s, 1.5 kB/s Setup OK. Reboot to recovery image!
Then
reboot
After reboot , system will enter recovery image for updating system and reboot system
Adv-Boot 2009.08-advantech_rom3420_1G_V2.210_svn414 (Mar 14 2014 - 09:51:19) U-Boot 2016.03-OTA+g3adf656d (Apr 05 2017 - 06:05:49 +0000) ..... setup env for recovery.. flash target is MMC:0 Net: FEC [PRIME] Normal Boot Hit any key to stop autoboot: 0 boota mmc0 recovery kernel @ 14008000 (5845616) ramdisk @ 15000000 (5362058) fdt @ 14f00000 (53290) ..... [OTA] Read recovery commands ... [OTA] Check OTA package ... [OTA] Unzip /cache/update.zip ... Archive: /cache/update.zip inflating: ota-update/updater-script inflating: ota-update/zImage inflating: ota-update/imx6q-rom3420-a1.dtb [OTA] Parse updater-script in /cache/update.zip ... [OTA] Update boot partition (zImage) ... [OTA] Update done! [OTA] OK [OTA] Cleaning BCB ... 32+0 records in 32+0 records out random: nonblocking pool is initialized [OTA] BCB is clear! [OTA] Going to reboot ... reboot: Restarting system
After updating system
/tools/do_update.sh result
it returns
OK
which means system updates successfully