From 75022b2e1d7d9e07bcce802aaf58c5c9d343fd1e Mon Sep 17 00:00:00 2001 From: Braiden Vasco Date: Mon, 3 Jul 2017 11:31:42 +0000 Subject: [PATCH] Add comments --- build.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/build.sh b/build.sh index a3c6d8d..5936e6a 100755 --- a/build.sh +++ b/build.sh @@ -399,6 +399,9 @@ fi install -m 644 files/resolv.conf "$MOUNT_DIR/etc/" +## +# Store file system UUIDs to configuration files. +# IMGID="$(fdisk -l "$IMG_FILE" | sed -n 's/Disk identifier: 0x\([^ ]*\)/\1/p')" BOOT_PARTUUID="$IMGID-01" @@ -408,6 +411,9 @@ sed -i "s/BOOTDEV/PARTUUID=$BOOT_PARTUUID/" "$MOUNT_DIR/etc/fstab" sed -i "s/ROOTDEV/PARTUUID=$ROOT_PARTUUID/" "$MOUNT_DIR/etc/fstab" sed -i "s/ROOTDEV/PARTUUID=$ROOT_PARTUUID/" "$MOUNT_DIR/boot/cmdline.txt" +## +# Remove logs and backups, protect files. +# if [ -d "$MOUNT_DIR/home/$USERNAME/.config" ]; then chmod 700 "$MOUNT_DIR/home/$USERNAME/.config" fi @@ -444,19 +450,27 @@ done rm -f "$MOUNT_DIR/root/.vnc/private.key" +## # Allow services to start. +# rm -f "$MOUNT_DIR/usr/sbin/policy-rc.d" +## # Save fake hardware clock time for more realistic time after startup. +# chroot_mount 'fake-hwclock save' +## # Unmount all file systems and minimize image file for distribution. +# ROOT_DEV=$(mount | grep "$MOUNT_DIR " | cut -f1 -d ' ') unmount "$MOUNT_DIR" zerofree -v "$ROOT_DEV" unmount_image "$IMG_FILE" +## # Create zip archive with image file for distribution. +# rm -f "$ZIP_FILE" pushd $(dirname "$IMG_FILE") > /dev/null zip "$ZIP_FILE" $(basename "$IMG_FILE")