Age | Commit message (Collapse) | Author | Files | Lines |
|
This patch makes several tweaks so that an initramfs image can be
completely created by an unprivileged user. It should maintain
compatibility with previous initramfs early userspace cpio/image creation
and it updates documentation.
There are a few very important tweaks:
CONFIG_INITRAMFS_SOURCE is now either a single cpio archive that is
directly used or a list of directories and files for building a cpio
archive for the initramfs image. Making the cpio archive listable in
CONFIG_INITRAMFS_SOURCE makes the cpio step more official and automated so
that it doesn't have to be copied by hand to usr/initramfs_data.cpio (I
think this was broken anyway and would be overwritten). The alternative
list of directories *and* files means that files can be install in a "root"
directory and device-special files can be listed in a file list.
CONFIG_ROOT_UID and CONFIG_ROOT_GID are now available for doing simple
user/group ID translation. That means that user ID 500, group ID 500 can
create all the files in the "root" directory, but that they can all be
owned by user ID 0, group ID 0 in the cpio image.
Various documentation updates to pull it all together.
Removal of old cruft that was unused/misleading.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
This patch makes gen_init_cpio more complete by adding symlink, pipe and
socket support. It updates scripts/gen_initramfs_list.sh to support the
new types. The patch applies to the recent mm series that already have the
updated gen_init_cpio and gen_initramfs_list.sh.
From: William Lee Irwin III <wli@holomorphy.com>
The rest of gen_init_cpio.c seems to cast the result of strlen() to handle
this situation, so this patch follows suit while killing off size_t -related
printk() warnings.
Signed-off-by: William Irwin <wli@holomorphy.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Moving logic to scripts/gen_initramfs_list.sh make a nice cleanup in
usr/Makefile.
A new initramfs image will be generated if the initramfs_list file changes.
This patch also fixes the bug with make O=..
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
|
|
Attached is a patch that adds CONFIG_INITRAMFS_SOURCE, enabling you to
either specify a file as cpio_list, or a directory to generate a list from.
It depreciate the INITRAMFS_LIST environment variable introduced not long
ago.
There are some issues (suggestions/patches welcome) that I am not
sure about:
1) I put the menu entry under block devices, but I am not sure if
this is the correct location?
2) There might be a better (or more correct) way to do this with
kbuild?
3) Variable names and especially help text needs some love.
4) I am not sure if I am duplicating work in progress?
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
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 node tyes.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
|
|
From: Pragnesh Sampat <pragnesh.sampat@timesys.com>
The file initramfs_data.cpio is slightly different when generated on
cygwin, compared to linux, which causes the kernel to panic with the
message "no cpio magic" (See Documentation/early-userspace/README).
The problem in cpio generation is due to the difference in sprintf
modifiers on cygwin. The code uses "%08ZX" for strlen of a device node.
printf man pages discourages "Z" and has 'z' instead. Both of these are
not available on cygwin sprintf (at least some versions of cygwin). The
net result of all of this is that the generated file literally contains
"ZX" and then the strlen after that and messes up that 110 offset etc. The
file is 516 bytes long on the system that I tested and on linux it is 512
bytes.
The fix below just uses "%08X" for that field.
|
|
From: Olaf Hering <olh@suse.de>
We need to update `offset' here so that the subsequent push_pad() (which
uses `offset') will do the right thing.
|
|
Dont print the contents of the initramfs, for any decent sized cpio it will
overflow the kernel ring buffer.
Also relax permissions on /dev (755 not 700).
|
|
From: maximilian attems <janitor@sternwelten.at>
Use char arrays instead of char* for strings:
a. uses a single variable instead of two.
b. shorter code.
c. __initdata will be completely dropped.
|
|
Update support for .incbin in /usr. No longer generate .S files
from within the Makefile.
Also deleted the assignment to LDFLAGS_BLOB for most architectures.
I did not touch ARM and cris:
arm: Russell told me they did not have a new as that could be used
cris: Looked like it was used for more than just usr/
|
|
The kernel build leaves a temp file in linux/usr/ that make clean
doesn't remove. Fixed in the patch below.
|
|
|
|
This makes initramfs use ".incbin" to include a binary blob into the
object file, instead of using LDFLAGS_BLOB, which isn't supported on all
architectures.
This will require reasonably modern binutils, but is portable.
This is the last thing that keeps the standard tree from building
directly for ia64.
|
|
|
|
EXTRA_TARGETS served several purposes before:
1) List targets to be build (built-in only)
2) Inform kbuild of targets within the makefile
Mixing the above are causing confusion, so for now on
targets :=
is used to inform kbuild about targets in a Makefile - that it otherwise
did not know about.
kbuild uses the "targets :=" information to:
a) read the dependency file .target.cmd
b) delete the target file during make clean
|
|
the build.
This also shows how to add files to the initramfs build, but is
commented out.
Patch originally done by Kai.
|
|
|
|
Grrh, don't do last minute changes without retesting.
Adapt arch/alpha as well, other archs need to
o add LDFLAGS_BLOB to arch/$(ARCH)/Makefile
o add .init.ramfs to arch/$(ARCH)/vmlinux.lds.S
See arch/i386/{Makefile,vmlinux.lds.S} for guidance ;)
|
|
Use ld to link the cpio archive into the image, build was broken
due to requiring a recent version of objcopy before, plus assorted
cleanups:
o Don't include arch/$(ARCH)/Makefile, export the needed arch-specific
flags instead.
o Name the generated section consistently .init.ramfs everywhere.
|
|
|