OSDN Git Service

add askdisk option
[instantos/instantARCH.git] / chroot / chroot.sh
1 #!/bin/bash
2
3 # enable all sorts of configuration concerning login, lightdm, networking and grub
4
5 # enable lightdm greeter
6 if grep -q 'greeter-session' /etc/lightdm/lightdm.conf; then
7     LASTSESSION="$(grep 'greeter-session' /etc/lightdm/lightdm.conf | tail -1)"
8     sed -i "s/$LASTSESSION/greeter-session=lightdm-gtk-greeter/g" /etc/lightdm/lightdm.conf
9 else
10     sed -i 's/^\[Seat:\*\]/\[Seat:\*\]\ngreeter-session=lightdm-gtk-greeter/g' /etc/lightdm/lightdm.conf
11 fi
12
13 # set up instantwm as a default user session
14 if grep-q '^user-session.*' /etc/lightdm/lightdm.conf; then
15     echo "adjusting user session"
16     sed -i 's/^user-session=.*/user-session=instantwm/g' /etc/lightdm/lightdm.conf
17 fi
18
19 # fix gui not showing up
20 sed -i 's/^#logind-check-graphical=.*/logind-check-graphical=true/' /etc/lightdm/lightdm.conf
21
22 # needed to get internet to work
23 if ! [ -e /opt/topinstall ] && ! iroot partswap; then
24     if ! grep -iq manjaro /etc/os-release; then
25         # enable swap
26         systemctl enable systemd-swap
27         sed -i 's/^swapfc_enabled=.*/swapfc_enabled=1/' /etc/systemd/swap.conf
28     fi
29 fi
30
31 sed -i 's/# %wheel/%wheel/g' /etc/sudoers
32 systemctl enable lightdm
33 systemctl enable NetworkManager
34
35 if ! command -v update-grub &>/dev/null; then
36     # can't include this in package
37     echo '#! /bin/sh
38 grub-mkconfig -o /boot/grub/grub.cfg' >/usr/bin/update-grub
39     chmod 755 /usr/bin/update-grub
40 fi