Imported 2.664.8

No reason for CPC update specified.
This commit is contained in:
CloudBuilder 2020-12-03 13:44:06 +00:00
parent 54aa3fec2a
commit 81ea1e273f
42 changed files with 164 additions and 11 deletions

24
debian/changelog vendored
View File

@ -1,3 +1,27 @@
livecd-rootfs (2.664.8) focal; urgency=medium
Backport snap-preseed work from groovy to focal LP: #1896755
[ Robert C Jennings ]
* Apply snap-preseed optimizations after seeding snaps
[ Dimitri John Ledkov ]
* live-server: remove duplicate snaps, due to overlayfs vs snap-preseed.
* apparmor: Add generic v5.4 kernel apparmor features
* apparmor: mount more up-to-date apparmor features in the chroot.
* seccomp: add more up-to-date seccomp actions
* seccomp: mount more up-to-date seccomp features
* apparmor: compile all profiles
[ Robert C Jennings ]
* Avoid rbind /sys for chroot snap pre-seeding (cgroups fail to unmount)
[ Dimitri John Ledkov ]
* auto/build: use setup|teardown_mountpoint to reduce duplication
* functions: provide nss_systemd-less nsswitch.conf in chroots.
-- Dimitri John Ledkov <xnox@ubuntu.com> Mon, 05 Oct 2020 10:33:02 +0100
livecd-rootfs (2.664.7) focal; urgency=medium livecd-rootfs (2.664.7) focal; urgency=medium
[ Stanislav German-Evtushenko <giner> / John Chittum ] [ Stanislav German-Evtushenko <giner> / John Chittum ]

View File

@ -0,0 +1,78 @@
query {label {multi_transaction {yes
}
data {yes
}
perms {allow deny audit quiet
}
}
}
dbus {mask {acquire send receive
}
}
signal {mask {hup int quit ill trap abrt bus fpe kill usr1 segv usr2 pipe alrm term stkflt chld cont stop stp ttin ttou urg xcpu xfsz vtalrm prof winch io pwr sys emt lost
}
}
ptrace {mask {read trace
}
}
caps {mask {chown dac_override dac_read_search fowner fsetid kill setgid setuid setpcap linux_immutable net_bind_service net_broadcast net_admin net_raw ipc_lock ipc_owner sys_module sys_rawio sys_chroot sys_ptrace sys_pacct sys_admin sys_boot sys_nice sys_resource sys_time sys_tty_config mknod lease audit_write audit_control setfcap mac_override mac_admin syslog wake_alarm block_suspend audit_read
}
}
rlimit {mask {cpu fsize data stack core rss nproc nofile memlock as locks sigpending msgqueue nice rtprio rttime
}
}
capability {0xffffff
}
namespaces {pivot_root {no
}
profile {yes
}
}
mount {mask {mount umount pivot_root
}
}
network {af_unix {yes
}
af_mask {unspec unix inet ax25 ipx appletalk netrom bridge atmpvc x25 inet6 rose netbeui security key netlink packet ash econet atmsvc rds sna irda pppox wanpipe llc ib mpls can tipc bluetooth iucv rxrpc isdn phonet ieee802154 caif alg nfc vsock kcm qipcrtr smc xdp
}
}
network_v8 {af_mask {unspec unix inet ax25 ipx appletalk netrom bridge atmpvc x25 inet6 rose netbeui security key netlink packet ash econet atmsvc rds sna irda pppox wanpipe llc ib mpls can tipc bluetooth iucv rxrpc isdn phonet ieee802154 caif alg nfc vsock kcm qipcrtr smc xdp
}
}
file {mask {create read write exec append mmap_exec link lock
}
}
domain {version {1.2
}
attach_conditions {xattr {yes
}
}
computed_longest_left {yes
}
post_nnp_subset {yes
}
fix_binfmt_elf_mmap {yes
}
stack {yes
}
change_profile {yes
}
change_onexec {yes
}
change_hatv {yes
}
change_hat {yes
}
}
policy {set_load {yes
}
versions {v8 {yes
}
v7 {yes
}
v6 {yes
}
v5 {yes
}
}
}

View File

@ -0,0 +1 @@
0xffffff

View File

@ -0,0 +1 @@
chown dac_override dac_read_search fowner fsetid kill setgid setuid setpcap linux_immutable net_bind_service net_broadcast net_admin net_raw ipc_lock ipc_owner sys_module sys_rawio sys_chroot sys_ptrace sys_pacct sys_admin sys_boot sys_nice sys_resource sys_time sys_tty_config mknod lease audit_write audit_control setfcap mac_override mac_admin syslog wake_alarm block_suspend audit_read

View File

@ -0,0 +1 @@
acquire send receive

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
1.2

View File

@ -0,0 +1 @@
create read write exec append mmap_exec link lock

View File

@ -0,0 +1 @@
mount umount pivot_root

View File

@ -0,0 +1 @@
no

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
unspec unix inet ax25 ipx appletalk netrom bridge atmpvc x25 inet6 rose netbeui security key netlink packet ash econet atmsvc rds sna irda pppox wanpipe llc ib mpls can tipc bluetooth iucv rxrpc isdn phonet ieee802154 caif alg nfc vsock kcm qipcrtr smc xdp

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
unspec unix inet ax25 ipx appletalk netrom bridge atmpvc x25 inet6 rose netbeui security key netlink packet ash econet atmsvc rds sna irda pppox wanpipe llc ib mpls can tipc bluetooth iucv rxrpc isdn phonet ieee802154 caif alg nfc vsock kcm qipcrtr smc xdp

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
read trace

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
allow deny audit quiet

View File

@ -0,0 +1 @@
cpu fsize data stack core rss nproc nofile memlock as locks sigpending msgqueue nice rtprio rttime

View File

@ -0,0 +1 @@
hup int quit ill trap abrt bus fpe kill usr1 segv usr2 pipe alrm term stkflt chld cont stop stp ttin ttou urg xcpu xfsz vtalrm prof winch io pwr sys emt lost

View File

@ -106,14 +106,17 @@ fi
Setup_cleanup Setup_cleanup
preinstall_snaps() { preinstall_snaps() {
lb chroot_resolv install setup_mountpoint chroot
snap_prepare chroot snap_prepare chroot
for snap in "$@"; do for snap in "$@"; do
SNAP_NO_VALIDATE_SEED=1 snap_preseed chroot "${snap}" SNAP_NO_VALIDATE_SEED=1 snap_preseed chroot "${snap}"
done done
snap_validate_seed chroot snap_validate_seed chroot
lb chroot_resolv remove
teardown_mountpoint chroot
} }
rm -f binary.success rm -f binary.success

View File

@ -775,7 +775,8 @@ case $PROJECT in
add_package install grub-pc add_package install grub-pc
;; ;;
amd64) amd64)
add_package install grub-pc add_package install grub-pc-bin
add_package install grub-efi-amd64-signed
add_package install shim-signed add_package install shim-signed
;; ;;
esac esac

View File

@ -96,14 +96,25 @@ mount_image() {
setup_mountpoint() { setup_mountpoint() {
local mountpoint="$1" local mountpoint="$1"
if [ ! -c /dev/mem ]; then
mknod -m 660 /dev/mem c 1 1
chown root:kmem /dev/mem
fi
mount --rbind /dev "$mountpoint/dev" mount --rbind /dev "$mountpoint/dev"
mount proc-live -t proc "$mountpoint/proc" mount proc-live -t proc "$mountpoint/proc"
mount sysfs-live -t sysfs "$mountpoint/sys" mount sysfs-live -t sysfs "$mountpoint/sys"
mount securityfs -t securityfs "$mountpoint/sys/kernel/security"
# Provide more up to date apparmor features, matching target kernel
mount -o bind /usr/share/livecd-rootfs/live-build/apparmor/generic "$mountpoint/sys/kernel/security/apparmor/features/"
mount -o bind /usr/share/livecd-rootfs/live-build/seccomp/generic.actions_avail "$mountpoint/proc/sys/kernel/seccomp/actions_avail"
mount -t tmpfs none "$mountpoint/tmp" mount -t tmpfs none "$mountpoint/tmp"
mount -t tmpfs none "$mountpoint/var/lib/apt" mount -t tmpfs none "$mountpoint/var/lib/apt"
mount -t tmpfs none "$mountpoint/var/cache/apt" mount -t tmpfs none "$mountpoint/var/cache/apt"
mv "$mountpoint/etc/resolv.conf" resolv.conf.tmp mv "$mountpoint/etc/resolv.conf" resolv.conf.tmp
cp /etc/resolv.conf "$mountpoint/etc/resolv.conf" cp /etc/resolv.conf "$mountpoint/etc/resolv.conf"
mv "$mountpoint/etc/nsswitch.conf" nsswitch.conf.tmp
sed 's/systemd//g' nsswitch.conf.tmp > "$mountpoint/etc/nsswitch.conf"
chroot "$mountpoint" apt-get update chroot "$mountpoint" apt-get update
} }
@ -121,6 +132,7 @@ teardown_mountpoint() {
umount $submount umount $submount
done done
mv resolv.conf.tmp "$mountpoint/etc/resolv.conf" mv resolv.conf.tmp "$mountpoint/etc/resolv.conf"
mv nsswitch.conf.tmp "$mountpoint/etc/nsswitch.conf"
} }
mount_partition() { mount_partition() {
@ -682,6 +694,9 @@ snap_validate_seed() {
if [ -e "${CHROOT_ROOT}/var/lib/snapd/seed/seed.yaml" ]; then if [ -e "${CHROOT_ROOT}/var/lib/snapd/seed/seed.yaml" ]; then
snap debug validate-seed "${CHROOT_ROOT}/var/lib/snapd/seed/seed.yaml" snap debug validate-seed "${CHROOT_ROOT}/var/lib/snapd/seed/seed.yaml"
/usr/lib/snapd/snap-preseed --reset $(realpath "${CHROOT_ROOT}")
/usr/lib/snapd/snap-preseed $(realpath "${CHROOT_ROOT}")
chroot "${CHROOT_ROOT}" apparmor_parser --skip-read-cache --write-cache --skip-kernel-load --verbose -j `nproc` /etc/apparmor.d
fi fi
} }

View File

@ -0,0 +1 @@
kill_process kill_thread trap errno user_notif trace log allow

View File

@ -33,7 +33,6 @@ install_grub() {
chroot mountpoint apt-get -qqy update chroot mountpoint apt-get -qqy update
chroot mountpoint apt-get -qqy install grub-ieee1275 chroot mountpoint apt-get -qqy install grub-ieee1275
chroot mountpoint apt-get -qqy remove --purge grub-legacy-ec2 chroot mountpoint apt-get -qqy remove --purge grub-legacy-ec2
chroot mountpoint apt-get autoremove --purge --assume-yes
# set the kernel commandline to use hvc0 # set the kernel commandline to use hvc0
mkdir -p mountpoint/etc/default/grub.d mkdir -p mountpoint/etc/default/grub.d

View File

@ -97,13 +97,11 @@ install_grub() {
efi_target=arm-efi efi_target=arm-efi
;; ;;
amd64) amd64)
chroot mountpoint apt-get install -qqy grub-pc shim-signed chroot mountpoint apt-get install -qqy grub-efi-amd64-signed shim-signed
efi_target=x86_64-efi efi_target=x86_64-efi
;; ;;
esac esac
chroot mountpoint apt-get autoremove --purge --assume-yes
# This call to rewrite the debian package manifest is added here to capture # This call to rewrite the debian package manifest is added here to capture
# grub-efi packages that otherwise would not make it into the base # grub-efi packages that otherwise would not make it into the base
# manifest. filesystem.packages is moved into place via symlinking to # manifest. filesystem.packages is moved into place via symlinking to

View File

@ -136,7 +136,6 @@ fi
if [ "$ARCH" = "s390x" ]; then if [ "$ARCH" = "s390x" ]; then
# Do ZIPL install bits # Do ZIPL install bits
chroot mountpoint apt-get -qqy install s390-tools sysconfig-hardware chroot mountpoint apt-get -qqy install s390-tools sysconfig-hardware
chroot mountpoint apt-get autoremove --purge --assume-yes
# Write out cloudy zipl.conf for future kernel updates # Write out cloudy zipl.conf for future kernel updates
cat << EOF > mountpoint/etc/zipl.conf cat << EOF > mountpoint/etc/zipl.conf

View File

@ -35,7 +35,6 @@ cp -a rootfs.dir $rootfs_dir
setup_mountpoint $rootfs_dir setup_mountpoint $rootfs_dir
env DEBIAN_FRONTEND=noninteractive chroot $rootfs_dir apt-get -y -qq install ubuntu-wsl env DEBIAN_FRONTEND=noninteractive chroot $rootfs_dir apt-get -y -qq install ubuntu-wsl
env DEBIAN_FRONTEND=noninteractive chroot $rootfs_dir apt-get autoremove --purge --assume-yes
create_manifest $rootfs_dir livecd.ubuntu-cpc.wsl.rootfs.manifest create_manifest $rootfs_dir livecd.ubuntu-cpc.wsl.rootfs.manifest
teardown_mountpoint $rootfs_dir teardown_mountpoint $rootfs_dir

View File

@ -21,10 +21,9 @@ if [ -n "$SUBARCH" ]; then
exit 0 exit 0
fi fi
. config/binary
. config/functions . config/functions
. config/common . config/common
# somehow i don't have LB_DISTRIBUTION set ?!
. config/bootstrap
FILESYSTEM_ROOT=binary/boot/squashfs.dir FILESYSTEM_ROOT=binary/boot/squashfs.dir
INSTALLER_ROOT=binary/boot/installer.squashfs.dir INSTALLER_ROOT=binary/boot/installer.squashfs.dir
@ -84,6 +83,12 @@ sed -i -e'N;/name: lxd/,+2d' $INSTALLER_ROOT/var/lib/snapd/seed/seed.yaml
teardown_mountpoint "$INSTALLER_ROOT" teardown_mountpoint "$INSTALLER_ROOT"
# Drop core/lxd/snapd that got copied up from base layer, due to
# snap-preseed tool doing --reset & speedup
find $OVERLAY_ROOT/var/lib/snapd/ -name 'core*.snap' -delete
find $OVERLAY_ROOT/var/lib/snapd/ -name 'snapd_*.snap' -delete
find $OVERLAY_ROOT/var/lib/snapd/ -name 'lxd_*.snap' -delete
squashfs_f="${PWD}/livecd.${PROJECT}.installer.squashfs" squashfs_f="${PWD}/livecd.${PROJECT}.installer.squashfs"
(cd "$OVERLAY_ROOT/" && (cd "$OVERLAY_ROOT/" &&