Chinaunix首页 | 论坛 | 博客
  • 博客访问: 238036
  • 博文数量: 68
  • 博客积分: 884
  • 博客等级: 准尉
  • 技术积分: 700
  • 用 户 组: 普通用户
  • 注册时间: 2010-04-25 14:34
文章分类

全部博文(68)

文章存档

2016年(3)

2015年(4)

2014年(9)

2013年(8)

2012年(6)

2011年(19)

2010年(19)

我的朋友

分类: LINUX

2011-11-20 17:20:48

In the last blog, i clarify the procedure of Linux generate vmlinuz-initrd, and why it impossible to extract ram rootfs from vmlinuz-initrd. But it's not mean that we could not modify the vmlinuz-initrd....

Here's some useful command, maybe could modify the vmlinuz-initrd , but i do not verify it :

From Wiki :

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Initramfs

This page describes how to inject a gzipped initramfs cpio file into vmlinux as section .init.ramfs:

Firs, turn the initramfs into an ELF binary, excluding everything but the file data:
$ objcopy -I binary -O elf32-i386 -B i386 --redefine-sym _binary_initramfs_start=.init.ramfs -N _binary_initramfs_end -N _binary_initramfs_size initramfs initramfs.elf

Note that the symbol names _binary_initramfs_{start,end,size} above depend on the input filename. objcopy does some translation so e.g. a period (.) in the filename becomes an underscore (_) in the symbol names. Then, remove any previous .init.ramfs section in vmlinuxand add the new one from initramfs.elf: 
$ objcopy -I elf32-i386 -O elf32-i386 -R .init.ramfs --add-section .init.ramfs=initramfs.elf vmlinux vmlinux.withnewinitramfs

Done! Please test using vmlinux.withnewinitramfs as payload with coreboot and let us know the result!

someone interesting in test it ?

阅读(1177) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~