|
|
@ -39,11 +39,6 @@ prompt(){ |
|
|
|
printf "%s" "$ans" |
|
|
|
} |
|
|
|
|
|
|
|
install_deps(){ |
|
|
|
info "Installing dependencies" |
|
|
|
sudo pacman -Sy --needed --noconfirm git tmux 2> /dev/null > /dev/null |
|
|
|
} |
|
|
|
|
|
|
|
banner(){ |
|
|
|
echo "${CYAN} |
|
|
|
dP dP .d888888 .d888888 .d88888b .d88888b |
|
|
@ -59,44 +54,38 @@ Y8. .8P d8' 88 d8' 88 88. \"' 88. \"' |
|
|
|
|
|
|
|
clear |
|
|
|
|
|
|
|
boot=$1 |
|
|
|
root=$2 |
|
|
|
swap=$3 |
|
|
|
encryption=$1 |
|
|
|
root=$3 |
|
|
|
swap=$4 |
|
|
|
home=$5 |
|
|
|
|
|
|
|
if [ ! "$(wc -l /install/device)" = "3" ]; then |
|
|
|
home=$4 |
|
|
|
fi |
|
|
|
|
|
|
|
ln -sf /usr/share/zoneinfo/Europe/Istanbul /etc/localtime |
|
|
|
zone=$(prompt "Please enter timezone: ") |
|
|
|
while [ ! -f "/usr/share/zoneinfo/$zone" ]; do |
|
|
|
zone=$(prompt "Please enter timezone: ") |
|
|
|
done |
|
|
|
ln -sf "/usr/share/zoneinfo/$zone" /etc/localtime |
|
|
|
hwclock --systohc |
|
|
|
|
|
|
|
echo -e "en_US.UTF-8 UTF-8\ntr_TR.UTF-8 UTF-8" > /etc/locale.gen |
|
|
|
locale-gen |
|
|
|
|
|
|
|
echo "LANG=en_US.UTF-8" > /etc/locale.conf |
|
|
|
|
|
|
|
if [ ! -f "/tmp/.blackarch" ]; then |
|
|
|
curl https://blackarch.org/strap.sh > /tmp/strap.sh |
|
|
|
chmod +x /tmp/strap.sh |
|
|
|
/tmp/strap.sh |
|
|
|
|
|
|
|
if [ -f "/install/artix" ]; then |
|
|
|
echo -e "\n[multilib]\nInclude = /etc/pacman.d/mirrorlist-arch" >> /etc/pacman.conf |
|
|
|
echo -e "\n[lib32]\nInclude = /etc/pacman.d/mirrorlist\n\n[options]\nILoveCandy\nTotalDownload\nColor" >> /etc/pacman.conf |
|
|
|
else |
|
|
|
echo -e "\n[multilib]\nInclude = /etc/pacman.d/mirrorlist\n\n[options]\nILoveCandy\nTotalDownload\nColor" >> /etc/pacman.conf |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
echo -n "Are you going to use a flexo server?(y/N): " |
|
|
|
read flexo |
|
|
|
printf "\n[multilib]\nInclude = /etc/pacman.d/mirrorlist\n\n[options]\nILoveCandy\nTotalDownload\nColor" >> /etc/pacman.conf |
|
|
|
flexo=$(prompt "Are you going to use a flexo server?(y/N): ") |
|
|
|
|
|
|
|
if [ "$flexo" = "y" ]; then |
|
|
|
echo -n "Please enter ip address of flexo server: " |
|
|
|
read flexo_ip |
|
|
|
flexo_ip=$(prompt "Please enter ip address of flexo server: ") |
|
|
|
echo -e "\nServer = http://$flexo_ip:7878/\$repo/os/\$arch\n" >> /etc/pacman.d/mirrorlist |
|
|
|
fi |
|
|
|
pacman -Syy |
|
|
|
|
|
|
|
echo -n "Did any errors occur?(y/N): " |
|
|
|
read errors |
|
|
|
errors=$(prompt "Did any errors occur?(y/N): ") |
|
|
|
|
|
|
|
if [ "$errors" = "y" ]; then |
|
|
|
echo "Dropping you into a shell so that you can fix them, once you quit the shell, the installation will continue from where you left off." |
|
|
@ -107,31 +96,29 @@ fi |
|
|
|
|
|
|
|
clear |
|
|
|
|
|
|
|
echo "Please enter hostname: " |
|
|
|
read hostname |
|
|
|
echo $hostname > /etc/hostname |
|
|
|
hostname=$(prompt "Please enter hostname: ") |
|
|
|
echo "$hostname" > /etc/hostname |
|
|
|
|
|
|
|
echo "Set password for root: " |
|
|
|
info "Set password for root: " |
|
|
|
passwd root |
|
|
|
|
|
|
|
echo "Please enter name for regular user:" |
|
|
|
read username |
|
|
|
username=$(prompt "Please enter name for regular user: ") |
|
|
|
|
|
|
|
useradd -m $username |
|
|
|
echo "Set password for user $username: " |
|
|
|
passwd $username |
|
|
|
usermod -aG wheel $username |
|
|
|
useradd -m "$username" |
|
|
|
info "Set password for user $username: " |
|
|
|
passwd "$username" |
|
|
|
usermod -aG wheel "$username" |
|
|
|
|
|
|
|
|
|
|
|
echo -e "127.0.0.1 localhost\n::1 localhost\n127.0.0.1 $hostname.localdomain $hostname" > /etc/hosts |
|
|
|
|
|
|
|
if [ -f "/install/encrypted" ]; then |
|
|
|
cat << EOF > /etc/initcpio/hooks/openswap |
|
|
|
if [ "$encryption" = "1" ]; then |
|
|
|
cat << EOF > /etc/initcpio/hooks/openswap |
|
|
|
run_hook () |
|
|
|
{ |
|
|
|
x=0; |
|
|
|
while [ ! -b /dev/mapper/root ] && [ \$x -le 10 ]; do |
|
|
|
x=$((x+1)) |
|
|
|
x=\$(( x+1 )) |
|
|
|
sleep .2 |
|
|
|
done |
|
|
|
mkdir crypto_key_device |
|
|
@ -141,7 +128,7 @@ run_hook () |
|
|
|
} |
|
|
|
EOF |
|
|
|
|
|
|
|
cat << EOF > /etc/initcpio/install/openswap |
|
|
|
cat << EOF > /etc/initcpio/install/openswap |
|
|
|
build () |
|
|
|
{ |
|
|
|
add_runscript |
|
|
@ -154,13 +141,14 @@ HELPEOF |
|
|
|
} |
|
|
|
EOF |
|
|
|
|
|
|
|
if [ ! "$home" = "" ]; then |
|
|
|
cat << EOF > /etc/initcpio/hooks/openhome |
|
|
|
if [ ! "$home" = "" ]; then |
|
|
|
|
|
|
|
cat << EOF > /etc/initcpio/hooks/openhome |
|
|
|
run_hook () |
|
|
|
{ |
|
|
|
x=0; |
|
|
|
while [ ! -b /dev/mapper/root ] && [ \$x -le 10 ]; do |
|
|
|
x=$((x+1)) |
|
|
|
x=\$((x+1)) |
|
|
|
sleep .2 |
|
|
|
done |
|
|
|
mkdir crypto_key_device |
|
|
@ -169,7 +157,8 @@ run_hook () |
|
|
|
umount crypto_key_device |
|
|
|
} |
|
|
|
EOF |
|
|
|
cat << EOF > /etc/initcpio/install/openhome |
|
|
|
|
|
|
|
cat << EOF > /etc/initcpio/install/openhome |
|
|
|
build () |
|
|
|
{ |
|
|
|
add_runscript |
|
|
@ -181,77 +170,78 @@ cat<<HELPEOF |
|
|
|
HELPEOF |
|
|
|
} |
|
|
|
EOF |
|
|
|
cat << EOF > /etc/mkinitcpio.conf |
|
|
|
|
|
|
|
cat << EOF > /etc/mkinitcpio.conf |
|
|
|
MODULES=(vfat i915) |
|
|
|
BINARIES=() |
|
|
|
FILES=() |
|
|
|
HOOKS=(base udev plymouth autodetect keyboard keymap consolefont modconf block plymouth-encrypt openswap openhome resume filesystems fsck) |
|
|
|
EOF |
|
|
|
else |
|
|
|
cat << EOF > /etc/mkinitcpio.conf |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
cat << EOF > /etc/mkinitcpio.conf |
|
|
|
MODULES=(vfat i915) |
|
|
|
BINARIES=() |
|
|
|
FILES=() |
|
|
|
HOOKS=(base udev plymouth autodetect keyboard keymap consolefont modconf block plymouth-encrypt openswap resume filesystems fsck) |
|
|
|
EOF |
|
|
|
fi |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
else |
|
|
|
cat << EOF > /etc/mkinitcpio.conf |
|
|
|
cat << EOF > /etc/mkinitcpio.conf |
|
|
|
MODULES=(vfat i915) |
|
|
|
BINARIES=() |
|
|
|
FILES=() |
|
|
|
HOOKS=(base udev plymouth autodetect keyboard keymap consolefont modconf block plymouth resume filesystems fsck) |
|
|
|
EOF |
|
|
|
fi |
|
|
|
|
|
|
|
pacman -Syu --noconfirm $(cat /install/packages.base | xargs) |
|
|
|
fi |
|
|
|
|
|
|
|
pacman -Syu --noconfirm "$(xargs < /install/pkg.list)" |
|
|
|
refind-install |
|
|
|
|
|
|
|
if [ -f "/install/encrypted" ]; then |
|
|
|
line=1 |
|
|
|
|
|
|
|
blkid | while IFS= read -r i; do |
|
|
|
echo "$line: $i" |
|
|
|
((line=line+1)) |
|
|
|
done |
|
|
|
|
|
|
|
echo -n "Please select the device you will save the LUKS key to: " |
|
|
|
read keydev |
|
|
|
|
|
|
|
uuid=$(blkid | sed -n 's/.*UUID=\"\([^\"]*\)\".*/\1/p' | sed -n "$keydev"p) |
|
|
|
cat << EOF > /boot/refind_linux.conf |
|
|
|
"Boot with encryption" "root=/dev/mapper/root resume=/dev/mapper/swap cryptdevice=UUID=$(blkid -s UUID -o value $root):root:allow-discards cryptkey=UUID=$uuid:vfat:key.yeet rw loglevel=3 quiet splash" |
|
|
|
EOF |
|
|
|
clear |
|
|
|
if [ "$encryption" = "1" ]; then |
|
|
|
line=1 |
|
|
|
|
|
|
|
blkid | while IFS= read -r i; do |
|
|
|
echo "$line: $i" |
|
|
|
((line=line+1)) |
|
|
|
done |
|
|
|
|
|
|
|
keydev=$(prompt "Please select the device you will save the LUKS key to: ") |
|
|
|
# TODO automatically copy key files and format device |
|
|
|
uuid=$(blkid | sed -n 's/.*UUID=\"\([^\"]*\)\".*/\1/p' | sed -n "$keydev"p) |
|
|
|
cat << EOF > /boot/refind_linux.conf |
|
|
|
"Boot with encryption" "root=/dev/mapper/root resume=/dev/mapper/swap cryptdevice=UUID=$(blkid -s UUID -o value "$root"):root:allow-discards cryptkey=UUID=$uuid:vfat:key.yeet rw loglevel=3 quiet splash" |
|
|
|
EOF |
|
|
|
clear |
|
|
|
else |
|
|
|
cat << EOF > /boot/refind_linux.conf |
|
|
|
"Boot without encryption" "root=UUID=$(blkid -s UUID -o value $root) resume=UUID=$(blkid -s UUID -o value $swap) rw loglevel=3 quiet splash" |
|
|
|
cat << EOF > /boot/refind_linux.conf |
|
|
|
"Boot without encryption" "root=UUID=$(blkid -s UUID -o value "$root") resume=UUID=$(blkid -s UUID -o value "$swap") rw loglevel=3 quiet splash" |
|
|
|
EOF |
|
|
|
fi |
|
|
|
|
|
|
|
mkdir -p /etc/sudoers.d |
|
|
|
echo "%wheel ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/nopwd |
|
|
|
|
|
|
|
info "Installing yay" |
|
|
|
sudo -u "$username" bash -c "git clone https://aur.archlinux.org/yay.git /tmp/yay" |
|
|
|
sudo -u "$username" bash -c "(cd /tmp/yay; makepkg --noconfirm -si)" |
|
|
|
sudo -u "$username" bash -c "yay --noconfirm -S plymouth" |
|
|
|
|
|
|
|
sudo -u $username bash -c "git clone https://aur.archlinux.org/yay.git /tmp/yay" |
|
|
|
sudo -u $username bash -c "(cd /tmp/yay; makepkg --noconfirm -si)" |
|
|
|
sudo -u $username bash -c "yay --noconfirm -S plymouth" |
|
|
|
|
|
|
|
if [ -f "/install/artix" ]; then |
|
|
|
sudo -u $username bash -c "yay --noconfirm -S plymouth-openrc-plugin" |
|
|
|
fi |
|
|
|
clear |
|
|
|
|
|
|
|
echo -n "Would you like to automatically install my dotfiles?(y/N): " |
|
|
|
read dotfiles |
|
|
|
dotfiles=$(prompt "Would you like to automatically install my dotfiles?(y/N): ") |
|
|
|
|
|
|
|
if [ "$dotfiles" = "y" ]; then |
|
|
|
pacman -R --noconfirm vim |
|
|
|
sudo -u $username bash -c "git clone --recurse-submodules https://github.com/theFr1nge/dotfiles.git ~/.dotfiles" |
|
|
|
sudo -u $username bash -c "(cd ~/.dotfiles; ./install.sh)" |
|
|
|
sudo -u "$username" bash -c "git clone --recurse-submodules https://github.com/theFr1nge/dotfiles.git ~/.dotfiles" |
|
|
|
sudo -u "$username" bash -c "(cd ~/.dotfiles; ./install.sh)" |
|
|
|
clear |
|
|
|
fi |
|
|
|
|
|
|
|
info "Installing Plymouth theme" |
|
|
|
git clone https://github.com/adi1090x/plymouth-themes.git /tmp/pthemes |
|
|
|
cat << EOF > /etc/plymouth/plymouthd.conf |
|
|
|
[Daemon] |
|
|
@ -264,25 +254,17 @@ clear |
|
|
|
|
|
|
|
echo -e "/boot/EFI/refind\n2\n2" | sudo bash -c "$(curl -fsSL https://raw.githubusercontent.com/bobafetthotmail/refind-theme-regular/master/install.sh)" |
|
|
|
|
|
|
|
if [ -f "/install/artix" ]; then |
|
|
|
sudo rc-update add cronie |
|
|
|
sudo rc-update add acpi |
|
|
|
sudo rc-update add dbus |
|
|
|
sudo rc-update add connmand |
|
|
|
sudo rc-update add syslog-ng |
|
|
|
else |
|
|
|
systemctl enable connman |
|
|
|
systemctl enable cronie |
|
|
|
fi |
|
|
|
systemctl enable connman |
|
|
|
systemctl enable cronie |
|
|
|
|
|
|
|
clear |
|
|
|
|
|
|
|
info "Running mkinitcpio" |
|
|
|
mkinitcpio -P |
|
|
|
|
|
|
|
if [ -f "/install/encrypted" ]; then |
|
|
|
if [ "$encryption" = "$1" ]; then |
|
|
|
vim /etc/fstab |
|
|
|
fi |
|
|
|
pacman --noconfirm -R nano # uninstall nano, eww |
|
|
|
|
|
|
|
clear |
|
|
|
|
|
|
|