Add 'DIB_UBUNTU_MIRROR_DISTS' to ubuntu-minimal

* Add "DIB_UBUNTU_MIRROR_DISTS":
    Default: ``updates,security,backports``
    Notes: For some deployment, is may be required
           to disable backport|update|etc packages
           integration.

Change-Id: Ic7dcd29ea658a66763b4422915149e4d3fe663cc
This commit is contained in:
azvyagintsev 2021-01-26 13:28:47 +02:00 committed by azvyagintsev
parent 2737d909bf
commit 3f8a85f932
3 changed files with 34 additions and 3 deletions

View File

@ -27,4 +27,13 @@ DIB_UBUNTU_KERNEL:
:Notes: The element must know about the package, otherwise it will select
the default.
DIB_UBUNTU_MIRROR_DISTS:
:Required: No
:Default: ``updates,security,backports``
:Description: Allow to manage 'dists' repos
:Example: ``DIB_UBUNTU_MIRROR_DISTS=updates,security``
:Notes: For some deployment,
is may be required to disable backport|update|etc packages integration.
.. element_deps::

View File

@ -0,0 +1,16 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
#
# See the License for the specific language governing permissions and
# limitations under the License.
export DIB_UBUNTU_MIRROR_DISTS=${DIB_UBUNTU_MIRROR_DISTS:-"updates,security,backports"}

View File

@ -27,13 +27,19 @@ if [ -n "${DIB_APT_KEYRING:-${DIB_DEBIAN_KEYRING:-}}" ]; then
fi
# We should manage this in a betterer way
# Add "basic" release dist
sudo bash -c "cat << EOF >$TARGET_ROOT/etc/apt/sources.list
deb $DIB_DISTRIBUTION_MIRROR $DIB_RELEASE ${DIB_DEBIAN_COMPONENTS//,/ }
deb $DIB_DISTRIBUTION_MIRROR $DIB_RELEASE-updates ${DIB_DEBIAN_COMPONENTS//,/ }
deb $DIB_DISTRIBUTION_MIRROR $DIB_RELEASE-backports ${DIB_DEBIAN_COMPONENTS//,/ }
deb $DIB_DISTRIBUTION_MIRROR $DIB_RELEASE-security ${DIB_DEBIAN_COMPONENTS//,/ }
EOF"
# Add any extra dists
for dist in ${DIB_UBUNTU_MIRROR_DISTS//,/ } ; do
sudo bash -c "cat << EOF >>$TARGET_ROOT/etc/apt/sources.list
deb $DIB_DISTRIBUTION_MIRROR $DIB_RELEASE-$dist ${DIB_DEBIAN_COMPONENTS//,/ }
EOF"
done
sudo mount -t proc none $TARGET_ROOT/proc
sudo mount -t sysfs none $TARGET_ROOT/sys
trap "sudo umount $TARGET_ROOT/proc; sudo umount $TARGET_ROOT/sys" EXIT