|
|
@ -922,6 +922,12 @@ configure_oci() {
|
|
|
|
# at https://github.com/tianon/docker-brew-ubuntu-core/blob/master/update.sh
|
|
|
|
# at https://github.com/tianon/docker-brew-ubuntu-core/blob/master/update.sh
|
|
|
|
|
|
|
|
|
|
|
|
local chroot=$1
|
|
|
|
local chroot=$1
|
|
|
|
|
|
|
|
local serial=$2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ ! -d "${chroot}" ]; then
|
|
|
|
|
|
|
|
echo "The chroot does not exist"
|
|
|
|
|
|
|
|
exit 1
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
echo "==== Configuring OCI ===="
|
|
|
|
echo "==== Configuring OCI ===="
|
|
|
|
|
|
|
|
|
|
|
@ -930,6 +936,15 @@ configure_oci() {
|
|
|
|
echo 'exit 101' >> ${chroot}/usr/sbin/policy-rc.d
|
|
|
|
echo 'exit 101' >> ${chroot}/usr/sbin/policy-rc.d
|
|
|
|
Chroot ${chroot} "chmod +x /usr/sbin/policy-rc.d"
|
|
|
|
Chroot ${chroot} "chmod +x /usr/sbin/policy-rc.d"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Inject a build stamp into the image
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mkdir -p ${chroot}/etc/cloud
|
|
|
|
|
|
|
|
cat > ${chroot}/etc/cloud/build.info << EOF
|
|
|
|
|
|
|
|
serial: $serial
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# https://github.com/docker/docker/blob/9a9fc01af8fb5d98b8eec0740716226fadb3735c/contrib/mkimage/debootstrap#L54-L56
|
|
|
|
# https://github.com/docker/docker/blob/9a9fc01af8fb5d98b8eec0740716226fadb3735c/contrib/mkimage/debootstrap#L54-L56
|
|
|
|
Chroot ${chroot} "dpkg-divert --local --rename --add /sbin/initctl"
|
|
|
|
Chroot ${chroot} "dpkg-divert --local --rename --add /sbin/initctl"
|
|
|
|
cp -a ${chroot}/usr/sbin/policy-rc.d ${chroot}/sbin/initctl
|
|
|
|
cp -a ${chroot}/usr/sbin/policy-rc.d ${chroot}/sbin/initctl
|
|
|
|