1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

live-iso: final fixes

This commit is contained in:
Steffen Vogel 2022-03-06 05:20:56 -05:00
parent d5e17879bb
commit d0a6af8fe6
4 changed files with 131 additions and 126 deletions

View file

@ -1,21 +0,0 @@
# ChangeLog
# 0.9.0
- Upgrade Fedora 25 to 29
- Use new repo location for FEIN e.V. packages
# 0.8.2
- Upgrade Fedora 24 to 25
# 0.8.1
- Upgrade villas-node to villas-node-0.3
- Fix villas repository URL
# 0.8
- Add live image and installable support
- Add villas-node-0.2
- Upgrade to fedora 24
# Prior versions
Prior version 0.8 the villas ISO was not made with anaconda/kickstart/livemedia-creator, but manually and not versioned, thus no older versions provided.

View file

@ -1,11 +1,10 @@
NAME ?= VILLASlive
RELEASEVER ?= 29
RELEASEVER ?= 35
RELEASEARCH ?= x86_64
DATE = $(shell date +%Y-%m-%d)
DEPLOY_HOST ?= villas.fein-aachen.org
DEPLOY_USER ?= acs
DEPLOY_PATH ?= /var/www/villas/iso/beta/
DEPLOY_PATH ?= https://files.fein-aachen.org/
DEPLOY_USER ?= webdav
ifneq ($(CI),)
VERSION = $(CI_COMMIT_REF_NAME)
@ -15,40 +14,42 @@ endif
BASE = $(NAME)-$(RELEASEARCH)-$(RELEASEVER)
IMG = $(BASE)-$(VERSION:v%=%).img
ISO = $(BASE)-$(VERSION:v%=%).iso
IMG_LATEST = $(BASE)-latest.iso
ISO_LATEST = $(BASE)-latest.iso
BASE_ISO=Fedora-Server-netinst-$(RELEASEARCH)-$(RELEASEVER)-1.2.iso
SRCDIR := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
BUILDDIR ?= $(SRCDIR)/build
RSYNCOPTS ?= --recursive --ignore-missing-args --copy-links --chown $(DEPLOY_USER):$(DEPLOY_USER)
export BUILDDIR
FILES = $(shell find $(SRCDIR)/files -type f)
PATCHED_FILES = $(FILES:$(SRCDIR)/files/%=$(BUILDDIR)/patched_files/%)
# Tools
LMC = livemedia-creator --releasever=$(RELEASEVER) --project=$(NAME) --title=$(NAME)
LMC = livemedia-creator \
--releasever=$(RELEASEVER) \
--ram=8192 \
--vcpus=16
# Targets
all: $(BUILDDIR)/$(IMG)
all: iso
iso: $(BUILDDIR)/$(ISO)
patched: $(PATCHED_FILES)
clean:
rm -rf $(BUILDDIR)
deploy: $(BUILDDIR)/$(IMG)
rsync $(RSYNCOPTS) $(BUILDDIR)/$(IMG) ChangeLog $(DEPLOY_USER}@$(DEPLOY_HOST):$(DEPLOY_PATH)
ssh $(DEPLOY_USER)@$(DEPLOY_HOST) ln -s $(DEPLOY_PATH)/$(ISO) $(DEPLOY_PATH)/$(IMG_LATEST)
deploy: #$(BUILDDIR)/$(ISO)
rclone config create fein webdav url ${DEPLOY_PATH} vendor other user ${DEPLOY_USER} pass ${DEPLOY_PASS}
rclone config show
rclone copy $(BUILDDIR)/$(ISO) fein:villas/iso
$(BUILDDIR)/$(IMG): $(BUILDDIR)/img/villas-live.img
$(BUILDDIR)/$(ISO): $(BUILDDIR)/iso/villas.iso
ln -s $< $@
$(BUILDDIR)/$(ISO): $(BUILDDIR)/iso/villas-live.iso
ln -s $< $@
$(BUILDDIR)/iso/%.iso: $(SRCDIR)/%.ks $(PATCHED_FILES)
$(BUILDDIR)/iso/%.iso: $(SRCDIR)/%.ks /tmp/$(BASE_ISO)
# livemedia-creator requires that the resultdir is not present
rm -rf $(dir $@)
@ -57,22 +58,17 @@ $(BUILDDIR)/iso/%.iso: $(SRCDIR)/%.ks $(PATCHED_FILES)
# that there are some usable /dev/loopX devices.
./ensure_loop.sh
$(LMC) --make-iso --iso-only --iso-name=$(notdir $@) --resultdir=$(dir $@) --ks $<
$(BUILDDIR)/img/%.img: $(SRCDIR)/%.ks $(PATCHED_FILES) Fedora-Server-netinst-x86_64-29_Beta-1.5.iso
# livemedia-creator requires that the resultdir is not present
rm -rf $(dir $@)
# livemedia-creator uses losetup to mount the image
# When used in a Docker container, we must make sure
# that there are some usable /dev/loopX devices.
./ensure_loop.sh
$(LMC) --make-disk --resultdir=$(dir $@) --ks $< --iso Fedora-Server-netinst-x86_64-29_Beta-1.5.iso
Fedora-Server-netinst-x86_64-29_Beta-1.5.iso:
wget -nv https://download.fedoraproject.org/pub/fedora/linux/releases/test/29_Beta/Server/x86_64/iso/Fedora-Server-netinst-x86_64-29_Beta-1.5.iso
$(LMC) \
--make-iso \
--iso-only \
--iso-name=$(notdir $@) \
--iso /tmp/$(BASE_ISO) \
--resultdir=$(dir $@) \
--kernel-args "inst.ks=file:/villas.ks" \
--ks $<
/tmp/$(BASE_ISO):
wget -nv -O $@ https://ftp.halifax.rwth-aachen.de/fedora/linux/releases/$(RELEASEVER)/Server/$(RELEASEARCH)/iso/$(BASE_ISO)
$(BUILDDIR)/patched_files/%: $(SRCDIR)/files/%
@mkdir -p $(dir $@)
@ -81,6 +77,6 @@ $(BUILDDIR)/patched_files/%: $(SRCDIR)/files/%
-e "s/§RELEASEARCH§/$(RELEASEARCH)/g" \
-e "s/§DATE§/$(DATE)/g" < $< > $@
.PHONY: all deploy clean deploy
.PHONY: all deploy clean deploy patched iso
.PRECIOUS: %

@ -1 +1 @@
Subproject commit 9e89057b4a370c54ef88af4402938ce59216250e
Subproject commit 410251a8a5854d978e22ca8fc902cc8763a72038

View file

@ -1,23 +1,20 @@
################################################################################
# VILLASlive image
# Kickstart file for VILLAS installation
################################################################################
# Configuration
lang en_US.UTF-8
keyboard us
timezone Europe/Berlin
auth --useshadow --passalgo=sha512
selinux --disabled
firewall --disabled
services --enabled=sshd,NetworkManager,chronyd,sshd,tuned,initial-setup
network --bootproto=dhcp --device=link --activate
network --bootproto=dhcp --device=link --activate --hostname=villas
rootpw --plaintext villas-admin
shutdown
# make sure that initial-setup runs and lets us do all the configuration bits
firstboot --reconfig
bootloader --timeout=1 --append "preempt=full"
bootloader --timeout=1
zerombr
clearpart --all --initlabel --disklabel=msdos
part / --size=8192 --fstype ext4
@ -26,9 +23,6 @@ part / --size=8192 --fstype ext4
firstboot --reconfig
# Add repositories
repo --name=planet-ccrma --install --baseurl=http://ccrma.stanford.edu/planetccrma/mirror/fedora/linux/planetcore/28/$basearch/
repo --name=fein --install --baseurl=https://packages.fein-aachen.org/fedora/$releasever/$basearch/
repo --name=fedora --mirrorlist=https://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
repo --name=updates --mirrorlist=https://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch
url --mirrorlist=https://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
@ -50,6 +44,7 @@ glibc-langpack-en
# remove this in %post
dracut-config-generic
-dracut-config-rescue
dracut-live
# install tools needed to manage and boot arm systems
-uboot-images-armv7
-initial-setup-gui
@ -68,45 +63,69 @@ kernel
kernel-modules
kernel-modules-extra
kernel-rt
kernel-rt-modules
kernel-rt-modules-extra
# Some custom packages
tuned
tuned-profiles-realtime
# Tools
jq
iproute
nano
ntp
lshw
traceroute
bind-utils
curl
tar
openssh-clients
python-pip
psmisc
procps-ng
tmux
wget
gcc
autoconf
automake
bash-completion
bind-utils
bison
chrony
cmake
curl
dia
doxygen
flex
gcc
gcc-c++
git
graphviz
iproute
jq
libtool
lshw
make
mercurial
nano
ninja-build
openssh-clients
pkgconfig
procps-ng
protobuf-c-compiler
protobuf-compiler
psmisc
python-pip
tar
texinfo
tmux
traceroute
wget
# For building Tinc-VPN
readline-devel
zlib-devel
# Libraries and build-time dependencies of VILLASnode
openssl-devel
lzo-devel
systemd-devel
# VILLASnode
villas-node
villas-node-doc
villas-node-tools
villas-node-plugins
protobuf-devel
protobuf-c-devel
libuuid-devel
libconfig-devel
libnl3-devel
libcurl-devel
jansson-devel
spdlog-devel
fmt-devel
libwebsockets-devel
zeromq-devel
nanomsg-devel
librabbitmq-devel
mosquitto-devel
libibverbs-devel
librdmacm-devel
re-devel
libusb-devel
lua-devel
librdkafka-devel
%end
@ -114,54 +133,65 @@ villas-node-plugins
# Custom post installer
%post
# Select tuned profile
# Install VILLASnode
mkdir /villas
git clone https://git.rwth-aachen.de/acs/public/villas/node.git /villas/node
cd /villas/node
git submodule update --init common
bash ./packaging/deps.sh
mkdir build
cd build
cmake ..
make -j$(nproc) install
echo /usr/local/lib64 > /etc/ld.so.conf.d/local.conf
ldconfig
# Select real-time tuned profile
PROC=$(nproc)
ISOLATED_CORES=
if ((PROC > 4)); then
ISOLATED_CORES+=$(seq -s, $((PROC/2)) $((PROC-1)))
fi
echo isolated_cores=${ISOLATED_CORES} >> /etc/tuned/realtime-variables.conf
tuned-adm profile realtime
# Install patched files
cd /villas/node/packaging/live-iso
make patched
rsync --ignore-errors --archive --verbose /villas/node/packaging/live-iso/build/patched_files/ /
%end
################################################################################
# Copy all files to ISO and fix permissions
%post --nochroot
export
mount
#set -x
#
#rsync --ignore-errors --archive --verbose $BUILDDIR/patched_files/ /mnt/sysimage/
#
#chmod 600 /mnt/sysimage/root/.ssh/id_rsa*
#chmod 755 /mnt/sysimage/usr/local/bin/remote-admin
#chmod 755 /mnt/sysimage/usr/local/bin/install-tinc
#chmod 755 /mnt/sysimage/usr/local/bin/tune-realtime
%end
# From fedora-disk-base
%post
releasever=$(rpm -q --qf '%{version}\n' fedora-release)
# Find the architecture we are on
arch=$(uname -m)
releasever=$(rpm --eval '%{fedora}')
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-primary
echo "Packages within this disk image"
rpm -qa
# Note that running rpm recreates the rpm db files which aren't needed or wanted
rm -f /var/lib/rpm/__db*
rpm -qa --qf '%{size}\t%{name}-%{version}-%{release}.%{arch}\n' |sort -rn
# remove random seed, the newly installed instance should make it's own
rm -f /var/lib/systemd/random-seed
# The enp1s0 interface is a left over from the imagefactory install, clean this up
rm -f /etc/sysconfig/network-scripts/ifcfg-enp1s0
rm -f /etc/NetworkManager/system-connections/*.nmconnection
dnf -y remove dracut-config-generic
# Disable network service here, as doing it in the services line
# fails due to RHBZ #1369794
/sbin/chkconfig network off
# Remove machine-id on pre generated images
rm -f /etc/machine-id
touch /etc/machine-id
# Note that running rpm recreates the rpm db files which aren't needed or wanted
rm -f /var/lib/rpm/__db*
%end