1
0
Fork 0

preparekern-desktop added.

This commit is contained in:
Alexey Skobkin 2022-06-20 17:48:46 +03:00
parent b16ab03556
commit 7009ec02d5
No known key found for this signature in database
GPG Key ID: 5D5CEF6F221278E7
1 changed files with 32 additions and 0 deletions

32
bin/preparekern-desktop Executable file
View File

@ -0,0 +1,32 @@
#!/usr/bin/env sh
ESP_MOUNTPOINT=/boot/efi
# Mounting EFI System Partition
mount $ESP_MOUNTPOINT
# Going to current Linux source directory
cd /usr/src/linux
# Removing verion record
rm .version
# Checking if we already have config or it's a new kernel
[[ ! -f .config ]] && zcat /proc/config.gz > .config
# Completing merging kernel config options with current version
make -j32 oldconfig &&
## Showing kernel configurations interface
#make -j8 nconfig &&
# Compiling kernel using -jN (where N is number of threads)
# Common value is N = number of CPU cores
make -j32 bzImage modules &&
# Installing kernel modules
make modules_install &&
# Rebuilding 3rd party kernel modules
emerge -vq @module-rebuild &&
# Doing backup of current kernel version and copying new version to ESP partition
(
cd $ESP_MOUNTPOINT/EFI/gentoo
mv -f kernel.old.efi kernel.old2.efi &>/dev/null;
mv -f kernel.efi kernel.old.efi &>/dev/null;
cp /usr/src/linux/arch/x86/boot/bzImage kernel.efi
) &&
# Showing current kernels
echo "Current kernel files:" &&
file /boot/efi/EFI/gentoo/*