Compare commits
No commits in common. "722a13262ffd822a93f1efadd749560c080370e1" and "c6bfeca636a98c0d96b9aaeecab124211f0e9bcd" have entirely different histories.
722a13262f
...
c6bfeca636
@ -1,14 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
BACKUP="/home/yorune/MEGA/Systems/Linux/portage"
|
||||
TMP_KERNEL="/tmp/kernel-config-$(uname -r)"
|
||||
BACKUP="/home/yorune/Linux/portage"
|
||||
LOG_FILE="/tmp/update-kernel.log"
|
||||
TMP_KERNEL="/tmp/kernel-config-`uname -r`"
|
||||
DEFAULT_KERNEL="/usr/src/linux/.config"
|
||||
GRUBRELOAD=1
|
||||
|
||||
function starting() {
|
||||
echo -e "\e[93m----------------------COMPILING------------------------------\e[0m"
|
||||
sudo cp -rv "$DEFAULT_KERNEL" "$TMP_KERNEL"
|
||||
cp -r "$TMP_KERNEL" "$BACKUP/kernel-config"
|
||||
sudo cp -rv $DEFAULT_KERNEL $TMP_KERNEL
|
||||
cp -r $TMP_KERNEL $BACKUP/kernel-config
|
||||
cp -r /etc/portage/* $BACKUP
|
||||
qlist -I | sort -u > $BACKUP/list-of-programs
|
||||
}
|
||||
@ -18,30 +18,26 @@ echo -e "\e[93m----------------------SELECTION-----------------------------\e[0m
|
||||
sudo eselect kernel list
|
||||
echo
|
||||
echo
|
||||
read -rp "New kernel is: " KERVER
|
||||
read -p "New kernel is: " KERVER
|
||||
echo
|
||||
echo -e "Your kernel now is \e[91m$(uname -sr)\e[0m"
|
||||
echo -e "Your selected kernel is \e[91m$KERVER\e[0m"
|
||||
sudo eselect kernel set "$KERVER"
|
||||
sudo eselect kernel list | grep -iE "\*"
|
||||
echo -e "Your selected kernel is \e[91m"$KERVER"\e[0m"
|
||||
sudo eselect kernel set $KERVER
|
||||
sudo eselect kernel list | grep "*"
|
||||
echo
|
||||
}
|
||||
|
||||
function compilation() {
|
||||
read -rp "Do you want to accept and compile (Y/N): " agreed
|
||||
read -p "Do you want to accept and compile (Y/N): " agreed
|
||||
echo
|
||||
if [ "$agreed" == "y" ] || [ "$agreed" == "Y" ]
|
||||
then
|
||||
echo -e "\e[91m----------------------\e[5mSTARTING\e[0m\e[91m------------------------------\e[0m" && sleep 10
|
||||
$NOW > /tmp/compiling-starting
|
||||
NEW_KERNEL="/tmp/new-kernel-config"
|
||||
sudo cp -r "$TMP_KERNEL" "$DEFAULT_KERNEL"
|
||||
cd /usr/src/linux || exit
|
||||
sudo make menuconfig; sleep 2; sudo cp -r "$DEFAULT_KERNEL" "$NEW_KERNEL"
|
||||
sudo genkernel all --makeopts=-j"$(nproc --all)" \
|
||||
--kernel-config=$NEW_KERNEL \
|
||||
--callback="emerge nvidia-drivers::gentoo" \
|
||||
--zfs
|
||||
sudo cp -r $TMP_KERNEL $DEFAULT_KERNEL
|
||||
cd /usr/src/linux; sudo make menuconfig; sleep 2; sudo cp -r $DEFAULT_KERNEL $NEW_KERNEL
|
||||
sudo genkernel all --makeopts=-j$(nproc --all) --kernel-config=$NEW_KERNEL --callback="emerge nvidia-drivers::gentoo" --lvm --btrfs --luks
|
||||
elif [ "$agreed" == "N" ] || [ "$agreed" == "n" ]
|
||||
then
|
||||
exit
|
||||
@ -68,20 +64,16 @@ echo -e "AFTER EVERYTHING YOU MUST WRITE COMMAND \e[91m"sudo grub-mkconfig -o /b
|
||||
}
|
||||
|
||||
function checking() {
|
||||
KERNEL=$(eselect kernel list \
|
||||
| awk '{print $2}' \
|
||||
| grep -Eo '[0-9]+.[0-9]+.[0-9]+' \
|
||||
| tail -n1)
|
||||
KERNEL=`eselect kernel list | awk '{print $2}' | egrep -o '[0-9]+.[0-9]+.[0-9]+' | tail -n1`
|
||||
|
||||
INITRANFS="initramfs-$KERNEL-gentoo-x86_64.img"
|
||||
SYSTEMMAP="System.map-$KERNEL-gentoo-x86_64"
|
||||
VMLINUZ="vmlinuz-$KERNEL-gentoo-x86_64"
|
||||
|
||||
ifchecking "$INITRANFS"
|
||||
ifchecking "$SYSTEMMAP"
|
||||
ifchecking "$VMLINUZ"
|
||||
[ "$GRUBRELOAD" -eq "1" ] && sudo grub-mkconfig -o /boot/grub/grub.cfg \
|
||||
|| echo "Please check all files and regenerate grub again!"
|
||||
ifchecking $INITRANFS
|
||||
ifchecking $SYSTEMMAP
|
||||
ifchecking $VMLINUZ
|
||||
sudo grub-mkconfig -o /boot/grub/grub.cfg
|
||||
}
|
||||
|
||||
function ifchecking () {
|
||||
@ -90,16 +82,15 @@ if test -f "$FILE"; then
|
||||
echo "$FILE exist in the /boot folder ;)"
|
||||
else
|
||||
echo "$FILE NOT exist in the /boot folder ;)"
|
||||
GRUBRELOAD=0
|
||||
fi
|
||||
}
|
||||
|
||||
function addgit() {
|
||||
cd "$BACKUP" || exit
|
||||
cd ~/Linux/portage || exit
|
||||
git add .
|
||||
git commit -m "Updated: $(date)"
|
||||
git push
|
||||
cd "$HOME" || exit
|
||||
cd ~ || exit
|
||||
}
|
||||
|
||||
function main() {
|
||||
|
1
.zshrc
1
.zshrc
@ -103,7 +103,6 @@ alias notes="nvim $HOME/git/notes/index.md"
|
||||
alias mgr="cd $HOME/Documents/Mega-Documents/Magisterka-Marcin/Semestr1/"
|
||||
alias mpv="__NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 __GLX_VENDOR_LIBRARY_NAME=nvidia __GL_SYNC_TO_VBLANK=0 mpv --vo=x11 --hwdec=no --ytdl-raw-options="yes-playlist=" --no-resume-playback --ytdl-format='bestvideo[height<=?1080]+bestaudio/best'"
|
||||
alias aria2c="aria2c --seed-time=0 --disable-ipv6 --max-upload-limit=1k"
|
||||
alias lg="lazygit"
|
||||
|
||||
# Cleaning-up
|
||||
export PATH=$HOME/.local/bin:$PATH
|
||||
|
Loading…
x
Reference in New Issue
Block a user