Problem booting NanoBSD from USB flash drive

My new router has been running for a few hours! :D

Yesterday I was almost there. The only missing piece was being able to use UFS labels instead of drive names, so using "NANO_LABEL" instead of "NANO_DRIVE".
In my previous router, the USB drive was named "da0" and in the new one it is named "da1" (probably because of the SD card reader). So using a label is easier to mount it, even when changing hardware.

So, line 255, after the makefs for /cfg ( https://github.com/freebsd/freebsd-src/blob/main/tools/tools/nanobsd/embedded/common#L252-L257 ), I have added:
Bash:
    if [ -n "${NANO_LABEL}" ]; then
        #UFS label for the / partition
        MD=`mdconfig -a -t vnode -f ${NANO_OBJ}/_.${NANO_SLICE_ROOT}`
        tunefs -L ${NANO_LABEL}"${NANO_SLICE_ROOT}" /dev/${MD}
        mdconfig -d -u $MD

        #UFS label for the /cfg partition
        MD=`mdconfig -a -t vnode -f ${NANO_OBJ}/_.${NANO_SLICE_CFG}`
        tunefs -L ${NANO_LABEL}"${NANO_SLICE_CFG}" /dev/${MD}
        mdconfig -d -u $MD
    fi

I'm not sure it's the best way to do it, but at least it works in my case.

I still need to clean my code. I'll post patches on FreeBSD's bugtracker and will post the link here.




For those interested, my previous router was based on an Intel DN2800MT motherboard with integrated Atom N2800 CPU, no disk, 8GB RAM and a dual port gigabit ethernet card.
The power consumption was between 17.9W and 20W on 230V.

Now, with this new router with a Celeron N5105 CPU and four I226-V ethernet controllers, no disk, and 16GB RAM, the power consumption is between 11.6W and 22W on 230V. For safety reasons, I am not using the PSU which was included 😅
 
Back
Top