Add fwl, fix pkm & vm_inst, update debian_preseed & provision_linux

This commit is contained in:
mitchell 2022-01-31 15:03:55 -05:00
parent 7f0d7d6f6f
commit 351d4c0574
5 changed files with 152 additions and 86 deletions

View file

@ -1,35 +1,24 @@
function vm_inst -a name os_variant install_source
argparse \
--ignore-unknown \
'm/memory=' \
'c/cpus=' \
'd/disk-size=' \
'b/bridge=' \
s/backing_store \
'b/bridge=?' \
s/backing-store \
i/import \
n/netboot \
--ignore-unknown \
-- $argv
or return
set -l memory 4096
set -l memory 2048
set -l vcpus 2
set -l disk_size 40
set -l disk_size 10
set -l bridge_iface br0
if test -n "$_flag_m"
set memory $_flag_m
end
if test -n "$_flag_c"
set vcpus $_flag_c
end
if test -n "$_flag_d"
set disk_size $_flag_d
end
if test -n "$_flag_b"
set bridge_iface $_flag_b
end
set -q "$_flag_memory"; and set memory $_flag_m
set -q "$_flag_cpus"; and set vcpus $_flag_c
set -q "$_flag_disk_size"; and set disk_size $_flag_d
set -q "$_flag_bridge"; and not math $_flag_b &>/dev/null; or set bridge_iface $_flag_b
set -l inst_args \
--name $name \
@ -37,20 +26,20 @@ function vm_inst -a name os_variant install_source
--vcpus $vcpus \
--os-variant $os_variant
if test -n "$_flag_b"
if set -q "$_flag_bridge"
set inst_args $inst_args \
--network bridge=$bridge_iface
end
if test -n "$_flag_i"
if test -n "$_flag_import"
set inst_args $inst_args \
--disk $install_source \
--import
else if test -n "$_flag_s"
else if test -n "$_flag_backing_store"
set inst_args $inst_args \
--disk size=$disk_size,sparse=yes,backing_store=$install_source \
--import
else if test -n "$_flag_n"
else if test -n "$_flag_netboot"
set inst_args $inst_args \
--disk size=$disk_size,sparse=yes \
--pxe
@ -60,5 +49,5 @@ function vm_inst -a name os_variant install_source
--cdrom $install_source
end
virt-install $inst_args $argv
virt-install $inst_args $argv[4..-1]
end