more changes

merge-requests/273/head
Bernhard Landauer 8 years ago
parent cb0ddc04a1
commit dd78a7a616

@ -67,7 +67,7 @@ install_de_wm() {
if [[ $(cat ${PACKAGES}) != "" ]]; then
clear
basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR
check_for_error "basestrap ${MOUNTPOINT} $(cat ${PACKAGES})" "$?"
check_for_error "basestrap ${MOUNTPOINT} $(cat ${PACKAGES})" "$?" install_vanilla_de_wm
fi
fi
}
@ -177,14 +177,11 @@ install_manjaro_de_wm() {
check_for_error "packages to install: $(grep -v -f /mnt/.base /tmp/.edition | sort | uniq | tr '\n' ' ')"
clear
# remove already installed base pkgs and
# basestrap the parsed package list to the new root
basestrap -i ${MOUNTPOINT} $(grep -v -f /mnt/.base /tmp/.edition | sort | uniq) 2>$ERR
check_for_error "install pkgs: $(cat /tmp/.desktop)" "$?"
check_for_error "install pkgs: $(cat /tmp/.desktop)" "$?" install_desktop_menu
# copy the profile overlay to the new root
echo "Copying overlay files to the new root"
@ -193,7 +190,7 @@ install_manjaro_de_wm() {
# Copy settings to root account
cp -ar $MOUNTPOINT/etc/skel/. $MOUNTPOINT/root/ 2>$ERR
check_for_error "copy root config" "$?"
check_for_error "copy root config" "$?" install_desktop_menu
# copy settings to already created users
if [[ -e "$(echo /mnt/home/*)" ]]; then
@ -288,7 +285,7 @@ install_manjaro_de_wm() {
if [[ $(cat ${PACKAGES}) != "" ]]; then
clear
basestrap -i ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR
check_for_error "basestrap -i ${MOUNTPOINT} $(cat ${PACKAGES})" "$?"
check_for_error "basestrap -i ${MOUNTPOINT} $(cat ${PACKAGES})" "$?" install_desktop_menu
fi
fi
}
@ -301,15 +298,9 @@ install_manjaro_de_wm_pkg() {
SHOW_ONCE=1
fi
clear
# install iso-profiles pkgs as needed
local pkgs=(manjaro-iso-profiles-{base,official,community})
for p in ${pkgs[@]}; do
pacman -Sy --noconfirm $p 2>$ERR
check_for_error "update profiles pkgs" $? install_graphics_menu
done
pacman -Sy --noconfirm $p manjaro-iso-profiles-{base,official,community} 2>$ERR
check_for_error "update profiles pkgs" $? install_graphics_menu
install_manjaro_de_wm
}
install_manjaro_de_wm_git() {
@ -330,8 +321,6 @@ install_manjaro_de_wm_git() {
git clone --depth 1 https://github.com/manjaro/iso-profiles.git $PROFILES 2>$ERR
check_for_error "clone profiles repo" $? install_graphics_menu
fi
install_manjaro_de_wm
}
# Display Manager
@ -441,8 +430,7 @@ install_nm() {
arch_chroot "systemctl enable $(cat ${PACKAGES})" 2>$ERR
fi
fi
check_for_error "$FUNCNAME" "$?"
check_for_error "$FUNCNAME" "$?" install_network_menu
NM_ENABLED=1
}
@ -478,6 +466,7 @@ install_nm() {
# Where networkmanager selected, add network-manager-applet
sed -i 's/NetworkManager/networkmanager network-manager-applet/g' ${PACKAGES}
basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR
check_for_error "$FUNCNAME" "$?" install_network_menu
# Where networkmanager selected, now remove network-manager-applet
sed -i 's/networkmanager network-manager-applet/NetworkManager/g' ${PACKAGES}
@ -491,100 +480,102 @@ install_nm() {
}
install_multimedia_menu() {
local PARENT="$FUNCNAME"
install_alsa_pulse() {
# Prep Variables
echo "" > ${PACKAGES}
ALSA=""
PULSE_EXTRA=""
alsa=$(pacman -Ss alsa | awk '{print $1}' | grep "/alsa-" | sed "s/extra\///g" | sort -u)
pulse_extra=$(pacman -Ss pulseaudio- | awk '{print $1}' | sed "s/extra\///g" | grep "pulseaudio-" | sort -u)
for i in ${alsa}; do
ALSA="${ALSA} ${i} - off"
done
declare -i loopmenu=1
while ((loopmenu)); do
local PARENT="$FUNCNAME"
submenu 5
DIALOG "$_InstMultMenuBody" --default-item ${HIGHLIGHT_SUB} --menu " $_InstMultMenuTitle " 0 0 5 \
"1" "$_InstMulSnd" \
"2" "$_InstMulCodec" \
"3" "$_InstMulAcc" \
"4" "$_InstMulCust" \
"5" "$_Back" 2>${ANSWER}
HIGHLIGHT_SUB=$(cat ${ANSWER})
case $(cat ${ANSWER}) in
"1") install_alsa_pulse
;;
"2") install_codecs
;;
"3") install_acc_menu
;;
"4") install_cust_pkgs
;;
*) loopmenu=0
;;
esac
done
install_multimedia_menu
}
ALSA=$(echo $ALSA | sed "s/alsa-utils - off/alsa-utils - on/g" | sed "s/alsa-plugins - off/alsa-plugins - on/g")
install_alsa_pulse() {
# Prep Variables
echo "" > ${PACKAGES}
ALSA=""
PULSE_EXTRA=""
alsa=$(pacman -Ss alsa | awk '{print $1}' | grep "/alsa-" | sed "s/extra\///g" | sort -u)
pulse_extra=$(pacman -Ss pulseaudio- | awk '{print $1}' | sed "s/extra\///g" | grep "pulseaudio-" | sort -u)
for i in ${pulse_extra}; do
PULSE_EXTRA="${PULSE_EXTRA} ${i} - off"
done
for i in ${alsa}; do
ALSA="${ALSA} ${i} - off"
done
DIALOG " $_InstMulSnd " --checklist "$_InstMulSndBody\n\n$_UseSpaceBar" 0 0 6 \
$ALSA "pulseaudio" "-" off $PULSE_EXTRA \
"paprefs" "pulseaudio GUI" off \
"pavucontrol" "pulseaudio GUI" off \
"ponymix" "pulseaudio CLI" off \
"volumeicon" "ALSA GUI" off \
"volwheel" "ASLA GUI" off 2>${PACKAGES}
ALSA=$(echo $ALSA | sed "s/alsa-utils - off/alsa-utils - on/g" | sed "s/alsa-plugins - off/alsa-plugins - on/g")
clear
# If at least one package, install.
if [[ $(cat ${PACKAGES}) != "" ]]; then
basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR
check_for_error "$FUNCNAME" "$?"
fi
}
for i in ${pulse_extra}; do
PULSE_EXTRA="${PULSE_EXTRA} ${i} - off"
done
install_codecs() {
# Prep Variables
echo "" > ${PACKAGES}
GSTREAMER=""
gstreamer=$(pacman -Ss gstreamer | awk '{print $1}' | grep "/gstreamer" | sed "s/extra\///g" | sed "s/community\///g" | sort -u)
echo $gstreamer
for i in ${gstreamer}; do
GSTREAMER="${GSTREAMER} ${i} - off"
done
DIALOG " $_InstMulSnd " --checklist "$_InstMulSndBody\n\n$_UseSpaceBar" 0 0 6 \
$ALSA "pulseaudio" "-" off $PULSE_EXTRA \
"paprefs" "pulseaudio GUI" off \
"pavucontrol" "pulseaudio GUI" off \
"ponymix" "pulseaudio CLI" off \
"volumeicon" "ALSA GUI" off \
"volwheel" "ASLA GUI" off 2>${PACKAGES}
DIALOG " $_InstMulCodec " --checklist "$_InstMulCodBody\n\n$_UseSpaceBar" 0 0 14 \
$GSTREAMER "xine-lib" "-" off 2>${PACKAGES}
clear
# If at least one package, install.
if [[ $(cat ${PACKAGES}) != "" ]]; then
basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR
check_for_error "$FUNCNAME" "$?" install_multimedia_menu
fi
}
clear
# If at least one package, install.
if [[ $(cat ${PACKAGES}) != "" ]]; then
basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR
check_for_error "$FUNCNAME" "$?"
fi
}
install_codecs() {
# Prep Variables
echo "" > ${PACKAGES}
GSTREAMER=""
gstreamer=$(pacman -Ss gstreamer | awk '{print $1}' | grep "/gstreamer" | sed "s/extra\///g" | sed "s/community\///g" | sort -u)
echo $gstreamer
for i in ${gstreamer}; do
GSTREAMER="${GSTREAMER} ${i} - off"
done
install_cust_pkgs() {
echo "" > ${PACKAGES}
DIALOG " $_InstMulCust " --inputbox "$_InstMulCustBody" 0 0 "" 2>${PACKAGES} || install_multimedia_menu
DIALOG " $_InstMulCodec " --checklist "$_InstMulCodBody\n\n$_UseSpaceBar" 0 0 14 \
$GSTREAMER "xine-lib" "-" off 2>${PACKAGES}
clear
# If at least one package, install.
if [[ $(cat ${PACKAGES}) != "" ]]; then
if [[ $(cat ${PACKAGES}) == "hen poem" ]]; then
DIALOG " \"My Sweet Buckies\" by Atiya & Carl " --msgbox "\nMy Sweet Buckies,\nYou are the sweetest Buckies that ever did \"buck\",\nLily, Rosie, Trumpet, and Flute,\nMy love for you all is absolute!\n\nThey buck: \"We love our treats, we are the Booyakka sisters,\"\n\"Sometimes we squabble and give each other comb-twisters,\"\n\"And in our garden we love to sunbathe, forage, hop and jump,\"\n\"We love our freedom far, far away from that factory farm dump,\"\n\n\"For so long we were trapped in cramped prisons full of disease,\"\n\"No sunlight, no fresh air, no one who cared for even our basic needs,\"\n\"We suffered in fear, pain, and misery for such a long time,\"\n\"But now we are so happy, we wanted to tell you in this rhyme!\"\n\n" 0 0
else
basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR
check_for_error "$FUNCNAME $(cat ${PACKAGES})" "$?"
fi
fi
}
clear
# If at least one package, install.
if [[ $(cat ${PACKAGES}) != "" ]]; then
basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR
check_for_error "$FUNCNAME" "$?" install_multimedia_menu
fi
}
submenu 5
DIALOG "$_InstMultMenuBody" --default-item ${HIGHLIGHT_SUB} --menu " $_InstMultMenuTitle " 0 0 5 \
"1" "$_InstMulSnd" \
"2" "$_InstMulCodec" \
"3" "$_InstMulAcc" \
"4" "$_InstMulCust" \
"5" "$_Back" 2>${ANSWER}
HIGHLIGHT_SUB=$(cat ${ANSWER})
case $(cat ${ANSWER}) in
"1") install_alsa_pulse
;;
"2") install_codecs
;;
"3") install_acc_menu
;;
"4") install_cust_pkgs
;;
*) main_menu_online
;;
esac
install_cust_pkgs() {
echo "" > ${PACKAGES}
DIALOG " $_InstMulCust " --inputbox "$_InstMulCustBody" 0 0 "" 2>${PACKAGES} || install_multimedia_menu
install_multimedia_menu
}
clear
# If at least one package, install.
if [[ $(cat ${PACKAGES}) != "" ]]; then
if [[ $(cat ${PACKAGES}) == "hen poem" ]]; then
DIALOG " \"My Sweet Buckies\" by Atiya & Carl " --msgbox "\nMy Sweet Buckies,\nYou are the sweetest Buckies that ever did \"buck\",\nLily, Rosie, Trumpet, and Flute,\nMy love for you all is absolute!\n\nThey buck: \"We love our treats, we are the Booyakka sisters,\"\n\"Sometimes we squabble and give each other comb-twisters,\"\n\"And in our garden we love to sunbathe, forage, hop and jump,\"\n\"We love our freedom far, far away from that factory farm dump,\"\n\n\"For so long we were trapped in cramped prisons full of disease,\"\n\"No sunlight, no fresh air, no one who cared for even our basic needs,\"\n\"We suffered in fear, pain, and misery for such a long time,\"\n\"But now we are so happy, we wanted to tell you in this rhyme!\"\n\n" 0 0
else
basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR
check_for_error "$FUNCNAME $(cat ${PACKAGES})" "$?" install_multimedia_menu
fi
fi
}

@ -106,7 +106,8 @@ submenu() {
if [[ $SUB_MENU != "$PARENT" ]]; then
SUB_MENU="$PARENT"
HIGHLIGHT_SUB=1
elif [[ $HIGHLIGHT_SUB != "$1" ]]; then
fi
if [[ $HIGHLIGHT_SUB != "$1" ]]; then
HIGHLIGHT_SUB=$(( HIGHLIGHT_SUB + 1 ))
fi
}
@ -157,7 +158,7 @@ id_system() {
check_for_error() {
local _msg="$1"
local _err="${2:-0}"
local _function_menu="${3:-main_menu_online}"
local _function_menu="${3:-main_menu}"
((${_err}!=0)) && _msg="[${_msg}][${_err}]"
[[ -f "${ERR}" ]] && {
_msg="${_msg} $(head -n1 ${ERR})"
@ -169,8 +170,9 @@ check_for_error() {
_fpath=" --${_fpath// /()<-}"
echo -e "$(date +%D\ %T) ERROR ${_msg} ${_fpath}" >> "${LOGFILE}"
if [[ "${_function_menu}" != "SKIP" ]]; then
DIALOG " $_ErrTitle " --msgbox "\n${_msg}\n" 0 0
($_function_menu)
DIALOG " $_ErrTitle " --msgbox "\n${_msg}\n" 0 0
loopmenu=0 # ??
($_function_menu)
fi
else
echo -e "$(date +%D\ %T) ${_msg}" >> "${LOGFILE}"
@ -291,7 +293,8 @@ check_requirements() {
sleep 2
clear
echo "" > $ERR
pacman -Syy
pacman -Syy 2>$ERR
check_for_error "refresh database" $? 'SKIP'
}
# Greet the user when first starting the installer
@ -299,6 +302,35 @@ greeting() {
DIALOG " $_WelTitle $VERSION " --msgbox "$_WelBody" 0 0
}
# Originally adapted from AIS. Added option to allow users to edit the mirrorlist.
configure_mirrorlist() {
declare -i loopmenu=1
while ((loopmenu)); do
DIALOG " $_MirrorlistTitle " \
--menu "$_MirrorlistBody" 0 0 4 \
"1" "$_MirrorRankTitle" \
"2" "$_MirrorConfig" \
"3" "$_MirrorPacman" \
"4" "$_Back" 2>${ANSWER}
case $(cat ${ANSWER}) in
"1") rank_mirrors
;;
"2") nano /etc/pacman-mirrors.conf
check_for_error "edit pacman-mirrors.conf"
;;
"3") nano /etc/pacman.conf
DIALOG " $_MirrorPacman " --yesno "$_MIrrorPacQ" 0 0 && COPY_PACCONF=1 || COPY_PACCONF=0
check_for_error "edit pacman.conf $COPY_PACCONF"
pacman -Syy
;;
*) loopmenu=0
;;
esac
done
install_base_menu
}
rank_mirrors() {
#Choose the branch for mirrorlist
BRANCH="/tmp/.branch"
@ -313,33 +345,6 @@ rank_mirrors() {
}
}
# Originally adapted from AIS. Added option to allow users to edit the mirrorlist.
configure_mirrorlist() {
DIALOG " $_MirrorlistTitle " \
--menu "$_MirrorlistBody" 0 0 4 \
"1" "$_MirrorRankTitle" \
"2" "$_MirrorConfig" \
"3" "$_MirrorPacman" \
"4" "$_Back" 2>${ANSWER}
case $(cat ${ANSWER}) in
"1") rank_mirrors
;;
"2") nano /etc/pacman-mirrors.conf
check_for_error "edit pacman-mirrors.conf"
;;
"3") nano /etc/pacman.conf
DIALOG " $_MirrorPacman " --yesno "$_MIrrorPacQ" 0 0 && COPY_PACCONF=1 || COPY_PACCONF=0
check_for_error "edit pacman.conf $COPY_PACCONF"
pacman -Syy
;;
*) install_base_menu
;;
esac
configure_mirrorlist
}
# Simple code to show devices / partitions.
show_devices() {
lsblk -o NAME,MODEL,TYPE,FSTYPE,SIZE,MOUNTPOINT | grep "disk\|part\|lvm\|crypt\|NAME\|MODEL\|TYPE\|FSTYPE\|SIZE\|MOUNTPOINT" > /tmp/.devlist
@ -355,7 +360,6 @@ arch_chroot() {
check_mount() {
if [[ $(lsblk -o MOUNTPOINT | grep ${MOUNTPOINT}) == "" ]]; then
DIALOG " $_ErrTitle " --msgbox "$_ErrNoMount" 0 0
main_menu_online
fi
}
@ -363,7 +367,6 @@ check_mount() {
check_base() {
if [[ ! -e /mnt/.base_installed ]]; then
DIALOG " $_ErrTitle " --msgbox "$_ErrNoBase" 0 0
install_base_menu
fi
}
@ -429,3 +432,32 @@ final_check() {
# check if user account has been generated
[[ $(ls /mnt/home) == "" ]] && echo "- No user accounts have been generated" >> ${CHECKLIST}
}
exit_done() {
if [[ $(lsblk -o MOUNTPOINT | grep ${MOUNTPOINT}) != "" ]]; then
final_check
dialog --backtitle "$VERSION - $SYSTEM ($ARCHI)" --yesno "$_CloseInstBody $(cat ${CHECKLIST})" 0 0
if [[ $? -eq 0 ]]; then
echo "exit installer." >> ${LOGFILE}
dialog --backtitle "$VERSION - $SYSTEM ($ARCHI)" --yesno "\n$_LogInfo\n" 0 0
if [[ $? -eq 0 ]]; then
[[ -e /mnt/.m-a.log ]] && cat ${LOGFILE} >> /mnt/.m-a.log
cp ${LOGFILE} /mnt/.m-a.log
fi
umount_partitions
clear
loopmenu=0
else
main_menu
fi
else
dialog --backtitle "$VERSION - $SYSTEM ($ARCHI)" --yesno "$_CloseInstBody" 0 0
if [[ $? -eq 0 ]]; then
umount_partitions
clear
loopmenu=0
else
main_menu
fi
fi
}

Loading…
Cancel
Save