Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support local iso mount for unattended install #673

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions package/harvester-os/files/usr/sbin/harv-install
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,27 @@ get_url()

check_iso(){
if [ -n "$HARVESTER_ISO_URL" ]; then
echo "Checking ISO URL.."
if [ "$HARVESTER_ISO_URL" = "local" ]; then
return
fi
echo "Checking ISO URL..."
check_url "$HARVESTER_ISO_URL"
fi
}

get_iso()
{
if [ -n "$HARVESTER_ISO_URL" ]; then
echo "Downloading ISO.."
ISOMNT=$(mktemp -d -p /tmp cos.XXXXXXXX.isomnt)
ISOTEMP=$(mktemp -p ${TARGET}/usr/local cos.XXXXXXXX.iso)
get_url ${HARVESTER_ISO_URL} ${ISOTEMP}
ISO_DEVICE=$(losetup --show -f $ISOTEMP)
if [ "$HARVESTER_ISO_URL" = "local" ]; then
echo "Using local ISO..."
ISO_DEVICE="/dev/sr0"
else
echo "Downloading ISO..."
ISOTEMP=$(mktemp -p ${TARGET}/usr/local cos.XXXXXXXX.iso)
get_url ${HARVESTER_ISO_URL} ${ISOTEMP}
ISO_DEVICE=$(losetup --show -f $ISOTEMP)
fi
mount -o ro ${ISO_DEVICE} ${ISOMNT}
fi
}
Expand Down
Loading