User Tools

Site Tools


subsystem:agl-sota:ostree

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
subsystem:agl-sota:ostree [2016/10/06 12:21]
oytis [OSTree] described ostree-admin features
subsystem:agl-sota:ostree [2020/09/02 16:44] (current)
jsmoeller [Building]
Line 3: Line 3:
  
 ===== OSTree ===== ===== OSTree =====
-[[https://​github.com/​ostreedev/​ostree|OSTree]] is a tool for distributing and deploying ​filesystem ​images. It provides atomic upgrades of the whole filesystem ​tree, while being effective with respect to disk space, i.e. files with the same contents are shared between managed ​filesystems.+[[https://​github.com/​ostreedev/​ostree|OSTree]] is a tool for distributing and deploying ​file system ​images. It provides atomic upgrades of the whole file system ​tree, while being effective with respect to disk space, i.e. files with the same contents are shared between managed ​file systems.
  
-OSTree stores all the data in repositories. They are treated to some degree like git repositories - user can commit data to it checkout commited ​filesystem ​tree to some location in the filesystem ​and pull data from one repository to another. All the data is stored in git-like object database, so that data is not duplicated. Basically there are two types of repositories+OSTree stores all the data in repositories. They are treated to some degree like git repositories - user can commit data to it checkout commited ​file system ​tree to some location in the file system ​and pull data from one repository to another. All the data is stored in git-like object database, so that data is not duplicated. Basically there are two types of repositories
   - archive-z2 repository stores all data in compressed format. When user checks out the data from it, they are just extracted to some location and can be treated independently from the data in repository. This type of repository is intended to be used on servers, from which data is distributed to target devices.   - archive-z2 repository stores all data in compressed format. When user checks out the data from it, they are just extracted to some location and can be treated independently from the data in repository. This type of repository is intended to be used on servers, from which data is distributed to target devices.
   - bare repository stores the data in uncompressed form. Checkout from this repository just creates hardlinks to the stored files. This repository type suits best for target devices.   - bare repository stores the data in uncompressed form. Checkout from this repository just creates hardlinks to the stored files. This repository type suits best for target devices.
Line 13: Line 13:
 You can find more details in [[http://​ostree.readthedocs.io/​en/​latest/​|OSTree documentation]]. You can find more details in [[http://​ostree.readthedocs.io/​en/​latest/​|OSTree documentation]].
 ===== SOTA client ===== ===== SOTA client =====
 +Work in progress.
 +
 +==== Download Master Branch ====
 +The OTA feature is currently only available in the master branch of AGL. To fetch this branch run:
 +
 +    $ repo init -u https://​gerrit.automotivelinux.org/​gerrit/​AGL/​AGL-repo
 +    $ repo sync
 +
 ===== Building ===== ===== Building =====
-To enable OTA feature just add **agl-ota** to the feature list when setting up your environment.+To enable OTA feature just add **agl-sota** to the feature list when setting up your environment.
     source meta-agl/​scripts/​aglsetup.sh -m qemux86-64 agl-demo agl-netboot agl-appfw-smack agl-sota     source meta-agl/​scripts/​aglsetup.sh -m qemux86-64 agl-demo agl-netboot agl-appfw-smack agl-sota
 You can then edit your local.conf You can then edit your local.conf
     vim conf/​local.conf     vim conf/​local.conf
 to tune several parameters. to tune several parameters.
-  * **OSTREE_REPO** sets //local// OSTree repository, to which your resulting image will be committed. +  * **OSTREE_REPO** sets //local// OSTree repository, to which your resulting image will be committed. It is set to //​deploy_dir///​ostree_repo by default
-  * **OSTREE_BRANCHNAME** is the ref name in your //local// repository. +  * **OSTREE_BRANCHNAME** is the ref name in your //local// repository. Default value is "​agl-ota"​
-  * **OSTREE_OSNAME** is the OS name in OSTree repository on your //target// device. See [[https://​ostree.readthedocs.io/​en/​latest/​manual/​deployment/​|OSTree documentation]] for the details.+  * **OSTREE_OSNAME** is the OS name in OSTree repository on your //target// device. Is equal to "​agl"​ by default. See [[https://​ostree.readthedocs.io/​en/​latest/​manual/​deployment/​|OSTree documentation]] for the details.
 After that just build your desired image e.g. After that just build your desired image e.g.
     bitbake agl-demo-platform     bitbake agl-demo-platform
 As a result of the building process you will get the following: As a result of the building process you will get the following:
-  - The whole root filesystem ​together with the kernel and initramfs commited to OSTree repository set in OSTREE_REPO on a branch set in OSTREE_BRANCHNAME+  - The whole root file system ​together with the kernel and initramfs commited to OSTree repository set in OSTREE_REPO on a branch set in OSTREE_BRANCHNAME
   - Archived exact copy of the commited tree ('​*.rootfs.ostree.tar.bz2'​ file)   - Archived exact copy of the commited tree ('​*.rootfs.ostree.tar.bz2'​ file)
   - Live bootstrap image with the commited tree as the only [[https://​ostree.readthedocs.io/​en/​latest/​manual/​deployment/​|OSTree deployment]] ('​*.otaimg'​ file).   - Live bootstrap image with the commited tree as the only [[https://​ostree.readthedocs.io/​en/​latest/​manual/​deployment/​|OSTree deployment]] ('​*.otaimg'​ file).
 To boot into the resulting image, provided you've built it for QEMU run To boot into the resulting image, provided you've built it for QEMU run
-    ​../meta-agl-extra/meta-sota/scripts/runqemu qemuparams="​-vga std" ​tmp/​deploy/​images/​qemux86-64/​agl-demo-platform-qemux86-64.otaimg+    ​qemu-system-x86_64 ​-bios tmp/deploy/images/​qemux86-64/​u-boot-qemux86-64.rom -drive file=tmp/​deploy/​images/​qemux86-64/​agl-demo-platform-qemux86-64.ota-ext4,​if=ide,​format=raw,​snapshot=on -serial stdio -m 2G -object rng-random,​id=rng0,​filename=/​dev/​urandom -device virtio-rng-pci,​rng=rng0 -net user,​hostfwd=tcp:​0.0.0.0:​2222-:​22,​restrict=off -net nic,​macaddr=ca:​fe:​85:​b2:​7b:​b9 -usb -device usb-tablet -show-cursor -vnc :0 -cpu host -enable-kvm ​
 runqemu script from poky upstream is not able to work with OTA images at the moment. runqemu script from poky upstream is not able to work with OTA images at the moment.
  
Line 37: Line 45:
 To expose your repo run ostree trivial-httpd using any free port. To expose your repo run ostree trivial-httpd using any free port.
  
-    ​ostree trivial-httpd ​tmp/​deploy/​images/​qemux86-64/​ostree_repo -57556+    ​cd tmp/​deploy/​images/​qemux86-64/​ostree_repo ​&& python ​-m SimpleHTTPServer ​57556
  
 You can then run from inside your device or QEMU emulation, provided your network is set up correctly. You can then run from inside your device or QEMU emulation, provided your network is set up correctly.
Line 44: Line 52:
     ostree remote add --no-gpg-verify agl-remote http://​192.168.7.1:​57556 agl-ota     ostree remote add --no-gpg-verify agl-remote http://​192.168.7.1:​57556 agl-ota
     ​     ​
-    # agl-ota is a branch name in the remote repo, set in OSTREE_BRANCHNAME +    # agl-otaq-emux86-64 ​is a branch name in the remote repo, set in OSTREE_BRANCHNAME 
-    ostree pull agl-remote ​agl-ota+    #   ​default value for OSTREE_BRANCHNAME is "​${MACHINE}"​ 
 +    ostree pull agl-remote ​qemux86-64
     ​     ​
     # agl is OS name as set in OSTREE_OSNAME     # agl is OS name as set in OSTREE_OSNAME
-    ostree admin deploy --os=agl agl-remote:agl-ota +    ostree admin deploy --os=poky agl-remote:qemux86-64 
 +    
 After restart you should boot into the newly deployed OS image. After restart you should boot into the newly deployed OS image.
-===== Secure update ===== 
- 
  
 +E.g. for the raspberrypi3 you can try this sequence:
 +    # add remote
 +    ostree remote add --no-gpg-verify agl-snapshot https://​download.automotivelinux.org/​AGL/​snapshots/​master/​latest/​raspberrypi3/​deploy/​images/​raspberrypi3/​ostree_repo/​ agl-ota-raspberrypi3
 +    ​
 +    # pull
 +    ostree pull agl-snapshot agl-ota-raspberrypi3
 +    ​
 +    # deploy
 +    ostree admin deploy --os=agl agl-snapshot:​agl-ota-raspberrypi3
  
  
 +===== Secure update =====
 +Work in progress
subsystem/agl-sota/ostree.1475756515.txt.gz · Last modified: 2016/10/06 12:21 by oytis