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


Init=$(GetStateVar 'INIT')
Wmde=$(GetStateVar 'WMDE')
if   [[ "${Init}" == 'openrc' ]]
then # Create the dbus user if it doesn't exist
     grep dbus /etc/group  > /dev/null || groupadd -g 81 dbus
     grep dbus /etc/passwd > /dev/null || useradd  -g 81 -u 81 dbus -r -s /sbin/nologin

     # Enable services with OpenRC
     rc-update add alsasound      default
     rc-update add dbus           default
     rc-update add NetworkManager default
elif [[ "${Init}" == 'systemd' ]]
     case "${Wmde}" in
     'lxde') systemctl enable 'NetworkManager.service' 'lxdm.service'     ;;
     'mate') systemctl enable 'NetworkManager.service' 'lightdm.service'  ;;
     *     ) systemctl enable 'dhcpcd.service' 'systemd-resolved.service' ;;
     esac
fi