=== zyga-laptop is now known as zyga-holidays === cpaelzer__ is now known as cpaelzer [16:02] apw: sigh [16:02] https://bugs.launchpad.net/ubuntu/+source/wireguard/+bug/1856539 [16:02] Ubuntu bug 1856539 in wireguard (Ubuntu) "wireguard package doesn't work on ubuntu eon" [Undecided,New] [16:02] helping this guy involves walking him through rebuilding his dkms stuff (for whatever reason) and/or disabling secure boot [16:03] that really sucks [16:03] proper .ko cannot come soon enough :-) [17:42] good morning all [17:43] I filed a bug (#1856603) just now and am wondering whether I could get some feedback on it - do I need to provide more info or is it good as-is? [17:50] as an aside, if someone could step me through building a patched kernel, I'd appreciate it. The docs seem to be out of date. [18:46] fm [22:01] so, can someone please point me to the latest guide to compiling an ubuntu kernel (with an upstream patch)? [22:02] https://help.ubuntu.com/community/Kernel/Compile is a bit outdated, and https://wiki.ubuntu.com/KernelTeam/GitKernelBuild isn't specific to Ubuntu (and is also, I think, outdated) [22:11] aberrant, Have you already cloned the git repository that corresponds to which Ubuntu kernel you'd like to apply the patch to? [22:12] connor_k: not yet. I started doing the "generic" instructions but figured that's probably not what I want. [22:12] connor_k: I'm on eoan [22:13] connor_k: should I just apt install linux-source-5.3.0 ? [22:13] aberrant, I suppose you could, but I prefer to use the git repository: https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/eoan [22:13] ah, ok [22:13] thank you [22:14] ping me once that's cloned and I'll walk you through applying your patch and building the kernel :-) [22:14] awesome! thanks. [22:16] still going. :) [22:16] It will probably take a few minutes :-) Do you already have the patch(es) you want to apply to it? [22:16] yes. it's one line [22:16] http://git.infradead.org/nvme.git/commitdiff/530436c45ef2e446c12538a400e465929a0b3ade?hp=400b6a7b13a3fd71cff087139ce45dd1e5fff444 [22:16] I hope this file is in the ubuntu kernel [22:17] actually, it's like 10 lines. :) [22:18] it looks like it is [22:18] so on that page you linked, I clicked on the "patch" link and it'll take you here: http://git.infradead.org/nvme.git/patch/530436c45ef2e446c12538a400e465929a0b3ade?hp=400b6a7b13a3fd71cff087139ce45dd1e5fff444 [22:18] it's in drivers, though. Does this require a new kernel, or just a driver? [22:19] "You merely need to compile a special driver. For this, you only need to install the linux-headers packages." [22:20] from https://help.ubuntu.com/community/Kernel/Compile [22:20] but this is useful info anyway, so let's march forward. [22:21] I'll be taking notes [22:21] Oof, lots of pressure for me to get it right then ha [22:21] hahaha. [22:22] I can build this on a different system than the one I need it on as long as the architecture's the same, right? [22:22] aberrant, yeah [22:22] ok, git clone finished [22:22] if you right-click the "patch" link on the commit page you linked me to, click "save link as" or something to download the patch so you can have it handy [22:24] or if you're ssh'ing onto a more powerful build machine then you can use a command line tool like "curl" or something: "curl http://git.infradead.org/nvme.git/patch/530436c45ef2e446c12538a400e465929a0b3ade?hp=400b6a7b13a3fd71cff087139ce45dd1e5fff444 > whatever-you-want-to-name-it.patch" [22:25] yup, got it. It has the email header in there. is that a problem? [22:25] no, git will ignore that when you apply it [22:25] ok, got it. [22:25] cd to .../nvme/host and then patch < patch1.txt ? [22:25] inside the "eoan" repo, if you run "git am ../path-to-that-patch-you-downloaded.patch" there's a chance it'll just fit in without any fuss [22:26] oh, use git. wow. [22:26] seth@hydrogen:~/kernel/eoan$ git am ~/patch1.txt [22:26] Applying: nvme: Discard workaround for non-conformant devices [22:26] done :) [22:26] let me just confirm some of the changed lines are there [22:26] nice! [22:27] yup, all good. [22:27] so far you're on a roll :) [22:29] Sweet! One last thing I'd do before spending time compiling it is to make sure that config option is enabled for the Ubuntu kernel you want to compile [22:29] ok, where is that specified? [22:30] or does make config take care of it? [22:31] (I also need kvm support, just FYI) [22:31] I looked in the folder where the code is that you patched (drivers/nvme/host) and saw the Kconfig specifies "NVME_CORE" [22:32] I'd just run "git grep NVME_CORE debian.master" [22:32] and I see in eoan: "debian.master/config/config.common.ubuntu:CONFIG_NVME_CORE=m" [22:32] debian.master/config/config.common.ubuntu:CONFIG_NVME_CORE=m [22:32] what's "m" mean? [22:32] so it looks like it's built as a module (which isn't terribly surprising since NVME seems pretty important to have these days [22:32] ah, ok [22:32] module just means that it can be loaded after the fact. Another value would be "y" which means it's built directly into the kernel image [22:33] er, module => "m" [22:33] so since the proper config is already set you could probably build the kernel [22:33] well, my boot drive is nvme, so [22:33] no 'make config' ? [22:33] (and what about KVM?) [22:34] before doing that I'd edit the changelog "debian.master/changelog" and inside the parentheses: linux (5.3.0-blah) I'd change the number in the parentheses to be (5.3.0-blah+MyPatch) or something [22:34] * connor_k can't type fast enough :-) [22:35] linux (5.3.0-24.26+nvme_patch) eoan; urgency=medium [22:35] perfect [22:35] ok. [22:35] that's just so you know you're running your test kernel when you run "uname -a" [22:35] understood. [22:35] perfect. [22:35] but I think Eoan is also built with kvm support [22:35] git grep CONFIG_KVM debian.master/ [22:35] debian.master/config/amd64/config.common.amd64:CONFIG_KVM=m [22:35] KVM worked out of the box with the iso install, so I think you're right [22:36] Ok. Looks like you're ready to put your CPU to work [22:36] make -j`nproc` bin-debpkg [22:36] basically I'd like the iso install kernel with this one patch :) [22:36] sweet. [22:36] j=6 [22:36] at least I think that's the makefile target that produces the -image, -modules debian packages once it's all done [22:37] *** Configuration file ".config" not found! [22:37] *** [22:37] *** Please run some configurator (e.g. "make oldconfig" or [22:37] *** "make menuconfig" or "make xconfig"). [22:37] oh woops, also I forgot at the very beginning [22:37] cp /boot/config-`uname -r` .config [22:37] then "make oldconfig" [22:37] config-5.3.0-24-generic ? [22:38] if that's what shows up when you run `uname -r` yeah, probably [22:38] oh, what packages do I need? it failed 'cause no flex [22:39] sorry. I'm building inside a VM [22:39] ah [22:39] flex and bison so far [22:39] in the eoan folder, if you open Documentation/Changes it has a list of packages [22:39] I have gcc and g++ [22:40] probably need bc, libssl-dev, libelf-dev, libncurses5-dev [22:40] ok, give me a minute :) [22:43] where is mcelog? [22:44] try skipping that one, I don't remember ever having to install it to build the kernel. I think you can get away with build-essential (which has gcc, g++), make, libssl-dev, libelf-dev, flex, bison, bc [22:45] mcelog was removed from Debian and in turn Ubuntu bionic due to "ROM; obsolete; no kernel support in testing". Please see https://launchpad.net/ubuntu/+source/mcelog/+publishinghistory or https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=889741 for more details. [22:45] erm. [22:45] Debian bug 889741 in ftp.debian.org "RM: mcelog -- ROM; obsolete; no kernel support in testing" [Normal,Open] [22:45] ok [22:46] iirc mcelog has been mostly replaced by rasdaemon; I haven't had any MCEs on my own hardware (thankfully) to verify that it actually serves as a replacement [22:46] ok, what's after `make oldconfig` again? [22:46] should be good to go with: "make -j`nproc` bin-debpkg" [22:47] got it. [22:47] and then take a break to have a snack, read a book, watch a film, or maybe overnight depending on that VM :-) [22:47] hahah [22:47] :) [22:47] 6 procs off a 3400G [22:47] that make target will produce the kernel all packaged up, and you'll be interested in installing the one that has *image*.deb and *modules*.deb [22:47] do I run the make in debian-master/ ? [22:47] no, in the top level directory of the eoan tree [22:47] the config was in the eoan root, right? [22:48] yeah run it in the eoan root [22:48] seth@hydrogen:~/kernel/eoan$ make -j6 bin-debpkg UPD include/config/kernel.release [22:48] make[1]: *** No rule to make target 'bin-debpkg'. Stop. [22:48] checking the makefile [22:49] I can't find bin-debpkg as a target [22:51] hmm, weird... I suppose running: "fakeroot debian/rules binary" should compile the kernel and produce the same packages I was going for with the "bin-debpkg" thing [22:51] how about `make all`? [22:52] make help shows that building vmlinux, modules, and bzImage [22:52] yeah I suppose you could, I was just trying to go the route where it produces debian packages so you can uninstall the test kernel but I guess if it's a VM then you could go the route "make" "make modules_install" "make install" (but I don't know the right targets off the top of my head) [22:52] nononon. I'm installing it ont he hypervisor [22:52] so yeah, I'd like to be able to uninstall. [22:52] I'm building on a vm, but installing on the HV [22:53] seth@hydrogen:~/kernel/eoan$ fakeroot debian/rules binary [22:53] Debug: prepare-indep [22:53] dh_prep -i [22:53] /bin/bash: dh_prep: command not found [22:53] make: *** [debian/rules.d/3-binary-indep.mk:172: prepare-indep] Error 127 [22:53] yeah i guess the way I'm most familiar with that should result in debian packages which are easily managed by dpkg or apt would be "fakeroot debian/rules binary" [22:54] let me try installing debhelper [22:55] seth@hydrogen:~/kernel/eoan$ fakeroot debian/rules binary [22:55] Debug: prepare-indep [22:55] dh_prep -i [22:55] dh_prep: "debian/control" not found. Are you sure you are in the correct directory? [22:55] make: *** [debian/rules.d/3-binary-indep.mk:172: prepare-indep] Error 255 [22:55] hrm. [22:56] trying fakeroot debian/rules clean [22:56] yeah that should generate it [22:56] ok. I'm following https://help.ubuntu.com/community/Kernel/Compile [22:57] AUTOBUILD=1 fakeroot debian/rules binary-debs <--- does that look reasonable? [22:57] did "fakeroot debian/rules clean" followed by "fakeroot debian/rules binary" not start building it? [22:57] I just did the clean so far [22:58] should I do binary or binary-debs? [22:58] just binary [22:58] ok [22:58] building [22:58] I also had to install kernel-wedge [22:58] woo! [22:58] wait [22:59] not woo! [22:59] is there a way to `j6` this? [22:59] or will it just be single-proc? [22:59] checking for libudev.h... no [22:59] configure: error: Missing /usr/include/libudev.h [22:59] crap. [22:59] ok [23:00] Hmm I'm sure there's a way to do an equivalent -j thing [23:00] just installed libudev-dev [23:01] utils/helpers/amd.c:8:10: fatal error: pci/pci.h: No such file or directory [23:01] crap. what's going on here? [23:04] let me try a `make -j6 all` and see what happens. [23:04] I can always distclean [23:05] frankly I'm still sad that the "make bin-debpkg" didn't work, and am wondering if I hallucinated all of my previous kernel builds [23:06] https://wiki.debian.org/BuildADebianKernelPackage [23:06] :) [23:06] This is an obsolete now guide on how to build the Linux Kernel into a .deb package. Don't use this, [23:08] what happens with a `make all` ? [23:08] it'll just compile the kernel (but doesn't produce debian packages from it) [23:09] maybe the fakeroot will work if the binaries already exist [23:10] fakeroot debian/rules binary-arch [23:10] huh. [23:11] well... i've done some soul searching and realized i've misled you. I said "make bin-debpkg" but really what I should have said was "make bindeb-pkg" [23:12] oooh. [23:12] ok, should I stop this `make all`? [23:12] no [23:12] you can run "make bindeb-pkg" after the make all [23:13] you got it. Thank you for persevering here. [23:13] but DON'T run "make deb-pkg" make sure you run "make bindeb-pkg" because the one without the "bin" in the name executes a "make clean" [23:13] yup, I took notes. [23:13] wiki definitely needs an update :) [23:13] cool :-) have fun kernel hacking! [23:13] assuming this works. [23:13] Thank you very much. Hopefully this patch 1) works, and 2) gets into a mainstream kernel build. [23:14] nasty bug. [23:15] ok, gonna let this crank. I'll be back to let you know outcome one way or another :) [23:17] sounds good to me :-) [23:18] thanks again, connor_k - greatly appreciated. [23:19] no problem! happy to help [23:22] just to confirm, this will build 3 .deb packages, and I just copy those over to the hypervisor and do a dpkg -i on each? [23:23] you'll only need the ones that are -*image*.deb -*modules*.deb [23:23] unless you're gonna compile DKMS packages on the kernel you're installing, in which case you'll want the -*headers*.deb too [23:23] dunno what those are, so .. no. [23:23] how do I uninstall if this gives me problems? [23:24] will dpkg -r do it? [23:24] there should be a version number in the *.deb name, I usually do "dpkg --get-selections | grep linux" and look for the linux-image package with the version number that's encoded in your deb name, then "apt remove THAT_PACKAGE" [23:28] does that restore the old kernel? [23:29] when you reboot after uninstalling, yeah it'll look for the newest kernel (which will be the one you were running before you installed your test kernel) [23:29] ah, right. Cool! [23:34] still building, so I'm headed home. Will check later. Thanks again. [23:34] Np! have a good evening! [23:38] wow, build just finished. [23:38] make -j6 bindeb-pkg now