Fixed Debian13 containers being unable to start after upgrade

* This was caused by outdated SystemD generator, this file will be updated when upgrading the container
This commit is contained in:
2026-01-11 17:46:41 +01:00
parent d51a694daa
commit 376b1dfa7c
3 changed files with 25 additions and 2 deletions

View File

@@ -60,6 +60,15 @@ if $DoDebianReleaseUpdate; then
* ) echo "Choose yes or no.";; * ) echo "Choose yes or no.";;
esac esac
done done
if [ "${NewDebianVersion}" = "trixie" ]; then
curl -o /tmp/lxc.generator "https://raw.githubusercontent.com/lxc/distrobuilder/refs/heads/main/distrobuilder/lxc.generator"
# Check if the download was successful
if [ $? -ne 0 ]; then
echo "Downloading of lxc.generator from github failed. Exiting."
exit 1
fi
fi
fi fi
if $DoAlpineReleaseUpdate; then if $DoAlpineReleaseUpdate; then
echo "Enter the Alpine version to upgrade to" echo "Enter the Alpine version to upgrade to"

View File

@@ -78,6 +78,15 @@ if [[ "${DIST}" == *"debian"* ]]; then
* ) echo "Choose yes or no.";; * ) echo "Choose yes or no.";;
esac esac
done done
if [ "${NewDebianVersion}" = "trixie" ]; then
curl -o /tmp/lxc.generator "https://raw.githubusercontent.com/lxc/distrobuilder/refs/heads/main/distrobuilder/lxc.generator"
# Check if the download was successful
if [ $? -ne 0 ]; then
echo "Downloading of lxc.generator from github failed. Exiting."
exit 1
fi
fi
elif [[ "${DIST}" == *"alpine"* ]]; then elif [[ "${DIST}" == *"alpine"* ]]; then
#Ask the wanted Alpine version #Ask the wanted Alpine version
DoAlpineReleaseUpdate=true DoAlpineReleaseUpdate=true

View File

@@ -182,6 +182,7 @@ UpgradeRelease () {
DOREBOOT=true DOREBOOT=true
# Post release cleanup if required # Post release cleanup if required
if [ "${NewDebianVersion}" = "trixie" ]; then PostDebianTrixieTasks; fi if [ "${NewDebianVersion}" = "trixie" ]; then PostDebianTrixieTasks; fi
if [ "${NewDebianVersion}" = "trixie" ]; then CTOnlyPostDebianTrixieTasks; fi
else else
echo "Notice: Skiped, already up-to-date" echo "Notice: Skiped, already up-to-date"
fi fi
@@ -260,13 +261,17 @@ PostDebianTrixieTasks () {
$INSTCALL -- apt modernize-sources -y $INSTCALL -- apt modernize-sources -y
$INSTCALL -- rm -f /etc/apt/sources.list.bak $INSTCALL -- rm -f /etc/apt/sources.list.bak
$INSTCALL -- rm -f /etc/apt/sources.list.d/*.bak $INSTCALL -- rm -f /etc/apt/sources.list.d/*.bak
$INSTCALL -- systemctl mask tmp.mount
}
CTOnlyPostDebianTrixieTasks () {
# Disable unwanted mounts # Disable unwanted mounts
$INSTCALL -- systemctl mask dev-mqueue.mount $INSTCALL -- systemctl mask dev-mqueue.mount
$INSTCALL -- systemctl mask run-lock.mount $INSTCALL -- systemctl mask run-lock.mount
$INSTCALL -- systemctl mask sys-kernel-config.mount $INSTCALL -- systemctl mask sys-kernel-config.mount
$INSTCALL -- systemctl mask sys-kernel-debug.mount $INSTCALL -- systemctl mask sys-kernel-debug.mount
$INSTCALL -- systemctl mask tmp.mount $INSTCALL -- rm /etc/systemd/system-generators/lxc
pct push $CTID /tmp/lxc.generator /etc/systemd/system-generators/lxc --perms 755
} }
PostAlpine323Tasks () { PostAlpine323Tasks () {