summaryrefslogtreecommitdiff
path: root/configs/profile/root-image/root/.session/install/chroot-environment.sh
blob: d320900fe7d110c63f7c43c8237c36b9f12aa1f6 (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
#!/bin/bash

# Parabola Install Wizard
#
# 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      bill-auger <bill-auger@programmer.net>
#
# License: GNU GPLv2+
#
# 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 2 of the License, or
# (at your option) any later version.
#
# Parabola Install Wizard 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


# configure hostname
echo $(GetStateVar 'HOSTNAME') > /etc/hostname

# configure timezone
ln -s /usr/share/zoneinfo/$(GetStateVar 'TIMEZONE') /etc/localtime

# configure keymap
echo "KEYMAP=$(GetStateVar 'KEYMAP')" > /etc/vconsole.conf

# configure locales
locales=$(echo $(GetStateVar 'LOCALES') | sed -e 's/" "/\n/g' -e 's/ /#/g' -e 's/"//g')
for locale in ${locales[@]}
do locale=$(echo ${locale} | sed -e 's/#/ /g')
   sed -i -e "s/#${locale}/${locale}/g" /etc/locale.gen
done
locale-gen

# configure language
echo "LANG=$(GetStateVar 'LANGUAGE')" > /etc/locale.conf

# prepare initrd
mkinitcpio -p linux-libre

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

     # enable Parabola GRUB theme
     sed -i "$GRUB_THEME_SED_CMD" /mnt/etc/default/grub
fi

# configure root login
usermod -p $(openssl passwd $(GetStateVar 'ROOT_PASS')) root

exit