Skip to content

Commit

Permalink
Update from base builder
Browse files Browse the repository at this point in the history
  • Loading branch information
Neilpang committed Jan 5, 2025
1 parent 3628d9c commit bbc5783
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export VM_RELEASE
export VM_OCR
export VM_DISK
export VM_ARCH
export VM_USE_CONSOLE_BUILD



##############################################################
Expand Down Expand Up @@ -75,9 +77,14 @@ fi


if [ "$VM_ISO_LINK" ]; then
#start from iso, install to the vir disk

$vmsh createVM $VM_ISO_LINK $osname $ostype $sshport

sleep 2
if [ "$VM_USE_CONSOLE_BUILD" ]; then
$vmsh openConsole "$osname"
fi

if [ -e "hooks/installOpts.sh" ]; then
echo "hooks/installOpts.sh"
Expand All @@ -102,8 +109,11 @@ if [ "$VM_ISO_LINK" ]; then
while $vmsh isRunning $osname; do
sleep 5
done

if [ "$VM_USE_CONSOLE_BUILD" ]; then
$vmsh closeConsole "$osname"
fi
elif [ "$VM_VHD_LINK" ]; then
#if the vm disk is already provided FreeBSD, just import it.
if [ ! -e "$osname.qcow2" ]; then
if [ ! -e "$osname.qcow2.xz" ]; then
$vmsh download "$VM_VHD_LINK" $osname.qcow2.xz
Expand All @@ -128,6 +138,9 @@ ls -lh
start_and_wait() {
$vmsh startVM $osname
sleep 2
if [ "$VM_USE_CONSOLE_BUILD" ]; then
$vmsh openConsole "$osname"
fi
if [ -e "hooks/waitForLoginTag.sh" ]; then
echo "hooks/waitForLoginTag.sh"
cat "hooks/waitForLoginTag.sh"
Expand All @@ -153,6 +166,9 @@ shutdown_and_wait() {
while $vmsh isRunning $osname; do
sleep 5
done
if [ "$VM_USE_CONSOLE_BUILD" ]; then
$vmsh closeConsole "$osname"
fi
}

restart_and_wait() {
Expand All @@ -162,6 +178,9 @@ restart_and_wait() {

###############################################


#start the installed vm, and initialize the ssh access:

start_and_wait

inputKeys "string root; enter; sleep 1;"
Expand Down

0 comments on commit bbc5783

Please sign in to comment.