Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. 支持读写initrdfs(cpio new format)内部文件. 例子,访问initrd.gz文件里面的文件内容(可以查看修改哦) 也可以利用这个来动态修改initrd的启动脚本实现一些特殊功能,当然了目前还是不能改变文件大小. map /inirtd.gz (rd) ls (rd)/ 2. initrd 多个文件时可以生成cpio new格式. initrd @name=FILE @name1=FILE1 如下例子可以通过[WIMBOOT](http://ipxe.org/wimboot)启动WIM文件 kernel /wimboot initrd @bcd=/boot/bcd @boot.sdi=/boot/boot.sdi @BOOTMGR=/boot/bootmgr @boot.wim=/boot/boot.wim
- Loading branch information
Showing
13 changed files
with
395 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#ifndef _CPIO_H | ||
#define _CPIO_H | ||
|
||
/** A CPIO archive header | ||
* | ||
* All field are hexadecimal ASCII numbers padded with '0' on the | ||
* left to the full width of the field. | ||
*/ | ||
struct cpio_header { | ||
char c_magic[6]; /** The string "070701" or "070702" */ | ||
char c_ino[8]; /** File inode number */ | ||
char c_mode[8]; /** File mode and permissions */ | ||
char c_uid[8]; /** File uid */ | ||
char c_gid[8]; /** File gid */ | ||
char c_nlink[8]; /** Number of links */ | ||
char c_mtime[8]; /** Modification time */ | ||
char c_filesize[8]; /** Size of data field */ | ||
char c_maj[8]; /** Major part of file device number */ | ||
char c_min[8]; /** Minor part of file device number */ | ||
char c_rmaj[8]; /** Major part of device node reference */ | ||
char c_rmin[8]; /** Minor part of device node reference */ | ||
char c_namesize[8]; /** Length of filename, including final NUL */ | ||
char c_chksum[8]; /** Checksum of data field if c_magic is 070702, othersize zero */ | ||
} __attribute__ (( packed )); | ||
|
||
/** CPIO magic */ | ||
#define CPIO_MAGIC "070701" | ||
#define CPIO_MODE_DIR 0040000 | ||
#define CPIO_ALIGN 4 | ||
static inline grub_u32_t cpio_image_align( grub_u32_t len ) | ||
{ | ||
return (len + (CPIO_ALIGN - 1)) & ~(CPIO_ALIGN - 1); | ||
} | ||
|
||
#endif /* _CPIO_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.