mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-03-01 14:31:11 +00:00
Merge remote-tracking branch 'toabctl/sru-bionic-lp1926732' into ubuntu/bionic
This commit is contained in:
commit
b6e8364381
8
debian/changelog
vendored
8
debian/changelog
vendored
@ -1,3 +1,11 @@
|
||||
livecd-rootfs (2.525.53) UNRELEASED; urgency=medium
|
||||
|
||||
* Add a new ubuntu-oci project that contains the customizations currently
|
||||
performed downstream for the official Ubuntu images on dockerhub.
|
||||
(LP: #1926732)
|
||||
|
||||
-- Thomas Bechtold <thomas.bechtold@canonical.com> Fri, 30 Apr 2021 14:20:00 +0200
|
||||
|
||||
livecd-rootfs (2.525.52) bionic; urgency=medium
|
||||
|
||||
[ Gauthier Jolly ]
|
||||
|
@ -439,6 +439,9 @@ deb file:/var/lib/preinstalled-pool/ $LB_DISTRIBUTION $LB_PARENT_ARCHIVE_AREAS
|
||||
Chroot chroot "ln -s /etc/media-info /var/log/installer/media-info"
|
||||
fi
|
||||
fi
|
||||
if [ "$PROJECT" = "ubuntu-oci" ]; then
|
||||
configure_oci chroot
|
||||
fi
|
||||
if [ "$PROJECT" = "ubuntu-cpc" ]; then
|
||||
if [ "${SUBPROJECT:-}" = minimized ]; then
|
||||
BUILD_NAME=minimal
|
||||
|
@ -317,7 +317,7 @@ if [ "$PREINSTALLED" = "true" ]; then
|
||||
ubuntu-server)
|
||||
add_package live oem-config-debconf ubiquity-frontend-debconf
|
||||
;;
|
||||
ubuntu-core|ubuntu-base|base|ubuntu-touch|ubuntu-touch-custom|ubuntu-cpc|ubuntu-desktop-next)
|
||||
ubuntu-core|ubuntu-base|base|ubuntu-touch|ubuntu-touch-custom|ubuntu-cpc|ubuntu-desktop-next|ubuntu-oci)
|
||||
;;
|
||||
ubuntu)
|
||||
add_package live oem-config-gtk ubiquity-frontend-gtk
|
||||
@ -672,6 +672,10 @@ case $PROJECT in
|
||||
OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal"
|
||||
;;
|
||||
|
||||
ubuntu-oci)
|
||||
OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal"
|
||||
;;
|
||||
|
||||
ubuntu-touch|ubuntu-touch-custom)
|
||||
HINTS="packagekit ubuntu-system-settings"
|
||||
case $ARCH in
|
||||
@ -925,7 +929,7 @@ case $ARCH in
|
||||
esac
|
||||
|
||||
case $PROJECT:${SUBPROJECT:-} in
|
||||
ubuntu-server:*|ubuntu-base:*|ubuntu-touch:*|ubuntu-touch-custom:*)
|
||||
ubuntu-server:*|ubuntu-base:*|ubuntu-touch:*|ubuntu-touch-custom:*|ubuntu-oci:*)
|
||||
OPTS="${OPTS:+$OPTS }--linux-packages=none --initramfs=none"
|
||||
KERNEL_FLAVOURS=none
|
||||
BINARY_REMOVE_LINUX=false
|
||||
|
@ -608,6 +608,62 @@ snap_preseed() {
|
||||
fi
|
||||
}
|
||||
|
||||
configure_oci() {
|
||||
# configure a chroot to be a OCI/docker container
|
||||
# theses changes are taken from the current Dockerfile modifications done
|
||||
# at https://github.com/tianon/docker-brew-ubuntu-core/blob/master/update.sh
|
||||
|
||||
local chroot=$1
|
||||
|
||||
echo "==== Configuring OCI ===="
|
||||
|
||||
# https://github.com/docker/docker/blob/9a9fc01af8fb5d98b8eec0740716226fadb3735c/contrib/mkimage/debootstrap#L40-L48
|
||||
echo '#!/bin/sh' > ${chroot}/usr/sbin/policy-rc.d
|
||||
echo 'exit 101' >> ${chroot}/usr/sbin/policy-rc.d
|
||||
Chroot ${chroot} "chmod +x /usr/sbin/policy-rc.d"
|
||||
|
||||
# https://github.com/docker/docker/blob/9a9fc01af8fb5d98b8eec0740716226fadb3735c/contrib/mkimage/debootstrap#L54-L56
|
||||
Chroot ${chroot} "dpkg-divert --local --rename --add /sbin/initctl"
|
||||
cp -a ${chroot}/usr/sbin/policy-rc.d ${chroot}/sbin/initctl
|
||||
sed -i 's/^exit.*/exit 0/' ${chroot}/sbin/initctl
|
||||
|
||||
# https://github.com/docker/docker/blob/9a9fc01af8fb5d98b8eec0740716226fadb3735c/contrib/mkimage/debootstrap#L71-L78
|
||||
echo 'force-unsafe-io' > ${chroot}/etc/dpkg/dpkg.cfg.d/docker-apt-speedup
|
||||
|
||||
# https://github.com/docker/docker/blob/9a9fc01af8fb5d98b8eec0740716226fadb3735c/contrib/mkimage/debootstrap#L85-L105
|
||||
echo 'DPkg::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' > ${chroot}/etc/apt/apt.conf.d/docker-clean
|
||||
|
||||
echo 'APT::Update::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' >> ${chroot}/etc/apt/apt.conf.d/docker-clean
|
||||
|
||||
echo 'Dir::Cache::pkgcache ""; Dir::Cache::srcpkgcache "";' >> ${chroot}/etc/apt/apt.conf.d/docker-clean
|
||||
|
||||
# https://github.com/docker/docker/blob/9a9fc01af8fb5d98b8eec0740716226fadb3735c/contrib/mkimage/debootstrap#L109-L115
|
||||
echo 'Acquire::Languages "none";' > ${chroot}/etc/apt/apt.conf.d/docker-no-languages
|
||||
|
||||
# https://github.com/docker/docker/blob/9a9fc01af8fb5d98b8eec0740716226fadb3735c/contrib/mkimage/debootstrap#L118-L130
|
||||
echo 'Acquire::GzipIndexes "true"; Acquire::CompressionTypes::Order:: "gz";' > ${chroot}/etc/apt/apt.conf.d/docker-gzip-indexes
|
||||
|
||||
# https://github.com/docker/docker/blob/9a9fc01af8fb5d98b8eec0740716226fadb3735c/contrib/mkimage/debootstrap#L134-L151
|
||||
echo 'Apt::AutoRemove::SuggestsImportant "false";' > ${chroot}/etc/apt/apt.conf.d/docker-autoremove-suggests
|
||||
|
||||
# delete all the apt list files since they're big and get stale quickly
|
||||
rm -rf ${chroot}/var/lib/apt/lists/*
|
||||
|
||||
# verify that the APT lists files do not exist
|
||||
Chroot chroot "apt-get indextargets" > indextargets.out
|
||||
[ ! -s indextargets.out ]
|
||||
rm indextargets.out
|
||||
# (see https://bugs.launchpad.net/cloud-images/+bug/1699913)
|
||||
|
||||
# make systemd-detect-virt return "docker"
|
||||
# See: https://github.com/systemd/systemd/blob/aa0c34279ee40bce2f9681b496922dedbadfca19/src/basic/virt.c#L434
|
||||
mkdir -p ${chroot}/run/systemd
|
||||
echo 'docker' > ${chroot}/run/systemd/container
|
||||
|
||||
rm -rf ${chroot}/var/cache/apt/*.bin
|
||||
echo "==== Configuring OCI done ===="
|
||||
}
|
||||
|
||||
is_live_layer () {
|
||||
local pass=$1
|
||||
for livepass in $LIVE_PASSES; do
|
||||
|
Loading…
x
Reference in New Issue
Block a user