-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-next.sh
More file actions
executable file
·32 lines (25 loc) · 970 Bytes
/
install-next.sh
File metadata and controls
executable file
·32 lines (25 loc) · 970 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
tasks="$(nproc)"
# $builddir from build script
cd /tmp/rc
# First copy modules to /lib/modules/
sudo make -j"$tasks" modules_install
if [[ -e "/etc/arch-release" ]]
then
# Arch uses mkinitcpio to create the initial ramdisk, which requires
# a few extra steps to finish installing the new kernel.
release="$(make kernelrelease)"
# Move the new kernel image and system map into place.
sudo cp --verbose /tmp/rc/arch/x86/boot/bzImage /boot/vmlinuz-"$release"
sudo cp --verbose /tmp/rc/System.map /boot/System.map-"$release"
# Make a new initramfs image file using /etc/mkinitcpio.conf
sudo mkinitcpio --kernel "$release" --generate /boot/initramfs-"$release".img
sudo grub-mkconfig -o /boot/grub/grub.cfg
elif [[ -e "/etc/fedora-release" ]]
then
old_entry="$(sudo grubby --info=ALL | rg '^kernel="(/boot/vmlinuz.*next.*)"' -r '$1')"
sudo grubby --remove-kernel="$old_entry" || true
sudo make install
else
echo "Unable to identify distro"
fi