1
0

Merge remote-tracking branch 'ftesosd/main'

This commit is contained in:
dtb 2023-09-11 22:46:59 -04:00
commit baeaa6d897
2 changed files with 260 additions and 0 deletions

3
ftesosd/LICENSE Normal file
View File

@ -0,0 +1,3 @@
Derived from
https://gist.github.com/artixnous/41f4bde311442aba6a4f5523db921415
without license.

257
ftesosd/eyesockets.sh Executable file
View File

@ -0,0 +1,257 @@
#!/bin/sh
# nous,2019-2020
# trinity,2021
# fork from the original FUCKTHESKULLOFSYSTEMD on GitHub Gists:
# https://gist.github.com/artixnous/41f4bde311442aba6a4f5523db921415
# Test Arch ISO installation:
# cfdisk /dev/sda
# mkfs.ext4 /dev/sda1
# mount /dev/sda1 /mnt
# pacstrap /mnt base linux linux-firmware openssh wget rsync dhcpcd grub
# arch-chroot /mnt
# grub-install /dev/sda
# mkinitcpio -P
# grub-mkconfig -o /boot/grub/grub.cfg
# the package name MUST be the same as the editor itself
# e.g. vim, ed, nano, ne, vis
# nous' default was nano, most people know how to use that one so that's what's
# being used here
DEFAULT_EDITOR="nano"
if [ -z "$VISUAL" ] && [ -n "$EDITOR" ]; then
VISUAL="$EDITOR"
elif [ -z "$VISUAL" ] && [ -z "$EDITOR" ]; then
VISUAL="$DEFAULT_EDITOR"
fi
. /usr/share/makepkg/util/message.sh
colorize
printf "$BOLD\
You should run this from inside screen(1) or tmux(1), especially if this is a
remote box. Use a terminal/session with a large scrollback buffer.
"
read -n 1 -p "$RED Last chance to press CTRL-C, ENTER to continue. "
printf "$CYAN\
Starting operation $RED\ FUCKTHESKULLOFSYSTEMD
"
error
error() {
printf "$RED\
An error occured, aborting to prevent incomplete conversion. Fix it and re-run
the script FROM THE LAST STEP ONWARDS.
"
exit 1
}
[ "$1" = "openrc" ] && target="openrc"
[ "$1" = "runit" ] && target="runit"
# runit not yet implemented
#[[ $target ]] || { echo "Usage: $0 <openrc|runit>" ; exit 1; }
#echo "Target: $target"
rm -f /var/lib/pacman/db.lck
sed -i s/Arch/Artix/g /etc/default/grub
# A full systemd update is needed, because libsystemd->systemd-libs
printf "$GREEN\
Updating Arch system first, if this fails abort and update manually;
then re-run the script \
$ALL_OFF"
pacman -Syu --noconfirm \
|| error
pacman -S --needed --noconfirm wget "$VISUAL" rsync \
|| error
cd /etc
printf "$GREEN\
Replacing Arch repositories with Artix\
$ALL_OFF"
mv -vf pacman.conf pacman.conf.arch
wget https://gitea.artixlinux.org/packagesP/pacman/raw/branch/master/trunk/pacman.conf -O /etc/pacman.conf \
|| error
mv -vf pacman.d/mirrorlist pacman.d/mirrorlist-arch
wget https://gitea.artixlinux.org/packagesA/artix-mirrorlist/raw/branch/master/trunk/mirrorlist -O pacman.d/mirrorlist \
|| error
cp -vf pacman.d/mirrorlist pacman.d/mirrorlist.artix
sed -i 's/Required DatabaseOptional/Never/' pacman.conf
printf "$GREEN\
Refreshing package databases\
$ALL_OFF"
pacman -Syy --noconfirm \
|| error
printf "\n"
read -n 1 -p "$GREEN Press ENTER and answer <yes> to the next question to make sure all packages come from Artix repos $ALL_OFF "
echo
pacman -Scc
echo "$GREEN Importing Artix keys $ALL_OFF"
pacman -S --noconfirm artix-keyring \
|| error
pacman-key --populate artix \
|| error
pacman-key --lsign-key 95AEC5D0C1E294FC9F82B253573A673A53C01BC2 \
|| error
systemctl list-units --state=running | grep -v systemd | awk '{print $1}' | grep service > /root/daemon.list
printf "$MAGENTA\
Your systemd running units are saved in /root/daemon.list.\n
$ALL_OFF"
read -n 1 -p "$RED\
Do not proceed if you've seen errors above.
Press CTRL-C to abort or ENTER to continue
$ALL_OFF"
printf "$GREEN
Downloading systemd-free packages from Artix
$ALL_OFF"
pacman -Sw --noconfirm \
base \
base-devel \
openrc-system \
grub linux-lts \
linux-lts-headers \
elogind-openrc \
openrc \
netifrc \
grub mkinitcpio \
archlinux-mirrorlist \
net-tools \
rsync \
"$VISUAL" \
lsb-release \
esysusers \
etmpfiles \
|| error
printf "$YELLOW\
This is the best part: removing systemd
$ALL_OFF"
pacman -Rdd --noconfirm \
systemd \
systemd-libs \
systemd-sysvcompat \
pacman-mirrorlist \
dbus \
|| error
# Previous pacman-mirrorlist removal also deleted this, restoring
cp -vf pacman.d/mirrorlist.artix pacman.d/mirrorlist
echo "$GREEN Installing clean Artix packages $ALL_OFF"
pacman -Qqn | pacman -S --noconfirm --overwrite '*' - \
|| error
echo "$GREEN Installing Artix system packages $ALL_OFF"
pacman -S --noconfirm --needed --overwrite '*' \
base \
base-devel \
openrc-system \
linux-lts \
linux-lts-headers \
elogind-openrc \
openrc \
netifrc \
grub \
mkinitcpio \
archlinux-mirrorlist \
net-tools \
rsync \
"$DEFAULT_EDITOR" \
lsb-release \
connman \
esysusers \
etmpfiles \
artix-branding-base \
|| error
echo "$GREEN Installing service files $ALL_OFF"
pacman -S --noconfirm --needed \
at-openrc \
xinetd-openrc \
cronie-openrc \
haveged-openrc \
hdparm-openrc \
openssh-openrc \
syslog-ng-openrc \
connman-openrc \
|| error
echo "$YELLOW Removing left-over cruft $ALL_OFF"
rm -fv /etc/resolv.conf
echo "$GREEN Enabling basic services $ALL_OFF"
rc-update add haveged sysinit
rc-update add udev sysinit
rc-update add sshd default
echo
echo "$BOLD Activating standard network interface naming (i.e. enp72^7s128%397 --> eth0)."
echo "$BOLD If you prefer the persistent naming, remove the last line from /etc/default/grub"
echo "$BOLD and run $ALL_OFF grub-mkconfig -o /boot/grub/grub.cfg $BOLD when this script prompts for reboot."
echo
read -n 1 -p "Press ENTER $ALL_OFF"
echo 'GRUB_CMDLINE_LINUX="net.ifnames=0"' >>/etc/default/grub
pacman -S --needed --noconfirm netifrc
printf "\
============================= $BOLD
Write down your IP and route. $ALL_OFF
=============================
"
ifconfig
route
printf " \
=============================================================== $BOLD
Press ENTER to edit conf.d/net to configure static networking.
No editing is needed if you use dhcp or a network manager, but
you MUST enable the daemon manually BEFORE rebooting.
You will be given the option at the end of this procedure.
Default setting is DHCP for eth0, should be enough for most. $ALL_OFF
===============================================================
"
read -n 1 -p " "
"$VISUAL" /etc/conf.d/net
ln -sf /etc/init.d/net.lo /etc/init.d/net.eth0
rc-update add net.eth0 default \
|| error
# Good riddance
echo "$YELLOW Removing more systemd cruft $ALL_OFF"
for user in journal journal-gateway timesync network bus-proxy journal-remote journal-upload resolve coredump;
do userdel systemd-$user
done
rm -vfr /{etc,var/lib}/systemd
echo "$GREEN Restoring pacman.conf security settings $ALL_OFF"
sed -i 's/= Never/= Required DatabaseOptional/' /etc/pacman.conf
echo "$GREEN Making OpenRC start faster $ALL_OFF"
sed -i 's/#rc_parallel="NO"/rc_parallel="YES"/' /etc/rc.conf
echo "$GREEN Replacing Arch with Artix in hostname and issue $ALL_OFF"
sed -i 's/Arch/Artix/ig' /etc/hostname /etc/issue 2>/dev/null
echo "$GREEN Recreating initrds $ALL_OFF"
mkinitcpio -P
echo "$GREEN Recreating grub.cfg $ALL_OFF"
cp -vf /boot/grub/grub.cfg /boot/grub/grub.cfg.arch
grub-mkconfig -o /boot/grub/grub.cfg \
|| error
echo "============================================="
echo "= If you haven't seen any errors ="
echo "= press ENTER to reboot ="
echo "= Otherwise switch console and fix them ="
echo "= ="
echo "= ="
echo "= Press CTRL-C to stop reboot ="
echo "=(mandatory if you need a networking daemon)="
echo "=Or switch console/terminal and type as root="
echo "= $BOLD rc-service add connmand $ALL_OFF ="
echo "= then switch back here and continue ="
echo "============================================="
read -n 1 -p " "
sync
mount -f / -o remount,ro
echo s >| /proc/sysrq-trigger
echo u >| /proc/sysrq-trigger
echo b >| /proc/sysrq-trigger