88 Commits

Author SHA1 Message Date
KosiehBarter 1fe3071916 Further rework of ai.sh
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2026-05-24 16:30:01 +02:00
KosiehBarter a163dea541 Reimplement ai.sh
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2026-05-24 15:36:22 +02:00
KosiehBarter 6c5637ca38 Add yubikey
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2026-04-27 14:54:06 +02:00
KosiehBarter affaff7132 FIX: plasmalogin instead of SDDM, dconf 2026-04-25 10:03:25 +01:00
KosiehBarter 11b6eb09f2 Migrate BarterVMOp to separate repo
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2026-04-17 19:50:02 +02:00
KosiehBarter ac296c5a4a Add information regarding tools used
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2026-04-09 21:38:38 +02:00
KosiehBarter 7e13d27d04 Update readme
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2026-04-06 19:06:17 +02:00
KosiehBarter 426e7d5237 Add license
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2026-04-06 19:01:07 +02:00
KosiehBarter fa4007366a Improve inhibitor handling
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2026-04-04 00:50:39 +02:00
KosiehBarter 49c5c2e801 Add BIOS extraction tool
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2026-04-03 21:51:49 +02:00
KosiehBarter a6a92c3809 Add a automation for NetworkManager
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2026-04-03 20:39:32 +02:00
KosiehBarter a5a2f1ddbf Improve automated installer from build server
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2026-04-03 11:31:37 +02:00
KosiehBarter 92d365dc3d Add graceful revert option
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2026-04-03 10:35:27 +02:00
KosiehBarter 7795cee9d7 Working, systemd-based
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2026-04-03 10:31:43 +02:00
KosiehBarter f8979f21a1 Semi-functional
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2026-04-03 00:39:51 +02:00
KosiehBarter 70ab6490a1 Semi-final version of home-made orchestrator
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2026-04-02 18:38:28 +02:00
KosiehBarter 784cfae002 Garbage collection
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2026-03-28 20:14:10 +01:00
KosiehBarter 6880248b69 Improve scripting
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2026-03-28 19:36:12 +01:00
KosiehBarter 524675c008 Fix mistakes with cat
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2026-03-27 23:31:38 +01:00
KosiehBarter 0e6bcca637 Add mouse and keyboard
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2026-03-27 23:12:14 +01:00
KosiehBarter 65cf303508 All-around settings for libvirtd
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2026-03-27 23:06:49 +01:00
KosiehBarter 272df10229 Fix issues in AI
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2026-03-22 13:34:13 +01:00
KosiehBarter 055601b055 Merge branch 'archlinux' of ssh://kb.brn.mooo.com:22002/KosiehBarter/linuxhacks into archlinux 2026-03-22 10:38:10 +01:00
KosiehBarter d7e9172c5a Improve building
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2026-03-22 10:36:47 +01:00
KosiehBarter 7c06ceef48 Improve DConf setup
Signed-off-by: Kosieh Barter <kaja.valek@gmail.com>
2026-03-21 16:43:51 +01:00
KosiehBarter fc0be3d1d5 Reimplement automated installer
Signed-off-by: Kosieh Barter <kaja.valek@gmail.com>
2026-03-20 10:17:32 +01:00
KosiehBarter 8821d1f58b Separate critical and non-critical projects
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2026-01-23 14:36:30 +01:00
KosiehBarter c166549423 Migrate vars to general place
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2026-01-23 09:16:58 +01:00
KosiehBarter d60127b7b0 Rework of general_builder
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2026-01-07 10:47:12 +01:00
KosiehBarter bb06128eed Improve handling, separate projects definition
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2025-12-02 09:23:43 +01:00
KosiehBarter ea0d9b693f Mid-version
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2025-11-23 12:37:54 +01:00
KosiehBarter 62dcbed523 Improve AutoInstaller for nVidia compatibility "prime-run"
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2025-11-19 18:23:37 +01:00
KosiehBarter 7faae82ca0 Rework whole build system
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2025-11-19 17:56:34 +01:00
KosiehBarter 7c979625b3 Add general builder for automated deployment
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2025-11-19 15:20:52 +01:00
KosiehBarter 762e05c52e FIX: Evdi change to git version, working
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2025-07-15 22:17:49 +02:00
KosiehBarter c857332374 FIX: Disable prime-run for nVidia
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2025-07-14 20:13:17 +01:00
KosiehBarter 07bde6b9d6 IMPROVE: Separate graphicals, add SWAY
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2025-07-12 10:38:06 +02:00
KosiehBarter e7fac36a22 ADD: nVidia Prime builder (Test)
IMPROVE: AutoInstaller packages, nVidia prime, reorg

Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2025-07-12 10:26:46 +02:00
KosiehBarter 4ddc42078b FIX: replace nvidia binary with nouveau
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2025-07-11 19:49:23 +01:00
KosiehBarter db62796d62 FIX: Enable PolyChromatic for Razer, cleau-up
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2025-07-11 13:18:07 +02:00
KosiehBarter 8cfa63f966 FIX: Semi-final
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2025-07-11 12:58:10 +02:00
KosiehBarter 1e6e4c9e6f IMPROVE: Move non-criticals to disabled to speed-up process
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2025-07-11 11:06:57 +02:00
KosiehBarter 01882a6442 FIX: Various fixes
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2025-07-11 09:51:23 +02:00
KosiehBarter 38bb169324 FIX: CPUFreq build
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2025-07-11 08:54:57 +02:00
KosiehBarter 8535047f47 FIX: Missing codium
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2025-07-11 08:52:46 +02:00
KosiehBarter 1c242373ef FIX: FirewallD, nVidia binary blob instead of linux-firmware
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2025-07-11 08:02:03 +02:00
KosiehBarter 1f3d6cd1f5 ADD: Firewalld
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2025-07-11 07:27:49 +02:00
KosiehBarter 63125dbe94 ADD: mate-extras, QoL packages
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2025-07-11 07:18:00 +02:00
KosiehBarter 2b59caf776 FIX: Bootstrap base fully without X
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2025-07-09 09:41:15 +02:00
KosiehBarter cc5742efb7 ADD: Repo addition
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2025-07-07 12:00:39 +02:00
KosiehBarter c922d5a1db ADD: Tweaks for autoinstall v2
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2025-07-07 10:55:04 +02:00
KosiehBarter 48e2fbff59 FIX: Wrapper
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2025-07-04 18:18:33 +02:00
KosiehBarter 54e52a6eeb RM built binaries for Bambu Studio
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2025-07-04 18:17:50 +02:00
KosiehBarter 681389dfd1 ADD: autoinstaller v2, BambuStudio builder IP route setup
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2025-07-04 17:23:30 +02:00
KosiehBarter b1ece36a00 Add BambuStudio builder
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2025-07-02 11:56:45 +02:00
KosiehBarter dd96ab02f5 FIX: Standardize build script
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2025-03-21 14:22:43 +01:00
KosiehBarter 5993053336 REPLACE: LibreWolf Binary from LibreWolf src
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2025-03-21 14:18:34 +01:00
KosiehBarter 82c33a8a72 FIX: LibreWolf package compiling
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2025-03-20 22:16:44 +01:00
KosiehBarter 5b4cab148d Add SSH key option
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2025-03-08 13:11:19 +01:00
KosiehBarter 986055b82b Fix error in wrapper
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2024-10-26 16:18:07 +02:00
KosiehBarter 719a608263 Tweak build scripting and ignores
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2024-10-26 15:59:12 +02:00
KosiehBarter f94b63662a Add librewolf, improve Archbuilder
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2024-10-08 11:46:32 +02:00
KosiehBarter a088c7b265 Fix wrapper
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2024-10-05 13:28:52 +02:00
KosiehBarter 467b9c7f04 Add ngrok
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2024-10-03 12:38:53 +02:00
KosiehBarter 928ce04531 Add Teams, fix wrapper
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2024-10-03 12:37:59 +02:00
KosiehBarter 4f480d85ba Improvement on printrun
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2024-09-22 09:54:56 +02:00
KosiehBarter 4f93ddd898 Add new, mostly Razer-oriented packages
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2024-09-22 09:54:28 +02:00
KosiehBarter 5aefcce258 Disable orca slicer
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2024-09-08 15:40:05 +02:00
KosiehBarter b0f96d4f38 Add AutoCpuFreq
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2024-09-08 11:12:01 +02:00
KosiehBarter 043e015a35 Working state, building, deployable
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2024-09-08 10:43:16 +02:00
KosiehBarter dc8001a653 Add building wrapper
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2024-09-07 16:56:15 +02:00
KosiehBarter d861c5281e Add compilables, add SCP capability to container
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2024-09-07 16:41:34 +02:00
KosiehBarter 42c0b17a6a Small how-to for running the container
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2024-09-05 11:31:47 +02:00
KosiehBarter 64ecf2498f Add mmore compilables
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2024-09-05 10:08:16 +02:00
KosiehBarter 9ba49294c2 Building tools for AUR-based packages
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2024-09-04 12:27:11 +02:00
KosiehBarter 26c422d16b Service enables
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2024-08-29 11:54:00 +02:00
KosiehBarter 0f8fced68a Fix CPU detection
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2024-08-29 10:38:32 +02:00
KosiehBarter b2e1438a2a Improve GRUB
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2024-08-29 09:57:46 +02:00
KosiehBarter 83b4d579b9 Pacman refresh and package
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2024-08-29 09:46:46 +02:00
KosiehBarter 3716fdc6bd Fix, add Intel GPU support
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2024-08-28 00:18:23 +02:00
KosiehBarter 53fae6aa5b Fix bug
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2024-08-26 17:09:21 +02:00
KosiehBarter bfd0933543 Improve handling
Signed-off-by: KosiehBarter <kaja.valek@gmail.com>
2024-08-26 16:25:05 +02:00
KosiehBarter 3dc2b3b9ac Re-implement from scratch
Signed-off-by: Kosieh Barter <kaja.valek@gmail.com>
2024-08-17 01:13:52 +02:00
KosiehBarter 4262bf7eef Custom shell coloring
Signed-off-by: Kosieh Barter <kaja.valek@gmail.com>
2024-07-22 21:12:52 +02:00
KosiehBarter 6dd1c7fde5 Add option for HTTP-based netbooting ISO
Signed-off-by: Kosieh Barter <kaja.valek@gmail.com>
2024-07-20 18:30:27 +02:00
KosiehBarter 63012661cc Implement a from-start-to-finish Arch installer
Signed-off-by: Kosieh Barter <kaja.valek@gmail.com>
2024-07-20 18:13:35 +02:00
KosiehBarter 351d52a368 Update for readme
Signed-off-by: Kosieh Barter <kaja.valek@gmail.com>
2024-07-18 22:13:20 +02:00
KosiehBarter eb32c1e9d6 Initial
Signed-off-by: Kosieh Barter <kaja.valek@gmail.com>
2022-03-13 20:49:19 +01:00
16 changed files with 1075 additions and 13 deletions
+38
View File
@@ -0,0 +1,38 @@
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
@@ -0,0 +1,27 @@
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
@@ -0,0 +1,58 @@
# 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
@@ -0,0 +1,265 @@
#!/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
@@ -0,0 +1,207 @@
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
@@ -0,0 +1,200 @@
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
@@ -1,3 +0,0 @@
#!/bin/bash
apt update && apt install git unzip tar bz2 -y
-10
View File
@@ -1,10 +0,0 @@
#!/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
@@ -0,0 +1,14 @@
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
@@ -0,0 +1,27 @@
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
@@ -0,0 +1,145 @@
# 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
@@ -0,0 +1,66 @@
# 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
@@ -0,0 +1,8 @@
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
@@ -0,0 +1,7 @@
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
@@ -0,0 +1,2 @@
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
@@ -0,0 +1,11 @@
#!/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."