add: init function
This commit is contained in:
parent
f95c0e5bfc
commit
442ff6bcbc
1 changed files with 20 additions and 16 deletions
12
shemum
12
shemum
|
@ -65,10 +65,7 @@ console_func function {
|
||||||
-m $RAM -smp $CPU
|
-m $RAM -smp $CPU
|
||||||
}
|
}
|
||||||
|
|
||||||
# Options
|
init_func function {
|
||||||
case $OPTION in
|
|
||||||
# Initializes the VM and starts the installer image.
|
|
||||||
"init")
|
|
||||||
mkdir -p "$ROOT_PATH/$OS_NAME"
|
mkdir -p "$ROOT_PATH/$OS_NAME"
|
||||||
qemu-img create $IMG_PATH $DISK_SIZE
|
qemu-img create $IMG_PATH $DISK_SIZE
|
||||||
if [ ! -f $ISO_PATH ] && [ ! -z $INSTALL_IMG ]; then
|
if [ ! -f $ISO_PATH ] && [ ! -z $INSTALL_IMG ]; then
|
||||||
|
@ -85,6 +82,13 @@ case $OPTION in
|
||||||
-drive file=$ISO_PATH,media=cdrom \
|
-drive file=$ISO_PATH,media=cdrom \
|
||||||
-drive file=$IMG_PATH,format=raw \
|
-drive file=$IMG_PATH,format=raw \
|
||||||
-m $RAM -smp $CPU
|
-m $RAM -smp $CPU
|
||||||
|
}
|
||||||
|
|
||||||
|
# Options
|
||||||
|
case $OPTION in
|
||||||
|
# Initializes the VM and starts the installer image.
|
||||||
|
"init")
|
||||||
|
init_func
|
||||||
;;
|
;;
|
||||||
"console")
|
"console")
|
||||||
console_func
|
console_func
|
||||||
|
|
Loading…
Reference in a new issue