diff --git a/README.md b/README.md index 8de0dfd..bac3145 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ ls buildroot/output_build/images/ # Find the file ending in *.raucb # You can also just flash MynaPlayer.img using dd but it takes a long time -mv buildroot/output_build/images/bundle-MynaPlayer-2020-08-06.fe2ca3ce-be36-4f33-94d4-e295cd0518be.raucb /var/www/www.jookia.org/ +mv buildroot/output_build/images/bundle-MynaPlayer.2020-09-06.raucb /var/www/www.jookia.org/ cp $PWD/easy-rsa/pki/ca.crt /var/www/www.jookia.org/ chmod a+r /var/www/www.jookia.org/ca.crt ``` @@ -105,11 +105,16 @@ wget 'https://www.jookia.org/ca.crt' cp /etc/rauc/keyring.pem{,.bak} mv ca.crt /etc/rauc/keyring.pem -rauc install https://www.jookia.org/bundle-MynaPlayer-2020-08-06.fe2ca3ce-be36-4f33-94d4-e295cd0518be.raucb +rauc install https://www.jookia.org/bundle-MynaPlayer.2020-09-06.raucb mv /etc/rauc/keyring.pem{.bak,} reboot ``` +* Notes: + * The bundle file name is derived from git describe, and might differ slightly if you use a branch with committed but not yet released work. E.g: bundle-MynaPlayer.2020-09-06-18-g3d0589f.raucb. + * If you have uncommitted work present in your branch, then the file name will have a 'dirty' tag added. + * If your git index and cache become corrupted for any reason, your bundle will have a 'broken' tag added. This doesn't indicate by any means that your image is broken! + Future updates won't need to copy the keyring, a single 'rauc install' invocation should download and install the image without trouble. diff --git a/board/myna-player-odyssey/scripts/rootfs_postimage.sh b/board/myna-player-odyssey/scripts/rootfs_postimage.sh index ab994de..67a85e0 100755 --- a/board/myna-player-odyssey/scripts/rootfs_postimage.sh +++ b/board/myna-player-odyssey/scripts/rootfs_postimage.sh @@ -8,16 +8,14 @@ mkfs.ext4 -F "${BINARIES_DIR}/rauc.ext4" # prepare for genimage - +cd "${BINARIES_DIR}" export GENIMAGE_TMP=${BR2_EXTERNAL_MynaPlayer_PATH}/board/myna-player-odyssey/utilities/genimage.tmp GENIMAGE_CFG="${BR2_EXTERNAL_MynaPlayer_PATH}/board/myna-player-odyssey/utilities/genimage.cfg" -export GENIMAGE_DATE=$(date -Idate) export GENIMAGE_USER=$(whoami) export GENIMAGE_HOST=$(hostname) -export GENIMAGE_BUILD_ID=$(uuidgen) +export GENIMAGE_BUILD_ID=$(git describe --dirty --broken) envsubst \ -\$GENIMAGE_DATE,\ \$GENIMAGE_USER,\ \$GENIMAGE_HOST,\ \$GENIMAGE_BUILD_ID \ diff --git a/board/myna-player-odyssey/utilities/genimage.tmp b/board/myna-player-odyssey/utilities/genimage.tmp index 51a102e..4c883dc 100644 --- a/board/myna-player-odyssey/utilities/genimage.tmp +++ b/board/myna-player-odyssey/utilities/genimage.tmp @@ -1,5 +1,5 @@ image MynaPlayer.img { - name = "MynaPlayer-${GENIMAGE_DATE}" + name = "MynaPlayer-${GENIMAGE_BUILD_ID}" hdimage { gpt = "true" } @@ -37,8 +37,8 @@ } } -image bundle-MynaPlayer-${GENIMAGE_DATE}.${GENIMAGE_BUILD_ID}.raucb { - name = "bundle-MynaPlayer-${GENIMAGE_DATE}" +image bundle-MynaPlayer.${GENIMAGE_BUILD_ID}.raucb { + name = "bundle-MynaPlayer-${GENIMAGE_BUILD_ID}" rauc { files = { "rootfs.tar.xz" @@ -49,9 +49,8 @@ manifest = "[update] compatible=LuminaSensum MynaPlayer - version=${GENIMAGE_DATE} - build=${GENIMAGE_BUILD_ID} - description=RAUC bundle for LuminaSensum MynaPlayer version ${GENIMAGE_DATE}, built by ${GENIMAGE_USER}@${GENIMAGE_HOST}. + version=${GENIMAGE_BUILD_ID} + description=RAUC bundle for LuminaSensum MynaPlayer version ${GENIMAGE_BUILD_ID}, built by ${GENIMAGE_USER}@${GENIMAGE_HOST}. [image.rootfs] filename=rootfs.tar.xz" }