• NetBSD
  • can't compile the sets for new wifi branch

I'd like to test the new wifi branch, but I can't get it to compile. Using these guides, renewal on hg and testing new wifi I've done the following.

doas pkgin in mercurial
cd /usr
doas mkdir src-draft
doas chown pete src-draft
hg clone https://anonhg.netbsd.org/src-draft
cd src-draft

vi .hg/hgrc
[extensions]
topic=

doas pkgin in py311-hg-evolve
hg up wifi

./build.sh -U -O obj/ -j2 -m amd64 tools
./build.sh -U -m amd64 -V MKRUMP=no -V MKKMOD=no sets

and this is the error message

===> build.sh command:    ./build.sh -U -m amd64 -V MKRUMP=no -V MKKMOD=no sets
===> build.sh started:    Sat Sep 14 08:17:31 CDT 2024
===> NetBSD version:      10.99.11
===> MACHINE:             amd64
===> MACHINE_ARCH:        x86_64
===> Build platform:      NetBSD 10.0 amd64
===> HOST_SH:             /bin/sh
===> share/mk MAKECONF:   /etc/mk.conf
===> MAKECONF file:       /etc/mk.conf (File not found)
===> TOOLDIR path:        /usr/src-draft/obj/tooldir.NetBSD-10.0-amd64
===> DESTDIR path:        /usr/src-draft/obj/destdir.amd64
===> RELEASEDIR path:     /usr/src-draft/obj/releasedir
===> Updated makewrapper: /usr/src-draft/obj/tooldir.NetBSD-10.0-amd64/bin/nbmake-amd64
===> Building sets from pre-populated /usr/src-draft/obj/destdir.amd64
sets ===> distrib/sets
nbmake[1]: don't know how to make /usr/src-draft/obj/destdir.amd64/METALOG. Stop

nbmake[1]: stopped making "sets" in /usr/src-draft/distrib/sets

*** Failed target:  sets
*** Failed command: _makedirtarget() { dir="$1"; shift; target="$1"; shift; case "${dir}" in /*) this="${dir}/"; real="${dir}" ;; .) this=""; real="/usr/src-draft" ;; *) this="${dir}/"; real="/usr/src-draft/${dir}" ;; esac; show=${this:-.}; echo "${target} ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" && /usr/src-draft/obj/tooldir.NetBSD-10.0-amd64/bin/nbmake _THISDIR_="${this}" "$@" ${target}; }; _makedirtarget distrib/sets sets
*** Error code 2

Stop.
nbmake: stopped making "sets" in /usr/src-draft

ERROR: Failed to make sets

*** BUILD ABORTED ***
  • rvp replied to this.

    feurry As the error message indicates,

    ===> Building sets from pre-populated /usr/src-draft/obj/destdir.amd64

    you need $DESTDIR to already be populated--either using release or distribution, I imagine; but, the wiki page also says that "At this point a full build will not work"... so, email martin@, see if he's got more precise build instructions.

      rvp Thank you. I thought I was building the sets, and missed that pre-populated part of the error. I would have never thought I needed sets to build sets. I will reach out as you suggested.

      I read the "full build will not work" to mean the kernel part and all the wifi drivers. So I just have to disable the non-working ones. I see that iwm was updated, and that's the one I'm hoping to test.

      I cantacted martin@ and he is in the middle of rebasing it with HEAD to fix some issues preventing the build. Waiting a couple days for that to be resolved, and I'll try again.

      I finally compiled and installed everything, but iwm0 and urtwn0 both crash my system.

      Continuing from hg up wifi

      Create kernel config to exclude drivers. Pulled straight from the Wiki, but I didn't use these lines.

      options     DEBUG       # expensive debugging checks/support
      options     LOCKDEBUG   # expensive locking checks/support

      So mine looked like this

      vi sys/arch/amd64/conf/GENERIC.local
      no an*
      no ath*
      no athn*
      no atw*
      no awi*
      no bwi*
      no bwfm*
      no iwi*
      no malo*
      no ral*
      no rtw*
      no wi*
      no wpi*
      no atu*
      no otus*
      no rum*
      no upgt*
      no ural*
      no urtw*
      no zyd*
      
      # options       URTWN_DEBUG # debug the urtwn driver
      options     IWM_DEBUG   # debug the iwm driver
      options     IWN_DEBUG   # debug the iwn driver
      options     RTWN_DEBUG  # debug the rtwn driver
      options     IEEE80211_DEBUG # debug 802.11 code
      options     KERNHIST    # allow debug output to go to a kernhist(9)

      compile the sets and kernel. I don't think I needed the obj/ part, but it worked.
      In the /usr/src-draft dir

      ./build.sh -U -u -O obj/ -j4 -m amd64 -V MKRUMP=no -V MKKMOD=no distsets
      ./build.sh -U -u -O obj/ -j4 -m amd64 -V MKRUMP=no -V MKKMOD=no kernel=GENERIC

      install kernel and upgrade with sysinst

      doas mv /netbsd /netbsd.old
      cd obj/sys/arch/amd64/compile/GENERIC/
      doas cp netbsd /netbsd
      shutdown -r now

      next boot

      su
      sysinst
      • followed the upgrade procedure and selected custom sets
        • unselect everything kernel related
        • unselect X11
        • selected everything else
      • set the "base directory" for the sets
        • base dir = /usr/src-draft/obj/releasedir

      When sysinst finished, I rebooted and ran etcupdate -s /usr/src-draft

      Rebooted again and tried to use the new wifi.

      sysctl net.wlan
      net.wlan.debug = 0
      net.wlan.debug_console = 0
      net.wlan.devices = iwm0
      
      doas ifconfig wlan0 create wlandev iwm0

      It gives a fatal error loading firmware

      doas ifconfig wlan0 up
      doas ifconfig wlan0 list scan
      ifconfig: SIOCS80211: Operation now in progress

      but there's no output, as I would expect from the fatal firmware error

      I also have the urtwn0, so I tried it. It loads without complaint, but crashes the system a few seconds later.

      I'm pretty happy I was able to get this to build and run. Hopefully if anyone else wants to try, this post might help clarify some steps, and give an idea what to expect.

      I don't know what I did, but I got urtwn0 working. This computer only has 1 working usb-c port left and I've had issues with peripherals and NetBSD before, so I played with it a bit more and was able to get urtwn0 to work!

      I booted up with nothing attached, and then connected my dock and the urtwn0 wifi adapter.

      doas ifconfig wlan0 create wlandev urtwn0
      doas ifconfig wlan0 list scan
          got some scan results

      I had wpa_suppicant disabled, so I turned that back on doas service wpa_supplicant onestart and dhcpcd automatically picked up an address.

      speedtest-cli
      Retrieving speedtest.net configuration...
      Testing from AT&T Internet (108.65.148.157)...
      Retrieving speedtest.net server list...
      Selecting best server based on ping...
      Hosted by Dish Wireless (Dallas, TX) [353.59 km]: 29.23 ms
      Testing download speed................................................................................
      Download: 10.89 Mbit/s
      Testing upload speed......................................................................................................
      Upload: 23.05 Mbit/s

      ran it 1 more time

      speedtest-cli
      Retrieving speedtest.net configuration...
      Testing from AT&T Internet (108.65.148.157)...
      Retrieving speedtest.net server list...
      Selecting best server based on ping...
      Hosted by Peoples (Quitman, TX) [330.89 km]: 16.436 ms
      Testing download speed................................................................................
      Download: 13.84 Mbit/s
      Testing upload speed......................................................................................................
      Upload: 12.91 Mbit/s

      Not blazing fast internet, but pretty good for this device, as I was getting 6-8 Mbit before on NetBSD. That 23Mbit upload was as fast as I've got on linux before.

      For context, the wifi is connected to an AC mesh on a gigabit connection.

      12 days later

      This is a really good step-by-step manual. Thank you, I will also try

      • Jay likes this.