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

View File

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