Add a switch that skips tarball extraction

This commit is contained in:
Salt 2020-12-04 06:21:27 -06:00
parent c1dbcfa5ed
commit 14aea7682b
1 changed files with 13 additions and 3 deletions

View File

@ -11,7 +11,9 @@ set -e
# Read-only set-once variables
declare -r _name="$(basename -- "$0")"
# Options
declare -i _optconfigure
declare -i _optchroot
declare -i _optchroot2
declare _optdest="/mnt"
declare _optprofile="desktop"
declare -i _opthelp
@ -78,6 +80,7 @@ printhelp() {
Usage: $_name [OPTION]...
-h Print this help text
-b Perform the host half of installation. Should invoke as root
-c Perform the Gentoo half of installation. Must be invoked from a chroot
-d Perform the second Gentoo half of installation from a chroot
-v Print more status messages. Stacks
@ -125,7 +128,9 @@ build-gentoo() {
sudo tar xf "$stage3file" -C "$_optdest"
fi
unset shouldextract
configure-gentoo
}
configure-gentoo() {
# Now we do some pre-chroot configuration
pushd "$_optdest" > /dev/null 2>&1
# These is a very generic make.conf to get the system up and running
@ -322,12 +327,15 @@ main() {
# Parse out flags
while getopts ":cdhv" opt; do
case $opt in
d)
_optchroot2=1
b)
_optconfigure=1
;;
c)
_optchroot=1
;;
d)
_optchroot2=1
;;
h)
_opthelp=1
;;
@ -365,6 +373,8 @@ main() {
build-gentoo-chroot2
elif [ -n "$_optchroot" ]; then
build-gentoo-chroot
elif [ -n "$_optconfigure" ]; then
configure-gentoo
else
build-gentoo
fi