在我目前的 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
我用谷歌搜尋了一下,但沒有找到任何有用的東西。我猜這是基本的 FreeBSD 模組建置內容......但我沒有看到它。
答案1
所有的源代碼都在那裡等待我簡單地閱讀它,所以我發現了這個有趣的條目/usr/src/sys/modules/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
'
事情似乎確實按照我想要的方式進行。
我無法在有問題的裝置上載入新映像,但這次安裝日誌顯示拉爾夫正在安裝模組。
問題已解決,但我仍然對對這一切有清晰看法的人的解釋感興趣。