mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-08-14 18:24:15 +00:00
Imported 2.757
No reason for CPC update specified.
This commit is contained in:
parent
77c778b8fd
commit
ba34914299
14
debian/changelog
vendored
14
debian/changelog
vendored
@ -1,3 +1,17 @@
|
|||||||
|
livecd-rootfs (2.757) jammy; urgency=medium
|
||||||
|
|
||||||
|
[ Dave Jones ]
|
||||||
|
* Fix holes in swapfiles on pre-installed desktop images. Instead of
|
||||||
|
pre-allocating the swapfile in the image, allocate it on first boot and
|
||||||
|
use a systemd .swap unit to activate it (LP: #1961047)
|
||||||
|
|
||||||
|
[ Łukasz 'sil2100' Zemczak ]
|
||||||
|
* Use the 'classic' branch of the pi gadget for both classic and desktop
|
||||||
|
pi images by specifying the gadget make target during the gadget priming
|
||||||
|
phase.
|
||||||
|
|
||||||
|
-- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Tue, 22 Feb 2022 11:33:28 +0100
|
||||||
|
|
||||||
livecd-rootfs (2.756) jammy; urgency=medium
|
livecd-rootfs (2.756) jammy; urgency=medium
|
||||||
|
|
||||||
* Unset `initrdless_boot_fallback_triggered` in /boot/grub/grubenv instead
|
* Unset `initrdless_boot_fallback_triggered` in /boot/grub/grubenv instead
|
||||||
|
@ -101,7 +101,8 @@ if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then
|
|||||||
mv output/seed.manifest "$PREFIX".manifest
|
mv output/seed.manifest "$PREFIX".manifest
|
||||||
else
|
else
|
||||||
# First we need to build the gadget tree
|
# First we need to build the gadget tree
|
||||||
make -C "config/$PREFIX-gadget" ARCH=$ARCH SERIES=$SUITE
|
make -C "config/$PREFIX-gadget" \
|
||||||
|
ARCH=$ARCH SERIES=$SUITE $GADGET_TARGET
|
||||||
ubuntu-image classic $UBUNTU_IMAGE_ARGS \
|
ubuntu-image classic $UBUNTU_IMAGE_ARGS \
|
||||||
-s $SUITE -p $PROJECT -a $ARCH --subarch $SUBARCH \
|
-s $SUITE -p $PROJECT -a $ARCH --subarch $SUBARCH \
|
||||||
-O output config/$PREFIX-gadget/install
|
-O output config/$PREFIX-gadget/install
|
||||||
|
@ -507,9 +507,9 @@ case $IMAGEFORMAT in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
BRANCH="classic"
|
GADGET_TARGET="server"
|
||||||
if [ "$SUBPROJECT" = "desktop-preinstalled" ]; then
|
if [ "$SUBPROJECT" = "desktop-preinstalled" ]; then
|
||||||
BRANCH="desktop"
|
GADGET_TARGET="desktop"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS${SUBPROJECT:+ --subproject \"$SUBPROJECT\"}"
|
UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS${SUBPROJECT:+ --subproject \"$SUBPROJECT\"}"
|
||||||
@ -519,10 +519,12 @@ case $IMAGEFORMAT in
|
|||||||
# We need to look in two places for the gadget tree:
|
# We need to look in two places for the gadget tree:
|
||||||
# - Launchpad hosted gadgets will be in the snap-gadget repo
|
# - Launchpad hosted gadgets will be in the snap-gadget repo
|
||||||
# - Github hosted gadgets are mirrored into a github-mirror repo
|
# - Github hosted gadgets are mirrored into a github-mirror repo
|
||||||
|
BRANCH="classic"
|
||||||
git clone git://git.launchpad.net/~canonical-foundations/snap-$MODEL/+git/snap-$MODEL -b $BRANCH config/$PREFIX-gadget || git clone git://git.launchpad.net/~canonical-foundations/snap-$MODEL/+git/github-mirror -b $BRANCH config/$PREFIX-gadget || git clone git://git.launchpad.net/~canonical-foundations/snap-$MODEL/+git/github-mirror-$ARCH -b $BRANCH config/$PREFIX-gadget
|
git clone git://git.launchpad.net/~canonical-foundations/snap-$MODEL/+git/snap-$MODEL -b $BRANCH config/$PREFIX-gadget || git clone git://git.launchpad.net/~canonical-foundations/snap-$MODEL/+git/github-mirror -b $BRANCH config/$PREFIX-gadget || git clone git://git.launchpad.net/~canonical-foundations/snap-$MODEL/+git/github-mirror-$ARCH -b $BRANCH config/$PREFIX-gadget
|
||||||
|
|
||||||
echo "IMAGEFORMAT=$IMAGEFORMAT" >> config/common
|
echo "IMAGEFORMAT=$IMAGEFORMAT" >> config/common
|
||||||
echo "SUITE=$SUITE" >> config/common
|
echo "SUITE=$SUITE" >> config/common
|
||||||
|
echo "GADGET_TARGET=$GADGET_TARGET" >> config/common
|
||||||
echo "UBUNTU_IMAGE_ARGS=\"$UBUNTU_IMAGE_ARGS\"" >> config/common
|
echo "UBUNTU_IMAGE_ARGS=\"$UBUNTU_IMAGE_ARGS\"" >> config/common
|
||||||
|
|
||||||
echo "Configured ubuntu-image for the following gadget model: $MODEL"
|
echo "Configured ubuntu-image for the following gadget model: $MODEL"
|
||||||
|
@ -17,14 +17,69 @@ if [ "$IMAGEFORMAT" == "none" ]; then
|
|||||||
/usr/sbin/oem-config-prepare --quiet
|
/usr/sbin/oem-config-prepare --quiet
|
||||||
touch "/var/lib/oem-config/run"
|
touch "/var/lib/oem-config/run"
|
||||||
|
|
||||||
# Make the writable partition grow
|
# Update the fstab to include the "discard" option, and
|
||||||
echo "LABEL=writable / ext4 defaults,x-systemd.growfs 0 0" >>/etc/fstab
|
# "x-systemd.growfs" to ensure the root partition is expanded on first
|
||||||
|
# boot
|
||||||
|
awk \
|
||||||
|
-v root_fs_label="writable" \
|
||||||
|
-v root_fs_options="discard,x-systemd.growfs" \
|
||||||
|
'
|
||||||
|
BEGIN { OFS="\t"; count=0; }
|
||||||
|
|
||||||
# Create a 1GB swapfile
|
# Omit the "UNCONFIGURED" warning if it is still present
|
||||||
dd if=/dev/zero of=/swapfile bs=1G count=1
|
/^# UNCONFIGURED FSTAB/ { next; }
|
||||||
chmod 0600 /swapfile
|
|
||||||
mkswap /swapfile
|
|
||||||
|
|
||||||
echo "/swapfile none swap sw 0 0" >>/etc/fstab
|
# Only modify the first non-comment line where the second field is the
|
||||||
|
# root and omit multiple root definitions
|
||||||
|
/^[^#]/ && $2 == "/" {
|
||||||
|
if (!count) {
|
||||||
|
$1="LABEL=" root_fs_label;
|
||||||
|
$4=root_fs_options;
|
||||||
|
$6="1";
|
||||||
|
}
|
||||||
|
count++;
|
||||||
|
if (count > 1) next;
|
||||||
|
}
|
||||||
|
|
||||||
|
{ print; }
|
||||||
|
|
||||||
|
# If we reach the end without seeing a root mount line, add one
|
||||||
|
END {
|
||||||
|
if (!count) {
|
||||||
|
print "LABEL=" root_fs_label, "/", "ext4", root_fs_options, "0", "1";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
' /etc/fstab > /etc/fstab.new
|
||||||
|
mv /etc/fstab.new /etc/fstab
|
||||||
|
|
||||||
|
# Add units for a 1GiB swapfile, generated on first boot
|
||||||
|
cat << EOF > /lib/systemd/system/mkswap.service
|
||||||
|
[Unit]
|
||||||
|
Description=Create the default swapfile
|
||||||
|
DefaultDependencies=no
|
||||||
|
Requires=local-fs.target
|
||||||
|
After=local-fs.target
|
||||||
|
Before=swapfile.swap
|
||||||
|
ConditionPathExists=!/swapfile
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStartPre=fallocate -l 1GiB /swapfile
|
||||||
|
ExecStartPre=chmod 600 /swapfile
|
||||||
|
ExecStart=mkswap /swapfile
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=swap.target
|
||||||
|
EOF
|
||||||
|
cat << EOF > /lib/systemd/system/swapfile.swap
|
||||||
|
[Unit]
|
||||||
|
Description=The default swapfile
|
||||||
|
|
||||||
|
[Swap]
|
||||||
|
What=/swapfile
|
||||||
|
EOF
|
||||||
|
mkdir -p /lib/systemd/system/swap.target.wants
|
||||||
|
ln -s ../mkswap.service /lib/systemd/system/swap.target.wants/
|
||||||
|
ln -s ../swapfile.swap /lib/systemd/system/swap.target.wants/
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user