summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2022-08-16 07:55:59 -0400
committerbill-auger <mr.j.spam.me@gmail.com>2022-08-17 06:37:01 -0400
commitb258526f9c10b412c170f28e49734c5b6587fa0a (patch)
treea308b27fff103140f03d683b7303e905a41b1a6a
parenta491beb48ba15ea85a2b38fc8ecc31cb2e8fbc91 (diff)
reference all files relatively
-rw-r--r--constants.sh.inc3
-rwxr-xr-xinstall.sh28
-rw-r--r--session-common.sh.inc19
-rwxr-xr-xsession-init.sh4
4 files changed, 26 insertions, 28 deletions
diff --git a/constants.sh.inc b/constants.sh.inc
index 7d114f5..4ec202f 100644
--- a/constants.sh.inc
+++ b/constants.sh.inc
@@ -20,9 +20,6 @@
# along with Parabola Install Wizard. If not, see <http://www.gnu.org/licenses/>.
-# environment
-readonly THIS_DIR="$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)"
-
# config
readonly SWAP_MB=1000
diff --git a/install.sh b/install.sh
index fc34944..f994999 100755
--- a/install.sh
+++ b/install.sh
@@ -60,15 +60,15 @@ Init()
ExitFail "${TR[insane_preset-${Lang}]}\n${STATEVARS_PRESET[@]/#/\\n\\t* }"
# check for prior state-vars, and offer to reset them or to resume instead
- elif grep -vE '(LANG|TR_KEY|XKBMAP|SESSION)' "${THIS_DIR}"/.session_state &> /dev/null &&
+ elif grep -vE '(LANG|TR_KEY|XKBMAP|SESSION)' ./.session_state &> /dev/null &&
! (( $( WizardDlg "${TR[dlg_preconfig-${Lang}]}" \
--yesno "${TR[preconfig-${Lang}]}" 0 0 ) ))
- then truncate --size=0 "${THIS_DIR}"/.session_state
+ then truncate --size=0 ./.session_state
fi
# sanity checks
while ! AreConfiguredStateVars 'LANG' 'TR_KEY' 'XKBMAP'
- do SetStateVar 'SESSION' 'wizard' ; "${THIS_DIR}"/session-init.sh ;
+ do SetStateVar 'SESSION' 'wizard' ; ./session-init.sh ;
done
SetLang $(GetStateVar 'TR_KEY')
@@ -324,7 +324,7 @@ SelectEnv()
# prompt for console keymap
local keymap
local keymaps=()
- for keymap in $(sort -u "${THIS_DIR}"/KEYMAPS_VT)
+ for keymap in $(sort -u ./KEYMAPS_VT)
do if [[ ${keymap} =~ ^$(GetStateVar 'XKBMAP' 'us') ]]
then keymaps=( "${keymap}" "${curr_msg}" "${keymaps[@]}" )
else keymaps+=( "${keymap}" '' )
@@ -574,15 +574,15 @@ InstallPkgs()
# prepare pacman.conf for online/offline install, systemd/non-systemd
if [[ "${install}" == 'offline' ]]
- then cp /etc/pacman-offline.conf "${THIS_DIR}"/pacman-wizard.conf
- else cp "${THIS_DIR}"/pacman.conf "${THIS_DIR}"/pacman-wizard.conf
- sed -i "$conf_regex" "${THIS_DIR}"/pacman-wizard.conf
+ then cp /etc/pacman-offline.conf ./pacman-wizard.conf
+ else cp ./pacman.conf ./pacman-wizard.conf
+ sed -i "$conf_regex" ./pacman-wizard.conf
fi
# install packages
(
set -o pipefail
- pacstrap -C "${THIS_DIR}"/pacman-wizard.conf /mnt ${packages[*]} 2>&1 | \
+ pacstrap -C ./pacman-wizard.conf /mnt ${packages[*]} 2>&1 | \
WizardDlg "${TR[dlg_pacstrap-${Lang}]}" --progressbox -1 -1
) || ! echo -e "\n${TR[pacstrap_fail-${Lang}]}" || exit 1
}
@@ -595,12 +595,12 @@ ConfigChroot()
AreConfiguredStateVars ${STATEVARS_CHROOTSERVICES[*]} # chroot-services.sh
# copy helper scripts into the chroot and execute them in-chroot
- install -m100 "${THIS_DIR}"/chroot-environment.sh /mnt/root/
- install -m100 "${THIS_DIR}"/chroot-login.sh /mnt/root/
- install -m100 "${THIS_DIR}"/chroot-services.sh /mnt/root/
- install -m400 "${THIS_DIR}"/.session_state /mnt/root/
- install -m400 "${THIS_DIR}"/session-common.sh.inc /mnt/root/
- genfstab -p /mnt >> /mnt/etc/fstab
+ install -m100 ./chroot-environment.sh /mnt/root/
+ install -m100 ./chroot-login.sh /mnt/root/
+ install -m100 ./chroot-services.sh /mnt/root/
+ install -m400 ./.session_state /mnt/root/
+ install -m400 ./session-common.sh.inc /mnt/root/
+ genfstab -p /mnt >> /mnt/etc/fstab
arch-chroot /mnt /root/chroot-environment.sh # configure environment
arch-chroot /mnt /root/chroot-login.sh # register login
arch-chroot /mnt /root/chroot-services.sh # configure services
diff --git a/session-common.sh.inc b/session-common.sh.inc
index a67e3bc..6c82854 100644
--- a/session-common.sh.inc
+++ b/session-common.sh.inc
@@ -20,15 +20,16 @@
# along with Parabola Install Wizard. If not, see <http://www.gnu.org/licenses/>.
-source $(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)/constants.sh.inc
+cd $(dirname ${BASH_SOURCE[0]})
+source ./constants.sh.inc
## sanity checks ##
if (( ! IN_CHROOT ))
-then which dialog &> /dev/null || ! echo "${DIALOG_ERR_MSG}" || exit
- (( ! $EUID )) || ! echo "${PRIVILEGE_ERR_MSG}" || exit
- [[ -w "${THIS_DIR}"/.session_state ]] || ! echo "${STATEFILE_ERR_MSG}" || exit
+then which dialog &> /dev/null || ! echo "${DIALOG_ERR_MSG}" || exit
+ (( ! $EUID )) || ! echo "${PRIVILEGE_ERR_MSG}" || exit
+ [[ -w ./.session_state ]] || ! echo "${STATEFILE_ERR_MSG}" || exit
fi
@@ -39,15 +40,15 @@ SetStateVar() # (var_name value*)
local var_name=$1 ; shift ;
local value="$*"
- sed -i "/^${var_name}=.*/d" "${THIS_DIR}"/.session_state
- echo "${var_name}=${value}" >> "${THIS_DIR}"/.session_state
+ sed -i "/^${var_name}=.*/d" ./.session_state
+ echo "${var_name}=${value}" >> ./.session_state
}
GetStateVar() # (var_name [def_value])
{
local var_name=$1
local def_value=$2
- local stored_value=$(grep "${var_name}=" "${THIS_DIR}"/.session_state | cut -d '=' -f 2)
+ local stored_value=$(grep "${var_name}=" ./.session_state | cut -d '=' -f 2)
if [[ -n "${stored_value}" ]] && [[ "${stored_value}" != '_UNDEFINED_' ]]
then echo ${stored_value}
@@ -428,8 +429,8 @@ readonly TRANSLATIONS_ERR_MSG="failed to source translations.sh.inc"
if (( ! IN_CHROOT ))
then # inject size of automatic swap partition into translations, then load the translations
- sed -i -E "${SWAP_SED_RX}" translations.sh.inc || ! echo "${SWAP_SED_ERR_MSG}" || exit 1
- source translations.sh.inc || ! echo "${TRANSLATIONS_ERR_MSG}" || exit 1
+ sed -i -E "${SWAP_SED_RX}" ./translations.sh.inc || ! echo "${SWAP_SED_ERR_MSG}" || exit 1
+ source ./translations.sh.inc || ! echo "${TRANSLATIONS_ERR_MSG}" || exit 1
fi
diff --git a/session-init.sh b/session-init.sh
index 2cf259a..8cb6512 100755
--- a/session-init.sh
+++ b/session-init.sh
@@ -35,8 +35,8 @@ source $(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)/session-common.sh.inc # sets: $L
readonly LANG_TITLE="System language selection"
readonly LANG_PROMPT="Select your language:"
-readonly -a LANGUAGES=( $(sort -u "${THIS_DIR}"/LANGUAGES) )
-readonly -a KEYMAPS=( $(sort -u "${THIS_DIR}"/KEYMAPS_X) )
+readonly -a LANGUAGES=( $(sort -u ./LANGUAGES) )
+readonly -a KEYMAPS=( $(sort -u ./KEYMAPS_X) )
readonly -a ALL_SESSIONS=( 'live' "Live desktop" \
'calamares' "GUI installer" \
'wizard' "TUI installer" \