Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Nigel Kukard <nkukard@lbsd.net>
To: buildroot@busybox.net
Subject: [Buildroot] initramfs doesn't need root to create an image
Date: Sat, 29 Mar 2008 14:12:02 +0000	[thread overview]
Message-ID: <1206799922.3224.157.camel@nigel-x60> (raw)
In-Reply-To: <20080329140004.GA25949@cloud.net.au>


> > Attached a patch which removes the requirement on fakeroot & makedevs
> > and prevents files from being created in /dev instead of devices when
> > one builds buildroot as a non-priv user.
> 
> Why? Was there a problem with fakeroot?

Not fakeroot itself, but you cannot create a device if you're a non-priv
user. So ... nothing fails, makedevs generates lovely zero size files
instead of devices & fakeroot appears to hide the errors.

My patch is initramfs specific and doesn't touch, remove or alter any of
the other target root filesystem types. It removes the requirement for
both fakeroot and makedevs for initramfs image generation. Real devices
aren't created, the cpio manifest is modified in such a way that the
result cpio archive contains the devices. The manifest is normally
generated from the actual files/devices found. My patch takes the
manifest (minus the devices as makedevs isn't run) parses the device
table and outputs the manifest with what makedevs would of generated,
with the uid/gid defaulting to 0 if not overridden by makedevs.

> The ext2 and jffs2 targets both use fakeroot, although the generator
> tools can do privilege squashing and handle device tables themselves.
> Next week I need to add ubifs support, and currently the generator tool
> does not have device table support fwiw.

I only touched initramfs image generation. If you see something I
missed, or error in my perl script, feel free to let me know so I can
fix it  :)  I've tested it with both the generic device list, my own
device list, as root and as a non-priv user with no errors, the
resulting initramfs image when booted contains all the devices
specified.

-N

-------------- 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://busybox.net/lists/buildroot/attachments/20080329/bd44a0d2/attachment.pgp 

  reply	other threads:[~2008-03-29 14:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-29  6:59 [Buildroot] initramfs doesn't need root to create an image Nigel Kukard
2008-03-29 14:00 ` Hamish Moffatt
2008-03-29 14:12   ` Nigel Kukard [this message]
2008-03-29 14:33     ` Peter Korsgaard
2008-03-29 14:56       ` Nigel Kukard
2008-03-29 15:04         ` Hamish Moffatt
2008-03-29 16:02           ` Nigel Kukard
2008-03-29 16:13         ` Peter Korsgaard
2008-03-29 16:32           ` Nigel Kukard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1206799922.3224.157.camel@nigel-x60 \
    --to=nkukard@lbsd.net \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox