Update cloud-init scripts and documentation for enhanced DNS management and provisioning steps</message>
<message>Modify the first-boot.sh script to include an additional step for managing screen brightness during the provisioning process. Update user-data.bootstrap to improve DNS configuration by ensuring NetworkManager manages /etc/resolv.conf correctly, and remove obsolete scripts related to systemd-resolved. Enhance documentation to reflect these changes and clarify the setup process for users, improving overall network boot functionality and user experience.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
# Mount a Raspberry Pi OS .img or .img.xz, edit cloud-init NoCloud files on the boot
|
||||
# partition, then unmount and (if .img.xz) recompress. Requires sudo for loop/mount.
|
||||
# partition, then unmount and (if .img.xz) recompress to a NEW file with current
|
||||
# date/time prefix. Original image is never overwritten. Requires sudo for loop/mount.
|
||||
#
|
||||
# Usage:
|
||||
# ./edit-cloudinit-on-image.sh <path-to-image.img.xz>
|
||||
@@ -13,7 +14,7 @@
|
||||
# Example:
|
||||
# ./edit-cloudinit-on-image.sh /path/to/gnss-bootstrap-20260223-215010.img.xz
|
||||
#
|
||||
# Backup the image before running if you want to keep the original.
|
||||
# The original image is preserved; output uses a new timestamp (e.g. gnss-bootstrap-20250305-143022.img.xz).
|
||||
|
||||
set -e
|
||||
|
||||
@@ -118,10 +119,19 @@ sudo losetup -d "$LOOP"
|
||||
LOOP=""
|
||||
|
||||
if [[ -n "$ORIGINAL_XZ" && -z "$NO_RECOMPRESS" ]]; then
|
||||
echo "Recompressing to $(basename "$ORIGINAL_XZ")…"
|
||||
ORIG_DIR="$(dirname "$ORIGINAL_XZ")"
|
||||
ORIG_BASE="$(basename "$ORIGINAL_XZ" .img.xz)"
|
||||
if [[ "$ORIG_BASE" =~ ^(.+)-[0-9]{8}-[0-9]{6}$ ]]; then
|
||||
BASE_NAME="${BASH_REMATCH[1]}"
|
||||
else
|
||||
BASE_NAME="$ORIG_BASE"
|
||||
fi
|
||||
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
|
||||
NEW_IMG_XZ="$ORIG_DIR/${BASE_NAME}-${TIMESTAMP}.img.xz"
|
||||
echo "Recompressing to $(basename "$NEW_IMG_XZ")…"
|
||||
xz -T 0 -z -f -k "$IMG_FILE"
|
||||
mv -f "${IMG_FILE}.xz" "$ORIGINAL_XZ"
|
||||
echo "Done. Updated: $ORIGINAL_XZ"
|
||||
mv -f "${IMG_FILE}.xz" "$NEW_IMG_XZ"
|
||||
echo "Done. New image (original unchanged): $NEW_IMG_XZ"
|
||||
rm -rf "$WORK_DIR"
|
||||
WORK_DIR=""
|
||||
elif [[ -n "$NO_RECOMPRESS" && -n "$ORIGINAL_XZ" ]]; then
|
||||
|
||||
Reference in New Issue
Block a user