Browse Source

Make iscsi-boot element support centos 8

This patch makes iscsi-boot element support not only just
DISTRO_NAME centos7 but also centos and centos-minimal.

Change-Id: I8db8b01f35b2e572666badd8d2316d24a5e4287a
tags/3.3.0
Xinliang Liu 1 month ago
parent
commit
fd850475ea
4 changed files with 5 additions and 5 deletions
  1. +2
    -2
      diskimage_builder/elements/iscsi-boot/README.rst
  2. +1
    -1
      diskimage_builder/elements/iscsi-boot/environment.d/open-iscsi-config
  3. +1
    -1
      diskimage_builder/elements/iscsi-boot/extra-data.d/50-check-dracut-regenerate
  4. +1
    -1
      diskimage_builder/elements/iscsi-boot/finalise.d/51-open-iscsi-config

+ 2
- 2
diskimage_builder/elements/iscsi-boot/README.rst View File

@@ -3,7 +3,7 @@ iscsi-boot
==========
Handles configuration for the disk to be capable of serving as
a remote root filesystem through iSCSI. Currently, this element
can configure Ubuntu/Debian images and CentOS7 images.
can configure Ubuntu/Debian images and CentOS images.

It performs the following actions:

@@ -13,7 +13,7 @@ For Ubuntu/Debian images:
``ISCSI_AUTO=true`` within it.
* Updates the initramfs to apply the changes.

For CentOS7 images:
For CentOS images:
* Required ``dracut-regenerate`` element when performs ``disk-image-create``.
* Updates ``network`` and ``iscsi`` into ``dracut-regenerate`` during
pre-installs.


+ 1
- 1
diskimage_builder/elements/iscsi-boot/environment.d/open-iscsi-config View File

@@ -1,4 +1,4 @@
if [[ $DISTRO_NAME = "centos7" ]]; then
if [[ $DISTRO_NAME =~ "centos" ]]; then

DIB_DRACUT_ENABLED_MODULES+="
- name: network


+ 1
- 1
diskimage_builder/elements/iscsi-boot/extra-data.d/50-check-dracut-regenerate View File

@@ -6,7 +6,7 @@ fi
set -eu
set -o pipefail

if [[ $DISTRO_NAME = "centos7" ]]; then
if [[ $DISTRO_NAME =~ "centos" ]]; then
eval declare -A image_elements=($(get_image_element_array))
if [[ ! "${image_elements[@]}" =~ "dracut-regenerate" ]]; then
echo "The dracut-regenerate element is required!"


+ 1
- 1
diskimage_builder/elements/iscsi-boot/finalise.d/51-open-iscsi-config View File

@@ -7,7 +7,7 @@ fi
set -eu
set -o pipefail

if [[ $DISTRO_NAME = "centos7" ]]; then
if [[ $DISTRO_NAME =~ "centos" ]]; then
sed -i -E 's/(GRUB_CMDLINE_LINUX_DEFAULT=")(.+)(")/\1\2 rd.iscsi.firmware=1"/' /etc/default/grub
grub2-mkconfig -o /boot/grub2/grub.cfg
fi

Loading…
Cancel
Save