From b992ae90295ef70c096979186f45fa5787383af7 Mon Sep 17 00:00:00 2001 From: "Andrew A. Vasilyev" Date: Wed, 12 Apr 2023 20:13:29 +0300 Subject: [PATCH] move initinstall.d/05-vm-profile to separate package volumes-profile-alt-server-v --- .../initinstall.d/05-vm-profile | 53 ------------------- 1 file changed, 53 deletions(-) delete mode 100755 installer-distro-alt-server-v/initinstall.d/05-vm-profile diff --git a/installer-distro-alt-server-v/initinstall.d/05-vm-profile b/installer-distro-alt-server-v/initinstall.d/05-vm-profile deleted file mode 100755 index 8102c3d..0000000 --- a/installer-distro-alt-server-v/initinstall.d/05-vm-profile +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh -# see also http://www.altlinux.org/Autoinstall - -message() { echo "vm-profile: $*" >>/tmp/vm-profile.log; } - -ROOT_MIN=7 # In Gb -VAR_MIN=1 # In Gb - -mem="$(sed -n '/^MemTotal/s/[^0-9]//gp' /proc/meminfo)" # in kB - -# feel free to suggest better defaults -if [ "$mem" -le 1048576 ]; then - swap="$[ 2*$mem ]" -else - swap=2097152 -fi - -# don't do RAID in a VM, reduce swap to a minimum -if grep -qE '(101300b8)|(80eebeef)|(14ad0405)' /proc/bus/pci/devices; then - methods='plain' - swap=131072 -else - methods='raid plain' -fi - -root_min="$[ $ROOT_MIN*1024*1024 ]" -var_min="$[ $VAR_MIN*1024*1024 ]" - -message "mem=$mem k" -message "swap=$swap k" -message "root_min=$root_min k" -message "var_min=$var_min k" - -# EVMS deals with sectors -swap="$[ 2*$swap ]" -root_min="$[ 2*$root_min ]" -var_min="$[ 2*$var_min ]" - -cat > /var/cache/alterator/vm-profile.scm << _EOF_ - ((rootonly - (title . "Minimal server (rootfs only /)") - (action . trivial) - (actiondata - ("swap" (size . $swap) (fsim . "SWAPFS") (methods $methods)) - ("/" (size $root_min . #t) (fsim . "Ext2/3") (methods $methods)))) - (server - (title . "Generic server KVM/Docker/LXD/Podman/CRI-O/PVE (large /var)") - (action . trivial) - (actiondata - ("swap" (size . $swap) (fsim . "SWAPFS") (methods $methods)) - ("/" (size $root_min . $[2*$root_min]) (fsim . "Ext2/3") (methods $methods)) - ("/var" (size $var_min . #t) (fsim . "Ext2/3") (methods $methods))))) -_EOF_