add: init function

This commit is contained in:
BonzaiBrains 2024-10-31 12:56:44 +01:00 committed by GitHub
parent f95c0e5bfc
commit 442ff6bcbc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

12
shemum
View file

@ -65,10 +65,7 @@ console_func function {
-m $RAM -smp $CPU
}
# Options
case $OPTION in
# Initializes the VM and starts the installer image.
"init")
init_func function {
mkdir -p "$ROOT_PATH/$OS_NAME"
qemu-img create $IMG_PATH $DISK_SIZE
if [ ! -f $ISO_PATH ] && [ ! -z $INSTALL_IMG ]; then
@ -85,6 +82,13 @@ case $OPTION in
-drive file=$ISO_PATH,media=cdrom \
-drive file=$IMG_PATH,format=raw \
-m $RAM -smp $CPU
}
# Options
case $OPTION in
# Initializes the VM and starts the installer image.
"init")
init_func
;;
"console")
console_func