summaryrefslogtreecommitdiff
path: root/chroot-environment.sh
blob: 2a950c84d112359869fd1cc9171279b237d9607b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash

# Parabola Install Wizard - in-chroot config
#
# this script is called by install.sh
# it is expected to run in-chroot during the install process;
#   and should not be run explicitly
#
#
# Copyright (C) 2015      Jorge Lopez <jorginho@riseup.net>
# Copyright (C) 2015-2016 André Fabian Silva Delgado <emulatorman@hyperbola.info>
# Copyright (C) 2020,2022 bill-auger <bill-auger@programmer.net>
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
# This file is part of Parabola Install Wizard.
#
# Parabola Install Wizard is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Parabola Install Wizard - in-chroot config is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Parabola Install Wizard. If not, see <http://www.gnu.org/licenses/>.


source /root/session-common.sh.inc


readonly HOSTNAME=$(GetStateVar 'HOSTNAME')
readonly TIMEZONE=$(GetStateVar 'TIMEZONE')
readonly KEYMAP=$(  GetStateVar 'KEYMAP'  )
readonly LOCALES=$( GetStateVar 'LOCALES' )
readonly LANG=$(    GetStateVar 'LANG'    )
readonly DEVICE=$(  GetStateVar 'DEVICE'  )
readonly BOOT=$(    GetStateVar 'BOOT'    )
readonly WMDE=$(    GetStateVar 'WMDE'    )
readonly THEME_DIR=$( [[ "${Wmde}" == 'cli' ]] && echo GNUAxiom || echo parabola-laf )


# configure hostname
echo ${HOSTNAME} > /etc/hostname

# configure timezone
ln -sf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime

# configure keymap
echo "KEYMAP=${KEYMAP}" > /etc/vconsole.conf

# configure locales
for locale in ${LOCALES}
do  sed -i "s|^#${locale} |${locale} |" /etc/locale.gen
done
locale-gen

# configure language
echo "LANG=${LANG}" > /etc/locale.conf

# prepare initrd
mkinitcpio -p linux-libre

# install and configure GRUB
if   [[ "${BOOT}" == 'grub' ]]
then grub-install ${DEVICE}
     grub-mkconfig -o /boot/grub/grub.cfg

     # enable Parabola GRUB theme
     sed -i "$GRUB_THEME_SED_RX ; s|_THEME_DIR_|${THEME_DIR}|" /etc/default/grub
fi

exit