dd option to use the package cache of the system being installed

merge-requests/273/head
Chrysostomus 6 years ago
parent 7d7f7595d3
commit ed153745c4

@ -44,4 +44,9 @@ set_language
mk_connection
check_connection
#greeting
if [[ -e /run/miso/bootmnt ]]; then
hostcache=true
else
hostcache=false
fi
main_menu

@ -52,7 +52,11 @@ install_cust_pkgs() {
clear
# If at least one package, install.
if [[ $(cat ${PACKAGES}) != "" ]]; then
basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR
if $hostcache; then
basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR
else
basestrap -c ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR
fi
check_for_error "$FUNCNAME $(cat ${PACKAGES})" "$?"
fi
}
@ -205,7 +209,11 @@ install_de_wm() {
if [[ $(cat ${PACKAGES}) != "" ]]; then
clear
sed -i 's/+\|\"//g' ${PACKAGES}
basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR
if $hostcache; then
basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR
else
basestrap -c ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR
fi
check_for_error "${FUNCNAME}: ${PACKAGES}" "$?"
# Clear the packages file for installation of "common" packages
@ -233,7 +241,12 @@ install_de_wm() {
# If at least one package, install.
if [[ $(cat ${PACKAGES}) != "" ]]; then
clear
basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR
if $hostcache; then
basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR
else
basestrap -c ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR
fi
check_for_error "basestrap ${MOUNTPOINT} $(cat ${PACKAGES})" "$?"
fi
fi

@ -120,7 +120,11 @@ install_all_drivers() {
echo "" >> /tmp/.all_drivers
done
sed -i '/KERNEL-/d' /tmp/.all_drivers
basestrap ${MOUNTPOINT} $(cat /tmp/.all_drivers)
if $hostcache; then
basestrap ${MOUNTPOINT} $(cat /tmp/.all_drivers)
else
basestrap -c ${MOUNTPOINT} $(cat /tmp/.all_drivers)
fi
}
install_ati() {
sed -i 's/MODULES=""/MODULES="radeon"/' ${MOUNTPOINT}/etc/mkinitcpio.conf
@ -188,7 +192,11 @@ install_manjaro_de_wm() {
check_for_error "packages to install: $(grep -vf /mnt/.base /mnt/.desktop | sort | tr '\n' ' ')"
clear
set -o pipefail
basestrap ${MOUNTPOINT} $(cat /mnt/.desktop) 2>$ERR |& tee /tmp/basestrap.log
if $hostcache; then
basestrap ${MOUNTPOINT} $(cat /mnt/.desktop) 2>$ERR |& tee /tmp/basestrap.log
else
basestrap -c ${MOUNTPOINT} $(cat /mnt/.desktop) 2>$ERR |& tee /tmp/basestrap.log
fi
local err=$?
set +o pipefail
check_for_error "install desktop-pkgs" $err || return $err
@ -301,7 +309,12 @@ install_desktop() {
check_for_error "packages to install: $(cat /mnt/.base | sort | tr '\n' ' ')"
clear
set -o pipefail
basestrap ${MOUNTPOINT} $(cat /mnt/.base) 2>$ERR |& tee /tmp/basestrap.log
if $hostcache; then
basestrap ${MOUNTPOINT} $(cat /mnt/.base) 2>$ERR |& tee /tmp/basestrap.log
else
basestrap -c ${MOUNTPOINT} $(cat /mnt/.base) 2>$ERR |& tee /tmp/basestrap.log
fi
local err=$?
set +o pipefail
check_for_error "install basepkgs" $err || {

@ -233,7 +233,8 @@ prep_menu() {
"6" "$_PrepMntPart" \
"7" "$_PrepMirror|>" \
"8" "$_PrepPacKey" \
"9" "$_Back" 2>${ANSWER}
"9" "$_HostCache" \
"10" "$_Back" 2>${ANSWER}
HIGHLIGHT_SUB=$(cat ${ANSWER})
case $(cat ${ANSWER}) in
@ -264,6 +265,8 @@ prep_menu() {
check_for_error 'refresh pacman-keys'
)
;;
"9") set_cache
;;
*) loopmenu=0
return 0
;;
@ -271,6 +274,17 @@ prep_menu() {
done
}
set_cache()
{
_HostCache="Choose pacman cache"
_HostCacheBody="Do you want to use the pacman cache of the running system instead of the installation target? This can reduce the size of the required downloads in the installation."
DIALOG " $_HostCache " --yesno "\n$_HostCacheBody\n " 0 0
if [[ $? -eq 0 ]]; then
hostcache=true
else
hostcache=false
fi
}
# Base Installation
install_base_menu() {
local PARENT="$FUNCNAME"

Loading…
Cancel
Save