ironic deploy initramf生成
30 # on RHEL pci.ids is locate on /usr/share/hwdata/pci.ids. 31 sudo find . -xdev \ 32 -path './sys/*' -prune -o \ 33 -path './tmp/*' -prune -o \ 34 -path './boot/*' -prune -o \ 35 -path './root/.cache' -prune -o \ 36 -path './usr/include/*' -prune -o \ 37 -path './usr/lib/locale/*' -prune -o \ 38 -path './usr/share/doc/*' -prune -o \ 39 -path './usr/share/man/*' -prune -o \ 40 -path './usr/share/info/*' -prune -o \ 41 -path './usr/share/licenses/*' -prune -o \ 42 -path './usr/share/misc/m*' -prune -o \ 43 -path './usr/src/kernels/*' -prune -o \ 44 -path './var/cache/*' -prune -o \ 45 -name '*.pyc' -prune -o \ 46 -name '*.pyo' -prune -o \ 47 -print | sudo cpio -o -H newc | ${DIB_IPA_COMPRESS_CMD} > ${IMAGE_PATH}.initramfs 48 49 select_boot_kernel_initrd $TARGET_ROOT 50 sudo cp $BOOTDIR/$KERNEL ${IMAGE_PATH}.kernel 51 sudo chown $USER: ${IMAGE_PATH}.kernel
解压
Use the file
command on the initramfs/initrd to identify the compression format:
file /boot/initramfs-$(uname -r).img
The $(uname -r)
will use the file for the current kernel version. You may also specify a specific file, such as:
file /boot/initramfs-2.6.32-754.el6.x86_64.img
The most common is a gzip-format image which displays as:
# file /boot/initramfs-$(uname -r).img
/boot/initramfs-2.6.32-754.el6.x86_64.img: gzip compressed data
However, there may also be an XZ/LZMA-format image which displays as:
# file /boot/initramfs-$(uname -r).img
/boot/initramfs-2.6.32-754.el6.x86_64.img: LZMA compressed data
Select the appropriate instructions below to extract or repack the correct image type for your system.
gzip format - Extract / Uncompress
Uncompress and extract the contents of the image in the /boot/
directory:
zcat /boot/initrd-$(uname -r).img | cpio -idmv
gzip format - Repack / Recompress
Still in the working directory, find all files and add them to a new boot image file:
find . | cpio -o -c | gzip -9 > /boot/new.img
xz/LZMA format - Extract / Uncompress
Uncompress and extract the contents of the image in the /boot/
directory:
xz -dc < /boot/initrd-$(uname -r).img | cpio -idmv
xz/LZMA format - Repack / Recompress
Still in the working directory, find all files and add them to a new boot image file:
find . 2>/dev/null | cpio -c -o | xz -9 --format=lzma > /boot/new.img
1、 file命令查看centos8-deploy.initramfs格式
2、 zcat centos8-deploy.initramfs | cpio -idmv
3. chroot
1. Get Initrd.img from ISO mkdir /mnt/{image,work} mount -o loop RHEL6.5-server.x86_64.iso /mnt/image/ cp /mnt/image/isolinux/initrd.img /mnt/work 1 2 3 mkdir /mnt/{image,work} mount -o loop RHEL6.5-server.x86_64.iso /mnt/image/ cp /mnt/image/isolinux/initrd.img /mnt/work 2. Extract Initrd.img Before extract rename initrd.img to initrd.img.xz because its compressed with xz and will remove its extension and rename again with initrd.img cd /mnt/work mkdir initrd-new mv initrd.img initrd.img.xz xz --format=lzma initrd.img.xz –decompress cd initrd-new cpio -ivdum < ../initrd.img cd /mnt/work mkdir initrd-new mv initrd.img initrd.img.xz xz --format=lzma initrd.img.xz –decompress cd initrd-new cpio -ivdum < ../initrd.img 3. Copy Required Driver I will used already installed chelsio driver from chelsio script. We were using same directory tree, cp /lib/modules/2.6.32.431.el6.x86_64/updates/drivers/ /mnt/work/initrd-new/modules/2.6.32.431.el6.x86_64/updates/ 1 cp /lib/modules/2.6.32.431.el6.x86_64/updates/drivers/ /mnt/work/initrd-new/modules/2.6.32.431.el6.x86_64/updates/ 4. Update driver information from modules.* to initrd.img modules.* files. I will used chelsio driver information here and it can be different for you. You need to confirm which hardware driver you will used to insert in initrd.img and its information from modules.* files. cd /lib/modules/2.6.32.431.el6.x86_64/ egrep 'cxgb4|toecore|t4_tom' modules.symbols >> /mnt/work/initrd-new/modules/2.6.32-431.el6.x86_64/modules.symbols egrep 'cxgb4|toecore|t4_tom' modules.alias >> /mnt/work/initrd-new/modules/2.6.32-431.el6.x86_64/modules.alias egrep 'cxgb4|toecore|t4_tom' modules.dep >> /mnt/work/initrd-new/modules/2.6.32-431.el6.x86_64/modules.dep cd /lib/modules/2.6.32.431.el6.x86_64/ egrep 'cxgb4|toecore|t4_tom' modules.symbols >> /mnt/work/initrd-new/modules/2.6.32-431.el6.x86_64/modules.symbols egrep 'cxgb4|toecore|t4_tom' modules.alias >> /mnt/work/initrd-new/modules/2.6.32-431.el6.x86_64/modules.alias egrep 'cxgb4|toecore|t4_tom' modules.dep >> /mnt/work/initrd-new/modules/2.6.32-431.el6.x86_64/modules.dep 5. Generate modules.*.bin files inside initrd.img This will recreate all modules.*.bin files using required driver information using modules.* files. This required because without this initrd.img will unable to load newly inserted driver. chroot /mnt/work/initrd-new depmod -a -v exit chroot /mnt/work/initrd-new depmod -a -v exit 6. Generate updated Initrd.img cd /mnt/work/initrd-new find . -print |cpio -o -H newc | xz --format=lzma > ../initrd.img cd /mnt/work/initrd-new find . -print |cpio -o -H newc | xz --format=lzma > ../initrd.img Your initrd.img is ready and you can used this new initrd.img to replaced stock initrd.img to start kickstart installation or network boot.
查看文件系统
https://www.cnblogs.com/ssslinppp/p/5945537.html
原文地址:https://www.cnblogs.com/dream397/p/12706634.html
- poj----(1251)Jungle Roads(最小生成树)
- poj-------(2240)Arbitrage(最短路)
- MySQL在线DDL修改表结构的简单经验分享
- HDUOJ-----(1162)Eddy's picture(最小生成树)
- hduoj----1142A Walk Through the Forest(记忆化搜索+最短路)
- java设计之简单的JAVA计算器
- Java之线程———GUI线程(包含打字游戏和计时器俩个GUI实列)
- la----3695 City Game(最大子矩阵)
- poj------(3468)A Simple Problem with Integers(区间更新)
- hdu-------(1698)Just a Hook(线段树区间更新)
- NBitcoin:密码学第2部分
- gh-ost:在线DDL修改MySQL表结构工具
- poj-----(2828)Buy Tickets(线段树单点更新)
- javaSE之线程联合
- JavaScript 教程
- JavaScript 编辑工具
- JavaScript 与HTML
- JavaScript 与Java
- JavaScript 数据结构
- JavaScript 基本数据类型
- JavaScript 特殊数据类型
- JavaScript 运算符
- JavaScript typeof 运算符
- JavaScript 表达式
- JavaScript 类型转换
- JavaScript 基本语法
- JavaScript 注释
- Javascript 基本处理流程
- Javascript 选择结构
- Javascript if 语句
- Javascript if 语句的嵌套
- Javascript switch 语句
- Javascript 循环结构
- Javascript 循环结构实例
- Javascript 跳转语句
- Javascript 控制语句总结
- Javascript 函数介绍
- Javascript 函数的定义
- Javascript 函数调用
- Javascript 几种特殊的函数
- JavaScript 内置函数简介
- Javascript eval() 函数
- Javascript isFinite() 函数
- Javascript isNaN() 函数
- parseInt() 与 parseFloat()
- escape() 与 unescape()
- Javascript 字符串介绍
- Javascript length属性
- javascript 字符串函数
- Javascript 日期对象简介
- Javascript 日期对象用途
- Date 对象属性和方法
- Javascript 数组是什么
- Javascript 创建数组
- Javascript 数组赋值与取值
- Javascript 数组属性和方法
- MyBatis-事务管理
- HTML知识清单(附学习网站)
- CSS、CSS3知识点清单
- linux使用MAT分析dump文件
- RabbitMQ 自动创建队列/交换器/绑定
- SpringBoot 整合Shiro实现动态权限加载更新+Session共享+单点登录
- 又一个布局利器, CSS 伪类 :placeholder-shown
- 聊聊微前端的原理和实践
- javax.el.PropertyNotFoundException: Property 'XXX' not found on type xx.xx.xx.xx(实体类具体路径)
- java基础知识点总结
- Ajax详解(拓展:利用Ajax实现用户名的校验)
- Maven学习笔记
- com.alibaba.dubbo.remoting.TimeoutException: Waiting server-side response timeout 的解决
- 基于VSFTPD技术与KindEditor的简单案例
- Linux下安装JDK1.8、Tomcat、以及MySQL详细介绍(附软件分享)