From 11415886bbd6261e014c7d73ed56f6569f280c1d Mon Sep 17 00:00:00 2001 From: Jin-Guk Kwon Date: Tue, 28 Sep 2021 10:36:52 +0200 Subject: [PATCH] [image]Update arch-build-opennebula-image.sh for Task#9418 --- .../arch-build-opennebula-image.sh | 33 +++++++++++-------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/opennebula-images/arch-build-opennebula-image.sh b/opennebula-images/arch-build-opennebula-image.sh index f809de5..6415f7a 100755 --- a/opennebula-images/arch-build-opennebula-image.sh +++ b/opennebula-images/arch-build-opennebula-image.sh @@ -1,6 +1,6 @@ #!/bin/sh -# This script generates Debian images for OpenNebula. +# This script generates arch linux images for OpenNebula. # # Test image locally (without network) with: # qemu-system-x86_64 -enable-kvm -m 1G -drive file=$IMAGE,format=qcow2 @@ -13,7 +13,7 @@ IMAGE_PATH=arch-$(date --iso-8601).img.qcow2 IMAGE_SIZE=10G NBD_DEVICE=/dev/nbd0 -ONE_CONTEXT_VERSION=5.12.0.2 +ONE_CONTEXT_VERSION=6.0.0 ONE_CONTEXT_SOURCE_ARCHIVE="https://github.com/OpenNebula/addon-context-linux/archive/v$ONE_CONTEXT_VERSION.tar.gz" cleanup() { @@ -108,37 +108,44 @@ 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 +run_root pacman -Syu +#run_root pacman --sync --refresh --upgrade # Guest networking is to be handled by the one-context package. # See https://github.com/OpenNebula/addon-context-linux for details. -run_root pacman --sync curl tar +run_root pacman -Sy curl tar rsync --noconfirm run_root curl -L "$ONE_CONTEXT_SOURCE_ARCHIVE" -o one-context.tar.gz run_root tar xf one-context.tar.gz -run_root cp -rT addon-context-linux-${ONE_CONTEXT_VERSION}/src/ / +run_root rsync -avrh addon-context-linux-${ONE_CONTEXT_VERSION}/src/* / +#run_root cp -rT addon-context-linux-${ONE_CONTEXT_VERSION}/src/ / run_root rm -r addon-context-linux-${ONE_CONTEXT_VERSION} -run_root systemctl enable one-context.service +run_root cp -r /usr/lib/systemd/system/one-context.service##arch.one /usr/lib/systemd/system/one-context.service +#run_root systemctl enable one-context.service # 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 - +#run_root pacman -Q linux # Install kernel and generate initramfs. -run_root pacman --sync linux mkinitcpio -run_rot mkinitcpio -P +run_root pacman -Sy linux +run_root rsync -avrh /usr/lib/modules/ /lib/modules +#run_root pacman -Sy linux +run_root pacman -Sy mkinitcpio +#run_root pacman -S linux +run_root mkinitcpio -P # Install and configure bootloader. -run_root pacman --sync grub +run_root pacman -Sy grub --noconfirm 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 +run_root pacman -Sy openssh --noconfirm # Install haveged due to lack of entropy in ONE environment. -run_root pacman --sync haveged +run_root pacman -Sy haveged run_root systemctl enable haveged.service # Generate fstab file. @@ -155,4 +162,4 @@ run_root touch /etc/machine-id rm -f /var/lib/systemd/random-seed # Make sure everything is written to disk before exiting. -sync +sync \ No newline at end of file