diff options
author | Gatis Paeglis <gatis.paeglis@theqtcompany.com> | 2016-03-14 17:57:16 +0100 |
---|---|---|
committer | Gatis Paeglis <gatis.paeglis@theqtcompany.com> | 2016-03-15 12:57:41 +0000 |
commit | 9888e3ed6e7b401f8cd36c1e86b277b48e80b65e (patch) | |
tree | f4aa09b8c32d2fdf8c2fbbb2727d7ab1a7949fb6 /qt-ostree | |
parent | 4292abe1aefe47de54bee75ad7d44e0cf350e270 (diff) |
Do not use OSTree's deployment terminology
Rename --create-initial-deployment command line argument
to --create-ota-sysroot and don't use deployment terminology
in the documentation. This terminology is taken from OSTree
internals and can be confusing for some users.
Change-Id: Ieba6695fb78cd4e303370e420b6d7b2f0ae997cf
Reviewed-by: Gatis Paeglis <gatis.paeglis@theqtcompany.com>
Diffstat (limited to 'qt-ostree')
-rwxr-xr-x | qt-ostree/ostree-grub-generator | 2 | ||||
-rwxr-xr-x | qt-ostree/qt-ostree | 57 |
2 files changed, 30 insertions, 29 deletions
diff --git a/qt-ostree/ostree-grub-generator b/qt-ostree/ostree-grub-generator index ca47dfb..ed6b968 100755 --- a/qt-ostree/ostree-grub-generator +++ b/qt-ostree/ostree-grub-generator @@ -7,7 +7,7 @@ # 1) cp ostree-grub-generator ostree-grub-generator-mydevice # 2) Edit ostree-grub-generator-mydevice # 3) Pass ostree-grub-generator-mydevice to qt-ostree via --grub2-cfg-generator -# 4) Examine the generated grub.cfg file in the OTA sysroot (created by --create-initial-deployment) +# 4) Examine the generated grub.cfg file in the OTA sysroot (created by --create-ota-sysroot) # # WARNINGS: # diff --git a/qt-ostree/qt-ostree b/qt-ostree/qt-ostree index 3efa6b3..b03dbfe 100755 --- a/qt-ostree/qt-ostree +++ b/qt-ostree/qt-ostree @@ -34,7 +34,8 @@ WORKDIR=$PWD GENERATED_TREE=${WORKDIR}/tree BOOT_FILE_PATH=${GENERATED_TREE}/boot SERVER_ROOT=${WORKDIR}/httpd -OTA_SYSROOT=false +CREATE_OTA_SYSROOT=false +OTA_SYSROOT=${WORKDIR}/sysroot START_HTTPD=false INVALID_ARGS=false BINARY_IMAGE=false @@ -152,7 +153,7 @@ usage() echo "--ostree-commit-subject \"SUBJECT\" Commits the generated update with the specified commit subject. A default commit subject is the" echo " date and time when the update was committed." echo - echo "--create-initial-deployment Generates Over-The-Air Update ready sysroot." + echo "--create-ota-sysroot Generates Over-The-Air Update enabled sysroot." echo "--start-trivial-httpd Starts a simple web server, hosting the OSTree repository (see --ostree-repo)." echo " The address to the hosted repository is listed in the httpd/httpd-address file in the working directory." echo @@ -163,7 +164,7 @@ usage() echo echo "--gpg-sign KEY-ID GPG Key ID to use for signing the commit." echo "--gpg-homedir DIR GPG home directory to use when looking for keyrings." - echo "--gpg-trusted-keyring FILE Adds the provided keyring file to the generated sysroot (see --create-initial-deployment) or to" + echo "--gpg-trusted-keyring FILE Adds the provided keyring file to the generated sysroot (see --create-ota-sysroot) or to" echo " the generated update. When providing a new keyring via update, the new keyring will be used for" echo " signature verification only after this update has been applied." echo @@ -243,8 +244,8 @@ parse_args() { while [ $# -gt 0 ] ; do case "${1}" in - --create-initial-deployment) - OTA_SYSROOT=true + --create-ota-sysroot) + CREATE_OTA_SYSROOT=true ;; --start-trivial-httpd) START_HTTPD=true @@ -360,8 +361,8 @@ clean_workdir() done # Remove immutable attribute. - chattr -if sysroot/ostree/deploy/*/deploy/* || /bin/true - rm -rf sysroot + chattr -if ${OTA_SYSROOT}/ostree/deploy/*/deploy/* || /bin/true + rm -rf ${OTA_SYSROOT} rm -rf ${GENERATED_TREE} rm -rf fakepath } @@ -421,7 +422,7 @@ adjust_sysroot_layout() mkdir -p sysroot/tmp/ rm -rf tmp/ ln -s sysroot/tmp/ tmp - # The deployment should not have a traditional UNIX /etc; instead, it should include /usr/etc. + # The sysroot should not have a traditional UNIX /etc; instead, it should include /usr/etc. if [ -e etc/ ] ; then mv etc/ usr/ fi @@ -542,23 +543,23 @@ configure_boot_loader() { qt_ostree_info "Configuring ${BOOTLOADER} boot loader" if [ "${BOOTLOADER}" = "u-boot" ] ; then - mkdir -p sysroot/boot/loader.0/ - ln -s loader.0 sysroot/boot/loader - touch sysroot/boot/loader/uEnv.txt - ln -s loader/uEnv.txt sysroot/boot/uEnv.txt + mkdir -p ${OTA_SYSROOT}/boot/loader.0/ + ln -s loader.0 ${OTA_SYSROOT}/boot/loader + touch ${OTA_SYSROOT}/boot/loader/uEnv.txt + ln -s loader/uEnv.txt ${OTA_SYSROOT}/boot/uEnv.txt # Add convenience symlinks, for details see ostree/src/libostree/ostree-bootloader-uboot.c for file in ${BOOT_FILE_PATH}/* ; do name=$(basename $file) if [[ ! -f $file || $name == *.dtb || $name == initramfs-* || $name == vmlinuz-* ]] ; then continue fi - ln -sf loader/${name} sysroot/boot/${name} + ln -sf loader/${name} ${OTA_SYSROOT}/boot/${name} done fi if [ "${BOOTLOADER}" = "grub2" ] ; then - mkdir -p sysroot/boot/grub2/ - ln -s ../loader/grub.cfg sysroot/boot/grub2/grub.cfg + mkdir -p ${OTA_SYSROOT}/boot/grub2/ + ln -s ../loader/grub.cfg ${OTA_SYSROOT}/boot/grub2/grub.cfg KERNEL_ARGS="--karg=root=LABEL=rootfs ${KERNEL_ARGS}" # Add ostree-grub-generator to the PATH. # https://bugzilla.gnome.org/show_bug.cgi?id=762220 @@ -577,13 +578,13 @@ populate_filesystem_images() if [[ ${DEVICE} = *nuc* ]] ; then mcopy -s -i boot.${BOOTFS_TYPE} ${GENERATED_TREE}/boot/EFI ::/EFI # The whole sysroot on the same partition. - cp -rd sysroot/* rootfs-dd/ + cp -rd ${OTA_SYSROOT}/* rootfs-dd/ return fi # boot/ directory on a separate boot partition. - cp -rd sysroot/!(boot) rootfs-dd/ - cp -rd sysroot/boot/* boot-dd/ + cp -rd ${OTA_SYSROOT}/!(boot) rootfs-dd/ + cp -rd ${OTA_SYSROOT}/boot/* boot-dd/ } # Disk layout: @@ -601,7 +602,7 @@ assemble_dd_image() cd ${WORKDIR} qt_ostree_info "Assembling a deployable image ..." # Align boot partition and calculate total binary image size. - sysroot_size=$(du -sk sysroot/ | cut -f1) + sysroot_size=$(du -sk ${OTA_SYSROOT}/ | cut -f1) rootfs_size=$(echo ${sysroot_size}*${ROOT_OVERHEAD_FACTOR} | bc | cut -f1 -d'.') bootfs_size_aligned=$(( ${BOOTFS_SIZE} + ${IMAGE_ROOTFS_ALIGNMENT} - 1 )) bootfs_size_aligned=$(( ${bootfs_size_aligned} - ${bootfs_size_aligned} % ${IMAGE_ROOTFS_ALIGNMENT} )) @@ -643,28 +644,28 @@ assemble_dd_image() qt_ostree_info "Example dd command: sudo dd bs=4M if=${image} of=/dev/sdX && sync" } -create_initial_deployment() +create_ota_sysroot() { qt_ostree_info "Creating OTA enabled sysroot ..." cd ${WORKDIR} - mkdir -p sysroot/sysroot/ - export OSTREE_SYSROOT=sysroot - ostree admin init-fs sysroot + mkdir -p ${OTA_SYSROOT}/sysroot/ + export OSTREE_SYSROOT=${OTA_SYSROOT} + ostree admin init-fs ${OTA_SYSROOT} ostree admin os-init ${OS_NAME} configure_boot_loader qt_ostree_info "Checking out filesystem tree from ${OSTREE_REPO} repository" - ostree --repo=sysroot/ostree/repo pull-local --remote=${OS_NAME} ${OSTREE_REPO} ${OSTREE_BRANCH} + ostree --repo=${OTA_SYSROOT}/ostree/repo pull-local --remote=${OS_NAME} ${OSTREE_REPO} ${OSTREE_BRANCH} # --verbose here is not really that verbose, it simply helps to confirm that the correct # boot loader backend was picked up by OSTree. ostree admin deploy --verbose ${KERNEL_ARGS} --os=${OS_NAME} ${OS_NAME}:${OSTREE_BRANCH} ostree admin status # OSTree does not touch the contents of /var, it is the OS responsibility to manage this directory. - rm -rf sysroot/ostree/deploy/${OS_NAME}/var/ - cp -r ${GENERATED_TREE}/var/ sysroot/ostree/deploy/${OS_NAME}/ + rm -rf ${OTA_SYSROOT}/ostree/deploy/${OS_NAME}/var/ + cp -rd ${GENERATED_TREE}/var/ ${OTA_SYSROOT}/ostree/deploy/${OS_NAME}/ assemble_dd_image } @@ -752,8 +753,8 @@ main() convert_to_ostree_sysroot commit_generated_tree - if [ $OTA_SYSROOT = true ] ; then - create_initial_deployment + if [ $CREATE_OTA_SYSROOT = true ] ; then + create_ota_sysroot fi if [ $START_HTTPD = true ] ; then |