Skip to content

Commit

Permalink
Some minor housekeeping, updated copyright
Browse files Browse the repository at this point in the history
years, added some comments and moved clean-up
commands to its respective script.
  • Loading branch information
alanbach committed Nov 10, 2023
1 parent 1139a1c commit f91a642
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 5 additions & 1 deletion ubuntu/scripts/cloudimg/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# cleanup.sh - Clean up what we did to be able to build the image.
#
# Copyright (C) 2022 Canonical
# Copyright (C) 2023 Canonical
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
Expand Down Expand Up @@ -32,3 +32,7 @@ sed -i s/^root:[^:]*/root:*/ /etc/shadow
rm -r /root/.ssh
rm -r /root/.cache
rm -r /etc/ssh/ssh_host_*

# Final Clean-up
apt-get autoremove --purge -yq
apt-get clean -yq
7 changes: 4 additions & 3 deletions ubuntu/scripts/cloudimg/setup-boot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# setup-boot.sh - Set up the image after initial boot
#
# Copyright (C) 2022 Canonical
# Copyright (C) 2023 Canonical
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
Expand Down Expand Up @@ -31,9 +31,10 @@ fi
# Reset cloud-init, so that it can run again when MAAS deploy the image.
cloud-init clean --logs

# Update apt listins first as they might be stale
apt-get update -q

# The cloud image for qemu has a kernel already. Remove it, since the user
# should either install a kernel in the customize script, or let MAAS install
# the right kernel when deploying.
apt-get remove --purge -y linux-virtual 'linux-image-*'
apt-get autoremove --purge -yq
apt-get clean -yq
3 changes: 2 additions & 1 deletion ubuntu/scripts/setup-bootloader
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Author: Alexsander de Souza <[email protected]>
#
# Copyright (C) 2021 Canonical
# Copyright (C) 2023 Canonical
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
Expand All @@ -25,6 +25,7 @@ export DEBIAN_FRONTEND=noninteractive
rm /var/cache/debconf/config.dat
dpkg --configure -a

# Ensure the existence of linux-image-generic for non-cloudimg images.
apt-get -y install linux-image-generic

grub-install \
Expand Down

0 comments on commit f91a642

Please sign in to comment.