Compare commits
11 Commits
c2853c6f2c
...
d06a66d0f0
Author | SHA1 | Date |
---|---|---|
Neil Hanlon | d06a66d0f0 | |
Zuul | 0576fadab8 | |
Zuul | 87e2321d55 | |
Dmitriy Rabotyagov | cff37ce502 | |
Zuul | 64a38a518d | |
Zuul | 4c4bb801ae | |
Zuul | 4f9ef195e3 | |
Clark Boylan | 252692c660 | |
Maksim Malchuk | 4fbf564615 | |
Maksim Malchuk | bccea6d5f0 | |
Dmitriy Rabotyagov | 335f8dc6fd |
|
@ -20,15 +20,16 @@ gnupg2 [!platform:redhat !platform:ubuntu-trusty !platform:suse]
|
|||
# ubuntu
|
||||
apt-transport-https [platform:dpkg]
|
||||
inetutils-ping [platform:dpkg]
|
||||
python-lzma [platform:dpkg !platform:ubuntu-focal !platform:ubuntu-jammy !platform:debian-bullseye]
|
||||
qemu-utils [platform:dpkg]
|
||||
rpm [platform:dpkg]
|
||||
uuid-runtime [platform:dpkg]
|
||||
yum-utils [platform:dpkg !platform:ubuntu-focal !platform:ubuntu-jammy !platform:debian-bullseye]
|
||||
dnf [platform:debian-bullseye]
|
||||
debootstrap [platform:dpkg]
|
||||
zstd [platform:dpkg]
|
||||
procps [platform:dpkg]
|
||||
# Version/distro specific items
|
||||
python-lzma [platform:ubuntu-bionic platform:debian-buster]
|
||||
yum-utils [platform:ubuntu-bionic platform:debian-buster]
|
||||
dnf [platform:dpkg !platform:debian-buster !platform:ubuntu-trusty !platform:ubuntu-bionic !platform:ubuntu-focal]
|
||||
|
||||
# centos/fedora
|
||||
qemu-img [platform:redhat]
|
||||
|
|
|
@ -10,6 +10,11 @@ Arguments
|
|||
* ``DIB_GRUB_TIMEOUT`` sets the ``grub`` menu timeout. It defaults to
|
||||
5 seconds. Set this to 0 (no timeout) for fast boot times.
|
||||
|
||||
* ``DIB_GRUB_TIMEOUT_STYLE`` sets the visibility of the ``grub`` menu.
|
||||
It defaults to ``hidden`` (or ``countdown`` as an alias). Set this to
|
||||
``menu`` to display the menu and then wait for the timeout set by
|
||||
``DIB_GRUB_TIMEOUT`` to expire before booting the default entry.
|
||||
|
||||
* ``DIB_BOOTLOADER_DEFAULT_CMDLINE`` sets parameters that are appended
|
||||
to the ``GRUB_CMDLINE_LINUX_DEFAULT`` values in ``grub.cfg``
|
||||
configuration. It defaults to ``nofb nomodeset gfxpayload=text``.
|
||||
|
|
|
@ -85,6 +85,7 @@ fi
|
|||
echo "GRUB_DEVICE=LABEL=${DIB_ROOT_LABEL}" >> /etc/default/grub
|
||||
echo 'GRUB_DISABLE_LINUX_UUID=true' >> /etc/default/grub
|
||||
echo "GRUB_TIMEOUT=${DIB_GRUB_TIMEOUT:-5}" >>/etc/default/grub
|
||||
echo "GRUB_TIMEOUT_STYLE=${DIB_GRUB_TIMEOUT_STYLE:-hidden}" >>/etc/default/grub
|
||||
echo 'GRUB_TERMINAL="serial console"' >>/etc/default/grub
|
||||
echo 'GRUB_GFXPAYLOAD_LINUX=auto' >>/etc/default/grub
|
||||
|
||||
|
|
|
@ -9,9 +9,9 @@ set -o pipefail
|
|||
# Set cloud-init to allow password authentication
|
||||
if [ -n "${DIB_CLOUD_INIT_ALLOW_SSH_PWAUTH:-}" ]; then
|
||||
if [ -f "/etc/cloud/cloud.cfg" ]; then
|
||||
if [ -z "$(cat /etc/cloud/cloud.cfg | grep ssh_pwauth)" ]; then
|
||||
if [ -z "$(grep ssh_pwauth /etc/cloud/cloud.cfg)" ]; then
|
||||
echo "ssh_pwauth not exist. append to EOF"
|
||||
sudo sh -c 'echo "ssh_pwauth: 1" >> /etc/cloud/cloud.cfg'
|
||||
echo "ssh_pwauth: 1" >> /etc/cloud/cloud.cfg
|
||||
else
|
||||
echo "ssh_pwauth exist. make sure ssh_pwauth enabled"
|
||||
sed -i -e 's/ssh_pwauth: *0/ssh_pwauth: 1/g' /etc/cloud/cloud.cfg
|
||||
|
|
|
@ -21,20 +21,29 @@ fi
|
|||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
DIB_DEBIAN_ALT_INIT_PACKAGE=${DIB_DEBIAN_ALT_INIT_PACKAGE:-sysvinit}
|
||||
case "${DIB_RELEASE}" in
|
||||
hamm|slink|potato|woody|sarge|etch|lenny|squeeze|wheezy)
|
||||
DIB_DEBIAN_ALT_INIT_PACKAGE=${DIB_DEBIAN_ALT_INIT_PACKAGE:-sysvinit}
|
||||
DIB_DEBIAN_CLOUD_INIT_HELPER=${DIB_DEBIAN_CLOUD_INIT_HELPER:-'true'}
|
||||
;;
|
||||
*)
|
||||
DIB_DEBIAN_ALT_INIT_PACKAGE=${DIB_DEBIAN_ALT_INIT_PACKAGE:-systemd-sysv}
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
adduser --gecos Debian-cloud-init-user --disabled-password --quiet debian
|
||||
install -d -m 0755 -o root -g root /etc/sudoers.d
|
||||
echo 'debian ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/debian-cloud-init
|
||||
chmod 0440 /etc/sudoers.d/debian-cloud-init
|
||||
if [ -n "${DIB_DEBIAN_CLOUD_INIT_HELPER:-}" ]; then
|
||||
adduser --gecos Debian-cloud-init-user --disabled-password --quiet debian
|
||||
install -d -m 0755 -o root -g root /etc/sudoers.d
|
||||
echo 'debian ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/debian-cloud-init
|
||||
chmod 0440 /etc/sudoers.d/debian-cloud-init
|
||||
fi
|
||||
|
||||
if [ "$DIB_DEBIAN_ALT_INIT_PACKAGE" != "sysvinit" ]; then
|
||||
# To avoid a conflict against an essential package, we need to remove sysvinit first
|
||||
dpkg --purge --force remove-essential sysvinit
|
||||
apt-get install -y $apt_get_bp_extra_opts $DIB_DEBIAN_ALT_INIT_PACKAGE
|
||||
printf \"Package: sysvinit\nPin: origin ""\nPin-Priority: -1\n\" > \
|
||||
/etc/apt/preferences.d/sysvinit > /etc/apt/preferences.d/sysvinit
|
||||
apt-get install -y $DIB_DEBIAN_ALT_INIT_PACKAGE
|
||||
printf "Package: sysvinit\nPin: origin \"\"\nPin-Priority: -1\n" > \
|
||||
/etc/apt/preferences.d/sysvinit
|
||||
fi
|
||||
|
||||
case "${DIB_RELEASE}" in
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
},
|
||||
"family": {
|
||||
"redhat": {
|
||||
"lsb_release": "redhat-lsb-core"
|
||||
"lsb_release": "ed hostname patch postfix tar time"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -88,6 +88,8 @@ function _install_repos {
|
|||
if [[ ${DISTRO_NAME} = fedora ]]; then
|
||||
packages+="fedora-release-cloud fedora-release-common "
|
||||
packages+="fedora-repos fedora-gpg-keys"
|
||||
elif [[ ${DISTRO_NAME} = rocky ]]; then
|
||||
packages+="rocky-release rocky-repos rocky-gpg-keys"
|
||||
elif [[ ${DISTRO_NAME} = centos && ${DIB_RELEASE%-stream} -gt 7 ]]; then
|
||||
packages+="centos-gpg-keys "
|
||||
if [[ "$DIB_RELEASE" =~ (stream) ]]; then
|
||||
|
@ -167,6 +169,8 @@ function _install_repos {
|
|||
if [[ ${DISTRO_NAME} == 'openeuler' ]]; then
|
||||
sudo sed -i 's/enabled=0/enabled=1/' $TARGET_ROOT/etc/yum.repos.d/*.repo
|
||||
fi
|
||||
|
||||
|
||||
}
|
||||
|
||||
# _install_pkg_manager packages...
|
||||
|
@ -211,7 +215,8 @@ function _install_pkg_manager {
|
|||
local _extra_pkgs=""
|
||||
|
||||
if [[ $DISTRO_NAME == "fedora" ]] || \
|
||||
[[ $DISTRO_NAME == "centos" && $DIB_RELEASE > "7" ]]; then
|
||||
[[ $DISTRO_NAME == "centos" && $DIB_RELEASE > "7" ]] || \
|
||||
[[ $DISTRO_NAME == 'rocky' ]]; then
|
||||
# glibc from F24 onwards has split locales into "langpack"
|
||||
# packages. Host yum doesn't understand the
|
||||
# weak-dependencies glibc now uses to get the
|
||||
|
@ -238,6 +243,10 @@ function _install_pkg_manager {
|
|||
sudo ln -s $TARGET_ROOT/etc/dnf/vars $TARGET_ROOT/etc/yum/vars
|
||||
fi
|
||||
|
||||
if [[ ${DISTRO_NAME} == 'rocky' ]]; then
|
||||
echo 'stg/rocky' | sudo tee /etc/dnf/vars/contentdir
|
||||
fi
|
||||
|
||||
sudo -E ${HOST_YUM} -y \
|
||||
--disableexcludes=all \
|
||||
--setopt=cachedir=$YUM_CACHE/$ARCH/$DIB_RELEASE \
|
||||
|
@ -308,7 +317,7 @@ _install_repos
|
|||
# it seems, as it seems like as part of the Fedora modular updates
|
||||
# (https://docs.fedoraproject.org/en-US/modularity/) we can pick up
|
||||
# seemingly mismatched libraries.
|
||||
if [[ ${DISTRO_NAME} =~ (fedora|openeuler) ]]; then
|
||||
if [[ ${DISTRO_NAME} =~ (fedora|openeuler|rocky) ]]; then
|
||||
_install_pkg_manager dnf dnf-plugins-core curl
|
||||
elif [[ ${DISTRO_NAME} == centos && $DIB_RELEASE > "7" ]]; then
|
||||
_install_pkg_manager dnf dnf-plugins-core curl libcurl
|
||||
|
@ -343,6 +352,10 @@ if [[ ${DISTRO_NAME} = centos && ${DIB_RELEASE%-stream} -le 7 ]]; then
|
|||
YUM="${YUM} --releasever=${DIB_RELEASE}"
|
||||
fi
|
||||
|
||||
if [[ ${DISTRO_NAME} == 'rocky' ]]; then
|
||||
YUM="DNF_VAR_contentdir=stg/rocky ${YUM}"
|
||||
fi
|
||||
|
||||
# we just installed yum/dnf with "outside" tools (yum/rpm) which
|
||||
# might have created /var/lib/[yum|rpm] (etc) that are slighlty
|
||||
# incompatible. Refresh everything with the in-chroot tools
|
||||
|
|
|
@ -134,6 +134,10 @@ if [ -n "$WHITELIST" ]; then
|
|||
#
|
||||
# [1] https://bugzilla.redhat.com/show_bug.cgi?id=965567
|
||||
set -o xtrace
|
||||
if [[ -n ${DIB_YUM_DNF_CONTENTDIR:-''} ]]; then
|
||||
echo $DIB_YUM_DNF_CONTENTDIR | sudo tee /etc/dnf/vars/contentdir
|
||||
sudo sed -i -e 's,^mirrorlist,#mirrorlist,' -e 's,^#baseurl,baseurl,' /etc/yum.repos.d/*.repo
|
||||
fi
|
||||
${YUM} -v -y $ACTION $EXTRA_ARGS $PKGS
|
||||
|
||||
if [ "$ACTION" == "install" ]; then
|
||||
|
|
|
@ -6,6 +6,11 @@ fi
|
|||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
|
||||
# if [[ -n ${DIB_YUM_DNF_CONTENTDIR:-''} ]]; then
|
||||
# sudo sed -i 's,^#mirrorlist,mirrorlist,' -e 's,^baseurl,#baseurl,' /etc/yum.repos.d/rocky.repo
|
||||
# fi
|
||||
|
||||
if [[ ${YUM} == "dnf" ]]; then
|
||||
cfg=/etc/dnf/dnf.conf
|
||||
cachedir=/var/cache/dnf
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
other:
|
||||
- |
|
||||
Added a ``DIB_DEBIAN_CLOUD_INIT_HELPER`` variable that controls whether
|
||||
``debian`` element will attempt to pre-create required users and sudoers
|
||||
file for the default cloud-init user. This should not be needed for any
|
||||
modern Debian distro.
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
|
||||
other:
|
||||
- |
|
||||
Value of ``DIB_DEBIAN_ALT_INIT_PACKAGE`` has been switched to
|
||||
``systemd-sysv`` for Debian releases older then Jessie.
|
||||
If you still need to build a version of Debian that is relying
|
||||
on ``sysvinit`` please override the ``DIB_DEBIAN_ALT_INIT_PACKAGE``
|
||||
variable for that.
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
features:
|
||||
- |
|
||||
The ``bootloader`` element will explicitly set the timeout style to
|
||||
``hidden`` to hide the menu. Set ``DIB_GRUB_TIMEOUT_STYLE`` to ``menu``
|
||||
to display the menu and then wait for the timeout expire before booting
|
||||
the default entry.
|
Loading…
Reference in New Issue