diff --git a/gentoo-install.sh b/gentoo-install.sh index 4a25aac..bf13a67 100755 --- a/gentoo-install.sh +++ b/gentoo-install.sh @@ -207,8 +207,8 @@ function prepare_target() { } function stage_step() { - local UUID PART_ENTRY_UUID - local SwapUUID SwapOffset + local s4file SwapUUID SwapOffset + local cmd show_options @@ -219,14 +219,24 @@ function stage_step() { exit 1 fi - if [[ "$DEBUG" ]]; then - local cmd="echo" + if "$DEBUG"; then + cmd="echo" else - local cmd="" + cmd="" fi #FIXME check $INSTALL_STAGE for http or local file - # + if [[ "$INSTALL_STAGE" == http* ]]; then + s4file="${INSTALL_STAGE##*/}" + ${cmd} curl -O "/mnt/gentoo/${s4file}" "$INSTALL_STAGE" + s4file="/mnt/gentoo/${INSTALL_STAGE##*/}" + else + s4file="${INSTALL_STAGE}" + fi + + ${cmd} git clone "https://github.com/erenfro/gen2stage4" "$HOME/gen2stage4" + ${cmd} "$HOME/gen2stage4/gen2stage4" -q -t /mnt/gentoo "$s4file" + ${cmd} rm -rf "$HOME/gen2stage4" #FIXME post stage extraction: