First draft of the installation script

This commit is contained in:
TuDatTr
2020-05-23 15:00:17 +02:00
parent e6ec25f60d
commit c6fd8e754f
7 changed files with 215 additions and 0 deletions

42
root/march-chroot.sh Normal file
View File

@@ -0,0 +1,42 @@
#!/bin/bash
timezone="CHANGEME" # specified in ./arch-chroot.sh
locale="CHANGEME"
hostname="CHANGEME"
username="CHANGEME"
sudogrp="CHANGEME"
arch-chroot /mnt root/march-chroot.sh -t timezone -l locale -h hostname -u username -s sudogrp
ln -sf $timezone /etc/localtime
hwclock --systohc
echo $locale >> /etc/locale.gen
if [ $locale != "en_US.UTF-8 UTF-8"]; then
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
fi
locale-gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf
echo $hostname > /etc/hostname
sed -i "s/^HOOKS=([[:alnum:][:space:]]\+)/HOOKS=(base udev autodetect keyboard keymap consolefont modconf block encrypt filesystems fsck)/" /etc/mkinitcpio.conf
mkinitcpio -p linux
passwd
bootctl install
echo "timeout 3
default arch" > /boot/loader/loader.conf
echo "title ArchLinux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options rw cryptdevice=$(blkid $rootpart | cut -d" " -f2 | tr -d \"):cryptroot root=$cryptroot i8042.noloop i8042.nomux i8042.nopnp i8042.reset" > /boot/loader/entries/arch.conf
sed -i "s/"
systemctl enable march.service
systemctl enable dhcpcd.service

32
root/march-reboot.sh Normal file
View File

@@ -0,0 +1,32 @@
#!/bin/bash
sudogrp="CHANGEME"
username="CHANGEME"
pacman -S --noconfirm git zsh gvim wget arch-audit lightdm lightdm-webkit2-greeter xorg-server xf86-video-intel i3-gaps xorg-xbacklight xorg-xrandr i3lock-color alsa-utils pulseaudio pulseaudio-alsa pulseaudio-bluetooth playerctl pavucontrol exfat-utils udiskie blueman acpi acpid tlp compton conky rxvt-unicode networkmanager network-manager-applet networkmanager-openconnect networkmanager-openvpn stow maim openssh xdotool xclip thunderbird firefox veracrypt keepassxc texlive-most evince pandoc pdfgrep adobe-source-han-sans-otc-fonts python3 python3-pip ranger atool elinks ffmpegthumbnailer highlight libcaca lynx mediainfo odt2txt perl-image-exiftool poppler python-chardet transmission-cli w3m
echo "%$sudogrp ALL=(ALL) ALL" >> /etc/sudoers
groupadd $sudogrp
useradd -m -G $sudogrp -s $username
systemctl enable lightdm
sed -i "s/#user-session.*/user-session=i3/g" /etc/lightdm/lightdm.conf
sed -i "s/#greeter-session.*/greeter-session=lightdm-webkit2-greeter/g" /etc/lightdm/lightdm.conf
cp $CWD/etc/systemd/system/suspend@.service /etc/systemd/system/suspend@.service
cp $CWD/etc/X11/xorg.conf.d/30-touchpad.conf /etc/X11/xorg.conf.d/30-touchpad.conf
cp $CWD/etc/iptables/iptables.rules /etc/iptables/iptables.rules
# From this on we need need to be $username
su $username sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" &
cp -r /usr/share/zsh-theme-powerlevel9k $HOME/.oh-my-zsh/themes/powerlevel9k
su $username sh -c "git clone https://github.com/powerline/fonts.git --depth=1 /home/$username/fonts"
su $username sh -c "chmod +x /home/$username/fonts/install.sh"
su $username sh -c "/home/$username/fonts/install.sh"
su $username sh -c "rm -rf /home/$username/fonts/"
su $username sh -c "git clone git@gitlab.com:TuDatTr/dotfiles.git /home/$username/.dotfiles"
su $username sh -c "cd /home/$username/.dotfiles & stow vim"
su $username sh -c "cd /home/$username/.dotfiles & stow zsh"
su $username sh -c "cd /home/$username/.dotfiles & stow config"