Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clean installation artifacts #192

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions debian/scripts/networking.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ rm -f /etc/cloud/cloud.cfg.d/subiquity-disable-cloudinit-networking.cfg
rm -f /etc/cloud/cloud.cfg.d/99-installer.cfg
rm -f /etc/cloud/ds-identify.cfg

rm -f /var/log/cloud-init*.log
rm -rf /var/lib/cloud/instances \
/var/lib/cloud/instance

# Install a dpkg-query wrapper to bypass MAAS netplan.io check
cat > /usr/local/bin/dpkg-query <<EOF
#!/bin/sh
Expand Down
16 changes: 15 additions & 1 deletion scripts/fuse-tar-root
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ BOOT_MOUNT=${TMP_DIR}/boot
echo 'Mounting root partition...'
mount_part "${ROOT_PARTITION}" "${ROOT_MOUNT}"

if [ -f "$ROOT_MOUNT/etc/machine-id" ]; then
echo 'reseting machine-id...'
: >| "$ROOT_MOUNT/etc/machine-id"
fi

if [ -f "$ROOT_MOUNT/var/lib/cloud/instance" ]; then
echo 'cleaning cloud-init state...'
rm -f "$ROOT_MOUNT/var/log/cloud-init*.log" \
"$ROOT_MOUNT/var/lib/cloud/instance"
rm -rf "$ROOT_MOUNT/var/lib/cloud/instances"
fi

if [ -d curtin ] || [ -d "$CURTIN_HOOKS" ]; then
echo 'Adding Curtin hooks...'
Expand All @@ -35,7 +46,10 @@ fi

echo "Creating MAAS image ${OUTPUT}..."
TARFILE=${OUTPUT%*.gz}
tar -Scpf "${TARFILE}" --acls --selinux --xattrs -C "$ROOT_MOUNT" .
tar -Scpf "${TARFILE}" --acls --selinux --xattrs \
--one-file-system \
--exclude-backups \
-C "$ROOT_MOUNT" .

if [ "${DETECT_BLS_BOOT}" -eq 1 ]; then
echo "auto-detecting 'bls_boot' partition"
Expand Down
4 changes: 0 additions & 4 deletions ubuntu/scripts/cloudimg/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
# cloud-init put networking in place on initial boot. Let's remove that, to
# allow MAAS to configure the networking on deploy.
rm /etc/netplan/50-cloud-init.yaml
: >| /etc/machine-id
rm -f /var/log/cloud-init*.log
rm -rf /var/lib/cloud/instances \
/var/lib/cloud/instance

# Everything in /run/packer_backup should be restored.
find /run/packer_backup
Expand Down
5 changes: 0 additions & 5 deletions ubuntu/scripts/networking.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,3 @@ rm -f /etc/cloud/cloud.cfg.d/subiquity-disable-cloudinit-networking.cfg
rm -f /etc/cloud/cloud.cfg.d/99-installer.cfg
rm -f /etc/cloud/ds-identify.cfg
rm -f /etc/netplan/00-installer-config.yaml
: >| /etc/machine-id

rm -f /var/log/cloud-init*.log
rm -rf /var/lib/cloud/instances \
/var/lib/cloud/instance