Thayne Harbaugh
2004-Sep-16 15:31 UTC
[klibc] [PATCH] gen_init_cpio uses external file list
(Apologies to klibc@zytor.com for the re-send) This patch makes gen_init_cpio generate the initramfs_data.cpio from a file which contains a list of entries: file, dir, nod. I swapped the order of filename/location for the file arguments so that it would be more uniform with the dir and nod tyes. [thayne@torch linux-2.6.8]$ usr/gen_init_cpio --help ERROR: unable to open '--help': No such file or directory Usage: usr/gen_init_cpio <cpio_list> <cpio_list> is a file containing newline separated entries that describe the files to be included in the initramfs archive: file <name> <location> <mode> <uid> <gid> dir <name> <mode> <uid> <gid> nod <name> <mode> <uid> <gid> <dev_type> <maj> <min> <name> name of the file/dir/nod in the archive <location> location of the file in the current filesystem <mode> mode/permissions of the file <uid> user id (0=root) <gid> group id (0=root) <dev_type> device type (b=block, c=character) <maj> major number of nod <min> minor number of nod example: dir /dev 0755 0 0 nod /dev/console 0600 0 0 c 5 1 dir /root 0700 0 0 dir /sbin 0755 0 0 file /sbin/kinit /usr/src/klibc/kinit/kinit 0755 0 0 -------------- next part -------------- A non-text attachment was scrubbed... Name: cpio_list.patch Type: text/x-patch Size: 8770 bytes Desc: Url : http://www.zytor.com/pipermail/klibc/attachments/20040916/0afab5b4/cpio_list.bin
Jeff Garzik
2004-Sep-16 16:07 UTC
[klibc] Re: [PATCH] gen_init_cpio uses external file list
Seems OK to me... Jeff, the original gen_init_cpio author
Sam Ravnborg
2004-Sep-16 21:48 UTC
[klibc] Re: [PATCH] gen_init_cpio uses external file list
On Thu, Sep 16, 2004 at 04:11:12PM -0600, Thayne Harbaugh wrote:> > This patch makes gen_init_cpio generate the initramfs_data.cpio from a > file which contains a list of entries: file, dir, nod. I swapped the > order of filename/location for the file arguments so that it would be > more uniform with the dir and nod tyes.Comments already given on klibc list by others, but repeated for lkml readers. Helper programs like this shall be compatible with at least solaris & cygwin. Therefore the linux only stuff needs to be avoided. + char name[PATH_MAX + 1];> + unsigned int mode; > + uid_t uid; > + gid_t gid; > + int rc = -1; > + > + if (4 != sscanf(line, "%" str(PATH_MAX) "s %o %d %d", name, &mode, &uid, &gid)) { > + fprintf(stderr, "Unrecognized dir format '%s'", line); > + goto fail;Do we know that uid_t and gid_t equals an int here? Use an int in the sscanf and do explicit type conversion later.> + while (-1 != getline(&line, &line_sz, cpio_list)) { > + int type_idx;fgets() please. Sam
Martin Schlemmer [c]
2004-Sep-23 15:44 UTC
[klibc] gen_initramfs_list.sh (was: Re: [PATCH] gen_init_cpio uses external file list) [u]
Skipped content of type multipart/mixed-------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://www.zytor.com/pipermail/klibc/attachments/20040924/f4d21be4/attachment.bin
Possibly Parallel Threads
- [PATCH] gen_init_cpio processes file from a file list
- [WIP] rebuild initramfs when content changes
- [PATCH] kbuild: rebuild initramfs if included files changes
- Reason for gen_init_cpio instead of just cpio?
- [PATCH 2.5.69 3/3] Bandaids for gen_init_cpio and initramfs