尝试为 dahdi 构建 RPM 导致目标计算机上启动失败

尝试为 dahdi 构建 RPM 导致目标计算机上启动失败

我正在尝试为 Centos 7 构建一个 rpm,以便能够在目标计算机上安装 dahdi,而不需要构建工具。

为此,我尝试创建此规格文件:

Name:           dahdi-linux-complete
Version:        3.1.0+3.1.0
Release:        1%{?dist}
Summary:        DAHDI Linux Asterisk kernel modules

License:        GPL
URL:            http://downloads.digium.com/pub/telephony/dahdi-linux-complete/
Source0:        $RPM_SOURCE_DIR/dahdi-linux-complete-3.1.0+3.1.0.tar.gz

BuildRequires:  kernel-headers = 3.10.0-1127.8.2.el7, kernel-devel = 3.10.0-1127.8.2.el7 
Requires:       kernel = 3.10.0-1127.8.2.el7

%description
Kernel modules to use with the Asterisk telephony server.

%prep
%setup -q

%build
make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
%make_install
make install-config

%files
%defattr(-,root,root,-)
%doc
/etc/bash_completion.d/dahdi
/etc/dahdi/assigned-spans.conf.sample
/etc/dahdi/modules.sample
/etc/dahdi/span-types.conf.sample
/etc/dahdi/system.conf.sample
/etc/udev/rules.d/dahdi.rules
/etc/udev/rules.d/xpp.rules
/lib/firmware/.dahdi-fw-a4a-a0017
/lib/firmware/.dahdi-fw-a4b-d001e
/lib/firmware/.dahdi-fw-a8a-1d0017
/lib/firmware/.dahdi-fw-a8b-1f001e
/lib/firmware/.dahdi-fw-hx8-2.06
/lib/firmware/.dahdi-fw-oct6114-032-1.05.01
/lib/firmware/.dahdi-fw-oct6114-064-1.05.01
/lib/firmware/.dahdi-fw-oct6114-128-1.05.01
/lib/firmware/.dahdi-fw-oct6114-256-1.05.01
/lib/firmware/.dahdi-fw-tc400m-MR6.12
/lib/firmware/.dahdi-fw-te133-7a001e
/lib/firmware/.dahdi-fw-te134-780017
/lib/firmware/.dahdi-fw-te435-13001e
/lib/firmware/.dahdi-fw-te436-10017
/lib/firmware/.dahdi-fw-te820-1.76
/lib/firmware/.dahdi-fw-vpmoct032-1.12.0
/lib/firmware/dahdi-fw-a4a.bin
/lib/firmware/dahdi-fw-a4b.bin
/lib/firmware/dahdi-fw-a8a.bin
/lib/firmware/dahdi-fw-a8b.bin
/lib/firmware/dahdi-fw-hx8.bin
/lib/firmware/dahdi-fw-oct6114-032.bin
/lib/firmware/dahdi-fw-oct6114-064.bin
/lib/firmware/dahdi-fw-oct6114-128.bin
/lib/firmware/dahdi-fw-oct6114-256.bin
/lib/firmware/dahdi-fw-tc400m.bin
/lib/firmware/dahdi-fw-te133.bin
/lib/firmware/dahdi-fw-te134.bin
/lib/firmware/dahdi-fw-te435.bin
/lib/firmware/dahdi-fw-te436.bin
/lib/firmware/dahdi-fw-te820.bin
/lib/firmware/dahdi-fw-vpmoct032.bin
/lib/modules/3.10.0-1127.8.2.el7.x86_64/dahdi/dahdi.ko
/lib/modules/3.10.0-1127.8.2.el7.x86_64/dahdi/dahdi_dynamic.ko
/lib/modules/3.10.0-1127.8.2.el7.x86_64/dahdi/dahdi_dynamic_eth.ko
/lib/modules/3.10.0-1127.8.2.el7.x86_64/dahdi/dahdi_dynamic_ethmf.ko
/lib/modules/3.10.0-1127.8.2.el7.x86_64/dahdi/dahdi_dynamic_loc.ko
/lib/modules/3.10.0-1127.8.2.el7.x86_64/dahdi/dahdi_echocan_jpah.ko
/lib/modules/3.10.0-1127.8.2.el7.x86_64/dahdi/dahdi_echocan_kb1.ko
/lib/modules/3.10.0-1127.8.2.el7.x86_64/dahdi/dahdi_echocan_mg2.ko
/lib/modules/3.10.0-1127.8.2.el7.x86_64/dahdi/dahdi_echocan_sec.ko
/lib/modules/3.10.0-1127.8.2.el7.x86_64/dahdi/dahdi_echocan_sec2.ko
/lib/modules/3.10.0-1127.8.2.el7.x86_64/dahdi/dahdi_transcode.ko
/lib/modules/3.10.0-1127.8.2.el7.x86_64/dahdi/dahdi_vpmadt032_loader.ko
/lib/modules/3.10.0-1127.8.2.el7.x86_64/dahdi/oct612x/oct612x.ko
/lib/modules/3.10.0-1127.8.2.el7.x86_64/dahdi/voicebus/dahdi_voicebus.ko
/lib/modules/3.10.0-1127.8.2.el7.x86_64/dahdi/wcaxx.ko
/lib/modules/3.10.0-1127.8.2.el7.x86_64/dahdi/wcb4xxp/wcb4xxp.ko
/lib/modules/3.10.0-1127.8.2.el7.x86_64/dahdi/wct4xxp/wct4xxp.ko
/lib/modules/3.10.0-1127.8.2.el7.x86_64/dahdi/wctc4xxp/wctc4xxp.ko
/lib/modules/3.10.0-1127.8.2.el7.x86_64/dahdi/wctdm24xxp/wctdm24xxp.ko
/lib/modules/3.10.0-1127.8.2.el7.x86_64/dahdi/wcte13xp.ko
/lib/modules/3.10.0-1127.8.2.el7.x86_64/dahdi/wcte43x.ko
/lib/modules/3.10.0-1127.8.2.el7.x86_64/dahdi/xpp/xpd_bri.ko
/lib/modules/3.10.0-1127.8.2.el7.x86_64/dahdi/xpp/xpd_echo.ko
/lib/modules/3.10.0-1127.8.2.el7.x86_64/dahdi/xpp/xpd_fxo.ko
/lib/modules/3.10.0-1127.8.2.el7.x86_64/dahdi/xpp/xpd_fxs.ko
/lib/modules/3.10.0-1127.8.2.el7.x86_64/dahdi/xpp/xpd_pri.ko
/lib/modules/3.10.0-1127.8.2.el7.x86_64/dahdi/xpp/xpp.ko
/lib/modules/3.10.0-1127.8.2.el7.x86_64/dahdi/xpp/xpp_usb.ko
/lib/modules/3.10.0-1127.8.2.el7.x86_64/modules.alias
/lib/modules/3.10.0-1127.8.2.el7.x86_64/modules.alias.bin
/lib/modules/3.10.0-1127.8.2.el7.x86_64/modules.builtin.bin
/lib/modules/3.10.0-1127.8.2.el7.x86_64/modules.dep
/lib/modules/3.10.0-1127.8.2.el7.x86_64/modules.dep.bin
/lib/modules/3.10.0-1127.8.2.el7.x86_64/modules.devname
/lib/modules/3.10.0-1127.8.2.el7.x86_64/modules.softdep
/lib/modules/3.10.0-1127.8.2.el7.x86_64/modules.symbols
/lib/modules/3.10.0-1127.8.2.el7.x86_64/modules.symbols.bin
/usr/include/dahdi/dahdi_config.h
/usr/include/dahdi/fasthdlc.h
/usr/include/dahdi/kernel.h
/usr/include/dahdi/tonezone.h
/usr/include/dahdi/user.h
/usr/include/dahdi/wctdm_user.h
/usr/lib/dracut/dracut.conf.d/50-dahdi.conf
/usr/lib/libtonezone.a
/usr/lib/libtonezone.la
/usr/lib/libtonezone.so
/usr/lib/libtonezone.so.2
/usr/lib/libtonezone.so.2.0
/usr/lib/libtonezone.so.2.0.0
/usr/local/share/perl5/Dahdi.pm
/usr/local/share/perl5/Dahdi/Chans.pm
/usr/local/share/perl5/Dahdi/Config/Gen.pm
/usr/local/share/perl5/Dahdi/Config/Gen/Assignedspans.pm
/usr/local/share/perl5/Dahdi/Config/Gen/Chandahdi.pm
/usr/local/share/perl5/Dahdi/Config/Gen/Freepbxdb.pm
/usr/local/share/perl5/Dahdi/Config/Gen/Modules.pm
/usr/local/share/perl5/Dahdi/Config/Gen/Spantypes.pm
/usr/local/share/perl5/Dahdi/Config/Gen/System.pm
/usr/local/share/perl5/Dahdi/Config/Gen/Unicall.pm
/usr/local/share/perl5/Dahdi/Config/Gen/Users.pm
/usr/local/share/perl5/Dahdi/Config/Gen/Xpporder.pm
/usr/local/share/perl5/Dahdi/Config/Params.pm
/usr/local/share/perl5/Dahdi/Hardware.pm
/usr/local/share/perl5/Dahdi/Hardware/PCI.pm
/usr/local/share/perl5/Dahdi/Hardware/USB.pm
/usr/local/share/perl5/Dahdi/Span.pm
/usr/local/share/perl5/Dahdi/Utils.pm
/usr/local/share/perl5/Dahdi/Xpp.pm
/usr/local/share/perl5/Dahdi/Xpp/Line.pm
/usr/local/share/perl5/Dahdi/Xpp/Mpp.pm
/usr/local/share/perl5/Dahdi/Xpp/Xbus.pm
/usr/local/share/perl5/Dahdi/Xpp/Xpd.pm
/usr/sbin/dahdi_cfg
/usr/sbin/dahdi_genconf
/usr/sbin/dahdi_hardware
/usr/sbin/dahdi_maint
/usr/sbin/dahdi_monitor
/usr/sbin/dahdi_registration
/usr/sbin/dahdi_scan
/usr/sbin/dahdi_span_assignments
/usr/sbin/dahdi_span_types
/usr/sbin/dahdi_speed
/usr/sbin/dahdi_test
/usr/sbin/dahdi_waitfor_span_assignments
/usr/sbin/fxotune
/usr/sbin/lsdahdi
/usr/sbin/sethdlc
/usr/sbin/twinstar
/usr/sbin/xpp_blink
/usr/sbin/xpp_sync
/usr/share/dahdi/FPGA_1141.hex
/usr/share/dahdi/FPGA_1151.hex
/usr/share/dahdi/FPGA_1161.201.hex
/usr/share/dahdi/FPGA_1161.202.hex
/usr/share/dahdi/FPGA_1161.203.hex
/usr/share/dahdi/FPGA_1161.hex
/usr/share/dahdi/FPGA_FXS.hex
/usr/share/dahdi/PIC_TYPE_1.hex
/usr/share/dahdi/PIC_TYPE_2.hex
/usr/share/dahdi/PIC_TYPE_3.hex
/usr/share/dahdi/PIC_TYPE_4.hex
/usr/share/dahdi/PIC_TYPE_6.hex
/usr/share/dahdi/USB_FW.201.hex
/usr/share/dahdi/USB_FW.202.hex
/usr/share/dahdi/USB_FW.203.hex
/usr/share/dahdi/USB_FW.hex
/usr/share/dahdi/USB_RECOV.hex
/usr/share/dahdi/XppConfig.pm
/usr/share/dahdi/astribank_hook
/usr/share/dahdi/dahdi_auto_assign_compat
/usr/share/dahdi/dahdi_handle_device
/usr/share/dahdi/dahdi_span_config
/usr/share/dahdi/handle_device.d/10-span-types
/usr/share/dahdi/handle_device.d/20-span-assignments
/usr/share/dahdi/init_card_1_30
/usr/share/dahdi/init_card_2_30
/usr/share/dahdi/init_card_3_30
/usr/share/dahdi/init_card_4_30
/usr/share/dahdi/init_card_5_30
/usr/share/dahdi/init_card_6_30
/usr/share/dahdi/span_config.d/10-dahdi-cfg
/usr/share/dahdi/span_config.d/20-fxotune
/usr/share/dahdi/span_config.d/50-asterisk
/usr/share/dahdi/waitfor_xpds
/usr/share/dahdi/xpp_fxloader
/usr/share/man/man8/dahdi_cfg.8.gz
/usr/share/man/man8/dahdi_genconf.8.gz
/usr/share/man/man8/dahdi_hardware.8.gz
/usr/share/man/man8/dahdi_maint.8.gz
/usr/share/man/man8/dahdi_monitor.8.gz
/usr/share/man/man8/dahdi_registration.8.gz
/usr/share/man/man8/dahdi_scan.8.gz
/usr/share/man/man8/dahdi_span_assignments.8.gz
/usr/share/man/man8/dahdi_span_types.8.gz
/usr/share/man/man8/dahdi_test.8.gz
/usr/share/man/man8/dahdi_tool.8.gz
/usr/share/man/man8/dahdi_waitfor_span_assignments.8.gz
/usr/share/man/man8/fxotune.8.gz
/usr/share/man/man8/lsdahdi.8.gz
/usr/share/man/man8/twinstar.8.gz
/usr/share/man/man8/xpp_blink.8.gz
/usr/share/man/man8/xpp_sync.8.gz


%changelog

到目前为止,它似乎按预期工作,但是我安装生成的 rpm 的机器将在启动时失败,systemd 在安装 efi 分区时失败,因为它找不到 vfat 驱动程序。

也许我需要执行 dracut 操作作为安装后挂钩。但我不太确定这就是我需要做的,而且我不知道该怎么做。

更新 :

似乎提供以下文件之一:

/lib/modules/3.10.0-1127.8.2.el7.x86_64/modules.alias
/lib/modules/3.10.0-1127.8.2.el7.x86_64/modules.alias.bin
/lib/modules/3.10.0-1127.8.2.el7.x86_64/modules.builtin.bin
/lib/modules/3.10.0-1127.8.2.el7.x86_64/modules.dep
/lib/modules/3.10.0-1127.8.2.el7.x86_64/modules.dep.bin
/lib/modules/3.10.0-1127.8.2.el7.x86_64/modules.devname
/lib/modules/3.10.0-1127.8.2.el7.x86_64/modules.softdep
/lib/modules/3.10.0-1127.8.2.el7.x86_64/modules.symbols
/lib/modules/3.10.0-1127.8.2.el7.x86_64/modules.symbols.bin

导致内核无法加载。为了进行测试,我保存了这些文件,并在安装 rpm 后恢复它们,这次内核加载正确,但未加载 dahdi 驱动程序。

所以看来我必须在 rpm 的后挂钩脚本中“修补”它们,而不是覆盖这些文件?

相关内容