Update a driver in an initrd file

更新SUSE Linux initrd中的e1000e驱动
本文介绍如何为SUSE Linux Enterprise Desktop 11 SP1中带有Sandybridge芯片组的机器更新e1000e网络驱动。通过创建包含最新驱动的initrd文件,实现通过网络进行AutoYaST安装和PXE引导。

Update a driver in an initrd file

Recently I found myself wanting to put SUSE Linux Enterprise Desktop 11 SP1 on to machine with a Sandybridge chipset. This was a problem as the e1000e driver in SLED 11 SP1 isn't new enough to support the network card in the machine. Having found an updated driver I still had the problem that I wanted to be able to do installations over the network with AutoYaST and PXE boot. That didn't work because the initrd file being used for PXE boot didn't have the new e1000e driver in. So the install failed almost immediately due to the absence of a network connection.

The solution is to make a new initrd file containing the new e1000e driver. It's far from obvious how to do this but I found the solution athttp://www.sharms.org/blog/2007/11/howto-add-updated-e1000-driver-to-sled-10-sp1/ This post is basically just me duplicating the information because you can never have such information in too many places. Also I've expanded it a little bit to include instructions on how to do some bits that I had to work out. You can of course adapt the following for whatever module you might find the need to update.

First of all, make a new directory and unpack the current initrd in to it

$ mkdir -p updated_initrd/initrd_unpack
$ cd updated_initrd/initrd_unpack
$ gunzip -dc /path/to/initrd | cpio -idmuv

Now get the new version of the e1000e module. I found this in an rpm on Novell's website which I needed to download and unpack to get the driver out of it.

$ cd ..
$ wget http://drivers.suse.com/driver-process/pub/update/Intel/sle11sp1/common/i586/intel-e1000e-kmp-pae-1.2.20_2.6.32.12_0.7-1.i586.rpm
$ mkdir rpmcontents
$ cd rpmcontents
$ rpm2cpio ../intel-e1000e-kmp-pae-1.2.20_2.6.32.12_0.7-1.i586.rpm | cpio -idv

Next copy the new driver over in to where you unpacked the initrd

$ cp lib/modules/2.6.32.12-0.7-pae/updates/e1000e.ko ../initrd_unpack/modules/
cp: overwrite `../initrd/modules/e1000e.ko'? y

Now you need to update files called modules.alias and modules.pcimap using information that you get from the depmod command. You can get the information to put in modules.alias with

$ /sbin/depmod -n $(pwd)/lib/modules/2.6.32.12-0.7-pae/updates/e1000e.ko | grep ^alias > /tmp/newaliases

Then I made a copy of the modules.alias file with the information for e1000e removed from it

$ grep  -v ' e1000e$' ../initrd_unpack/lib/modules/2.6.32.12-0.7-default/modules.alias > /tmp/modules.alias

Add the new information to that file

$ cat  /tmp/newaliases >>  /tmp/modules.alias

And then replace the original file

$ cp /tmp/modules.alias  ../initrd_unpack/lib/modules/2.6.32.12-0.7-default/modules.alias
cp: overwrite `../initrd_unpack/lib/modules/2.6.32.12-0.7-default/modules.alias'? y

The process is the same for the modules.pcimap file

$ /sbin/depmod -n $(pwd)/lib/modules/2.6.32.12-0.7-pae/updates/e1000e.ko | grep '^e1000e ' > /tmp/newpcimap
$ grep -v '^e1000e ' ../initrd_unpack/lib/modules/2.6.32.12-0.7-default/modules.pcimap > /tmp/modules.pcimap
$ cat /tmp/newpcimap >> /tmp/modules.pcimap
$ cp /tmp/modules.pcimap ../initrd_unpack/lib/modules/2.6.32.12-0.7-default/modules.pcimap
cp: overwrite `../initrd_unpack/lib/modules/2.6.32.12-0.7-default/modules.pcimap'? y

Finally, make the new initrd file

$ cd ../initrd_unpack
$ find . | cpio --quiet -o -H newc > ../initrd
$ cd ..
$ gzip -v9c initrd > initrd.gz
$ mv initrd.gz initrd
mv: overwrite `initrd'? y
$ file initrd
initrd: gzip compressed data, was "initrd", from Unix, last modified: Wed Jun 29 12:31:49 2011, max compression
帮我分析报错:2 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Setting up nvidia-dkms-550 (550.120-0ubuntu0.22.04.1) ... update-initramfs: deferring update (trigger activated) INFO:Enable nvidia DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/lenovo_thinkpad DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/put_your_quirks_here DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/dell_latitude Removing old nvidia-550.120 DKMS files... Deleting module nvidia-550.120 completely from the DKMS tree. Loading new nvidia-550.120 DKMS files... Building for 6.8.0-40-generic Building for architecture x86_64 Building initial module for 6.8.0-40-generic ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/nvidia-kernel-source-550.0.crash' Error! Bad return status for module build on kernel: 6.8.0-40-generic (x86_64) Consult /var/lib/dkms/nvidia/550.120/build/make.log for more information. dpkg: error processing package nvidia-dkms-550 (--configure): installed nvidia-dkms-550 package post-installation script subprocess returned error exit status 10 dpkg: dependency problems prevent configuration of nvidia-driver-550: nvidia-driver-550 depends on nvidia-dkms-550 (<= 550.120-1); however: Package nvidia-dkms-550 is not configured yet. nvidia-driver-550 depends on nvidia-dkms-550 (>= 550.120); however: Package nvidia-dkms-550 is not configured yet. dpkg: error processing package nvidia-driver-550 (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure. Processing triggers for initramfs-tools (0.140ubuntu13.4) ... update-initramfs: Generating /boot/initrd.img-6.8.0-40-generic Errors were encountered while processing: nvidia-dkms-550 nvidia-driver-550 E: Sub-process /usr/bin/dpkg returned an error code (1)
03-10
Failed command: 'make' -j20 KERNEL_UNAME=6.8.0-87-generic IGNORE_CC_MISMATCH=1 SYSSRC=/lib/modules/6.8.0-87-generic/build LD=/usr/bin/ld.bfd CONFIG_X86_KERNEL_IBT= modules ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/nvidia-kernel-source-575.0.crash' Error! Bad return status for module build on kernel: 6.8.0-87-generic (x86_64) Consult /var/lib/dkms/nvidia/575.57.08/build/make.log for more information. dpkg: 处理软件包 nvidia-dkms-575 (--configure)时出错: 已安装 nvidia-dkms-575 软件包 post-installation 脚本 子进程返回错误状态 10 dpkg: 依赖关系问题使得 nvidia-driver-575 的配置工作不能继续: nvidia-driver-575 依赖于 nvidia-dkms-575 (= 575.57.08-0ubuntu1);然而: 软件包 nvidia-dkms-575 尚未配置。 dpkg: 处理软件包 nvidia-driver-575 (--configure)时出错: 依赖关系问题 - 仍未被配置 dpkg: 依赖关系问题使得 cuda-drivers-575 的配置工作不能继续: cuda-drivers-575 依赖于 nvidia-driver-575 (>= 575.57.08) | nvidia-driver-575-open (>= 575.57.08) | nvidia-driver-575-server (>= 575.57.08) | nvidia-driver-575-server-open (>= 575.57.08);然而: 软件包 nvidia-driver-575 尚未配置。 未安装软件包 nvidia-driver-575-open。 未安装软件包 nvidia-driver-575-server。 未安装软件包 nvidia-driver-575-server-open。 dpkg: 处理软件包 cuda-drivers-575 (--configure)时出错: 依赖关系问题 - 仍未被配置 dpkg: 依赖关系问题使得 cuda-drivers 的配置工作不能继续: cuda-drivers 依赖于 cuda-drivers-575 (=因为错误消息指示这是由于上一个问题导致的错误,没有写入 apport 报告。 因为错误消息指示这是由于上一个问题导致的错误,没有写入 apport 报告。 由于已经达到 MaxReports 限制,没有写入 apport 报告。 575.57.08-0ubuntu1);然而: 软件包 cuda-drivers-575 尚未配置。 dpkg: 处理软件包 cuda-drivers (--configure)时出错: 依赖关系问题 - 仍未被配置 正在处理用于 initramfs-tools (0.140ubuntu13.5) 的触发器 ... update-initramfs: Generating /boot/initrd.img-6.8.0-87-generic I: The initramfs will attempt to resume from /dev/nvme0n1p8 I: (UUID=863d50f2-473a-4289-821e-826609df855c) I: Set the RESUME variable to override this. 在处理时有错误发生: nvidia-dkms-575 nvidia-driver-575 cuda-drivers-575 cuda-drivers E: Sub-process /usr/bin/dpkg returned an error code (1)
11-14
【直流微电网】径向直流微电网的状态空间建模与线性化:一种耦合DC-DC变换器状态空间平均模型的方法 (Matlab代码实现)内容概要:本文介绍了径向直流微电网的状态空间建模与线性化方法,重点提出了一种基于耦合DC-DC变换器状态空间平均模型的建模策略。该方法通过对系统中多个相互耦合的DC-DC变换器进行统一建模,构建出整个微电网的集中状态空间模型,并在此基础上实施线性化处理,便于后续的小信号分析与稳定性研究。文中详细阐述了建模过程中的关键步骤,包括电路拓扑分析、状态变量选取、平均化处理以及雅可比矩阵的推导,最终通过Matlab代码实现模型仿真验证,展示了该方法在动态响应分析和控制器设计中的有效性。; 适合人群:具备电力电子、自动控制理论基础,熟悉Matlab/Simulink仿真工具,从事微电网、新能源系统建模与控制研究的研究生、科研人员及工程技术人员。; 使用场景及目标:①掌握直流微电网中多变换器系统的统一建模方法;②理解状态空间平均法在非线性电力电子系统中的应用;③实现系统线性化并用于稳定性分析与控制器设计;④通过Matlab代码复现和扩展模型,服务于科研仿真与教学实践。; 阅读建议:建议读者结合Matlab代码逐步理解建模流程,重点关注状态变量的选择与平均化处理的数学推导,同时可尝试修改系统参数或拓扑结构以加深对模型通用性和适应性的理解。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值