summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Luck <ben+qa@advancedtelematic.com>2018-09-21 13:47:24 +0200
committerGitHub <noreply@github.com>2018-09-21 13:47:24 +0200
commit61c5d81118acbf97b36112ba21d701f29543524f (patch)
tree5f209af237f47838543524a2f2b3187addae5060
parentff1c9122d48813297e667f690456192f55398828 (diff)
parentdea9bc8d4e17643145462c7c39bda99978d9f16b (diff)
downloadmeta-updater-61c5d81118acbf97b36112ba21d701f29543524f.tar.gz
Merge pull request #394 from advancedtelematic/bugfix/OTA-852/pushcredentials/rocko
Don't commit credentials to OSTree repository
-rw-r--r--classes/image_types_ostree.bbclass6
-rw-r--r--classes/image_types_ota.bbclass10
2 files changed, 11 insertions, 5 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass
index bc44e33..95d1b59 100644
--- a/classes/image_types_ostree.bbclass
+++ b/classes/image_types_ostree.bbclass
@@ -33,6 +33,12 @@ IMAGE_CMD_ostree () {
33 33
34 cd ${OSTREE_ROOTFS} 34 cd ${OSTREE_ROOTFS}
35 35
36 for d in var/*; do
37 if [ "${d}" != "var/local" ]; then
38 rm -rf ${d}
39 fi
40 done
41
36 # Create sysroot directory to which physical sysroot will be mounted 42 # Create sysroot directory to which physical sysroot will be mounted
37 mkdir sysroot 43 mkdir sysroot
38 ln -sf sysroot/ostree ostree 44 ln -sf sysroot/ostree ostree
diff --git a/classes/image_types_ota.bbclass b/classes/image_types_ota.bbclass
index 9581971..360b746 100644
--- a/classes/image_types_ota.bbclass
+++ b/classes/image_types_ota.bbclass
@@ -65,7 +65,6 @@ IMAGE_CMD_otaimg () {
65 bbfatal "OSTREE_BRANCHNAME should be set in your local.conf" 65 bbfatal "OSTREE_BRANCHNAME should be set in your local.conf"
66 fi 66 fi
67 67
68
69 PHYS_SYSROOT=`mktemp -d ${WORKDIR}/ota-sysroot-XXXXX` 68 PHYS_SYSROOT=`mktemp -d ${WORKDIR}/ota-sysroot-XXXXX`
70 69
71 ostree admin --sysroot=${PHYS_SYSROOT} init-fs ${PHYS_SYSROOT} 70 ostree admin --sysroot=${PHYS_SYSROOT} init-fs ${PHYS_SYSROOT}
@@ -96,13 +95,15 @@ IMAGE_CMD_otaimg () {
96 95
97 # Copy deployment /home and /var/sota to sysroot 96 # Copy deployment /home and /var/sota to sysroot
98 HOME_TMP=`mktemp -d ${WORKDIR}/home-tmp-XXXXX` 97 HOME_TMP=`mktemp -d ${WORKDIR}/home-tmp-XXXXX`
99 tar --xattrs --xattrs-include='*' -C ${HOME_TMP} -xf ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.rootfs.ostree.tar.bz2 ./usr/homedirs ./var/sota ./var/local || true 98 tar --xattrs --xattrs-include='*' -C ${HOME_TMP} -xf ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.rootfs.ostree.tar.bz2 ./usr/homedirs ./var/local || true
100 mv ${HOME_TMP}/var/sota ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/ || true 99
101 mv ${HOME_TMP}/var/local ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/ || true 100 cp -a ${IMAGE_ROOTFS}/var/sota ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/ || true
102 # Create /var/sota if it doesn't exist yet 101 # Create /var/sota if it doesn't exist yet
103 mkdir -p ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/sota || true 102 mkdir -p ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/sota || true
104 # Ensure the permissions are correctly set 103 # Ensure the permissions are correctly set
105 chmod 700 ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/sota 104 chmod 700 ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/sota
105
106 mv ${HOME_TMP}/var/local ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/ || true
106 mv ${HOME_TMP}/usr/homedirs/home ${PHYS_SYSROOT}/ || true 107 mv ${HOME_TMP}/usr/homedirs/home ${PHYS_SYSROOT}/ || true
107 # Ensure that /var/local exists (AGL symlinks /usr/local to /var/local) 108 # Ensure that /var/local exists (AGL symlinks /usr/local to /var/local)
108 install -d ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/local 109 install -d ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/local
@@ -112,7 +113,6 @@ IMAGE_CMD_otaimg () {
112 target_version=${GARAGE_TARGET_VERSION} 113 target_version=${GARAGE_TARGET_VERSION}
113 fi 114 fi
114 echo "{\"${ostree_target_hash}\":\"${GARAGE_TARGET_NAME}-${target_version}\"}" > ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/sota/installed_versions 115 echo "{\"${ostree_target_hash}\":\"${GARAGE_TARGET_NAME}-${target_version}\"}" > ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/sota/installed_versions
115
116 rm -rf ${HOME_TMP} 116 rm -rf ${HOME_TMP}
117 117
118 # Calculate image type 118 # Calculate image type