Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions oracle-linux-image-tools/distr/ol7-slim/image-scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,20 @@
#######################################
# Validate distribution parameters
# Globals:
# ROOT_FS
# ROOT_FS TMP_IN_TMPFS UEK_RELEASE LINUX_FIRMWARE STRIP_LOCALES EXCLUDE_DOCS
# Arguments:
# None
# Returns:
# None
#######################################
distr::validate() {
[[ "${ROOT_FS,,}" =~ ^(xfs)|(btrfs)|(lvm)$ ]] || error "ROOT_FS must be xfs, btrfs or lvm"
[[ "${TMP_IN_TMPFS,,}" =~ ^(yes)|(no)$ ]] || error "TMP_IN_TMPFS must be yes or no"
[[ "${UEK_RELEASE}" =~ ^[56]$ ]] || error "UEK_RELEASE must be 5 or 6"
[[ "${LINUX_FIRMWARE,,}" =~ ^(yes)|(no)$ ]] || error "LINUX_FIRMWARE must be yes or no"
[[ "${STRIP_LOCALES,,}" =~ ^(yes)|(no)$ ]] || error "STRIP_LOCALES must be yes or no"
[[ "${EXCLUDE_DOCS,,}" =~ ^(yes)|(no)|(minimal)$ ]] || error "EXCLUDE_DOCS must be yes, no or minimal"
readonly ROOT_FS UEK_RELEASE LINUX_FIRMWARE STRIP_LOCALES EXCLUDE_DOCS
readonly ROOT_FS TMP_IN_TMPFS UEK_RELEASE LINUX_FIRMWARE STRIP_LOCALES EXCLUDE_DOCS
}

#######################################
Expand Down Expand Up @@ -75,6 +76,9 @@ logvol / --fstype=\"xfs\" --vgname=vg_main --size=4096 --name=lv_root --gr
if [[ "${EXCLUDE_DOCS,,}" = "yes" ]]; then
sed -i -e 's!^%packages !%packages --excludedocs !' "${ks_file}"
fi

# /tmp in tmpfs
sed -i -e "s!^TMP_IN_TMPFS=no!TMP_IN_TMPFS=$TMP_IN_TMPFS!" "${ks_file}"
}

#######################################
Expand Down
6 changes: 6 additions & 0 deletions oracle-linux-image-tools/distr/ol7-slim/ol7-ks.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -235,4 +235,10 @@ fi
sed -i -e 's/^DEFAULTKERNEL=.*/DEFAULTKERNEL='"${kernel}"'/' /etc/sysconfig/kernel

yum install -y ${yum_options} ${kernel}

# use tmpfs for /tmp
TMP_IN_TMPFS=no
if [[ "${TMP_IN_TMPFS,,}" == "yes" ]]; then
systemctl enable tmp.mount
fi
%end
8 changes: 6 additions & 2 deletions oracle-linux-image-tools/distr/ol8-aarch64/image-scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#######################################
# Validate distribution parameters
# Globals:
# ISO_LABEL RESCUE_KERNEL ROOT_FS
# ROOT_FS TMP_IN_TMPFS UEK_RELEASE RESCUE_KERNEL ISO_LABEL LINUX_FIRMWARE KERNEL_MODULES EXCLUDE_DOCS
# Arguments:
# None
# Returns:
Expand All @@ -27,13 +27,14 @@
distr::validate() {
[[ "${ROOT_FS,,}" =~ ^(xfs)|(btrfs)|(lvm)$ ]] || error "ROOT_FS must be xfs, btrfs or lvm"
[[ "${ROOT_FS,,}" = "btrfs" ]] && echo_message "Note that for btrfs root filesystem you need to use an UEK boot ISO"
[[ "${TMP_IN_TMPFS,,}" =~ ^(yes)|(no)$ ]] || error "TMP_IN_TMPFS must be yes or no"
[[ "${UEK_RELEASE}" =~ ^[67]$ ]] || error "UEK_RELEASE must be 6 or 7"
[[ "${RESCUE_KERNEL,,}" =~ ^(yes)|(no)$ ]] || error "RESCUE_KERNEL must be yes or no"
[[ -n ${ISO_LABEL} ]] || error "ISO_LABEL must be provided"
[[ "${LINUX_FIRMWARE,,}" =~ ^(yes)|(no)$ ]] || error "LINUX_FIRMWARE must be yes or no"
[[ "${KERNEL_MODULES,,}" =~ ^(yes)|(no)$ ]] || error "KERNEL_MODULES must be yes or no"
[[ "${EXCLUDE_DOCS,,}" =~ ^(yes)|(no)|(minimal)$ ]] || error "EXCLUDE_DOCS must be yes, no or minimal"
readonly ROOT_FS UEK_RELEASE RESCUE_KERNEL ISO_LABEL LINUX_FIRMWARE EXCLUDE_DOCS
readonly ROOT_FS TMP_IN_TMPFS UEK_RELEASE RESCUE_KERNEL ISO_LABEL LINUX_FIRMWARE KERNEL_MODULES EXCLUDE_DOCS
}

#######################################
Expand Down Expand Up @@ -101,6 +102,9 @@ logvol / --fstype=\"xfs\" --vgname=vg_main --size=4096 --name=lv_root --gr
if [[ "${EXCLUDE_DOCS,,}" = "yes" ]]; then
sed -i -e 's!^%packages!%packages --excludedocs!' "${ks_file}"
fi

# /tmp in tmpfs
sed -i -e "s!^TMP_IN_TMPFS=no!TMP_IN_TMPFS=$TMP_IN_TMPFS!" "${ks_file}"
}

#######################################
Expand Down
5 changes: 5 additions & 0 deletions oracle-linux-image-tools/distr/ol8-aarch64/ol8-aarch64-ks.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,11 @@ else
dnf install -y ${dnf_options} ${kernel}
fi

# use tmpfs for /tmp
TMP_IN_TMPFS=no
if [[ "${TMP_IN_TMPFS,,}" == "yes" ]]; then
systemctl enable tmp.mount
fi
%end

%addon com_redhat_kdump --disable
Expand Down
8 changes: 6 additions & 2 deletions oracle-linux-image-tools/distr/ol8-slim/image-scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#######################################
# Validate distribution parameters
# Globals:
# RESCUE_LERNEL ROOT_FS
# ROOT_FS TMP_IN_TMPFS UEK_RELEASE RESCUE_KERNEL KERNEL_MODULES LINUX_FIRMWARE EXCLUDE_DOCS
# Arguments:
# None
# Returns:
Expand All @@ -28,12 +28,13 @@
distr::validate() {
[[ "${ROOT_FS,,}" =~ ^(xfs)|(btrfs)|(lvm)$ ]] || error "ROOT_FS must be xfs, btrfs or lvm"
[[ "${ROOT_FS,,}" = "btrfs" ]] && echo_message "Note that for btrfs root filesystem you need to use an UEK boot ISO"
[[ "${TMP_IN_TMPFS,,}" =~ ^(yes)|(no)$ ]] || error "TMP_IN_TMPFS must be yes or no"
[[ "${UEK_RELEASE}" =~ ^[67]$ ]] || error "UEK_RELEASE must be 6 or 7"
[[ "${RESCUE_KERNEL,,}" =~ ^(yes)|(no)$ ]] || error "RESCUE_KERNEL must be yes or no"
[[ "${KERNEL_MODULES,,}" =~ ^(yes)|(no)$ ]] || error "KERNEL_MODULES must be yes or no"
[[ "${LINUX_FIRMWARE,,}" =~ ^(yes)|(no)$ ]] || error "LINUX_FIRMWARE must be yes or no"
[[ "${EXCLUDE_DOCS,,}" =~ ^(yes)|(no)|(minimal)$ ]] || error "EXCLUDE_DOCS must be yes, no or minimal"
readonly ROOT_FS UEK_RELEASE RESCUE_KERNEL KERNEL_MODULES LINUX_FIRMWARE EXCLUDE_DOCS
readonly ROOT_FS TMP_IN_TMPFS UEK_RELEASE RESCUE_KERNEL KERNEL_MODULES LINUX_FIRMWARE EXCLUDE_DOCS
}

#######################################
Expand Down Expand Up @@ -83,6 +84,9 @@ logvol / --fstype=\"xfs\" --vgname=vg_main --size=4096 --name=lv_root --gr
if [[ "${EXCLUDE_DOCS,,}" = "yes" ]]; then
sed -i -e 's!^%packages!%packages --excludedocs!' "${ks_file}"
fi

# /tmp in tmpfs
sed -i -e "s!^TMP_IN_TMPFS=no!TMP_IN_TMPFS=$TMP_IN_TMPFS!" "${ks_file}"
}

#######################################
Expand Down
5 changes: 5 additions & 0 deletions oracle-linux-image-tools/distr/ol8-slim/ol8-ks.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@ else
dnf install -y ${dnf_options} ${kernel}
fi

# use tmpfs for /tmp
TMP_IN_TMPFS=no
if [[ "${TMP_IN_TMPFS,,}" == "yes" ]]; then
systemctl enable tmp.mount
fi
%end

%addon com_redhat_kdump --disable
Expand Down
8 changes: 6 additions & 2 deletions oracle-linux-image-tools/distr/ol9-aarch64/image-scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#######################################
# Validate distribution parameters
# Globals:
# ISO_LABEL RESCUE_LERNEL ROOT_FS
# ROOT_FS TMP_IN_TMPFS RESCUE_KERNEL ISO_LABEL KERNEL_MODULES EXCLUDE_DOCS
# Arguments:
# None
# Returns:
Expand All @@ -28,11 +28,12 @@
distr::validate() {
[[ "${ROOT_FS,,}" =~ ^(xfs)|(btrfs)|(lvm)$ ]] || error "ROOT_FS must be xfs, btrfs or lvm"
[[ "${ROOT_FS,,}" = "btrfs" ]] && echo_message "Note that for btrfs root filesystem you need to use an UEK boot ISO"
[[ "${TMP_IN_TMPFS,,}" =~ ^(yes)|(no)$ ]] || error "TMP_IN_TMPFS must be yes or no"
[[ "${RESCUE_KERNEL,,}" =~ ^(yes)|(no)$ ]] || error "RESCUE_KERNEL must be yes or no"
[[ -n ${ISO_LABEL} ]] || error "ISO_LABEL must be provided"
[[ "${KERNEL_MODULES,,}" =~ ^(yes)|(no)$ ]] || error "KERNEL_MODULES must be yes or no"
[[ "${EXCLUDE_DOCS,,}" =~ ^(yes)|(no)|(minimal)$ ]] || error "EXCLUDE_DOCS must be yes, no or minimal"
readonly ROOT_FS RESCUE_KERNEL ISO_LABEL KERNEL_MODULES EXCLUDE_DOCS
readonly ROOT_FS TMP_IN_TMPFS RESCUE_KERNEL ISO_LABEL KERNEL_MODULES EXCLUDE_DOCS
}

#######################################
Expand Down Expand Up @@ -82,6 +83,9 @@ logvol / --fstype=\"xfs\" --vgname=vg_main --size=4096 --name=lv_root --gr
if [[ "${EXCLUDE_DOCS,,}" = "yes" ]]; then
sed -i -e 's!^%packages!%packages --excludedocs!' "${ks_file}"
fi

# /tmp in tmpfs
sed -i -e "s!^TMP_IN_TMPFS=no!TMP_IN_TMPFS=$TMP_IN_TMPFS!" "${ks_file}"
}

#######################################
Expand Down
5 changes: 5 additions & 0 deletions oracle-linux-image-tools/distr/ol9-aarch64/ol9-aarch64-ks.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@ fi
# Ensure we have the correct boot options
grub2-mkconfig -o /boot/grub2/grub.cfg

# use tmpfs for /tmp
TMP_IN_TMPFS=no
if [[ "${TMP_IN_TMPFS,,}" == "yes" ]]; then
systemctl enable tmp.mount
fi
%end

%addon com_redhat_kdump --disable
Expand Down
8 changes: 6 additions & 2 deletions oracle-linux-image-tools/distr/ol9-slim/image-scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#######################################
# Validate distribution parameters
# Globals:
# RESCUE_LERNEL ROOT_FS
# ROOT_FS TMP_IN_TMPFS RESCUE_KERNEL KERNEL_MODULES EXCLUDE_DOCS
# Arguments:
# None
# Returns:
Expand All @@ -28,10 +28,11 @@
distr::validate() {
[[ "${ROOT_FS,,}" =~ ^(xfs)|(btrfs)|(lvm)$ ]] || error "ROOT_FS must be xfs, btrfs or lvm"
[[ "${ROOT_FS,,}" = "btrfs" ]] && echo_message "Note that for btrfs root filesystem you need to use an UEK boot ISO"
[[ "${TMP_IN_TMPFS,,}" =~ ^(yes)|(no)$ ]] || error "TMP_IN_TMPFS must be yes or no"
[[ "${RESCUE_KERNEL,,}" =~ ^(yes)|(no)$ ]] || error "RESCUE_KERNEL must be yes or no"
[[ "${KERNEL_MODULES,,}" =~ ^(yes)|(no)$ ]] || error "KERNEL_MODULES must be yes or no"
[[ "${EXCLUDE_DOCS,,}" =~ ^(yes)|(no)|(minimal)$ ]] || error "EXCLUDE_DOCS must be yes, no or minimal"
readonly ROOT_FS RESCUE_KERNEL KERNEL_MODULES EXCLUDE_DOCS
readonly ROOT_FS TMP_IN_TMPFS RESCUE_KERNEL KERNEL_MODULES EXCLUDE_DOCS
}

#######################################
Expand Down Expand Up @@ -80,6 +81,9 @@ logvol / --fstype=\"xfs\" --vgname=vg_main --size=4096 --name=lv_root --gr
if [[ "${EXCLUDE_DOCS,,}" = "yes" ]]; then
sed -i -e 's!^%packages!%packages --excludedocs!' "${ks_file}"
fi

# /tmp in tmpfs
sed -i -e "s!^TMP_IN_TMPFS=no!TMP_IN_TMPFS=$TMP_IN_TMPFS!" "${ks_file}"
}

#######################################
Expand Down
5 changes: 5 additions & 0 deletions oracle-linux-image-tools/distr/ol9-slim/ol9-ks.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@ fi
# Ensure we have the correct boot options
grub2-mkconfig -o /boot/grub2/grub.cfg

# use tmpfs for /tmp
TMP_IN_TMPFS=no
if [[ "${TMP_IN_TMPFS,,}" == "yes" ]]; then
systemctl enable tmp.mount
fi
%end

%addon com_redhat_kdump --disable
Expand Down
3 changes: 3 additions & 0 deletions oracle-linux-image-tools/env.properties
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ CLOUD="none"
# Root filesystem: btrfs, xfs or lvm (Default: xfs)
# ROOT_FS=

# Set /tmp to tmpfs
# TMP_IN_TMPFS="no"

# Which kernel? (uek, rhck, modrhck, default is distribution / cloud specific)
# KERNEL=

Expand Down
5 changes: 4 additions & 1 deletion oracle-linux-image-tools/env.properties.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ SELINUX="enforcing"
# Allocated disk size for the image.
DISK_SIZE_GB=15

# Set /tmp to tmpfs
TMP_IN_TMPFS="no"

# Root access to the VM. You must provide either a password or a key file.
SSH_PASSWORD=
SSH_KEY_FILE=
Expand All @@ -50,7 +53,7 @@ QEMU_BINARY=""
# If defined, override generated VM_NAME
VM_NAME=

# The following two parameters can be specified when using a boot install image
# The following two parameters can be specified when using a boot install image
# instead of a full DVD ISO image
# URL to an installation tree on a remote server
REPO_URL=
Expand Down