mirror of
https://github.com/Snigdha-OS/snigdhaos-system-config.git
synced 2025-09-20 11:34:58 +02:00
@eshanized: push via push.sh 🎉 !!!
This commit is contained in:
59
usr/local/bin/snigdhaos-fix-grub
Normal file
59
usr/local/bin/snigdhaos-fix-grub
Normal file
@@ -0,0 +1,59 @@
|
||||
#!/bin/bash
|
||||
#set -e
|
||||
|
||||
echo
|
||||
echo "Reinstalling Grub..."
|
||||
echo
|
||||
|
||||
Online=0
|
||||
file_boolean=0
|
||||
|
||||
function check_connectivity() {
|
||||
local test_ip
|
||||
local test_count
|
||||
|
||||
test_ip="172.217.12.110"
|
||||
test_count=1
|
||||
|
||||
if ping -c ${test_count} ${test_ip} > /dev/null; then
|
||||
echo "System Online."
|
||||
Online=1
|
||||
else
|
||||
echo "System Offline!"
|
||||
Online=0
|
||||
fi
|
||||
}
|
||||
|
||||
function check_file() {
|
||||
file="/usr/local/share/snigdhaos/grub/grub"
|
||||
if [[ -f $file ]];then
|
||||
echo $file " exists"
|
||||
file_boolean=1
|
||||
else
|
||||
echo $file " doesn't exist"
|
||||
file_boolean=0
|
||||
fi
|
||||
}
|
||||
|
||||
check_connectivity
|
||||
check_file
|
||||
|
||||
if [ $Online -eq 1 ] ; then
|
||||
echo "Downloading Default Grub..."
|
||||
sudo wget https://raw.githubusercontent.com/Snigdha-OS/snigdhaos-updater/master/grub -O $workdir/etc/default/grub
|
||||
fi
|
||||
|
||||
if [ $Online -eq 0 ] && [ $file_boolean -eq 1 ] ; then
|
||||
sudo cp /usr/local/share/snigdhaos/grub/grub /etc/default/grub
|
||||
echo "Copied Grub Locally!"
|
||||
fi
|
||||
|
||||
if [ $Online -eq 0 ] && [ $file_boolean -eq 0 ] ; then
|
||||
echo "Run this script once you are back online"
|
||||
fi
|
||||
|
||||
sudo grub-mkconfig -o /boot/grub/grub.cfg
|
||||
|
||||
echo
|
||||
echo "Task Completed!"
|
||||
echo
|
57
usr/local/bin/snigdhaos-fix-pacman-conf
Normal file
57
usr/local/bin/snigdhaos-fix-pacman-conf
Normal file
@@ -0,0 +1,57 @@
|
||||
#!/bin/bash
|
||||
#set -e
|
||||
|
||||
echo
|
||||
echo "Downloading Latest pacman.conf..."
|
||||
echo
|
||||
|
||||
Online=0
|
||||
file_boolean=0
|
||||
|
||||
function check_connectivity() {
|
||||
local test_ip
|
||||
local test_count
|
||||
|
||||
test_ip="172.217.12.110"
|
||||
test_count=1
|
||||
|
||||
if ping -c ${test_count} ${test_ip} > /dev/null; then
|
||||
echo "System Online!"
|
||||
Online=1
|
||||
else
|
||||
echo "System Offline!"
|
||||
Online=0
|
||||
fi
|
||||
}
|
||||
|
||||
function check_file() {
|
||||
file="/usr/local/share/snigdhaos/pacman.conf"
|
||||
if [[ -f $file ]];then
|
||||
echo $file " Found."
|
||||
file_boolean=1
|
||||
else
|
||||
echo $file " Not Found!"
|
||||
file_boolean=0
|
||||
fi
|
||||
}
|
||||
|
||||
check_connectivity
|
||||
check_file
|
||||
|
||||
if [ $Online -eq 1 ] ; then
|
||||
echo "Downloading pacman.conf..."
|
||||
sudo wget https://raw.githubusercontent.com/Snigdha-OS/snigdhaos-updater/master/pacman.conf -O $workdir/etc/pacman.conf
|
||||
fi
|
||||
|
||||
if [ $Online -eq 0 ] && [ $file_boolean -eq 1 ] ; then
|
||||
sudo cp /usr/local/share/snigdhaos/pacman.conf /etc/pacman.conf
|
||||
echo "Copied pacman.conf..."
|
||||
fi
|
||||
|
||||
if [ $Online -eq 0 ] && [ $file_boolean -eq 0 ] ; then
|
||||
echo "Run this script once you are back online!"
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "Task Completed!"
|
||||
echo
|
73
usr/local/bin/snigdhaos-fix-pacman-databases-and-keys
Normal file
73
usr/local/bin/snigdhaos-fix-pacman-databases-and-keys
Normal file
@@ -0,0 +1,73 @@
|
||||
#!/bin/bash
|
||||
#set -e
|
||||
|
||||
Online=0
|
||||
function check_connectivity() {
|
||||
local test_ip
|
||||
local test_count
|
||||
|
||||
test_ip="172.217.12.110"
|
||||
test_count=1
|
||||
|
||||
if ping -c ${test_count} ${test_ip} > /dev/null; then
|
||||
echo
|
||||
echo "System Online!"
|
||||
echo
|
||||
Online=1
|
||||
else
|
||||
echo
|
||||
echo "System Offline! Unable To Download snigdhaos-keyring!"
|
||||
echo
|
||||
Online=0
|
||||
fi
|
||||
}
|
||||
|
||||
check_connectivity
|
||||
|
||||
if [ $Online -eq 1 ] ; then
|
||||
echo
|
||||
echo "Installing snigdhaos-keyring..."
|
||||
echo
|
||||
sudo pacman -Sy snigdhaos-keyring --noconfirm
|
||||
echo
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "Removing prevoius pacman databases at /var/lib/pacman/sync/*"
|
||||
echo
|
||||
sudo rm /var/lib/pacman/sync/*
|
||||
echo
|
||||
|
||||
echo
|
||||
echo "Removing prevoius /etc/pacman.d/gnupg folder"
|
||||
echo
|
||||
sudo rm -rf /etc/pacman.d/gnupg/*
|
||||
echo
|
||||
|
||||
echo
|
||||
echo "Initializing pacman keys..."
|
||||
echo
|
||||
sudo pacman-key --init
|
||||
echo
|
||||
|
||||
echo
|
||||
echo "Populating keyring..."
|
||||
echo
|
||||
sudo pacman-key --populate
|
||||
echo
|
||||
|
||||
echo
|
||||
echo "Adding Ubuntu keyserver..."
|
||||
echo
|
||||
echo "
|
||||
keyserver hkp://keyserver.ubuntu.com:80" | sudo tee --append /etc/pacman.d/gnupg/gpg.conf
|
||||
|
||||
echo
|
||||
echo "Synchronizing Database..."
|
||||
echo
|
||||
sudo pacman -Sy
|
||||
echo
|
||||
|
||||
echo
|
||||
echo "Task Completed!"
|
||||
echo
|
30
usr/local/bin/snigdhaos-fix-pacman-gpg-conf
Normal file
30
usr/local/bin/snigdhaos-fix-pacman-gpg-conf
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
#set -e
|
||||
|
||||
echo
|
||||
echo "Copying /etc/pacman.d/gnupg/gpg.conf"
|
||||
echo
|
||||
|
||||
file_boolean=0
|
||||
function check_file() {
|
||||
|
||||
file="/usr/local/share/snigdhaos/gpg.conf"
|
||||
if [[ -f $file ]];then
|
||||
echo $file " exists"
|
||||
file_boolean=1
|
||||
else
|
||||
echo $file " doesn't exist"
|
||||
file_boolean=0
|
||||
fi
|
||||
}
|
||||
|
||||
check_file
|
||||
|
||||
if [ $file_boolean -eq 1 ] ; then
|
||||
sudo cp /usr/local/share/snigdhaos/gpg.conf /etc/pacman.d/gnupg/gpg.conf
|
||||
echo "/etc/pacman.d/gnupg/gpg.conf copied from local system"
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "Task Completed!"
|
||||
echo
|
6
usr/local/bin/snigdhaos-get-mirrors
Normal file
6
usr/local/bin/snigdhaos-get-mirrors
Normal file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
#set -e
|
||||
|
||||
sudo /usr/bin/reflector --score 100 --fastest 10 --number 10 --verbose --save /etc/pacman.d/mirrorlist
|
||||
|
||||
echo "Task Completed!"
|
10
usr/local/bin/snigdhaos-systemd-test
Normal file
10
usr/local/bin/snigdhaos-systemd-test
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
#set -e
|
||||
|
||||
boot=$(bootctl status | grep Product | awk '{printf($2)}')
|
||||
echo "The system is using $boot to boot."
|
||||
|
||||
if [ $boot = "GRUB" ]; then
|
||||
/usr/bin/grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=snigdhaos --disable-shim-lock --removable
|
||||
fi
|
30
usr/local/bin/snigdhaos-toboot
Normal file
30
usr/local/bin/snigdhaos-toboot
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
#set -e
|
||||
|
||||
if lsblk | grep -q "/boot/efi" ; then
|
||||
echo
|
||||
echo "Reinstalling systemd-boot..."
|
||||
echo
|
||||
|
||||
sudo pacman -S --noconfirm kernel-install-mkinitcpio
|
||||
sudo bootctl install
|
||||
sudo reinstall-kernels
|
||||
|
||||
if [[ -f /boot/efi/loader/loader.conf ]];then
|
||||
sudo sed -i "s/#timeout 3/timeout 3/g" /boot/efi/loader/loader.conf
|
||||
fi
|
||||
|
||||
if [[ -f /boot/efi/loader/loader.conf ]];then
|
||||
sudo sed -i "s/#console-mode keep/console-mode keep/g" /boot/efi/loader/loader.conf
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "Task Completed!"
|
||||
echo
|
||||
|
||||
else
|
||||
echo
|
||||
echo "Task Falied!"
|
||||
echo "More on: https://wiki.archlinux.org/title/Arch_boot_process"
|
||||
echo
|
||||
fi
|
67
usr/local/bin/snigdhaos-togrub
Normal file
67
usr/local/bin/snigdhaos-togrub
Normal file
@@ -0,0 +1,67 @@
|
||||
#!/bin/bash
|
||||
#set -e
|
||||
|
||||
echo
|
||||
echo "Reinstalling Grub..."
|
||||
echo
|
||||
|
||||
Online=0
|
||||
file_boolean=0
|
||||
|
||||
function check_connectivity() {
|
||||
local test_ip
|
||||
local test_count
|
||||
|
||||
test_ip="172.217.12.110"
|
||||
test_count=1
|
||||
|
||||
if ping -c ${test_count} ${test_ip} > /dev/null; then
|
||||
echo "System Online!"
|
||||
Online=1
|
||||
else
|
||||
echo "System Offline!"
|
||||
Online=0
|
||||
fi
|
||||
}
|
||||
|
||||
function check_file() {
|
||||
file="/usr/local/share/snigdhaos/grub/grub"
|
||||
if [[ -f $file ]];then
|
||||
echo $file " Found."
|
||||
file_boolean=1
|
||||
else
|
||||
echo $file " Not Found!"
|
||||
file_boolean=0
|
||||
fi
|
||||
}
|
||||
|
||||
check_connectivity
|
||||
check_file
|
||||
|
||||
if [ $Online -eq 1 ] ; then
|
||||
echo "getting latest /etc/default/grub from github"
|
||||
sudo wget https://raw.githubusercontent.com/Snigdha-OS/snigdhaos-updater/master/grub -O $workdir/etc/default/grub
|
||||
fi
|
||||
|
||||
if [ $Online -eq 0 ] && [ $file_boolean -eq 1 ] ; then
|
||||
sudo cp /usr/local/share/snigdhaos/grub/grub /etc/default/grub
|
||||
echo "Copied Grub From System!"
|
||||
fi
|
||||
|
||||
if [ $Online -eq 0 ] && [ $file_boolean -eq 0 ] ; then
|
||||
echo "Run this script once you are back online"
|
||||
fi
|
||||
|
||||
sudo pacman -R --noconfirm kernel-install-mkinitcpio
|
||||
|
||||
echo
|
||||
echo "Updating your /boot/grub/grub.cfg to apply the grub default file..."
|
||||
echo
|
||||
|
||||
sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=snigdhaos
|
||||
|
||||
sudo grub-mkconfig -o /boot/grub/grub.cfg
|
||||
|
||||
echo
|
||||
echo "Make sure you installed snigdhaos-grub-theme"
|
||||
echo
|
16
usr/local/share/snigdhaos/gpg.conf
Normal file
16
usr/local/share/snigdhaos/gpg.conf
Normal file
@@ -0,0 +1,16 @@
|
||||
no-greeting
|
||||
no-permission-warning
|
||||
lock-never
|
||||
keyserver-options timeout=10
|
||||
keyserver-options import-clean
|
||||
keyserver-options no-self-sigs-only
|
||||
|
||||
#keyserver hkp://keys.openpgp.org
|
||||
#keyserver hkp://keys.openpgp.org:80
|
||||
#keyserver hkps://keys.openpgp.org
|
||||
#keyserver hkps://keys.openpgp.org:443
|
||||
#keyserver hkps://keyserver.ubuntu.com:443
|
||||
keyserver hkp://keyserver.ubuntu.com:80
|
||||
#keyserver hkp://pool.sks-keyservers.net:80
|
||||
#keyserver hkps://hkps.pool.sks-keyservers.net:443
|
||||
#keyserver hkp://ipv4.pool.sks-keyservers.net:11371
|
64
usr/local/share/snigdhaos/grub/grub
Normal file
64
usr/local/share/snigdhaos/grub/grub
Normal file
@@ -0,0 +1,64 @@
|
||||
# GRUB boot loader configuration
|
||||
|
||||
GRUB_DEFAULT=0
|
||||
GRUB_TIMEOUT=5
|
||||
GRUB_DISTRIBUTOR="SnigdhaOS"
|
||||
GRUB_CMDLINE_LINUX_DEFAULT="quiet loglevel=3 audit=0 nvme_load=yes"
|
||||
GRUB_CMDLINE_LINUX=""
|
||||
|
||||
# Preload both GPT and MBR modules so that they are not missed
|
||||
GRUB_PRELOAD_MODULES="part_gpt part_msdos"
|
||||
|
||||
# Uncomment to enable booting from LUKS encrypted devices
|
||||
#GRUB_ENABLE_CRYPTODISK=y
|
||||
|
||||
# Set to 'countdown' or 'hidden' to change timeout behavior,
|
||||
# press ESC key to display menu.
|
||||
GRUB_TIMEOUT_STYLE=menu
|
||||
|
||||
# Uncomment to use basic console
|
||||
GRUB_TERMINAL_INPUT=console
|
||||
|
||||
# Uncomment to disable graphical terminal
|
||||
#GRUB_TERMINAL_OUTPUT=console
|
||||
|
||||
# The resolution used on graphical terminal
|
||||
# note that you can use only modes which your graphic card supports via VBE
|
||||
# you can see them in real GRUB with the command `videoinfo'
|
||||
GRUB_GFXMODE=auto
|
||||
|
||||
# Uncomment to allow the kernel use the same resolution used by grub
|
||||
GRUB_GFXPAYLOAD_LINUX=keep
|
||||
|
||||
# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
|
||||
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
|
||||
#GRUB_DISABLE_LINUX_UUID=true
|
||||
|
||||
# Uncomment to disable generation of recovery mode menu entries
|
||||
GRUB_DISABLE_RECOVERY=true
|
||||
|
||||
# Uncomment and set to the desired menu colors. Used by normal and wallpaper
|
||||
# modes only. Entries specified as foreground/background.
|
||||
#GRUB_COLOR_NORMAL="light-blue/black"
|
||||
#GRUB_COLOR_HIGHLIGHT="light-cyan/blue"
|
||||
|
||||
# Uncomment one of them for the gfx desired, a image background or a gfxtheme
|
||||
#GRUB_BACKGROUND="/path/to/wallpaper"
|
||||
GRUB_THEME="/boot/grub/themes/snigdhaos-live/theme.txt"
|
||||
|
||||
# Uncomment to get a beep at GRUB start
|
||||
#GRUB_INIT_TUNE="480 440 1"
|
||||
|
||||
# Uncomment to make GRUB remember the last selection. This requires
|
||||
# setting 'GRUB_DEFAULT=saved' above. Change 0 into saved.
|
||||
# Do not forget to 'update-grub' in a terminal to apply the new settings
|
||||
#GRUB_SAVEDEFAULT="true"
|
||||
|
||||
# Uncomment to disable submenus in boot menu
|
||||
#GRUB_DISABLE_SUBMENU=y
|
||||
|
||||
# Probing for other operating systems is disabled for security reasons. Read
|
||||
# documentation on GRUB_DISABLE_OS_PROBER, if still want to enable this
|
||||
# functionality install os-prober and uncomment to detect and include other
|
||||
# operating systems.
|
||||
GRUB_DISABLE_OS_PROBER=false
|
102
usr/local/share/snigdhaos/pacman.conf
Normal file
102
usr/local/share/snigdhaos/pacman.conf
Normal file
@@ -0,0 +1,102 @@
|
||||
#
|
||||
# /etc/pacman.conf
|
||||
#
|
||||
# See the pacman.conf(5) manpage for option and repository directives
|
||||
|
||||
#
|
||||
# GENERAL OPTIONS
|
||||
#
|
||||
[options]
|
||||
# The following paths are commented out with their default values listed.
|
||||
# If you wish to use different paths, uncomment and update the paths.
|
||||
#RootDir = /
|
||||
#DBPath = /var/lib/pacman/
|
||||
#CacheDir = /var/cache/pacman/pkg/
|
||||
#LogFile = /var/log/pacman.log
|
||||
#GPGDir = /etc/pacman.d/gnupg/
|
||||
#HookDir = /etc/pacman.d/hooks/
|
||||
HoldPkg = pacman glibc
|
||||
#XferCommand = /usr/bin/curl -L -C - -f -o %o %u
|
||||
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
|
||||
#CleanMethod = KeepInstalled
|
||||
Architecture = auto
|
||||
|
||||
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
|
||||
#IgnorePkg =
|
||||
#IgnoreGroup =
|
||||
|
||||
#NoUpgrade =
|
||||
#NoExtract =
|
||||
|
||||
# Misc options
|
||||
#UseSyslog
|
||||
#Color
|
||||
#NoProgressBar
|
||||
CheckSpace
|
||||
#VerbosePkgLists
|
||||
#ParallelDownloads = 5
|
||||
|
||||
# By default, pacman accepts packages signed by keys that its local keyring
|
||||
# trusts (see pacman-key and its man page), as well as unsigned packages.
|
||||
SigLevel = Required DatabaseOptional
|
||||
LocalFileSigLevel = Optional
|
||||
#RemoteFileSigLevel = Required
|
||||
|
||||
# NOTE: You must run `pacman-key --init` before first using pacman; the local
|
||||
# keyring can then be populated with the keys of all official Arch Linux
|
||||
# packagers with `pacman-key --populate archlinux`.
|
||||
|
||||
#
|
||||
# REPOSITORIES
|
||||
# - can be defined here or included from another file
|
||||
# - pacman will search repositories in the order defined here
|
||||
# - local/custom mirrors can be added here or in separate files
|
||||
# - repositories listed first will take precedence when packages
|
||||
# have identical names, regardless of version number
|
||||
# - URLs will have $repo replaced by the name of the current repo
|
||||
# - URLs will have $arch replaced by the name of the architecture
|
||||
#
|
||||
# Repository entries are of the format:
|
||||
# [repo-name]
|
||||
# Server = ServerName
|
||||
# Include = IncludePath
|
||||
#
|
||||
# The header [repo-name] is crucial - it must be present and
|
||||
# uncommented to enable the repo.
|
||||
#
|
||||
|
||||
# The testing repositories are disabled by default. To enable, uncomment the
|
||||
# repo name header and Include lines. You can add preferred servers immediately
|
||||
# after the header, and they will be used before the default mirrors.
|
||||
|
||||
#[core-testing]
|
||||
#Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[core]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
#[extra-testing]
|
||||
#Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[extra]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
# If you want to run 32 bit applications on your x86_64 system,
|
||||
# enable the multilib repositories as required here.
|
||||
|
||||
#[multilib-testing]
|
||||
#Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[multilib]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
# An example of a custom package repository. See the pacman manpage for
|
||||
# tips on creating your own repositories.
|
||||
#[custom]
|
||||
#SigLevel = Optional TrustAll
|
||||
#Server = file:///home/custompkgs
|
||||
|
||||
[chaotic-aur]
|
||||
Include = /etc/pacman.d/chaotic-mirrorlist
|
||||
[blackarch]
|
||||
Include = /etc/pacman.d/blackarch-mirrorlist
|
Reference in New Issue
Block a user