re: building 9.1 kernel with /usr/src elsewhere?
> This completed apparently normally, reporting the build directory and > telling me to remember to make depend. I then went to ~/kbuild/GEN91 > and ran make depend && make. It failed fast - no more than a second or > two - with > > make[1]: don't know how to make absvdi2.c. Stop what happens if you run "make USETOOLS=no"? .mrg.
Re: building 9.1 kernel with /usr/src elsewhere?
You should build the kernel using build.sh, with the tools and all from there. ./build.sh kernel=foobar Don't try to make things complicated by doing all that stuff by hand. :-) Johnny On 2023-03-08 00:32, Mouse wrote: Okay, I'm trying to help someone with a NetBSD 9.1 machine at work. Today's issue is one I had trying to build a kernel. We needed to do this because that project has a few customziations in the system needed to build the application layer, and more needed to run it. He installed stock 9.1, but did not install any source; /usr/src and /usr/xsrc did not exist. We then set up the customized source trees in his homedir, which I will here call /home/abcxyz, under a directory 9.1. Thus, the path to kernel source, for example, was /home/abcxyz/netbsd-9.1/usr/src/sys. Then I copied in a kernel config (GEN91) into my ~/kconf/GEN91, from back when I was working on that project. I then ran % config -b ~/kbuild/GEN91 -s /home/abcxyz/netbsd-9.1/usr/src/sys ~/kconf/GEN91 This completed apparently normally, reporting the build directory and telling me to remember to make depend. I then went to ~/kbuild/GEN91 and ran make depend && make. It failed fast - no more than a second or two - with make[1]: don't know how to make absvdi2.c. Stop (full log below). I then moved /home/abcxyz/netbsd-9.1/usr/{src,xsrc} to /usr/{src,xsrc}, chowned them -R to 0, destroyed ~/kbuild/GEN91, and repeated, only this time I passed /usr/src/sys to config's -s flag. This time the kernel built fine (at least apparently - we haven't tried booting it yet, but I've built enough kernels to be confident there are no obvious red flags in the log; it certainly did not fail a second or two in with a cryptic message about absvdi2.c). Note in particular that the source tree content was identical; only the path and ownership differed. Is this a bug? Or am I doing something wrong? /~\ The ASCII Mouse \ / Ribbon Campaign X Against HTML mo...@rodents-montreal.org / \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B The logfile includes one line that's over 3300 characters long, guaranteeing that it'd get mangled by email (soft limit 78 characters, hard limit 998). So, I ran the logfile through bzip2 and then base64-encoded the output. Here's the result: QlpoOTFBWSZTWfzLRGEAA6xfgGAQSZP/cj/v36qwUANjwoKAAGSNUbUn6mpv U1NPU8hAZB6mQA9EMymmagOaMmJgAmIwI0wIMRgmTAIw5oyYmACYjAjTAgxGCZMA jDmjJiYAJiMCNMCDEYJkwCMEUQkwmQJoBR6jR5QA02ppo0Gm2qaekaI6tlUVe/S1 HAv0T332gt7Q3uZ7SnDMNrMXxRm2qdT965avS81vYtWJqOVqFHMMG2lXjZAzLhEs 27kbS8RZOB1YXdRZGFfB+Vv64SXOnJbdALlWMEEIQABCjGnQhAOAkGYImXVAYFSV gDpIIgIk4iJU661xD4IOouYQv7DytQCYMTqXUIYqMGgCfbG40vx0e6+cYsRMxWbG Ry7dS5oRQAwI3XHxETDWFMrFa1+URPAsCmnoETwfSvQInSHI418MxAY/xIzvVCzA h8iP4i6OcEEPxhJRZKmkZ6dtYVdUDx1F0h7z+ryOBD/FDb5RQsf2pwBlyggpIeVR 92uNxc3aZYSUPe2TV3aWC5CNOUBELwKW0ESTM5thvQmeUmlz7thjtk0ZKaUlm7gU OASVllCpleWIQpx0y3morldhNMw1tTjtzvoRkc3rx23xrveRHQbDZTLTOChswIDD Hd1nzGHP6A6yTEnMgL84Z9SCSxgYH37YdFFZdV2mdEHoHkd4UEEKgyDwOZDxQfyI LY3SF3TJCfWg+wRPXIPqESyDXzK+OW6lP1KEJkIlSAsAbcBcD4Z3iJiVKGIiUIVP 2N8kaG0HbAXu37Pbdt2AG2OyBH02gG/nzEShoSSVebJPP+Tvi5LgcVHE0ETWo+og lPYdofIamwKb8sqHQKEUOcsc6XWAN4TwoSAdclLBN1QIjmJqi9pYEKRoAYHCIhB2 JbpbzqBS+ki6xaG47NWFzrJmUkSRYUZQK3CJKcZTX/htKF+MY7OgFIFyd+gvIvDY 9NSBvxpfE85ThkVMyOwRJdkiJYLaw0Bb1Qzg77rchEyOLkoB1ApmIlADnLcxULoE TYnnCmYiQ6/ao6pPnJ+4sPC3GA6D4mvuANDYUESE1XGG9JKlu+DVtUdYidGAibhE 4iJ/4u5IpwoSH5lojCA= -- Johnny Billquist || "I'm on a bus || on a psychedelic trip email: b...@softjar.se || Reading murder books pdp is alive! || tryin' to stay hip" - B. Idol
Re: building 9.1 kernel with /usr/src elsewhere?
> Date: Tue, 7 Mar 2023 18:32:46 -0500 (EST) > From: Mouse > > This completed apparently normally, reporting the build directory and > telling me to remember to make depend. I then went to ~/kbuild/GEN91 > and ran make depend && make. It failed fast - no more than a second or > two - with > > make[1]: don't know how to make absvdi2.c. Stop Does it make a difference if you set NETBSDSRCDIR=/home/abcxyz/netbsd-9.1/usr/src when you run make? I always build out of my home directory, never /usr/src, but I also always use build.sh and the make wrapper it creates to pass all the right options to make (including for cross-builds). My usual build incantation is: ./build.sh -O ../obj.amd64 -U -u -m amd64 -j4 -N1 tools kernel=GENERIC or ./build.sh -O ../obj.arm64 -U -u -m evbarm64 -j4 -N1 -V MKCROSSGDB=yes -V MKDEBUG=yes -V USE_PIGZGZIP=yes tools kernel=GENERIC64 or similar. (Once `tools' is built once, no need to build it again during kernel development.) FYI, if you use build.sh, you don't need to do the build from inside netbsd-9.1 on the same architecture. I mostly do development of netbsd-current on 9.x, but you could also do it from macOS or Linux too. I suspect that explicitly running /usr/bin/config for a non-cross-build is an unusual use case these days. And you will get a more consistent toolchain, and a more consistent build product (including the option of a 100% reproducible build with MKREPRO), if you use build.sh.
Re: building 9.1 kernel with /usr/src elsewhere?
hello. I regularly build kernels outside of the /usr/src location. My technique is to install the source in some location: /usr/local/netbsd/src-91, for example, then put my configuration file in: /usr/local/netbsd/src-91/sys/arch//conf/ Then cd /usr/local/netbsd/src-91/sys/arch//conf config cd ../compile/ make -j 4 >& make.log And, I'm off to the races. Does that not work for you? -Brian
building 9.1 kernel with /usr/src elsewhere?
Okay, I'm trying to help someone with a NetBSD 9.1 machine at work. Today's issue is one I had trying to build a kernel. We needed to do this because that project has a few customziations in the system needed to build the application layer, and more needed to run it. He installed stock 9.1, but did not install any source; /usr/src and /usr/xsrc did not exist. We then set up the customized source trees in his homedir, which I will here call /home/abcxyz, under a directory 9.1. Thus, the path to kernel source, for example, was /home/abcxyz/netbsd-9.1/usr/src/sys. Then I copied in a kernel config (GEN91) into my ~/kconf/GEN91, from back when I was working on that project. I then ran % config -b ~/kbuild/GEN91 -s /home/abcxyz/netbsd-9.1/usr/src/sys ~/kconf/GEN91 This completed apparently normally, reporting the build directory and telling me to remember to make depend. I then went to ~/kbuild/GEN91 and ran make depend && make. It failed fast - no more than a second or two - with make[1]: don't know how to make absvdi2.c. Stop (full log below). I then moved /home/abcxyz/netbsd-9.1/usr/{src,xsrc} to /usr/{src,xsrc}, chowned them -R to 0, destroyed ~/kbuild/GEN91, and repeated, only this time I passed /usr/src/sys to config's -s flag. This time the kernel built fine (at least apparently - we haven't tried booting it yet, but I've built enough kernels to be confident there are no obvious red flags in the log; it certainly did not fail a second or two in with a cryptic message about absvdi2.c). Note in particular that the source tree content was identical; only the path and ownership differed. Is this a bug? Or am I doing something wrong? /~\ The ASCII Mouse \ / Ribbon Campaign X Against HTMLmo...@rodents-montreal.org / \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B The logfile includes one line that's over 3300 characters long, guaranteeing that it'd get mangled by email (soft limit 78 characters, hard limit 998). So, I ran the logfile through bzip2 and then base64-encoded the output. Here's the result: QlpoOTFBWSZTWfzLRGEAA6xfgGAQSZP/cj/v36qwUANjwoKAAGSNUbUn6mpv U1NPU8hAZB6mQA9EMymmagOaMmJgAmIwI0wIMRgmTAIw5oyYmACYjAjTAgxGCZMA jDmjJiYAJiMCNMCDEYJkwCMEUQkwmQJoBR6jR5QA02ppo0Gm2qaekaI6tlUVe/S1 HAv0T332gt7Q3uZ7SnDMNrMXxRm2qdT965avS81vYtWJqOVqFHMMG2lXjZAzLhEs 27kbS8RZOB1YXdRZGFfB+Vv64SXOnJbdALlWMEEIQABCjGnQhAOAkGYImXVAYFSV g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