4 Commits

Author SHA1 Message Date
KosiehBarter 54c0a01dc3 Make name more appropriate
Signed-off-by: Kosieh Barter <kaja.valek@gmail.com>
2021-05-02 15:52:08 +02:00
KosiehBarter 359097edd1 Fix path
Signed-off-by: Kosieh Barter <kaja.valek@gmail.com>
2021-05-02 15:51:01 +02:00
KosiehBarter 3f25191b4e Fix helper scripts, add helper installer
Signed-off-by: Kosieh Barter <kaja.valek@gmail.com>
2021-05-02 15:47:12 +02:00
KosiehBarter 0a91d0c7a7 Simplifying script for mounting FullData
Signed-off-by: Kosieh Barter <kaja.valek@gmail.com>
2021-02-21 17:56:35 +01:00
16 changed files with 13 additions and 1075 deletions
-38
View File
@@ -1,38 +0,0 @@
packages
vscodium
yay
thorium-browser-bin
superslicer-bin
microsoft-edge-stable-bin
razercommander-git
pyglet
printrun
polychromatic
bambustudio-bin
libstroke
fvwm
nscde
orbitiny-desktop-bin
auto-cpufreq
librewolf-bin
razercommander-git
polychromatic
gtk2
gtk-engines
libjpeg6-turbo
libpng15
ncurses5-compat-libs
libtiff5
libxcrypt-compat
maxx-desktop
libstdc++5
plainbase
plainabout
plainartwork
plainpanel
plaincontrolcenter
plainde-meta
linuxflip-git
lumina-desktop
ttf-nanum
orca-slicer
-27
View File
@@ -1,27 +0,0 @@
FROM docker.io/archlinux
RUN \
pacman-key --init && \
pacman-key --populate && \
pacman -Syy
RUN \
pacman -Sy git base-devel make cmake wget net-tools openssh sshfs fuse python3 7zip pipewire-jack gnu-free-fonts --noconfirm
RUN \
mkdir /archbuild
RUN \
echo user_allow_other >> /etc/fuse.conf
RUN \
useradd -m -G wheel builder
RUN \
echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
USER builder
WORKDIR /archbuild
# podman run -it -v /home/kosieh/Development/archbuild:/archbuild:z --userns=keep-id <img_name> bash
-58
View File
@@ -1,58 +0,0 @@
# Linux Hacks / Scripting
## This repository is maintained by a human.
- AI reasoning is used for analytical purposes only.
- Definitive, last and the only executive decision is made a by a human.
## License
- GNU GPL v3
This repository serves as a general place for archiving various GNU/Linux / GNU/BASH scripts, automations and installers.
## Arch Linux Installer
The `ai.sh` is a BASH-based semi-automatic installer for deploying Arch Linux via a iPXE interface.
Arguments are positional, so to change / use specific paramter preceeding paramters must be set.
Apart from `mode` parameter remaining parameters are optional.
In case you will omit the $3 parameter (disk), installer assumes you have your intended-to-be system drive mounted under /mnt.
### Usage:
```bash
Usage:
bash /path/to/ai.sh <mode> [number] [disk]
Parameters:
\$1: Mode, please see below:
-d: Auto-format disk, auto-make paritions:
- /boot
- /
- /boot/efi (EFI-only systems)
-a: Fully-automated mode
-i Interactive mode
\$2: Graphical environment to install. Options:
0: No GUI / Text-only
1: MATE Desktop
2: KDE Desktop
3: Budgie Desktop
4: LXQT Desktop
5: i3-WM
\$3: Disk / partition to install to. Empty means interactive mode
```
### HTTP-based chainload:
You can use this script for netbooting. Append the following line to the `kernel` parameter:
```bash
script=https://kb.brn.mooo.com/git/KosiehBarter/LinuxHacks/raw/branch/archlinux/ai.sh
```
## AI Agents
- `agents_gemini.md` — independent AI perspective (used for double reasoning)
- `agents_openai.md` — independent AI perspective (used for double reasoning)
> These two files document redundant and independent AI insights. They are **not authoritative**; all decisions are human-audited.
> The goal is to provide additional reasoning and verification while ensuring hardware safety and deterministic behavior.
-265
View File
@@ -1,265 +0,0 @@
#!/usr/bin/bash
# Copyright (C) 2026 KosiehBarter
# This program 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 3 of the License
NVIDIA_PKGS="nvidia-open-lts nvidia-settings nvidia-utils"
NV_OSS_PKGS="linux-firmware-nvidia"
ATIAMD_PKGS="linux-firmware-amdgpu amdgpu_top" # ATi no longer exists, historical reference
# Run Auto-SSH enable for archiso
ssh_access() {
# pre-defined password is necesity, home conditions behind a firewall.
echo "root:installer" | chpasswd && \
echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config && \
systemctl restart sshd
exit 0
}
install_core() {
# Core - base packages
PKGS="base linux-lts vim networkmanager openssh"
# Processor tuning / checkup for specific ucode.
if [[ $(cat /proc/cpuinfo | grep -i name | grep -i amd) ]]
then
PKGS="$PKGS amd-ucode"
else
PKGS="$PKGS intel-ucode"
fi
# Check and hold if we are on EFI-capable system.
if [[ -d /sys/firmware/efi/ ]]
then
PKGS="$PKGS efibootmgr"
fi
# Start installation of the base system.
# Make sure /mnt is mounted.
if [[ $(cat /proc/mounts | grep /mnt) ]]
then
# Pacstrap it
pacstrap /mnt $PKGS
if [[ $? -ne 0 ]]
then
echo "Error during pacstap, possibly missing package."
exit 1
fi
fi
# Generate FSTAB
genfstab -U /mnt >> /mnt/etc/fstab
# Enable SSHD and networking
echo "Enable NetworkManager and SSHD"
arch-chroot /mnt systemctl enable sshd
arch-chroot /mnt systemctl enable NetworkManager
# Quality-of-life
arch-chroot /mnt /bin/bash -c "echo \"alias ls='ls --color'\" >> /etc/profile"
arch-chroot /mnt sed -i 's/PS1=.*/PS1='"'"'\\[\\e[0;35m\\][\\[\\e[0m\\]\\[\\e[0;32m\\]\\u\\[\\e[0m\\]\\[\\e[0;35m\\]@\\[\\e[0m\\]\\[\\e[0;34m\\]\\h\\[\\e[0m\\]\\[\\e[0m\\]\\[\\e[0;35m\\]]\\[\\e[0m\\]\\[\\e[0;35m\\]:\\[\\e[0m\\] \\[\\e[0;33m\\]\\W \\[\\e[0;35m\\]\\$\\[\\e[0m\\] '"'"'/g' /etc/bash.bashrc
printf '#%.0s' {1..80} && printf '\n'
echo -e "Base system installed.\nDo not forget to set up users to prevent bricking yourself.\nDon't forget to install GRUB by providing your main drive where EFI partition is."
echo -e "\e[1;91mDo not forget to set up 'root' password.\e[0m"
printf '#%.0s' {1..80} && printf '\n'
}
install_grub() {
# Install GRUB
arch-chroot /mnt pacman -Sy grub os-prober --noconfirm
# Set up OS Prober to register other OSes.
arch-chroot /mnt sed -i 's/#GRUB_DISABLE_OS_PROBER=false/GRUB_DISABLE_OS_PROBER=false/g' /etc/default/grub
if [[ -n "$1" ]]
then
if [ -d /sys/firmware/efi/ ]
then
arch-chroot /mnt grub-install --bootloader-id=grub --target=x86_64-efi $1
else
arch-chroot /mnt grub-install --target=i386-pc $1
fi
arch-chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg
else
echo "\n/mnt/ not mounted for installation, exitting.\n\n"
exit 1
fi
}
install_drivers() {
PKGS=""
# Try to detect bluetooth
if [[ $(lsusb | grep -i bluetooth) ]] || [[ $(lspci | grep -i bluetooth) ]]
then
PKGS="${PKGS} bluez bluez-utils"
fi
# Realtek-based chips.
if [[ $(lspci | grep -i realtek) ]]
then
PKGS="${PKGS} linux-firmware-realtek"
fi
# Atheros
if [[ $(lspci | grep -i atheros) ]]
then
PKGS="${PKGS} linux-firmware-atheros"
fi
# Intel - graphics, but not limited to, network cards, etc.
if [[ $(lspci | grep -i intel) ]]
then
PKGS="${PKGS} linux-firmware-intel"
fi
# Broadcom
if [[ $(lspci | grep -i broadcom) ]] || [[ $(lsusb | grep -i broadcom) ]]
then
PKGS="${PKGS} linux-firmware-broadcom"
fi
# Non-firmware packages
# Detect audio devices.
if [[ $(lspci | grep -i audio | grep -vi nvidia | grep -vi radeon) ]]
then
PKGS="$PKGS wireplumber pipewire pipewire-docs pipewire-audio pipewire-pulse pipewire-alsa pipewire-jack"
fi
arch-chroot /mnt pacman -Sy --noconfirm $PKGS
}
install_security() {
# Install Yubico key support
arch-chroot /mnt pacman -Sy extra/yubico-piv-tool extra/yubikey-touch-detector pam-u2f libfido2 firewalld --noconfirm
arch-chroot /mnt sed -i '3 i\auth\t\tsufficient\t\t\tpam_u2f.so\t\t\tcue' /etc/pam.d/system-auth
# Security - firewalld, permit SSHD login
echo "Enable FirewallD and enable SSH service through"
arch-chroot /mnt systemctl enable firewalld
arch-chroot /mnt firewall-offline-cmd --add-service=ssh
}
install_nm_addons() {
arch-chroot /mnt pacman -Sy --noconfirm networkmanager-openvpn networkmanager-pptp networkmanager-vpnc
}
install_optionals() {
# Hostname generation
arch-chroot /mnt /bin/bash -c "dmidecode -s baseboard-product-name | sed -e 's/[a-z]*//g' | sed -e 's/\ //g' | sed -e 's/\(.*\)/\L\1/g' | sed -e 's/\//-/g' > /etc/hostname"
}
install_gui() {
PKGS="nm-connection-editor network-manager-applet gvfs-afc gvfs-dnssd gvfs-goa gvfs-gphoto2 gvfs-mtp gvfs-nfs gvfs-onedrive gvfs-smb gvfs-wsdd gnu-free-fonts vlc vlc-plugins-all"
# Try to detect VGA and install drivers for it.
if [[ $(lspci -nnk | grep -i vga | grep -i nvidia) ]]
then
# User has not specified OSS Driver => proprietary
if [[ -z "$NV_OSS" ]]
then
PKGS="${PKGS} $NVIDIA_PKGS"
# OSS
else
PKGS="${PKGS} $NV_OSS_PKGS"
fi
fi
if [[ $(lspci -nnk | grep -i vga | grep -i amd) ]]
then
PKGS="${PKGS} $ATIAMD_PKGS"
fi
case "$1" in
"mate")
DEPKGS="mate mate-extra blueman lightdm lightdm-gtk-greeter gnome-keyring"
DCONF="dconf write /org/mate/terminal/profiles/default/foreground-color \"'#ffffff'\" && dconf write /org/mate/terminal/profiles/default/background-color \"'#000000'\""
LOGINMANAGER="lightdm"
;;
"plasma")
DEPKGS="plasma-meta dolphin konsole kdeconnect plasma-login-manager gwenview power-profiles-daemon qt6-multimedia-ffmpeg"
LOGINMANAGER="plasmalogin"
;;
"cosmic")
DEPKGS="cosmic gnome-keyring"
;;
*)
;;
esac
if [[ -n $DEPKGS ]]
then
arch-chroot /mnt pacman -Syu --noconfirm $PKGS
fi
if [[ -n $LOGINMANAGER ]]
then
arch-chroot /mnt systemctl enable $LOGINMANAGER
fi
if [[ -n $DCONF ]]
then
arch-chroot /mnt /bin/bash -c "$DCONF"
fi
}
# No arugments - just start the SSH shell
if [[ -z "$1" ]]
then
ssh_access
else
if [[ "$1" == "-i" ]]
then
if [[ $(cat /proc/mounts | grep mnt) ]]
then
if [[ -z "$2" ]]
then
install_core
fi
if [[ "$2" == "grub" ]]
then
if [[ -z "$3" ]]
then
echo "Please provide drive to install GRUB to."
exit 1
else
install_grub $3
fi
fi
if [[ "$2" == "drivers" ]]
then
install_drivers
fi
if [[ "$2" == "sec" ]]
then
install_security
fi
if [[ "$2" == "gui" ]]
then
if [[ -z "$3" ]]
then
echo "No GUI selected"
exit 1
else
install_gui $3
fi
fi
if [[ "$2" == "AUTO" ]]
then
install_core
install_grub $3
install_security
install_gui "plasma"
# Set root's PW and inform the user about change
arch-chroot /mnt "echo \"root:installer\" | chpasswd"
fi
else
echo "Please make sure you have your target/destination storage formatted and mounted, exitting."
exit 1
fi
else
install_gui $1
fi
fi
-207
View File
@@ -1,207 +0,0 @@
from html.parser import HTMLParser
import subprocess
import sys
import re
import os
content = subprocess.getoutput("curl https://aur.archlinux.org/packages/%s?all_deps=1&all_reqs=1#pkgreqs" % sys.argv[1])
normal_deps = list()
external_deps = list()
possible_deps = list()
debug = False
force_aur = False
was_aur = False
try:
if sys.argv[3].lower() == "debug":
debug = True
except:
pass
try:
if sys.argv[2].lower() == "forceaur":
force_aur = True
except:
pass
def check_existing_std(pkg):
for aur_dep in external_deps:
if aur_dep in pkg:
return True
return False
def add_package_std(current_package):
# We want to skip "compat" packages
if 'compat' in current_package:
return
if current_package != '' and current_package not in normal_deps:
normal_deps.append(current_package)
def check_raw(line):
current_package = ''
if '<a href' not in line and '<li>' not in line and '<em>' not in line and '</a>' not in line and 'ttps' not in line:
current_package = line
add_package_std(current_package)
def check_leading_a_tag_std(line):
current_package = ''
if 'archlinux.org/packages/?q=' in line:
current_package = line.split('?q=')[1].split('">')[0]
add_package_std(current_package)
def check_paren_tagless(line):
current_package = ''
if '<em>' in line and '</em>' in line and '<a' not in line:
current_package = line.split('<em>(')[1].split(')</em>')[0]
add_package_std(current_package)
def check_aur_standard(pkg):
test_pkg = ''
# For checking,
if pkg.endswith('-git'):
test_pkg = pkg.replace('-git', '')
# We want also dummies to be ignored as well.
if '-dummy' in pkg:
test_pkg = pkg.replace('-dummy', '')
# If we have no initial changes
if test_pkg == '':
test_pkg = pkg
for n_dep in normal_deps:
# Make recognizable for AUR counterpart
if 'python-' in n_dep:
n_dep = n_dep.replace('python-', '')
# Do check of AUR against current dep
if test_pkg in n_dep:
return True
# STD Dep > AUR
if n_dep in test_pkg:
return True
return False
def check_a_tag_aur(line):
current_package = ''
if ' href="/packages/' in line:
current_package = line.split('"/packages/')[1].split('">')[0]
if current_package == '':
return
if check_aur_standard(current_package):
return
if current_package not in external_deps and current_package not in normal_deps:
external_deps.append(current_package)
was_aur = True
def clean_out_aurs():
for aur_pkg in external_deps:
if check_aur_standard(aur_pkg):
external_deps.remove(aur_pkg)
def crawl_sublist(line):
for sub_line in line.split('>, <'):
print(sub_line)
check_raw(line)
check_leading_a_tag_std(line)
check_a_tag_aur(line)
check_paren_tagless(line)
def crawl(content):
reading = False
list_entry = False
aur_dep = False
ignore_within = False
for line in content.split('\n'):
line = line.strip()
# Ignore empty lines
if line == "":
continue
# Also ignore list tag lines and reset AUR meta
elif '<li>' in line or '</li>' in line:
continue
# Also, skip "Optional" lines to reduce package count
elif '<em>(optional)' in line:
continue
# Also, ignore empty <em> tags
elif '<em></em>' in line:
continue
# We want to also skip junk from the CLI as well:
elif '--:--:--' in line:
continue
# Reading mode
if "<ul id=\"pkgdepslist\">" in line:
reading = True
continue
elif "</ul>" in line:
reading = False
# Skip lines that aren't within a list.
if not reading:
continue
if '>, <' in line and '<em>' in line:
#crawl_sublist(line)
continue
#print("RAW LINE: " + line)
check_raw(line)
check_leading_a_tag_std(line)
check_a_tag_aur(line)
check_paren_tagless(line)
clean_out_aurs()
# Write normal deps
f = open(os.getcwd() + "/deps_pacman", "w")
f.write("\n".join(normal_deps))
f.close()
f = open(os.getcwd() + "/deps_possibles", "w")
f.write("\n".join(possible_deps))
f.close()
def crawl_aur():
f = open(os.getcwd() + "/deps_aur", "w")
f.write("\n".join(external_deps))
f.close()
crawl(content)
crawl_aur()
-200
View File
@@ -1,200 +0,0 @@
remove_directory() {
ls -l $1 > /dev/null
if [[ $? -eq 0 ]]
then
rm -rf $1
fi
}
clone_package() {
# Clone the repo
git clone https://aur.archlinux.org/"$1".git
# This mostly happens with python- based packages.
if [[ $? -ne 0 ]]
then
git clone https://aur.archlinux.org/`echo $1 | sed -e 's/python-//'g`
cd `echo $1 | sed -e 's/python-//'g`
else
cd "$1"
fi
}
build_single() {
clone_package $1
# get all packages
python3 /archbuild/dependency_reader.py $1
PKGS=" "
AUR_PKGS=" "
for PKG in `cat ./deps_pacman`
do
if [[ "*evdi*" == "$PKG" ]]
then
PKGS="$PKGS linux-lts-headers"
fi
# Special case: mesa-amber
if [[ $PKG == *"mesa-amber"* ]]
then
PKG=" "
else
sudo pacman -Syp $PKG
if [[ $? -ne 0 ]]
then
AUR_PKGS="$AUR_PKGS $PKG"
else
PKGS="$PKGS $PKG"
fi
fi
done
# Verify packages
sudo pacman -Syp $PKGS 2>&1 | grep error: | awk '{print $5}' > AUR_POSSIBLE
# List packages
echo -e "Packages: $PKGS"
echo -e "AUR Packages: $AUR_PKGS"
sudo pacman -Syyuu --noconfirm $PKGS
makepkg --skippgpcheck
if [[ $? != 0 ]]
then
echo FAILED: $1 >> /archbuild/FAILURES
fi
# Install newly built package
sudo pacman -U --noconfirm *.pkg.tar.zst
cd ..
}
build_all_project() {
for project in `cat $1`
do
build_single $project
finalize $project
done
scp_packages
}
finalize() {
# Create packages dir when non-existent
ls -l /archbuild | grep packages
if [[ $? != 0 ]]
then
mkdir /archbuild/packages/
fi
sudo chown builder /archbuild/packages -R
# Copy files
for i in `find ./$1 | grep zst | grep -v debug`
do
mv $i /archbuild/packages/`echo $i | cut -d '/' -f4`
done
}
scp_packages() {
eval $(ssh-agent -s) && ssh-add /archbuild/reposerver
ssh -i /archbuild/reposerver -o StrictHostKeyChecking=no kosieh@$IPADDRESS 'rm /home/storage/kosieh/repo/arch/x86_64/*.zst'
cd packages
rm kosiehbarter.db.tar.zst kosiehbarter.db kosiehbarter.files.tar.zst kosiehbarter.files
for i in `ls *`
do
mv "$i" `echo "$i" | sed -e 's/-bin-//g'`
done
cd ..
repo-add ./packages/kosiehbarter.db.tar.zst ./packages/*.pkg.tar.zst
cd packages
unlink kosiehbarter.db
cp kosiehbarter.db.tar.zst kosiehbarter.db
unlink kosiehbarter.files
cp kosiehbarter.files.tar.zst kosiehbarter.files
cd ..
scp -i /archbuild/reposerver -o StrictHostKeyChecking=no ./packages/* kosieh@$IPADDRESS:/home/storage/kosieh/repo/arch/x86_64
for i in `cat projects`
do
rm -rf $i
done
}
check_std_package() {
for std_dep in `cat ./deps_pacman`
do
# Special case: mesa-amber
if [[ $PKG == *"mesa-amber"* ]]
then
PKG=" "
else
sudo pacman -Syp $PKG
if [[ $? -ne 0 ]]
then
AUR_PKGS="$AUR_PKGS $PKG"
else
PKGS="$PKGS $PKG"
fi
fi
done
}
gather_deps() {
# Gather dependencies via script
python3 /archbuild/dependency_reader.py $1
for aur_dep in `cat ./deps_aur`
do
clone_make_pkg $aur_dep
# Assume we are CD'd in already
ls -l deps_aur
if [[ $? -eq 0 ]]
then
gather_deps $aur_dep
fi
ls -l deps_pacman
if [[ $? -eq 0 ]]
then
sudo pacman -S
fi
done
# Make packages
makepkg --skippgpcheck
# Install it
sudo pacman -U --noconfirm *.pkg.tar.zst
# Finally, switch back to the "parent"
cd ..
}
# Clean up first
remove_directory $1
# Go through all standard deps and install them, along with the package
if [[ -n "$1" ]]
then
if [[ "$1" == "SCP" ]]
then
scp_packages
else
build_single $1
finalize $1
fi
else
build_all_project projects
fi
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
apt update && apt install git unzip tar bz2 -y
+10
View File
@@ -0,0 +1,10 @@
#!/bin/bash
if [[ -z "$1" ]]
then
echo "Please give letter where your data drive is mounted in Windows."
exit 1
fi
sudo umount /mnt/$1
sudo mount $1: /mnt/$1 -t drvfs -o uid=1000,gid=1000
-14
View File
@@ -1,14 +0,0 @@
evdi-dkms-git
displaylink
vscodium
auto-cpufreq
bambustudio-bin
librewolf-bin
superslicer-bin
razercommander-git
polychromatic
python-flit-core
python-pillow
pyglet
printrun
yay
-27
View File
@@ -1,27 +0,0 @@
thorium-browser-bin
microsoft-edge-stable-bin
razercommander-git
polychromatic
libstroke
fvwm
nscde
orbitiny-desktop-bin
gtk2
gtk-engines
libjpeg6-turbo
libpng15
ncurses5-compat-libs
libtiff5
libxcrypt-compat
maxx-desktop
libstdc++5
plainbase
plainabout
plainartwork
plainpanel
plaincontrolcenter
plainde-meta
linuxflip-git
lumina-desktop
ttf-nanum
orca-slicer
-145
View File
@@ -1,145 +0,0 @@
# Run Auto-SSH enable for archiso
ssh_access() {
echo "root:installer" | chpasswd && \
echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config && \
systemctl restart sshd
exit
}
install() {
# Add repository
cat << EOF >> /etc/pacman.conf
[kosiehbarter]
SigLevel = Never
Server = https://kb.brn.mooo.com/repo/arch/x86_64/
EOF
# Prepare the base
PKGS="base linux-lts grub vim e2fsprogs networkmanager vi dosfstools os-prober firewalld"
# EFI installation when detected
if [[ `ls /sys/firmware/efi` ]]
then
PKGS="${PKGS} efibootmgr"
fi
# Firmware detection:
# Graphics - nVidia
if [[ `lspci | grep -i nvidia | grep -i vga` ]]
then
PKGS="${PKGS} nvidia-lts nvidia-utils"
fi
# AMD Radeon (mostly accompanied with audio)
if [[ `lspci | grep -i radeon | grep -i vga` ]]
then
PKGS="${PKGS} linux-firmware-radeon linux-firmware-amdgpu"
fi
# Graphics, but not limited to
if [[ `lspci | grep -i intel` ]]
then
PKGS="${PKGS} linux-firmware-intel"
fi
# Mostly network devices
if [[ `lspci | grep -i realtek` ]]
then
PKGS="${PKGS} linux-firmware-realtek"
fi
# CPU auto-detect
lscpu | grep name | grep -i amd
if [[ $? == 0 ]]
then
PKGS="${PKGS} amd-ucode"
else
PKGS="${PKGS} intel-ucode"
fi
# Try to detect bluetooth
if [[ `lsusb | grep -i bluetooth` ]]
then
PKGS="${PKGS} bluez bluez-utils"
fi
# Try to detect Audio
if [[ `lspci | grep -i audio` ]]
then
PKGS="${PKGS} pipewire pipewire-docs pipewire-audio pipewire-pulse"
fi
# MATE installation
PKGS="${PKGS} gnu-free-fonts gvfs-smb sshfs wireplumber webp-pixbuf-loader f3d ffmpegthumbnailer caja mate-extra marco mate-backgrounds mate-control-center mate-desktop mate-icon-theme mate-menus mate-notification-daemon mate-panel mate-polkit mate-session-manager mate-settings-daemon mate-themes mate-user-guide lightdm lightdm-gtk-greeter mate-terminal nm-connection-editor nm-connection-editor network-manager-applet networkmanager-openvpn networkmanager-pptp networkmanager-vpnc pipewire-jack"
# Perform the installation
pacstrap /mnt $PKGS
# Setup essentials
arch-chroot /mnt sed -i 's/#cs_CZ.UTF-8/cs_CZ.UTF-8/g' /etc/locale.gen
arch-chroot /mnt sed -i 's/#en_US.UTF-8/en_US.UTF-8/g' /etc/locale.gen
arch-chroot /mnt ln -s /usr/share/zoneinfo/Europe/Prague /etc/localtime
# Quality-of-life
arch-chroot /mnt echo "alias ls='ls --color'" >> /etc/profile
arch-chroot /mnt sed -i 's/PS1=.*/PS1='"'"'\\[\\e[0;35m\\][\\[\\e[0m\\]\\[\\e[0;32m\\]\\u\\[\\e[0m\\]\\[\\e[0;35m\\]@\\[\\e[0m\\]\\[\\e[0;34m\\]\\h\\[\\e[0m\\]\\[\\e[0m\\]\\[\\e[0;35m\\]]\\[\\e[0m\\]\\[\\e[0;35m\\]:\\[\\e[0m\\] \\[\\e[0;33m\\]\\W \\[\\e[0;35m\\]\\$\\[\\e[0m\\] '"'"'/g' /etc/bash.bashrc
# (Possibly) Battery life and CPU throttling
echo "Setting up ACPI / CPU features"
arch-chroot /mnt systemctl enable thermald
# Enable SSHD and networking
echo "Enable NetworkManager and SSHD"
arch-chroot /mnt systemctl enable sshd
arch-chroot /mnt systemctl enable NetworkManager
# Security - firewalld, permit SSHD login
echo "Enable FirewallD and enable SSH service through"
arch-chroot /mnt systemctl enable firewalld
arch-chroot /mnt/ firewall-offline-cmd --add-service ssh
# Generate FSTAB
genfstab -U /mnt >> /mnt/etc/fstab
# Setup GRUB
echo "Setting-up GRUB, generating FSTAB"
if [[ `ls /sys/firmware/efi` ]]
then
arch-chroot /mnt grub-install --bootloader-id=grub --target=x86_64-efi "$2"
else
arch-chroot /mnt grub-install --target=i386-pc "$2"
fi
arch-chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg
# Add repo
cat << EOF >> /mnt/etc/pacman.conf
[kosiehbarter]
SigLevel = Never
Server = https://kb.brn.mooo.com/repo/arch/x86_64/
EOF
# SWAY - experimental
# arch-chroot /mnt pacman -Sy --noconfirm sway foot waybar
# MATE desktop
arch-chroot /mnt dconf write /org/mate/terminal/profiles/default/foreground-color "'#ffffff'"
arch-chroot /mnt dconf write /org/mate/terminal/profiles/default/background-color "'#000000'"
arch-chroot /mnt systemctl enable lightdm
# Final message
echo -e "###\n# DO NOT FORGET TO SET YOUR USERS AND PASSWORDS.\n###"
# Change me once it is installed:
arch-chroot /mnt echo "root:operating" | chpasswd
}
if [[ -z "$1" ]]
then
ssh_access
fi
if [[ "$1" == "-i" ]]
then
if [[ -z "$2" ]]
then
echo "Target disk device not supplied"
exit
fi
install "$2"
fi
-66
View File
@@ -1,66 +0,0 @@
# Run Auto-SSH enable for archiso
ssh_access() {
echo "root:installer" | chpasswd && \
echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config && \
systemctl restart sshd
exit
}
if [[ -z "$1" ]]
then
ssh_access
fi
if [[ "$1" == "-i" ]]
then
if [[ -z "$2" ]]
then
echo "Target disk device not supplied"
exit
fi
install "$2"
if [[ "$1" == "-r" ]]
then
if [[ -z "$2" ]]
then
echo "No Disk provided, provide path, example: /dev/vda"
exit
fi
mkfs.vfat "$2"1
mkfs.ext4 "$2"2
mount "$2"2 /mnt
mount "$2"1 /mnt/boot/efi --mkdir
fi
install() {
PKGS="base linux-lts grub vim e2fsprogs networkmanager vi dosfstools os-prober gnu-free-fonts"
# EFI installation when detected
if [[ `ls /sys/firmware/efi` ]]
then
PKGS="${PKGS} efibootmgr"
fi
# Firmware detection:
# Graphics - nVidia
if [[ `lspci | grep -i nvidia | grep -i vga` ]]
then
PKGS="${PKGS} linux-firmware-nvidia"
fi
# AMD Radeon (mostly accompanied with audio)
if [[ `lspci | grep -i radeon | grep -i vga` ]]
then
PKGS="${PKGS} linux-firmware-radeon linux-firmware-amdgpu"
fi
# Graphics, but not limited to
if [[ `lspci | grep -i intel` ]]
then
PKGS="${PKGS} linux-firmware-intel"
fi
# Mostly network devices
if [[ `lspci | grep -i realtek` ]]
then
PKGS="${PKGS} linux-firmware-realtek"
fi
}
-8
View File
@@ -1,8 +0,0 @@
ip link set br0 down
ip link delete br0 type bridge
ip link add name br0 type bridge
ip link set br0 up
ip link set enp5s0 up
ip link set enp5s0 master br0
ip addr add dev br0 192.168.0.11/24
ip route add dev br0 default via 192.168.0.1
-7
View File
@@ -1,7 +0,0 @@
podman image rm `podman image ls | grep archlinux | awk '{print $3}'`
podman container prune -f
podman image prune -f
cd /home/kosieh/Development/linuxhacks
podman build -t archbuild -f ARCHBUILD_Dockerfile
export IPADDRESS=$IPADDRESS
/usr/bin/podman run -it -e IPADDRESS=$IPADDRESS -v /home/kosieh/Development/linuxhacks/:/archbuild:z --userns=keep-id archbuild bash general_builder.sh
-2
View File
@@ -1,2 +0,0 @@
deadlock:wayland: __GL_VRR_ALLOWED=1 __GL_MAX_FRAMES_ALLOWED=1 __GL_SHADER_DISK_CACHE=1 __GL_SHADER_DISK_CACHE_SIZE=1073741824
deadlock:wayland:__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia __GL_SHADER_DISK_CACHE=1 __GL_SHADER_DISK_CACHE_PATH=/stedisk1/steam_cache __GL_MAX_FRAMES_ALLOWED=1
-11
View File
@@ -1,11 +0,0 @@
#!/bin/bash
if [[ $EUID -ne 0 ]]
then
echo "This scriptlet must be executed as root Exitting."
exit 1
fi
pacman -Sy extra/yubico-piv-tool extra/yubikey-touch-detector pam-u2f libfido2 --noconfirm
sed -i '3 i\auth\t\tsufficient\t\t\tpam_u2f.so\t\t\tcue' /etc/pam.d/system-auth
echo -e "Installation for PAMd for YubiKey done.\nAs per: https://support.yubico.com/s/article/Ubuntu-Linux-login-guide-U2F:\nPlease do the following as regular user:\n\nmkdir -p ~/.config/Yubico && pamu2fcfg > ~/.config/Yubico/u2f_keys\n\nAnd restart your system."