blob: cd4e3ab555da853efe1829a383db2bdc395e0499 (
plain)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
#!/usr/bin/env nu
#
# ~~~ kernel updater
#
# get device
let DEVICE_ID = match (uname | get nodename) {
"glados" => "010",
"wheatley" => "020",
"companioncube" => "110",
"cavejohnson" => "120",
_ => { error make -u { msg: "invalid device" } }
}
# get kernel config location
let DEVICE_CONFIG = match ($DEVICE_ID) {
"010" | "020" => $"/home/autumn/src/kernel/configs/($DEVICE_ID).config",
"110" | "120" => $"/root/kernel/configs/($DEVICE_ID).config"
}
# setup kernel
cd /usr/src/linux
cp $DEVICE_CONFIG .config
make oldconfig
# compile kernel
match ($DEVICE_ID) {
"010" => { make -j20 },
"020" => { make -j12 },
"110" => { make -j3 },
"120" => { make -j8 }
}
make modules_install
make install
# build initramfs
dracut -f --kernel-image=/boot/vmlinuz
# setup EFI directory
let OLD_EFI = (ls -l /efi/EFI/Linux/ | get name | first)
if ($DEVICE_ID == "110") {
mv $OLD_EFI /efi/EFI/Linux/Linux.efi
} else {
mv $OLD_EFI /efi/Linux.efi
try { rm -r /efi/EFI /efi/loader }
sbctl sign-all
}
|