NanoBSD:图像中包含 ral 驱动程序固件的问题

NanoBSD:图像中包含 ral 驱动程序固件的问题

使用我当前的 NanoBSD 版本,我无法启动 ral0 接口。相反,我得到了以下内容:

...
rt2561sfw: could not load firmware image, error 2
ral0: rt2661_load_microcode: unable to retrieve firmware image rt2561sfw
ral0: rt2661_init_locked: could not load 8051 microcode, error 22

我发现我需要该设备的固件,我希望使用 nanobsd.conf 文件中的 ral 和 ralfw 模块来实现:

NANO_NAME="nano"

NANO_KERNEL=GENERIC
NANO_ARCH=i386
TARGET_ARCH=i386; export TARGET_ARCH
TARGET_CPUTYPE=i386; export TARGET_CPUTYPE
NO_CLEAN=YES
NANO_DRIVE=ad1

NANO_MEDIASIZE=1900000
NANO_CONFSIZE=40960
NANO_RAM_ETCSIZE=20480
NANO_RAM_TMPVARSIZE=102400
NANO_NEWFS="-m 0 -b 4096 -f 512 -i 8192 -O1"
# NANO_PMAKE="make -j 8"
NANO_PMAKE="${NANO_PMAKE} -DDB_FROM_SRC"
NANO_MODULES="pf pflog if_bridge bridgestp netgraph/netgraph netgraph/ether netgraph/pppoe netgraph/socket wlan wlan_xauth wlan_tkip wlan_ccmp wlan_wep wlan_rssadapt firmware amdtemp bios wlan_amrr ral ralfw"

# 0 -> Leave second image all zeroes so it compresses better.
# 1 -> Initialize second image with a copy of the first
NANO_INIT_IMG2=0


CONF_INSTALL='
WITHOUT_INSTALLLIB=yes
WITHOUT_TOOLCHAIN=yes
'

CONF_WORLD='
WITHOUT_ACCT=yes
WITHOUT_ACPI=yes
WITHOUT_AMD=yes
WITHOUT_APM=yes
WITHOUT_AT=yes
WITHOUT_ATM=yes
WITHOUT_AUDIT=yes
WITHOUT_AUTHPF=yes
WITHOUT_BLUETOOTH=yes
WITHOUT_CALENDAR=yes
WITHOUT_CDDL=yes
WITHOUT_CTM=yes
WITHOUT_CVS=yes
WITHOUT_DICT=yes
WITHOUT_EXAMPLES=yes
WITHOUT_FDT=yes
WITHOUT_FLOPPY=yes
WITHOUT_FREEBSD_UPDATE=yes
WITHOUT_GAMES=yes
WITHOUT_GCOV=yes
WITHOUT_GPIB=yes
WITHOUT_GPIO=yes
WITHOUT_INFO=yes
WITHOUT_IPFILTER=yes
WITHOUT_IPFW=yes
WITHOUT_IPX=yes
WITHOUT_JAIL=yes
WITHOUT_LOCALES=yes
WITHOUT_LOCATE=yes
WITHOUT_LPR=yes
WITHOUT_NDIS=yes
WITHOUT_NIS=yes
WITHOUT_NLS=yes
WITHOUT_NLS_CATALOGS=yes
WITHOUT_NS_CACHING=yes
WITHOUT_PC_SYSINSTALL=yes
WITHOUT_PORTSNAP=yes
WITHOUT_PROFILE=yes
WITHOUT_QUOTAS=yes
WITHOUT_RCMDS=yes
WITHOUT_RCS=yes
WITHOUT_ROUTED=yes
WITHOUT_SHAREDOCS=yes
WITHOUT_SOURCELESS=yes
WITHOUT_SYSINSTALL=yes
WITHOUT_USB=yes
WITHOUT_MAN=yes
WITHOUT_MAN_UTILS=yes
'

cust_local() {
        echo '
sshd_enable=YES
ifconfig_re0="DHCP"
' >>${NANO_WORLDDIR}/etc/rc.conf
}

customize_cmd cust_pkg
customize_cmd cust_comconsole
customize_cmd cust_install_files
customize_cmd cust_allow_ssh_root
customize_cmd cust_local

然而,这导致内核安装失败,更具体地说,我收到以下错误

===> ral (install)
install -o root -g wheel -m 555   if_ral.ko /usr/obj/nanobsd.nano//_.w/boot/kernel
install -o root -g wheel -m 555   if_ral.ko.symbols /usr/obj/nanobsd.nano//_.w/boot/kernel
===> ralfw (install)
===> ralfw/rt2561 (install)
install -o root -g wheel -m 555   rt2561fw.ko /usr/obj/nanobsd.nano//_.w/boot/kernel
install: rt2561fw.ko: No such file or directory
*** Error code 71

我在 Google 上搜索了一下,但没找到任何有用的东西。我猜这是基本的 FreeBSD 模块构建内容……但我没看到。

答案1

所有的资料都在那里等着我去阅读,所以我找到了这个有趣的条目/usr/src/sys/模块/Makefile

.if ${MK_SOURCELESS_UCODE} != "no"
_bce=           bce
_fatm=          fatm
_fxp=           fxp
_ispfw=         ispfw
_mwlfw=         mwlfw
_ralfw=         ralfw
_sf=            sf
_sn=            sn
_ti=            ti
_txp=           txp
.endif

它似乎控制着 ral 固件(和一堆其他固件)是否包含在内核中。(阅读文件的其余部分了解详细信息)。

因此我认为在 nanobsd.conf 中设置以下内容可以解决所有问题:

CONF_BUILD='
MK_SOURCELESS_UCODE=yes
'

奇怪的是,现在构建世界(不是构建内核!)失败了:

--- buildworld ---
make[1]: "/usr/src/share/mk/bsd.own.mk" line 457: MK_SOURCELESS_UCODE can't be set by a user.
*** [buildworld] Error code 1

值得单独开一个主题。

无论如何,当尝试时:

CONF_BUILD='
_ralfw=ralfw
'

事情似乎正如我所期望的那样发展。

我无法在相关设备上加载新图像,但这次安装日志显示拉尔夫正在安装的模块。

问题已经解决,但我仍然希望有人能对这一切有清晰的认识,并给出解释。

相关内容