From 6b51feb1fdfe2f0735c716e35bb3570dff37d669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Thu, 7 May 2020 08:25:00 +0200 Subject: [PATCH 01/13] Bump Fedora image (F31 -> F32) --- fedora-build-opennebula-image.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fedora-build-opennebula-image.sh b/fedora-build-opennebula-image.sh index 45c1629..a84a960 100755 --- a/fedora-build-opennebula-image.sh +++ b/fedora-build-opennebula-image.sh @@ -18,7 +18,7 @@ set -e set -x # XXX: Handle command-line arguments? -RELEASE=31 +RELEASE=32 ARCH=x86_64 IMAGE_PATH=fedora-$RELEASE-$(date +%+F).img.qcow2 IMAGE_SIZE=10G From 8970127c246a052d6aa24825f8db453719cbbca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Thu, 7 May 2020 08:30:08 +0200 Subject: [PATCH 02/13] Add haveged to Fedora image --- fedora-build-opennebula-image.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fedora-build-opennebula-image.sh b/fedora-build-opennebula-image.sh index a84a960..b4bc5c6 100755 --- a/fedora-build-opennebula-image.sh +++ b/fedora-build-opennebula-image.sh @@ -132,6 +132,10 @@ run_root systemd-machine-id-setup run_root ln -sf /usr/share/zoneinfo/UTC /etc/localtime run_root systemctl enable systemd-timesyncd.service +# Install haveged due to lack of entropy in ONE environment. +run_root dnf -y install haveged +run_root systemctl enable haveged.service + # Install kernel and bootloader. # Note: linux-firmware is not required our environment and takes almost 200M # uncompressed but is a direct dependency of kernel-core... From 6ea31faa476f9b516b4bdc51c214e79b1b024f01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Mon, 11 May 2020 10:18:46 +0200 Subject: [PATCH 03/13] Move ONE image defitions to their own folder --- .../alpine-build-opennebula-image.sh | 0 .../fedora-build-opennebula-image.sh | 0 .../ubuntu-build-opennebula-image.sh | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename alpine-build-opennebula-image.sh => opennebula-images/alpine-build-opennebula-image.sh (100%) rename fedora-build-opennebula-image.sh => opennebula-images/fedora-build-opennebula-image.sh (100%) rename ubuntu-build-opennebula-image.sh => opennebula-images/ubuntu-build-opennebula-image.sh (100%) diff --git a/alpine-build-opennebula-image.sh b/opennebula-images/alpine-build-opennebula-image.sh similarity index 100% rename from alpine-build-opennebula-image.sh rename to opennebula-images/alpine-build-opennebula-image.sh diff --git a/fedora-build-opennebula-image.sh b/opennebula-images/fedora-build-opennebula-image.sh similarity index 100% rename from fedora-build-opennebula-image.sh rename to opennebula-images/fedora-build-opennebula-image.sh diff --git a/ubuntu-build-opennebula-image.sh b/opennebula-images/ubuntu-build-opennebula-image.sh similarity index 100% rename from ubuntu-build-opennebula-image.sh rename to opennebula-images/ubuntu-build-opennebula-image.sh From 43b52b264df75d8b223d40ed532cfb7c33a42857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Mon, 11 May 2020 10:20:00 +0200 Subject: [PATCH 04/13] Add forgotten centos to opennebula-images dir, +x ubuntu-build-one-... --- .../centos-build-opennebula-image.sh | 0 opennebula-images/ubuntu-build-opennebula-image.sh | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename centos-build-opennebula-image.sh => opennebula-images/centos-build-opennebula-image.sh (100%) mode change 100644 => 100755 opennebula-images/ubuntu-build-opennebula-image.sh diff --git a/centos-build-opennebula-image.sh b/opennebula-images/centos-build-opennebula-image.sh similarity index 100% rename from centos-build-opennebula-image.sh rename to opennebula-images/centos-build-opennebula-image.sh diff --git a/opennebula-images/ubuntu-build-opennebula-image.sh b/opennebula-images/ubuntu-build-opennebula-image.sh old mode 100644 new mode 100755 From b3f79de311110baa532e81c9b3437db7093a05e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Mon, 11 May 2020 10:51:26 +0200 Subject: [PATCH 05/13] Add debian image build definition --- .../debian-build-opennebula-image.sh | 164 ++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100755 opennebula-images/debian-build-opennebula-image.sh diff --git a/opennebula-images/debian-build-opennebula-image.sh b/opennebula-images/debian-build-opennebula-image.sh new file mode 100755 index 0000000..17dc1e3 --- /dev/null +++ b/opennebula-images/debian-build-opennebula-image.sh @@ -0,0 +1,164 @@ +#!/bin/sh + +# This script generates Debian images for OpenNebula. +# +# Test image locally (without network) with: +# qemu-system-x86_64 -enable-kvm -m 1G -drive file=$IMAGE,format=qcow2 + +set -e +set -x + +# XXX: Handle command-line arguments? +RELEASE=buster # 10.X +ARCH=amd64 +IMAGE_PATH=debian-$RELEASE-$(date --iso-8601).img.qcow2 +IMAGE_SIZE=10G +NBD_DEVICE=/dev/nbd0 + +# TODO: find the package definition and built ourself, publish in some RPM repository. +ONE_CONTEXT_DEB_URL="https://github.com/OpenNebula/addon-context-linux/releases/download/v5.10.0/one-context_5.10.0-1.deb" +ONE_CONTEXT_DEB_PATH=/root/one-context.deb + +cleanup() { + # The order here is important. + umount /mnt/dev/pts 2>/dev/null || true + umount /mnt/dev/shm 2>/dev/null || true + umount /mnt/dev 2>/dev/null || true + umount /mnt/proc 2>/dev/null || true + umount /mnt/run 2>/dev/null || true + umount /mnt/sys 2>/dev/null || true + umount /mnt/boot 2>/dev/null || true + umount /mnt 2>/dev/null || true + qemu-nbd --disconnect "$NBD_DEVICE" || true +} + +run_root() { + chroot /mnt /usr/bin/env \ + PATH=/sbin:/usr/sbin:/bin:/usr/bin \ + sh -c "$*" +} + +if [ "$(whoami)" != 'root' ]; then + echo "This script must be run as root." >&2 + exit 1 +fi + +if [ $(lsb_release --short --id) != "Ubuntu" ]; then + echo "WARNING: this script has been designed to run on an Ubuntu system." >&2 + echo "WARNING: Not running Ubuntu. Giving you 5 seconds to abort." >&2 + sleep 5 +fi + +# Create base QCOW2 image. +qemu-img create -f qcow2 "$IMAGE_PATH" "$IMAGE_SIZE" +modprobe nbd max_part=16 +qemu-nbd --connect="$NBD_DEVICE" "$IMAGE_PATH" + +# Wait for qemu-nbd to settle. +sleep 1 + +# Don't forget to cleanup, even if the script crash. +trap cleanup EXIT + +# Create partition table, format partitions. +sfdisk --no-reread "$NBD_DEVICE" < /mnt/etc/hosts << EOF +127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 +::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 + +EOF + +# Configure package sources and update package index. +cat >/mnt/etc/apt/sources.list < "/mnt$ONE_CONTEXT_DEB_PATH" +run_root apt-get -y install "$ONE_CONTEXT_DEB_PATH" +run_root rm "$ONE_CONTEXT_DEB_PATH" + +# Manually install legacy network scripts used by one-context. +run_root apt-get -y install ifupdown + +# Initalize base services. +run_root systemd-machine-id-setup + +run_root ln -sf /usr/share/zoneinfo/UTC /etc/localtime +run_root systemctl enable systemd-timesyncd.service + +# Install kernel and bootloader. Do not autoconfigure grub. +run_root 'echo "grub-pc grub-pc/install_devices_empty boolean true" | debconf-set-selections' +run_root DEBIAN_FRONTEND=noninteractive apt-get -y install locales linux-image-amd64 grub-pc + +# Configure grub. +run_root grub-install --target=i386-pc "${NBD_DEVICE}" +run_root grub-mkconfig -o /boot/grub/grub.cfg + +# Install en configure SSH daemon. +run_root apt-get -y install openssh-server + +# Install haveged due to lack of entropy in ONE environment. +run_root apt-get -y install haveged +run_root systemctl enable haveged.service + +# Generate fstab file. +boot_uuid=$(blkid --match-tag UUID --output value "${NBD_DEVICE}p1") +root_uuid=$(blkid --match-tag UUID --output value "${NBD_DEVICE}p2") +cat >>/mnt/etc/fstab < Date: Mon, 11 May 2020 12:29:52 +0200 Subject: [PATCH 06/13] [OpenNebula-images] Add scripts to generate FreeBSD images. Tested for 12.1-RELEASE, 11.3-STABLE should be tested as well. Two scripts are added, FreeBSD-build-opennebula-image-generic.sh takes information from the environment and generates the specified image with either dualstack or IPv6-only kernel and base applications. FreeBSD-build-opennebula-image.sh has the versions supported in DCL and generates all neeeded images (combination of Version x Network support). This should run in a DCL VM with an OK amount of cores (4/8 minimum), 2-4G RAM, and storage of roughly 20G + 5G * #resulting_images. This is because there is the base system, a 'pristine chroot', and during the build there can be 2 copies of the resulting system written to the system. Since there are 4 combinations of images: {STABLE,RELEASE} x {dualstack, IPv6ONLY} That means we'll need to assign about 40G storage to be on the safe side. --- .../FreeBSD-build-opennebula-image-generic.sh | 243 ++++++++++++++++++ .../FreeBSD-build-opennebula-image.sh | 31 +++ 2 files changed, 274 insertions(+) create mode 100644 opennebula-images/FreeBSD-build-opennebula-image-generic.sh create mode 100755 opennebula-images/FreeBSD-build-opennebula-image.sh diff --git a/opennebula-images/FreeBSD-build-opennebula-image-generic.sh b/opennebula-images/FreeBSD-build-opennebula-image-generic.sh new file mode 100644 index 0000000..d251f56 --- /dev/null +++ b/opennebula-images/FreeBSD-build-opennebula-image-generic.sh @@ -0,0 +1,243 @@ +#!/bin/sh +# +# Copyright 2020 -- Evilham +# This is BSD licensed as it's based on BSD-licensed code +# +# We could have used e.g. something like: +# - https://git.sr.ht/~sircmpwn/builds.sr.ht/tree/master/images/freebsd/genimg +# +# But we actually do want to compile the kernel, so that the IPv6-only images +# are different and don't support INET. + +# Explode if something goes wrong +set -e + +# What are we building? +# These are the only configuration options. +# They default to current environment. +# RELEASE: should be 'CURRENT' for current or 'X.Y' Defaults to 'CURRENT'. +# ARCH: probably amd64 for DCL +# VMFORMATS: defaults to qcow2, can also be raw. See man mkimg. +# OPENNEBULA_CONTEXT_VERSION: For DCL's OpenNebula that'd be 5.10.0 (default) +# OPENNEBULA_CONTEXT_REVISION: Defaults to 1. +RELEASE=${RELEASE:-CURRENT} +if [ "${RELEASE}" == "CURRENT" ]; then + SRCBRANCH="master" +else + SRCBRANCH="releng/${RELEASE}" +fi +ARCH=${ARCH:-amd64} +VMFORMATS=${VMFORMATS:-qcow2} +OPENNEBULA_CONTEXT_VERSION=${OPENNEBULA_CONTEXT_VERSION:-5.10.0} +OPENNEBULA_CONTEXT_REVISION=${OPENNEBULA_CONTEXT_REVISION:-1} + +# Didn't see a need to make these configurable. +CHROOTDIR="/scratch" +SRCDIR="${CHROOTDIR}/usr/src" +OUR_DIR="$(realpath $(dirname "${0}"))" +OUR_SRCCONF="${SRCDIR}/release/src.conf" +OUR_RELEASE_CONF="${SRCDIR}/release/release.conf" +# Shorthand for the package file name. +OPENNEBULA_CONTEXT="one-context-${OPENNEBULA_CONTEXT_VERSION}_${OPENNEBULA_CONTEXT_REVISION}.txz" + +setup_sources() { + # Let's use git, we might need to install it + if ! which git 2>&1 > /dev/null; then + pkg install -y git + fi + + if [ ! -d "$(dirname ${SRCDIR})" ]; then + mkdir -p "$(dirname ${SRCDIR})" + fi + + # Checkout needed branch + if [ ! -d "${SRCDIR}" ]; then + git clone "https://github.com/freebsd/freebsd" \ + --branch "${SRCBRANCH}" "${SRCDIR}" + else + GIT_CMD="git -C ${SRCDIR}" + ${GIT_CMD} clean -df + ${GIT_CMD} reset --hard + ${GIT_CMD} fetch + ${GIT_CMD} checkout "${SRCBRANCH}" + ${GIT_CMD} pull + fi + + # Add settings for IPv6-only kernel + cat > "${SRCDIR}/sys/${ARCH}/conf/GENERIC-IPV6ONLY" << EOF +include GENERIC +ident GENERIC-IPV6ONLY +makeoptions MKMODULESENV+="WITHOUT_INET_SUPPORT=" +nooptions INET +nodevice gre +EOF + # Fix vmimage.subr to install custom package and fix other things + cat >> "${SRCDIR}/release/tools/vmimage.subr" << EOF +vm_extra_install_ports() { + # Make sure we install the opennbula context package + cp "/${OPENNEBULA_CONTEXT}" "\${DESTDIR}/tmp/${OPENNEBULA_CONTEXT}" + chroot \${DESTDIR} \${EMULATOR} env ASSUME_ALWAYS_YES=yes \\ + /usr/sbin/pkg add '/tmp/${OPENNEBULA_CONTEXT}' + + # Now make sure the system has better defaults + cat >> "\${DESTDIR}/etc/rc.conf" << eof +# Update to latest patch on first boot +firstboot_freebsd_update_enable="YES" +# Enable OpenNebula's service. +one_context_enable="YES" +# Enable SSH for customers +sshd_enable="YES" +# Clear tmp on boot +clear_tmp_enable="YES" +# Disable sendmail by default +sendmail_enable="NONE" +# Disable crash dumps +dumpdev="NO" +eof + # Enable root access with SSH key. + # It is user's responsibility to further secure their system. + sed -i '' -E \ + 's/(^#[ ]*|^)PermitRootLogin .*/PermitRootLogin without-password/' \ + "\${DESTDIR}/etc/ssh/sshd_config" +} +EOF + # Skip building iso images + rm "${SRCDIR}/release/${ARCH}/mkisoimages.sh" + # This is a hack to not build the memstick + cat > "${SRCDIR}/release/${ARCH}/make-memstick.sh" < \${CHROOTDIR}/etc/src-env.conf +} + +## Set the directory within which the release will be built. +CHROOTDIR="${CHROOTDIR}" + +## Set to override the default target architecture and kernel +TARGET="${ARCH}" +TARGET_ARCH="${ARCH}" +KERNEL="${KERNEL_CONFIG}" + +## Set to specify a custom make.conf and/or src.conf +SRC_CONF="${OUR_SRCCONF}" + +# Since these are VMs, users should add other components if they want to. +NODOC=YES +NOPORTS=YES +NOSRC=YES + +# We manage sources manually +SRC_UPDATE_SKIP=YES + +## Set to pass additional flags to make(1) for the build chroot setup, such +## as TARGET/TARGET_ARCH. +# This was necessary for "cross-compiling" +CHROOT_MAKEENV="MK_LLVM_TARGET_X86=yes" + +WITH_VMIMAGES=YES + +# VM image size, see man 1 truncate +VMSIZE="10G" + +# List of disk image formats, see man mkgimg. +VMFORMATS="${VMFORMATS}" + +# These variables have to be exported because they are needed in subprocesses. +export NOSWAP=YES +# Custom ports +# - firstboot-freebsd-update helps us not have to create an image for each +# patch level. We still will have to do it for each minor version update. +# - bash is apparently needed for one-context +export VM_EXTRA_PACKAGES="firstboot-freebsd-update bash" +EOF +} + +_do_run_release() { + . "${SRCDIR}/release/release.sh" +} +run_release() { + _do_run_release -c "${OUR_RELEASE_CONF}" +} + + +build_image() { + # Generate configuration + echo "${2}" > "${OUR_SRCCONF}" + KERNEL_CONFIG="${1}" + gen_releaseconf > "${OUR_RELEASE_CONF}" + # Be paranoid about files and stuff + sync + # Continue with the release script + run_release + # Be paranoid about files and stuff + sync + + mv "${CHROOTDIR}/R/vmimages" "${OUR_DIR}/FreeBSD-${RELEASE}-${1}" + + # Be paranoid about files and stuff + sync +} + +our_main() { + case "$1" in + --dualstack) + BUILD_DUALSTACK=yes + ;; + --ipv6only) + BUILD_IPV6ONLY=yes + ;; + *) + cat << EOF +Run with --dualstack or --ipv6only depending on the image you want. +EOF + exit 1 + ;; + esac + setup_sources + setup_our_env + # Fetch OpenNebula's context package + fetch "https://github.com/OpenNebula/addon-context-linux/releases/download/v${OPENNEBULA_CONTEXT_VERSION}/${OPENNEBULA_CONTEXT}" \ + -o "${CHROOTDIR}/${OPENNEBULA_CONTEXT}" + # Do run + if [ -n "${BUILD_DUALSTACK}" ]; then + build_image "GENERIC" + fi + if [ -n "${BUILD_IPV6ONLY}" ]; then + build_image "GENERIC-IPV6ONLY" "$(cat << EOF +WITHOUT_INET=yes +WITHOUT_INET_SUPPORT=yes +EOF +)" + fi + + cat << EOF + +*************** DONE *************** +You will find the images under "${OUR_DIR}". +************************************ +EOF +} + +our_main "${@}" diff --git a/opennebula-images/FreeBSD-build-opennebula-image.sh b/opennebula-images/FreeBSD-build-opennebula-image.sh new file mode 100755 index 0000000..c72a2b0 --- /dev/null +++ b/opennebula-images/FreeBSD-build-opennebula-image.sh @@ -0,0 +1,31 @@ +#!/bin/sh +# +# Copyright 2020 -- Evilham +# This is BSD licensed as it's based on BSD-licensed code +# +# +# This builds all needed FreeBSD images for ungleich's Data Center Light +# When there are new releases, they should be updated here and the script +# should run. +# 11.4 is scheduled end of June 2020 +# 12.2 is scheduled end of October 2020 +# + +SUPPORTED_RELEASES="11.3 12.1" + +# This should run in a DCL VM with an OK amount of cores (4/8 minimum), +# 4G RAM, and storage of roughly 20G + 5G * #resulting_images. +# +# This is because there is the base system, a 'pristine chroot', and during the +# build there can be 2 copies of the resulting system written to the system. +# Since there are 4 combinations of images: +# {STABLE,RELEASE} x {dualstack, IPv6ONLY} +# +# That means we'll need to assign about 40G storage to be on the safe side. + +for release in ${SUPPORTED_RELEASES}; do + for build in dualstack ipv6only; do + env RELEASE=${release} sh FreeBSD-build-opennebula-image-generic.sh --${build} \ + | tee "FreeBSD-${release}-${build}.log" + done +done From 4eb3bc55239e3439f126ba9cc7c0993abb15b1e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Tue, 12 May 2020 07:15:50 +0200 Subject: [PATCH 07/13] Add WIP archlinux image definition script --- .../arch-build-opennebula-image.sh | 154 ++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100755 opennebula-images/arch-build-opennebula-image.sh diff --git a/opennebula-images/arch-build-opennebula-image.sh b/opennebula-images/arch-build-opennebula-image.sh new file mode 100755 index 0000000..00c454f --- /dev/null +++ b/opennebula-images/arch-build-opennebula-image.sh @@ -0,0 +1,154 @@ +#!/bin/sh + +# This script generates Debian images for OpenNebula. +# +# Test image locally (without network) with: +# qemu-system-x86_64 -enable-kvm -m 1G -drive file=$IMAGE,format=qcow2 + +set -e +set -x + +# XXX: Handle command-line arguments? +ARCH=amd64 +IMAGE_PATH=arch-$(date --iso-8601).img.qcow2 +IMAGE_SIZE=10G +NBD_DEVICE=/dev/nbd0 + +# TODO: find the package definition and built ourself, publish in some RPM repository. +ONE_CONTEXT_DEB_URL="https://github.com/OpenNebula/addon-context-linux/releases/download/v5.10.0/one-context_5.10.0-1.deb" +ONE_CONTEXT_DEB_PATH=/root/one-context.deb + +cleanup() { + # The order here is important. + umount /mnt/dev/pts 2>/dev/null || true + umount /mnt/dev/shm 2>/dev/null || true + umount /mnt/dev 2>/dev/null || true + umount /mnt/proc 2>/dev/null || true + umount /mnt/run 2>/dev/null || true + umount /mnt/sys 2>/dev/null || true + umount /mnt/boot 2>/dev/null || true + umount /mnt 2>/dev/null || true + qemu-nbd --disconnect "$NBD_DEVICE" || true +} + +run_root() { + chroot /mnt /usr/bin/env \ + PATH=/sbin:/usr/sbin:/bin:/usr/bin \ + sh -c "$*" +} + +if [ "$(whoami)" != 'root' ]; then + echo "This script must be run as root." >&2 + exit 1 +fi + +if [ $(lsb_release --short --id) != "Arch" ]; then + echo "WARNING: this script has been designed to run on an Ubuntu system." >&2 + echo "WARNING: Not running Ubuntu. Giving you 5 seconds to abort." >&2 + sleep 5 +fi + +# Create base QCOW2 image. +qemu-img create -f qcow2 "$IMAGE_PATH" "$IMAGE_SIZE" +modprobe nbd max_part=16 +qemu-nbd --connect="$NBD_DEVICE" "$IMAGE_PATH" + +# Wait for qemu-nbd to settle. +sleep 1 + +# Don't forget to cleanup, even if the script crash. +trap cleanup EXIT + +# Create partition table, format partitions. +sfdisk --no-reread "$NBD_DEVICE" < /mnt/etc/hosts << EOF +127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 +::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 + +EOF + +# Configure package sources and update package index. +cat > /mnt/etc/pacman.d/mirrorlist << EOF +## +## Arch Linux repository mirrorlist +## Generated on 2020-05-12 +## + +## Switzerland +Server = http://pkg.adfinis-sygroup.ch/archlinux/$repo/os/$arch +Server = https://pkg.adfinis-sygroup.ch/archlinux/$repo/os/$arch +Server = http://mirror.init7.net/archlinux/$repo/os/$arch +Server = https://mirror.init7.net/archlinux/$repo/os/$arch +Server = http://mirror.puzzle.ch/archlinux/$repo/os/$arch +Server = https://mirror.puzzle.ch/archlinux/$repo/os/$arch +Server = https://mirror.ungleich.ch/mirror/packages/archlinux/$repo/os/$arch +EOF +run_root pacman --sync --refresh --upgrade + +# Initalize base services. +run_root systemd-machine-id-setup + +run_root ln -sf /usr/share/zoneinfo/UTC /etc/localtime +run_root systemctl enable systemd-timesyncd.service + +# Install kernel and generate initramfs. +run_root pacman --sync linux mkinitcpio +run_rot mkinitcpio -P + +# Install and configure bootloader. +run_root pacman --sync grub +run_root grub-install --target=i386-pc "${NBD_DEVICE}" +run_root grub-mkconfig -o /boot/grub/grub.cfg + +# Install en configure SSH daemon. +run_root pacman --sync openssh-server + +# Install haveged due to lack of entropy in ONE environment. +run_root pacman --sync haveged +run_root systemctl enable haveged.service + +# Generate fstab file. +boot_uuid=$(blkid --match-tag UUID --output value "${NBD_DEVICE}p1") +root_uuid=$(blkid --match-tag UUID --output value "${NBD_DEVICE}p2") +cat >>/mnt/etc/fstab < Date: Wed, 13 May 2020 11:41:34 +0200 Subject: [PATCH 08/13] Rename freebsd build scripts for consistency --- ...image-generic.sh => freebsd-build-opennebula-image-generic.sh} | 0 ...uild-opennebula-image.sh => freebsd-build-opennebula-image.sh} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename opennebula-images/{FreeBSD-build-opennebula-image-generic.sh => freebsd-build-opennebula-image-generic.sh} (100%) mode change 100644 => 100755 rename opennebula-images/{FreeBSD-build-opennebula-image.sh => freebsd-build-opennebula-image.sh} (100%) diff --git a/opennebula-images/FreeBSD-build-opennebula-image-generic.sh b/opennebula-images/freebsd-build-opennebula-image-generic.sh old mode 100644 new mode 100755 similarity index 100% rename from opennebula-images/FreeBSD-build-opennebula-image-generic.sh rename to opennebula-images/freebsd-build-opennebula-image-generic.sh diff --git a/opennebula-images/FreeBSD-build-opennebula-image.sh b/opennebula-images/freebsd-build-opennebula-image.sh similarity index 100% rename from opennebula-images/FreeBSD-build-opennebula-image.sh rename to opennebula-images/freebsd-build-opennebula-image.sh From 5af488b9d6a470f112740087529fffa97adce217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Wed, 13 May 2020 12:09:26 +0200 Subject: [PATCH 09/13] Fix script call in FreeBSD build following renaming --- opennebula-images/freebsd-build-opennebula-image.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/opennebula-images/freebsd-build-opennebula-image.sh b/opennebula-images/freebsd-build-opennebula-image.sh index c72a2b0..266f639 100755 --- a/opennebula-images/freebsd-build-opennebula-image.sh +++ b/opennebula-images/freebsd-build-opennebula-image.sh @@ -23,9 +23,10 @@ SUPPORTED_RELEASES="11.3 12.1" # # That means we'll need to assign about 40G storage to be on the safe side. +date=$(date -I) for release in ${SUPPORTED_RELEASES}; do for build in dualstack ipv6only; do - env RELEASE=${release} sh FreeBSD-build-opennebula-image-generic.sh --${build} \ - | tee "FreeBSD-${release}-${build}.log" + env RELEASE=${release} sh freebsd-build-opennebula-image-generic.sh --${build} \ + | tee "freebsd-${release}-${build}-${date}.log" done done From 0e7aa75959cdc8673c6c62c7abf02d686770cd8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Wed, 13 May 2020 14:25:17 +0200 Subject: [PATCH 10/13] Fix locale issue in debian image --- opennebula-images/debian-build-opennebula-image.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/opennebula-images/debian-build-opennebula-image.sh b/opennebula-images/debian-build-opennebula-image.sh index 17dc1e3..9a51f1e 100755 --- a/opennebula-images/debian-build-opennebula-image.sh +++ b/opennebula-images/debian-build-opennebula-image.sh @@ -144,6 +144,10 @@ run_root apt-get -y install openssh-server run_root apt-get -y install haveged run_root systemctl enable haveged.service +# Generate locales. +run_root sed -i 's/^# *\(en_GB.UTF-8\)/\1/' /etc/locale.gen +run_root locale-gen + # Generate fstab file. boot_uuid=$(blkid --match-tag UUID --output value "${NBD_DEVICE}p1") root_uuid=$(blkid --match-tag UUID --output value "${NBD_DEVICE}p2") From 5a2e01d0edfebc45e081067f259dc8fbe66d820d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Wed, 13 May 2020 14:27:58 +0200 Subject: [PATCH 11/13] s/Ubuntu/Debian/ in debian build script --- opennebula-images/debian-build-opennebula-image.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opennebula-images/debian-build-opennebula-image.sh b/opennebula-images/debian-build-opennebula-image.sh index 9a51f1e..67714bf 100755 --- a/opennebula-images/debian-build-opennebula-image.sh +++ b/opennebula-images/debian-build-opennebula-image.sh @@ -43,9 +43,9 @@ if [ "$(whoami)" != 'root' ]; then exit 1 fi -if [ $(lsb_release --short --id) != "Ubuntu" ]; then - echo "WARNING: this script has been designed to run on an Ubuntu system." >&2 - echo "WARNING: Not running Ubuntu. Giving you 5 seconds to abort." >&2 +if [ $(lsb_release --short --id) != "Debian" ]; then + echo "WARNING: this script has been designed to run on an Debian system." >&2 + echo "WARNING: Not running Debian. Giving you 5 seconds to abort." >&2 sleep 5 fi From 1d3b786a0f635f533116c024efee9ca2664fac77 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 15 May 2020 20:51:28 +0200 Subject: [PATCH 12/13] add shell script to update server to ceph nautilus --- ceph-upgrade-server-to-nautilus.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 ceph-upgrade-server-to-nautilus.sh diff --git a/ceph-upgrade-server-to-nautilus.sh b/ceph-upgrade-server-to-nautilus.sh new file mode 100644 index 0000000..058e40d --- /dev/null +++ b/ceph-upgrade-server-to-nautilus.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +rm -f /etc/apt/sources.list.d/ceph.list + +cat > /etc/apt/sources.list < /etc/apt/sources.list.d/backports.list +apt update +apt dist-upgrade -y +apt install -t buster-backports -y ceph From a2558df86804e403c1a2273fdf863fbad7349555 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 15 May 2020 20:52:45 +0200 Subject: [PATCH 13/13] Mode update --- ceph-upgrade-server-to-nautilus.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 ceph-upgrade-server-to-nautilus.sh diff --git a/ceph-upgrade-server-to-nautilus.sh b/ceph-upgrade-server-to-nautilus.sh old mode 100644 new mode 100755