Imported 23.10.8

No reason for CPC update specified.
This commit is contained in:
CloudBuilder 2023-08-02 11:51:09 +00:00
parent a497fcf67e
commit 2149b61789
3 changed files with 32 additions and 61 deletions

13
debian/changelog vendored
View File

@ -1,3 +1,16 @@
livecd-rootfs (23.10.8) mantic; urgency=medium
[ Heinrich Schuchardt ]
* risc-v: increase loader2 partition for VisionFive 2. EDK II is available
for the StarFive VisionFive 2 board. As it is larger than U-Boot we need
to increase the size of the loader 2 partition to accommodate it.
[ Michael Hudson-Doyle ]
* lb_chroot_layered: use rsync to make more minimal overlay layers.
(LP: #2028213)
-- Michael Hudson-Doyle <michael.hudson@ubuntu.com> Wed, 02 Aug 2023 13:19:29 +1200
livecd-rootfs (23.10.7) mantic; urgency=medium livecd-rootfs (23.10.7) mantic; urgency=medium
* Actually fix live-build/ubuntu-cpc/hooks.d/base/disk-image.binary to not * Actually fix live-build/ubuntu-cpc/hooks.d/base/disk-image.binary to not

View File

@ -107,57 +107,6 @@ lb_chroot_includes () {
cd "${OLDPWD}" cd "${OLDPWD}"
} }
reduce_pass_size () {
# Remove duplicated files between parent and current pass
# Note the empty directories created in a child pass are not removed
local pass=$1
local parent="$(get_parent_pass $pass)"
$(is_root_layer $pass) && return
pass_dir="overlay.${pass}"
parent_pass_dir="overlay.${parent}"
local list_pass=$(mktemp)
local list_parent=$(mktemp)
(cd $pass_dir && find . ! -type d -printf "%h/%f|%s|%y|%U|%G|%m\n"|sort > $list_pass)
(cd $parent_pass_dir && find . ! -type d -printf "%h/%f|%s|%y|%U|%G|%m\n"|sort > $list_parent)
# Only iterate on common files with same type, owner, permission and size
comm -12 $list_pass $list_parent|cut -d'|' -f1|while read f; do
# If file contents are different, keep it
if ! diff --brief --no-dereference "$pass_dir/$f" "$parent_pass_dir/$f" >/dev/null; then
continue
fi
p="$(dirname "$f")"
while [ "$p" != . ]; do
# As explained in the overlayfs documentation
# https://www.kernel.org/doc/html/latest/filesystems/overlayfs.html#whiteouts-and-opaque-directories
# an xattr of trusted.overlay.opaque indicates an 'opaque' directory
# that was deleted from the overlay. Removing files from within the
# directory, even if identical with one in the lower layer, will result
# in it going missing from the combined filesystem.
#
# It would be possible to be more clever, e.g. if the two directories
# are still similar, we could the delete the attribute and convert any
# still-needed deletions to whiteouts but it doesn't seem worth it in
# the cases seen so far.
if [ -n "$(getfattr -n trusted.overlay.opaque -h --only-values -- "$pass_dir/$p" 2>/dev/null)" ]; then
Echo_message "reduce_pass_size: '%s' would be removed from overlay but for trusted.overlay.opaque on '%s'" "$f" "$p"
continue 2
fi
p="$(dirname "$p")"
done
# Files are strictly identical between the 2 passes (only mod or access times differs). No need for unused delta.
Echo_message "reduce_pass_size: '%s' is strictly identical between %s and %s. Removing." "$f" "$pass" "$parent"
rm "$pass_dir/$f"
done
rm $list_pass
rm $list_parent
}
create_chroot_pass () { create_chroot_pass () {
local pass=$1 local pass=$1
shift 1 # restore ${*} shift 1 # restore ${*}
@ -182,8 +131,8 @@ create_chroot_pass () {
mkdir -p "$overlay_dir/" mkdir -p "$overlay_dir/"
lowerdirs=$(get_lowerdirs_for_pass $pass) lowerdirs=$(get_lowerdirs_for_pass $pass)
if [ -n "$lowerdirs" ]; then if [ -n "$lowerdirs" ]; then
mkdir -p chroot/ mkdir -p chroot "${overlay_dir}-initial"
mount_overlay "$lowerdirs" "$overlay_dir" chroot/ mount_overlay "$lowerdirs" "${overlay_dir}-initial" chroot/
else else
ln -s "$overlay_dir/" chroot ln -s "$overlay_dir/" chroot
fi fi
@ -319,13 +268,22 @@ create_chroot_pass () {
lb chroot_devpts remove ${*} lb chroot_devpts remove ${*}
if [ -n "$lowerdirs" ]; then if [ -n "$lowerdirs" ]; then
umount chroot # Although the current chroot was created as an overlay over
rmdir chroot # the previous layer, many operations can result in redundant
# files in the upperdir. Rather than trying to minimize the
# overlay by hand, we rsync the chroot into a fresh overlay,
# rely on rsyncs ability to avoid redundant file operations,
# and take _that_ overlay's upperdir as the content of the
# layer.
mkdir chroot-2
mount_overlay "$lowerdirs" "$overlay_dir" chroot-2/
rsync -aXHAS --del chroot/ chroot-2/
umount chroot chroot-2
rmdir chroot chroot-2
rm -rf ${overlay_dir}-initial
else else
rm chroot rm chroot
fi fi
reduce_pass_size $pass
} }
if [ ! -d chroot.bootstrap/ ]; then if [ ! -d chroot.bootstrap/ ]; then

View File

@ -139,15 +139,15 @@ create_partitions() {
--new=13:4096:8191 \ --new=13:4096:8191 \
--typecode=13:2E54B353-1271-4842-806F-E436D6AF6985 \ --typecode=13:2E54B353-1271-4842-806F-E436D6AF6985 \
--change-name=13:loader1 \ --change-name=13:loader1 \
--new=2:8192:16383 \ --new=2:8192:40959 \
--typecode=2:7a097280-70d2-44bc-886c-ff5ffbb7b098 \ --typecode=2:7a097280-70d2-44bc-886c-ff5ffbb7b098 \
--change-name=2:loader2 \ --change-name=2:loader2 \
--new=12:16384:24575 \ --new=12:40960:49151 \
--change-name=12:CIDATA \ --change-name=12:CIDATA \
--new=15:24576:229375 \ --new=15:49152:253951 \
--typecode=15:ef00 \ --typecode=15:ef00 \
--change-name=15:ESP \ --change-name=15:ESP \
--new=1:229376: \ --new=1:253952: \
--attributes=1:set:2 --attributes=1:set:2
else else
# preinstalled server, currently FU540 # preinstalled server, currently FU540