summaryrefslogtreecommitdiff
path: root/export-image
diff options
context:
space:
mode:
authorSerge Schneider <serge@raspberrypi.org>2017-07-12 12:29:57 +0100
committerSerge Schneider <serge@raspberrypi.org>2017-07-28 13:35:46 +0100
commit7149e20f2d919efdafc325602c373aee35b27023 (patch)
tree2aa8035f0e05266a16b13d0a0fdea0fe6e2250ef /export-image
parent207003b5edfa33795a9886a5cb434b5079c9817b (diff)
export-image: generate .info file
Diffstat (limited to 'export-image')
-rwxr-xr-xexport-image/04-finalise/01-run.sh22
1 files changed, 21 insertions, 1 deletions
diff --git a/export-image/04-finalise/01-run.sh b/export-image/04-finalise/01-run.sh
index cc69dec..fefed50 100755
--- a/export-image/04-finalise/01-run.sh
+++ b/export-image/04-finalise/01-run.sh
@@ -1,6 +1,7 @@
#!/bin/bash -e
IMG_FILE="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.img"
+INFO_FILE="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.info"
on_chroot << EOF
/etc/init.d/fake-hwclock stop
@@ -47,6 +48,24 @@ update_issue $(basename ${EXPORT_DIR})
install -m 644 ${ROOTFS_DIR}/etc/rpi-issue ${ROOTFS_DIR}/boot/issue.txt
install files/LICENSE.oracle ${ROOTFS_DIR}/boot/
+
+cp "$ROOTFS_DIR/etc/rpi-issue" "$INFO_FILE"
+
+firmware=$(zgrep "firmware as of" "$ROOTFS_DIR/usr/share/doc/raspberrypi-kernel/changelog.Debian.gz" | \
+ head -n1 | \
+ sed -n 's|.* \([^ ]*\)$|\1|p')
+
+printf "\nFirmware: https://github.com/raspberrypi/firmware/tree/%s\n" "$firmware" >> "$INFO_FILE"
+
+kernel=$(curl -s -L "https://github.com/raspberrypi/firmware/raw/$firmware/extra/git_hash")
+printf "Kernel: https://github.com/raspberrypi/linux/tree/%s\n" "$kernel" >> "$INFO_FILE"
+
+uname=$(curl -s -L "https://github.com/raspberrypi/firmware/raw/$firmware/extra/uname_string7")
+printf "Uname string: %s\n" "$uname" >> "$INFO_FILE"
+
+printf "\nPackages:\n">> "$INFO_FILE"
+dpkg -l --root "$ROOTFS_DIR" >> "$INFO_FILE"
+
ROOT_DEV=$(mount | grep "${ROOTFS_DIR} " | cut -f1 -d' ')
unmount ${ROOTFS_DIR}
@@ -58,7 +77,8 @@ mkdir -p ${DEPLOY_DIR}
rm -f ${DEPLOY_DIR}/image_${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.zip
-echo zip ${DEPLOY_DIR}/image_${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.zip ${IMG_FILE}
pushd ${STAGE_WORK_DIR} > /dev/null
zip ${DEPLOY_DIR}/image_${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.zip $(basename ${IMG_FILE})
popd > /dev/null
+
+cp "$INFO_FILE" "$DEPLOY_DIR"