🚧 move scripts back to archiso

This commit is contained in:
Vladislav Nepogodin committed 2022-03-29 14:51:07 +04:00
1 parent df3c83e811
commit 29eb30e392
12 files changed
+263 -15

No files matched your search

+1 -1
View File
@@ -49,7 +49,7 @@ FILES=()
#
## NOTE: If you have /usr on a separate partition, you MUST include the
# usr, fsck and shutdown hooks.
HOOKS=(base udev modconf memdisk archiso_shutdown archiso archiso_loop_mnt archiso_pxe_common archiso_pxe_nbd archiso_pxe_http archiso_pxe_nfs archiso_kms block filesystems keyboard)
HOOKS=(base udev modconf memdisk archiso archiso_loop_mnt archiso_pxe_common archiso_pxe_nbd archiso_pxe_http archiso_pxe_nfs archiso_kms block filesystems keyboard)
# COMPRESSION
# Use this to compress the initramfs image. By default, gzip compression
-6
View File
@@ -70,15 +70,9 @@ LocalFileSigLevel = Optional
#
# cachyos repos
#<disabled_v3>[cachyos-desktop-v3]
#<disabled_v3>Include = /etc/pacman.d/cachyos-v3-mirrorlist
#<disabled_v3>[cachyos-v3]
#<disabled_v3>Include = /etc/pacman.d/cachyos-v3-mirrorlist
[cachyos-desktop]
Include = /etc/pacman.d/cachyos-mirrorlist
[cachyos]
Include = /etc/pacman.d/cachyos-mirrorlist
@@ -1,4 +1,7 @@
[Match]
# Matching with "Type=ether" causes issues with containers because it also matches virtual Ethernet interfaces (veth*).
# See https://bugs.archlinux.org/task/70892
# Instead match by globbing the network interface name.
Name=en*
Name=eth*
@@ -0,0 +1 @@
/dev/null
@@ -1,3 +1,3 @@
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin liveuser --noclear %I 38400 linux
ExecStart=-/sbin/agetty -o '-p -f -- \\u' --noclear --autologin liveuser - $TERM
+1 -1
View File
@@ -16,7 +16,7 @@ automated_script ()
script="$(script_cmdline)"
if [[ -n "${script}" && ! -x /tmp/startup_script ]]; then
if [[ "${script}" =~ ^((http|https|ftp)://) ]]; then
curl "${script}" --location --retry-connrefused -s -o /tmp/startup_script >/dev/null
curl "${script}" --location --retry-connrefused --retry 10 -s -o /tmp/startup_script >/dev/null
rt=$?
else
cp "${script}" /tmp/startup_script
+37
View File
@@ -0,0 +1,37 @@
#!/bin/bash
#set -e
###############################################################################
# Author : Erik Dubois
# Website : https://www.erikdubois.be
# Website : https://www.arcolinux.info
# Website : https://www.arcolinux.com
# Website : https://www.arcolinuxd.com
# Website : https://www.arcolinuxb.com
# Website : https://www.arcolinuxiso.com
# Website : https://www.arcolinuxforum.com
###############################################################################
#
# DO NOT JUST RUN THIS. EXAMINE AND JUDGE. RUN AT YOUR OWN RISK.
#
###############################################################################
package=ly
if pacman -Qs $package > /dev/null ; then
ln -sf /usr/lib/systemd/system/ly.service /etc/systemd/system/display-manager.service
fi
package=sddm
if pacman -Qs $package > /dev/null ; then
ln -sf /usr/lib/systemd/system/sddm.service /etc/systemd/system/display-manager.service
fi
package=gdm
if pacman -Qs $package > /dev/null ; then
ln -sf /usr/lib/systemd/system/gdm.service /etc/systemd/system/display-manager.service
fi
package=lxdm
if pacman -Qs $package > /dev/null ; then
ln -sf /usr/lib/systemd/system/lxdm.service /etc/systemd/system/display-manager.service
fi
package=lightdm
if pacman -Qs $package > /dev/null ; then
ln -sf /usr/lib/systemd/system/lightdm.service /etc/systemd/system/display-manager.service
fi
+123
View File
@@ -0,0 +1,123 @@
#!/bin/bash
# grabed from https://github.com/xerolinux/xerolinux_iso
#
# driver=free or driver=nonfree - grub and efi
echo "Start cachyos-remove-nvidia"
kernel_cmdline(){
for param in $(cat /proc/cmdline); do
case "${param}" in
$1=*) echo "${param##*=}"; return 0 ;;
$1) return 0 ;;
*) continue ;;
esac
done
[ -n "${2}" ] && echo "${2}"
return 1
}
get_driver(){
echo $(kernel_cmdline driver)
}
get_virtmach(){
echo $(kernel_cmdline virtmach)
}
while [ -e "/var/lib/pacman/db.lck" ];
do
echo 'Pacman is not ready yet. Will try again in 10 seconds.'
seconds=$(($seconds + 10))
sleep 10
if [[ "$seconds" == "30" ]]; then
echo 'Warning: removing pacman db.lck!'
rm /var/lib/pacman/db.lck
fi
done
# free = remove nvidia keep nouveau
selection=$(get_driver)
echo "#################################"
echo "Selection was "$selection
echo "#################################"
if [[ $selection == "free" ]]; then
pacman -R --noconfirm nvidia-dkms nvidia-utils
fi
#freenonouveau = remove nvidia and nouveau
selection=$(get_driver)
echo "#################################"
echo "Selection was "$selection
echo "#################################"
if [[ $selection == "freenonouveau" ]]; then
pacman -R --noconfirm nvidia-dkms nvidia-utils
pacman -R --noconfirm xf86-video-nouveau
fi
#nonfree = keepin nvidia and nouveau
selection=$(get_driver)
echo "Selection was "$selection
if [[ $selection == "nonfree" ]]; then
echo "#################################"
echo "We keep nvidia and nouveau onboard"
echo "#################################"
fi
# nonfreenonouveau : keep nvidia and remove nouveau
selection=$(get_driver)
echo "#################################"
echo "Selection was "$selection
echo "#################################"
if [[ $selection == "nonfreenonouveau" ]]; then
pacman -R --noconfirm xf86-video-nouveau
fi
# remove virtual machines
selection=$(get_virtmach)
echo "#################################"
echo "Selection was "$selection
echo "#################################"
if [[ $selection == "none" ]]; then
#remove virtualbox
if pacman -Qi virtualbox-guest-utils &> /dev/null; then
systemctl disable vboxservice.service
pacman -Rns virtualbox-guest-utils --noconfirm
echo "Removed virtualbox-guest-utils"
fi
if pacman -Qi virtualbox-guest-utils-nox &> /dev/null; then
systemctl disable vboxservice.service
pacman -Rns virtualbox-guest-utils-nox --noconfirm
echo "Removed virtualbox-guest-utils-nox"
fi
#remove vmware
if [ -f /etc/xdg/autostart/vmware-user.desktop ]; then
rm /etc/xdg/autostart/vmware-user.desktop
echo "Removed vmware-user.desktop"
fi
if pacman -Qi open-vm-tools &> /dev/null; then
systemctl disable vmtoolsd.service
echo "Disabled vmtoolsd.service"
pacman -Rns open-vm-tools --noconfirm
echo "Removed open-vm-tools"
fi
if [ -f /etc/systemd/system/multi-user.target.wants/vmtoolsd.service ]; then
rm /etc/systemd/system/multi-user.target.wants/vmtoolsd.service
echo "Removed vmtoolsd.service if still exists"
fi
#remove qemu
if pacman -Qi qemu-guest-agent &> /dev/null; then
systemctl disable qemu-guest-agent.service
pacman -Rns qemu-guest-agent --noconfirm
echo "Removed qemu-guest-agent"
fi
fi
echo "#################################"
echo "End cachyos-remove-nvidia"
echo "#################################"
+75
View File
@@ -0,0 +1,75 @@
#!/bin/bash
#set -e
###############################################################################
# Author : Erik Dubois
# Website : https://www.erikdubois.be
# Website : https://www.arcolinux.info
# Website : https://www.arcolinux.com
# Website : https://www.arcolinuxd.com
# Website : https://www.arcolinuxb.com
# Website : https://www.arcolinuxiso.com
# Website : https://www.arcolinuxforum.com
###############################################################################
#
# DO NOT JUST RUN THIS. EXAMINE AND JUDGE. RUN AT YOUR OWN RISK.
#
###############################################################################
_clean_packages(){
local _packages_to_remove=(
gparted
grsync
cachyos-calamares
cachyos-calamares-config
edk2-shell
boost-libs
doxygen
expect
gpart
tcpdump
arch-install-scripts
squashfs-tools
extra-cmake-modules
cmake
elinks
yaml-cpp
syslinux
clonezilla
memtest86+
mkinitcpio-archiso
)
local xx
# @ does one by one to avoid errors in the entire process
# * can be used to treat all packages in one command
for xx in ${_packages_to_remove[@]}; do pacman -Rsc $xx --noconfirm; done
}
_try_v3(){
/lib/ld-linux-x86-64.so.2 --help | grep "x86-64-v3 (supported, searched)" > /dev/null
local pacman_conf="/etc/pacman.conf"
local pacman_conf_cachyos="/etc/pacman-more.conf"
local pacman_conf_path_backup="/etc/pacman.conf.bak"
if [ $? -eq 0 ]; then
echo "x86-64-v3 is supported"
sed -i 's/Architecture = auto/#Architecture = auto/' $pacman_conf_cachyos
sed -i 's/#<disabled_v3>//g' $pacman_conf_cachyos
echo "backup old config"
mv $pacman_conf $pacman_conf_path_backup
echo "CachyOS -v3 Repo changed"
mv $pacman_conf_cachyos $pacman_conf
else
echo "x86-64-v3 is not supported"
fi
}
_clean_packages
_try_v3
+14
View File
@@ -0,0 +1,14 @@
#!/bin/bash
_clean_packages(){
local _leave_these_packages="base\nbase-devel\ncachyos-keyring\ncachyos-mirrorlist\ncachyos-v3-mirrorlist\ncachyos-hello\ngrub\nefibootmgr\n"
local _packages_to_remove=($(comm -23 <(pacman -Qqt | sort) <({ pacman -Qqg base-devel; printf $_leave_these_packages; } | sort -u)))
local xx
# @ does one by one to avoid errors in the entire process
# * can be used to treat all packages in one command
for xx in ${_packages_to_remove[@]}; do pacman -Rsc $xx --noconfirm; done
rm /etc/sddm.conf || true
}
_clean_packages