diff options
Diffstat (limited to 'export-noobs')
-rwxr-xr-x | export-noobs/00-release/00-run.sh | 44 | ||||
-rwxr-xr-x | export-noobs/prerun.sh | 30 |
2 files changed, 37 insertions, 37 deletions
diff --git a/export-noobs/00-release/00-run.sh b/export-noobs/00-release/00-run.sh index 25f62fd..5874944 100755 --- a/export-noobs/00-release/00-run.sh +++ b/export-noobs/00-release/00-run.sh @@ -2,35 +2,35 @@ NOOBS_DIR="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}" -install -v -m 744 files/partition_setup.sh ${NOOBS_DIR}/ -install -v files/partitions.json ${NOOBS_DIR}/ -install -v files/os.json ${NOOBS_DIR}/ -install -v files/OS.png ${NOOBS_DIR}/ -install -v files/release_notes.txt ${NOOBS_DIR}/ +install -v -m 744 files/partition_setup.sh "${NOOBS_DIR}/" +install -v files/partitions.json "${NOOBS_DIR}/" +install -v files/os.json "${NOOBS_DIR}/" +install -v files/OS.png "${NOOBS_DIR}/" +install -v files/release_notes.txt "${NOOBS_DIR}/" -tar -v -c -C files/marketing -f ${NOOBS_DIR}/marketing.tar . +tar -v -c -C files/marketing -f "${NOOBS_DIR}/marketing.tar" . -BOOT_SIZE=$(xz --robot -l ${NOOBS_DIR}/boot.tar.xz | grep totals | cut -f 5) -ROOT_SIZE=$(xz --robot -l ${NOOBS_DIR}/root.tar.xz | grep totals | cut -f 5) +BOOT_SIZE="$(xz --robot -l "${NOOBS_DIR}/boot.tar.xz" | grep totals | cut -f 5)" +ROOT_SIZE="$(xz --robot -l "${NOOBS_DIR}/root.tar.xz" | grep totals | cut -f 5)" -BOOT_SIZE=$(expr ${BOOT_SIZE} / 1000000 \+ 1) -ROOT_SIZE=$(expr ${ROOT_SIZE} / 1000000 \+ 1) +BOOT_SIZE="$(( BOOT_SIZE / 1000000 + 1))" +ROOT_SIZE="$(( ROOT_SIZE / 1000000 + 1))" -BOOT_NOM=$(expr ${BOOT_SIZE} \* 3) -ROOT_NOM=$(expr ${ROOT_SIZE} \+ 400) +BOOT_NOM="$(( BOOT_SIZE * 3 ))" +ROOT_NOM="$(( ROOT_SIZE + 400 ))" -mv "${NOOBS_DIR}/OS.png" "${NOOBS_DIR}/$(echo ${NOOBS_NAME} | sed 's/ /_/g').png" +mv "${NOOBS_DIR}/OS.png" "${NOOBS_DIR}/${NOOBS_NAME// /_}.png" -sed ${NOOBS_DIR}/partitions.json -i -e "s|BOOT_SIZE|${BOOT_SIZE}|" -sed ${NOOBS_DIR}/partitions.json -i -e "s|ROOT_SIZE|${ROOT_SIZE}|" +sed "${NOOBS_DIR}/partitions.json" -i -e "s|BOOT_SIZE|${BOOT_SIZE}|" +sed "${NOOBS_DIR}/partitions.json" -i -e "s|ROOT_SIZE|${ROOT_SIZE}|" -sed ${NOOBS_DIR}/partitions.json -i -e "s|BOOT_NOM|${BOOT_NOM}|" -sed ${NOOBS_DIR}/partitions.json -i -e "s|ROOT_NOM|${ROOT_NOM}|" +sed "${NOOBS_DIR}/partitions.json" -i -e "s|BOOT_NOM|${BOOT_NOM}|" +sed "${NOOBS_DIR}/partitions.json" -i -e "s|ROOT_NOM|${ROOT_NOM}|" -sed ${NOOBS_DIR}/os.json -i -e "s|UNRELEASED|${IMG_DATE}|" -sed ${NOOBS_DIR}/os.json -i -e "s|NOOBS_NAME|${NOOBS_NAME}|" -sed ${NOOBS_DIR}/os.json -i -e "s|NOOBS_DESCRIPTION|${NOOBS_DESCRIPTION}|" +sed "${NOOBS_DIR}/os.json" -i -e "s|UNRELEASED|${IMG_DATE}|" +sed "${NOOBS_DIR}/os.json" -i -e "s|NOOBS_NAME|${NOOBS_NAME}|" +sed "${NOOBS_DIR}/os.json" -i -e "s|NOOBS_DESCRIPTION|${NOOBS_DESCRIPTION}|" -sed ${NOOBS_DIR}/release_notes.txt -i -e "s|UNRELEASED|${IMG_DATE}|" +sed "${NOOBS_DIR}/release_notes.txt" -i -e "s|UNRELEASED|${IMG_DATE}|" -cp -a ${NOOBS_DIR} ${DEPLOY_DIR}/ +cp -a "${NOOBS_DIR}" "${DEPLOY_DIR}/" diff --git a/export-noobs/prerun.sh b/export-noobs/prerun.sh index dafe654..1889567 100755 --- a/export-noobs/prerun.sh +++ b/export-noobs/prerun.sh @@ -2,14 +2,14 @@ IMG_FILE="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.img" NOOBS_DIR="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}" -unmount_image ${IMG_FILE} +unmount_image "${IMG_FILE}" -mkdir -p ${STAGE_WORK_DIR} -cp ${WORK_DIR}/export-image/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.img ${STAGE_WORK_DIR}/ +mkdir -p "${STAGE_WORK_DIR}" +cp "${WORK_DIR}/export-image/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.img" "${STAGE_WORK_DIR}/" -rm -rf ${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX} +rm -rf "${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}" -PARTED_OUT=$(parted -s ${IMG_FILE} unit b print) +PARTED_OUT=$(parted -s "${IMG_FILE}" unit b print) BOOT_OFFSET=$(echo "$PARTED_OUT" | grep -e '^ 1'| xargs echo -n \ | cut -d" " -f 2 | tr -d B) BOOT_LENGTH=$(echo "$PARTED_OUT" | grep -e '^ 1'| xargs echo -n \ @@ -20,21 +20,21 @@ ROOT_OFFSET=$(echo "$PARTED_OUT" | grep -e '^ 2'| xargs echo -n \ ROOT_LENGTH=$(echo "$PARTED_OUT" | grep -e '^ 2'| xargs echo -n \ | cut -d" " -f 4 | tr -d B) -BOOT_DEV=$(losetup --show -f -o ${BOOT_OFFSET} --sizelimit ${BOOT_LENGTH} ${IMG_FILE}) -ROOT_DEV=$(losetup --show -f -o ${ROOT_OFFSET} --sizelimit ${ROOT_LENGTH} ${IMG_FILE}) +BOOT_DEV=$(losetup --show -f -o "${BOOT_OFFSET}" --sizelimit "${BOOT_LENGTH}" "${IMG_FILE}") +ROOT_DEV=$(losetup --show -f -o "${ROOT_OFFSET}" --sizelimit "${ROOT_LENGTH}" "${IMG_FILE}") echo "/boot: offset $BOOT_OFFSET, length $BOOT_LENGTH" echo "/: offset $ROOT_OFFSET, length $ROOT_LENGTH" -mkdir -p ${STAGE_WORK_DIR}/rootfs -mkdir -p ${NOOBS_DIR} +mkdir -p "${STAGE_WORK_DIR}/rootfs" +mkdir -p "${NOOBS_DIR}" -mount $ROOT_DEV ${STAGE_WORK_DIR}/rootfs -mount $BOOT_DEV ${STAGE_WORK_DIR}/rootfs/boot +mount "$ROOT_DEV" "${STAGE_WORK_DIR}/rootfs" +mount "$BOOT_DEV" "${STAGE_WORK_DIR}/rootfs/boot" ln -sv "/lib/systemd/system/apply_noobs_os_config.service" "$ROOTFS_DIR/etc/systemd/system/multi-user.target.wants/apply_noobs_os_config.service" -bsdtar --numeric-owner --format gnutar --use-compress-program pxz -C ${STAGE_WORK_DIR}/rootfs/boot -cpf ${NOOBS_DIR}/boot.tar.xz . -umount ${STAGE_WORK_DIR}/rootfs/boot -bsdtar --numeric-owner --format gnutar --use-compress-program pxz -C ${STAGE_WORK_DIR}/rootfs --one-file-system -cpf ${NOOBS_DIR}/root.tar.xz . +bsdtar --numeric-owner --format gnutar --use-compress-program pxz -C "${STAGE_WORK_DIR}/rootfs/boot" -cpf "${NOOBS_DIR}/boot.tar.xz" . +umount "${STAGE_WORK_DIR}/rootfs/boot" +bsdtar --numeric-owner --format gnutar --use-compress-program pxz -C "${STAGE_WORK_DIR}/rootfs" --one-file-system -cpf "${NOOBS_DIR}/root.tar.xz" . -unmount_image ${IMG_FILE} +unmount_image "${IMG_FILE}" |