diff --git a/export-noobs/00-release/00-run.sh b/export-noobs/00-release/00-run.sh index 18a3a5d..c2a4a51 100755 --- a/export-noobs/00-release/00-run.sh +++ b/export-noobs/00-release/00-run.sh @@ -37,6 +37,7 @@ 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|RELEASE|${RELEASE}|" +sed "${NOOBS_DIR}/os.json" -i -e "s|KERNEL|$(cat "${STAGE_WORK_DIR}/kernel_version")|" sed "${NOOBS_DIR}/release_notes.txt" -i -e "s|UNRELEASED|${IMG_DATE}|" diff --git a/export-noobs/00-release/files/os.json b/export-noobs/00-release/files/os.json index e231238..6cc0e36 100644 --- a/export-noobs/00-release/files/os.json +++ b/export-noobs/00-release/files/os.json @@ -1,7 +1,7 @@ { "description": "NOOBS_DESCRIPTION", "feature_level": 35120124, - "kernel": "4.19", + "kernel": "KERNEL", "name": "NOOBS_NAME", "password": "raspberry", "release_date": "UNRELEASED", diff --git a/export-noobs/prerun.sh b/export-noobs/prerun.sh index c161ee6..3ac53c4 100755 --- a/export-noobs/prerun.sh +++ b/export-noobs/prerun.sh @@ -53,6 +53,9 @@ 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" +KERNEL_VER="$(zgrep -oPm 1 "Linux version \K(.*)$" "${STAGE_WORK_DIR}/rootfs/usr/share/doc/raspberrypi-kernel/changelog.Debian.gz" | cut -f-2 -d.)" +echo "$KERNEL_VER" > "${STAGE_WORK_DIR}/kernel_version" + bsdtar --numeric-owner --format gnutar -C "${STAGE_WORK_DIR}/rootfs/boot" -cpf - . | xz -T0 > "${NOOBS_DIR}/boot.tar.xz" umount "${STAGE_WORK_DIR}/rootfs/boot" bsdtar --numeric-owner --format gnutar -C "${STAGE_WORK_DIR}/rootfs" --one-file-system -cpf - . | xz -T0 > "${NOOBS_DIR}/root.tar.xz"