mkinitrd unification across distributions
 help / color / mirror / Atom feed
* some $prefix issues
@ 2011-09-30  1:03 Michal Soltys
  0 siblings, 0 replies; only message in thread
From: Michal Soltys @ 2011-09-30  1:03 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA

Current code allows customization of $prefix, but init still has 
hardcoded /run/initramfs path - so outside of setting prefix to that 
particular path its use is kinda limited (without making init aware of 
$prefix).

Another thing is, that inst*() family of functions have no notion of 
$prefix at all, so - especially subsequent - calls to those functions 
will not really care. This could in certain cases lead to frictions, for 
example:

Suppose we have (on host):
/bin -> usr/bin

We run dracut with:
--prefix=/run/intiramfs

In part of the code preparing basic directory layout:
...
$initdir/usr -> run/initramfs/usr
...
will be pre-created (and dangling at this point)

As bin is a symlink on the host (and dracut tries to mimic host's layout 
(?), we will have):
inst() /bin $prefix/bin
which will call inst_symlink() with same arguments, effectively leading to:
src: /bin
realsrc: /usr/bin
target: $initdir$prefix/bin

There will be attempt to create $initdir/usr/bin, but there's already 
(dangling) symlink and mkdir attempt (after readlink) will fail.

This can be easily verified by making on the host:
/binn -> usr/binn
And adding binn to the relevant layout-creating loops, which will lead 
to something like:
mkdir: cannot create directory `/var/tmp/initramfs.C2ifhw/usr': File exists

Last thing - /run remains mounted inside intramfs after mount --bind 
currently. With simple /run symlink to movable mount and without being 
forced to care if it suddenly loses binaries - it could be cleanly moved 
to real root almost atomically.

It's all fixable in one or the other way, but is --prefix functionality 
actually needed for something specific ? after pivot peeking/extracting 
is just a matter of cat/cpio or lsinitrd, or anything similar.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-09-30  1:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-30  1:03 some $prefix issues Michal Soltys

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox