don't warn about md-root need busybox: it doesn't anymore.
We believed mdadm needs busybox in initramfs, but it has been fixed long ago.
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: maximilian attems <max@stro.at>
Reviewed-by: Michael Prokop <mika@debian.org>
When mounting kernel filesystems and tmpfs filesystems, "none" is
unsuitable as the filesystem name. This is because it causes
breakage when /etc/mtab is a symlink to /proc/mounts. This is needed
so that we can switch /etc/mtab to be a symlink when util-linux is
updated to use libmount (#620710).
When /etc/mtab is a file updated by mount, the initscripts
mountkernfs.sh, mountdevsubfs.sh and mtab.sh initialise the mtab at
boot using values other than "none". For example, /proc uses "proc",
/dev/pts uses "devpts" and /sys uses "sysfs". The mtab entries are
created from defaults, plus any user customisations added to
/etc/fstab.
When /etc/mtab is a symlink to /proc/mounts, the values set when the
filesystems were mounted by init in the initramfs are now visible, and
these differ from values in /etc/fstab. The initscripts are now no
longer able to update the mtab file, and this causes problems mounting
local filesystems.
The most visible issue is /proc. The default fstab entry is:
proc /proc proc defaults 0 0
while init is using
mount -t proc -o nodev,noexec,nosuid none /proc
rather than
mount -t proc -o nodev,noexec,nosuid proc /proc
which results in "mount -a" failing with an exit code of 32 (mount
failure). While altering "proc" to "none" in the fstab file corrects
this boot failure, this is present by default in the fstab file of
every installed system, and so is not easy to update. Additionally,
the /dev/pts and /sys mounts may also have been added using the
"devpts" and "sysfs" names, and so these should ideally also be
corrected to use these names in the initramfs. This behaviour may be
easily verified by changing the fsname for /proc in /etc/fstab and
checking the exit status of "mount -a".
I also fixed an inconsistency in the udev /dev fsname. It might use
"none" or "udev"; it now always uses "udev".
Closes: #603858
Reported-by: Goswin von Brederlow <goswin-v-b@web.de>
Signed-off-by: Roger Leigh <rleigh@debian.org>
[ fixes bug in old initscripts barking on 'none' fsname. -maks ]
Signed-off-by: maximilian attems <max@stro.at>
Reviewed-by: Christian Hofstaedtler <ch@grml.org>
Reviewed-by: Michael Prokop <mika@debian.org>
This bit syncs the mount options with the initscripts defaults, but
most importantly the s/none/tmpfs/ makes the initscripts mount checks
not mount a second tmpfs on /run, obscuring the one from the initramfs.
domount() checks for already mounted filesystems to guard against
mounting an already mounted filesystem. But it mounts all tmpfs
filesystems with "tmpfs" as mnt_fsname, and having this as "none"
breaks that check, leading to a second tmpfs mount. Please could you
do the s/none/tmpfs whether or not you also pick up the mount defaults
changes, which are optional (we remount with the user-defined options
later).
Note that the nodev option was removed, because it's currently
required on some systems by /etc/init.d/checkroot.sh (it uses
mknod /dev/rootdev to get a device node to mount /root). I hope
that we can remove this at some point, but for now mounting /run
with nodev will cause some systems to break. It also mounts with
noexec, since this is potentially needed for some uses of /dev/shm.
Again, I hope we can remove it, but it will need testing whether
or not exec perms are needed to map with PROT_EXEC on current
kernels.
WRT these mount options, I aim to get initscripts to remount /run
with options from /etc/fstab or /etc/default/tmpfs which will
allow the system to be configured to use more restrictive mount
options after boot, should the admin choose. And, depending upon
the configuration, we may be able to automatically determine if
stricter permissions are possible (e.g. /run/shm is a separate
mount, so noexec is safe to use). So this patch uses the options
we know are safe, and initscripts can tighten them up later, if
possible. This remounting with user-specified options will apply
to all filesystems mounted in mountkernfs/mountdevsubfs.
Closes: #621803
Signed-off-by: rleigh <rleigh@codelibre.net>
Tested-by: Tollef Fog Heen <tfheen@err.no>
Tested-by: Michael Biebl <biebl@debian.org>
Signed-off-by: maximilian attems <max@stro.at>
Reviewed-by: Christian Hofstaedtler <ch@grml.org>
Reviewed-by: Michael Prokop <mika@debian.org>
If /run is not present on the rootfs, instead of losing the /run/udev from the
initramfs, we move it to /dev/.udev:
This is against initramfs-tools branch maks/run. This preserves historical
behaviour, and will make udev/lvm work correctly during the transitional
period, i.e. the state is kept in the same place it always has been. Once
you install a new initscripts which puts a /run on the rootfs, the udev
state will stay in /run. So this caters for either possibility.
Signed-off-by: rleigh <rleigh@codelibre.net>
[ shorten comments -maks ]
Signed-off-by: maximilian attems <max@stro.at>
Reviewed-by: Christian Hofstaedtler <ch@grml.org>
Reviewed-by: Michael Prokop <mika@debian.org>
If we move filesystems after moving /proc to the new root,
mount will complain because /proc/mounts is no longer there.
Signed-off-by: Michael Prokop <mika@debian.org>
Reviewed-by: Christian Hofstaedtler <ch@grml.org>
Reviewed-by: Michael Prokop <mika@debian.org>
No usage anymore, back in the days udev used it to know
that it is run in initramfs.
Now the /dev/ should be free of initramfs-tools created dirs and files.
Signed-off-by: maximilian attems <max@stro.at>
Reviewed-by: Christian Hofstaedtler <ch@grml.org>
Reviewed-by: Michael Prokop <mika@debian.org>
The purpose is to have a persisent directory from boot on.
Also migrate our debug log to /run:
Use /run/initramfs and not /dev/.initramfs
This was a private dir with no good outside usage
(usplash is gone, /etc/init.d/rc mentions progress bar).
live-initramfs needs to use /run/initramfs for uninofs-fuse.
If the rootmnt has no /run dir care to umount the dir in order
to not confront user with mount move errors.
This leeds to debug info loosage, which is considered ok.
Signed-off-by: maximilian attems <max@stro.at>
Reviewed-by: Christian Hofstaedtler <ch@grml.org>
Reviewed-by: Michael Prokop <mika@debian.org>
This will allow us in further patches to migrate away from
fugly /dev/.initramfs directories.
Signed-off-by: maximilian attems <max@stro.at>
Reviewed-by: Christian Hofstaedtler <ch@grml.org>
Reviewed-by: Michael Prokop <mika@debian.org>
The -9 consumes mem and takes quite long and doesn't save
really that much. A small benchmark of different compression
options gave the following result:
-5: 12570036 bytes; 1:01.40 runtime
-6: 12507864 bytes; 1:04.63 runtime
-7: 12441428 bytes; 1:07.09 runtime
-8: 12381060 bytes; 1:09.77 runtime
-9: 12346124 bytes; 1:20.74 runtime
So -8 should be a sensible default both for time and space matters.
Signed-off-by: Michael Prokop <mika@debian.org>
Reviewed-by: maximilian attems <max@stro.at>
xz uses crc64 per default as checksum though xz embedded only
supports crc32.
Without the crc32 check the kernel will fail with:
| Initramfs unpacking failed: Input was encoded with settings that
| are not supported by this XZ decoder
More details in Documentation/xz.txt, section "Notes on compression options".
Thanks: Ulrich Dangel <mru@grml.org>
Signed-off-by: Michael Prokop <mika@debian.org>
Reviewed-by: maximilian attems <max@stro.at>
Allmost directly taken from dracut.
Do it also at a late stage when everything is on initramfs.
It should fix boot on a box where the lvm library was searching for a
libgcc, which was on the initramfs but not in the lib search path.
Ubuntu got hit similarly:
"We had a rather obscure Ubuntu bug
(https://bugs.launchpad.net/bugs/728611) which presented as Plymouth not
being able to display text at boot time, which of course is nasty in
cases where the user needs to answer a prompt in order for boot to
complete. This turned out to be restricted to configurations where
Plymouth is built into the initramfs, so I chased this down.
The problem is that /lib/plymouth/label.so now transitively links to
libGL, which (on Ubuntu, at least) lives in /usr/lib/mesa/libGL.so.1 or
some other subdirectory of /usr/lib depending on the GL implementation
in use (fglrx, nvidia, etc.). This directory isn't on the linker's
default search path; instead, it relies on /etc/ld.so.cache having been
built appropriately from a configuration including
/etc/ld.so.conf.d/GL.conf, which is managed by update-alternatives. The
thing that's going wrong here is that /usr/lib/mesa/libGL.so.1 is copied
into the initramfs, but it isn't on the linker's search path so
/lib/plymouth/label.so fails to load." -cjwatson
Closes: #612633, #619670
Reported-by: Benedikt Spranger <b.spranger@linutronix.de>
Tested-by: Benedikt Spranger <b.spranger@linutronix.de>
Reviewed-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: maximilian attems <max@stro.at>
Reported-by: Colin Watson <cjwatson@ubuntu.com>
[ code readability fixes -mika ]
Signed-off-by: Michael Prokop <mika@debian.org>
This facilitates mkinitramfs building.
It is intended as fix for the not possible ldconfig run inside
the symlink tree. It should also allow to cleanup the copy_exec() mess.
This also allows to no longer shipp duplicate busybox copies in
initramfs. dracut does it also. The symlinking was thought as
speed gain by jbailey, but I'm less then conviced it is worth it.
Also specify to cpio that the files should be owned by root.
In retrospect this really similar quasi a fowarded ported patch by
Michal Schmidt <xschmi00@stud.feec.vutbr.cz>
Closes: #338405, #506540
Signed-off-by: maximilian attems <max@stro.at>
Tested-by: Benedikt Spranger <b.spranger@linutronix.de>
Reviewed-by: Michael Prokop <mika@debian.org>
elilo, lilo, and zipl all install post-update hooks for us, so we
don't need call them specifically. Unfortunately, flash-kernel does
not yet, so keep that for a little longer.
Add 'breaks' relations to the versions of these packages that do not
install post-update hooks.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: maximilian attems <max@stro.at>
Reviewed-by: Michael Prokop <mika@debian.org>
Official Debian and Ubuntu kernel packages will invoke us directly as
part of the $ramdisk handling inherited from kernel-package. They
will later run our hook script, as will custom packages made with
'make-kpkg' or the upstream 'make deb-pkg'.
Currently, for official packages we perform an update on the first
invocation (possibly deferred using dpkg triggers) and then ignore the
second. However, the long-term plan is to remove that first
invocation. Therefore, ignore the first invocation and perform the
update on the second.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
[ Use && op, we make the effort to not use -a evaluation. -maks ]
Signed-off-by: maximilian attems <max@stro.at>
Reviewed-by: Michael Prokop <mika@debian.org>
We should not continue after a command unexpectedly fails.
Change the $INITRD test so that failure is not treated as unexpected.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: maximilian attems <max@stro.at>
Reviewed-by: Michael Prokop <mika@debian.org>
The version argument is mandatory and we should complain if some package
doesn't pass it rather than quietly failing to do our job.
However, making package removal fail is generally unhelpful, so
continue to return 0 from the postrm hook.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
[ Prefix new warnings as of 3a02c6f37d with W: -maks ]
Signed-off-by: maximilian attems <max@stro.at>
Reviewed-by: Michael Prokop <mika@debian.org>
If you pass a root= argument with a numeric device number
(i.e. root=0806), that's currently resolved by running mknod to create
a /dev/root device with an appropriate major/minor number and setting
ROOT=/dev/root (the parse_numeric function in scripts/functions).
However, this /dev/root device is completely unknown to udev. On
Ubuntu, this leads to problems because we use udev to wait for the
root device to appear. Since /dev/root isn't in udev's database, the
boot hangs forever (well, it hangs until rootdelay passes).
udev's standard configuration creates /dev/block/N:N symlinks for
every block device in its database (see the first non-comment line of
/lib/udev/rules.d/50-udev-default.rules). Setting ROOT to the
/dev/block/N:N symlink instead of creating a new /dev/root device and
setting ROOT to that solves Ubuntu's problem.
See https://bugs.launchpad.net/bugs/576429 for more discussion.
I think I actually want to take a different approach in order to
maintain the current semantics of setting root=X:Y.
In particular, if the user passes in a value that has a prefixed 0,
that will get passed directly to mknod, which would treat the number
as octal. So root=010:0 would actually create a device with major
number 8. Instead of trying to resolve this directly, we can use the
shell's arithmetic expansion to get a decimal number back.
Closes: #606806
[ change condition from specific udev script to udevd availability. ]
Signed-off-by: maximilian attems <max@stro.at>
Reviewed-by: Michael Prokop <mika@debian.org>
Thanks to mika for showing a shell version of a variadic function.
Use it from the initial step on.
Signed-off-by: maximilian attems <max@stro.at>
Reviewed-by: Michael Prokop <mika@debian.org>
ubifs is another case where the module deps aren't properly
declared or detectable by modulde-init-tools. Thus use the new
hidden_dep_add_modules().
One could go farer and maybe cleanup the ubi category in
auto_add_modules(), this is currently left out.
Reported-by: Loïc Minier <lool@debian.org>
Signed-off-by: maximilian attems <max@stro.at>
No point in linking to the resolved bug, just use the git
buildpackage feature, which landed in time for squeeze.
Also fix a parsing, where the `v' prefix of the git tags was forgotten.
Remove protective parenthesis around id-length and use meta there not
full.
While at it s/stable/oldstable/ for git-core package.
Signed-off-by: maximilian attems <max@stro.at>
Reviewed-by: Michael Prokop <mika@debian.org>
List the top 6 commiters of the initramfs-tools git repo.
Update the year attribution, also pay attention to current maintainers.
No point in listing people that didn't contribute really in a
significant way.
The cut off of the best 6 is quite arbitrary. It just happens to be
that those have each more then 5 commits / person and thus can be
seen as significant contributors.
Signed-off-by: maximilian attems <max@stro.at>
Reviewed-by: Michael Prokop <mika@debian.org>
"Taking netconsole parameters from the kernel command line is a neat
feature, but you can't load it before the network drivers."
Do it the earliest possible aka after udev in init-top and
after the modules loading.
Closes: #596742
Reported-by: Ferenc Wagner <wferi@niif.hu>
Signed-off-by: maximilian attems <max@stro.at>
Reviewed-by: Michael Prokop <mika@debian.org>
It seems to be a common one and is included in dracut after IRC request.
Signed-off-by: maximilian attems <max@stro.at>
Reviewed-by: Michael Prokop <mika@debian.org>
Currently if a system administrator uses "panic=60 break=top" boot
options initramfs prints
Spawning shell within the initramfs
but does not actually spawn the shell since panic= disallows
that. This patch explicitely informs the user about the reboot and
hints that by reminving panic= he/she can get break= debugging to
work.
Signed-off-by: Timo Juhani Lindfors <timo.lindfors@iki.fi>
[ small wording change -maks ]
Signed-off-by: maximilian attems <max@stro.at>
The purpose of panic= is to make the system reboot automatically on
panic but also give the interactive user some time to see what went
wrong.
Signed-off-by: Timo Juhani Lindfors <timo.lindfors@iki.fi>
Signed-off-by: maximilian attems <max@stro.at>
This is an unused old mkinitramfs wrapper.
These days update-initramfs is to be called.
No point in keeping that old thing around, as it shouldn't be used
anymore since Lenny.
Closes: #502792
Signed-off-by: maximilian attems <max@stro.at>
Reviewed-by: Michael Prokop <mika@debian.org>
usplash is not released in Squeeze and is no longer in Debian unstable.
Thus nuke usplash calls and any ref to it.
Signed-off-by: maximilian attems <max@stro.at>
Reviewed-by: Michael Prokop <mika@debian.org>
These days since 2.6.28 or such ide-disk is an alias of gd_mod
thus no point in trying to add it too.
Signed-off-by: maximilian attems <max@stro.at>
Reviewed-by: Michael Prokop <mika@debian.org>
Also add info to relevant config file.
Reference: <20110216144546.GA20971@dali>
Reported-by: trentbuck@gmail.com
Signed-off-by: maximilian attems <max@stro.at>
Reviewed-by: Michael Prokop <mika@debian.org>
Remove comparison with dpkg that is older than lenny.
Any recent dpkg provides proper trigger and no point in guarding against
that specific Ubuntu dpkg dev version that was buggy as no distro
released with it.
update-initramfs anyway guards and checks for a postitive
`dpkg-trigger --check-supported`.
Signed-off-by: maximilian attems <max@stro.at>
Reviewed-by: Michael Prokop <mika@debian.org>
Prefer blkid over vol_id. I was tempted to nuke vol_id,
but vol_id has been around for long and shouldn't be rm'ed on first
occasion. Add note to do so.
Wondering why this bug is not fatal, but it seems Debian Installer
generates that file too.
Closes: #609964
Signed-off-by: maximilian attems <max@stro.at>
Reviewed-by: Michael Prokop <mika@debian.org>
This needs to be expressed in terms of package dependencies,
no point in keeping that old hack. Supporting special initramfs
arch bugs in the time between 2.6.12 and 2.6.15 is not worth.
Nowadays this check succeeds anyway.
Signed-off-by: maximilian attems <max@stro.at>
Reviewed-by: Michael Prokop <mika@debian.org>
The wanted email address is and not the qa alias:
"Mails sent to the maintainer through the *@packages.debian.org email
aliases."
Reported-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: maximilian attems <max@stro.at>
Reviewed-by: Michael Prokop <mika@debian.org>
Users just sometimes quote the message, it is already useful
to get the error code.
Signed-off-by: maximilian attems <max@stro.at>
Reviewed-by: Michael Prokop <mika@debian.org>
due to a script assignment misplacement mkinitramfs displays a misleading message:
No gzip in /usr/bin:/sbin:/bin, using gzip
instead of
No lzma in /usr/bin:/sbin:/bin, using gzip
this makes difficult to known that it needs lzma executable in the path
(I tought xz instead)
Closes: #611046
Signed-off-by: maximilian attems <max@stro.at>
The parsing goes wrong as the output ends in multiline:
~#df /tmp
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/buildServer--1-tmp
4805760 142028 4419612 4% /tmp
Use POSIX output format as suggested by Ian.
Closes: #608865
Thanks: Ian Campbell <ijc@hellion.org.uk>
Reviewed-by: Michael Prokop <mika@debian.org>
Signed-off-by: maximilian attems <max@stro.at>
The parsing goes wrong as the output ends in multiline:
~#df /tmp
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/buildServer--1-tmp
4805760 142028 4419612 4% /tmp
Use POSIX output format as suggested by Ian.
Closes: #608865
Thanks: Ian Campbell <ijc@hellion.org.uk>
Reviewed-by: Michael Prokop <mika@debian.org>
Signed-off-by: maximilian attems <max@stro.at>
'depmod' only looks at symbol dependencies; there is no way for
modules to declare explicit dependencies through module information,
so dependencies on e.g. crypto providers are hidden. Until this is
fixed, we need to handle those hidden dependencies.
This affects btrfs root.
Closes: #608538
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Reviewed-by: Michael Prokop <mika@debian.org>
Signed-off-by: maximilian attems <max@stro.at>
'depmod' only looks at symbol dependencies; there is no way for
modules to declare explicit dependencies through module information,
so dependencies on e.g. crypto providers are hidden. Until this is
fixed, we need to handle those hidden dependencies.
This affects btrfs root.
Closes: #608538
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Reviewed-by: Michael Prokop <mika@debian.org>
Signed-off-by: maximilian attems <max@stro.at>
Similar to #582858, however for me it still does not work
with symlinked /etc/mtab to /proc/mounts.
---- contents of /proc/mounts ----
rootfs / rootfs rw 0 0
ubi0:rootfs / ubifs rw,relatime 0 0
Tighten the regex not to match ^/dev/ but not to match the
rootfs entry while also checking for the `/' root entry.
Also fix the FSTYPE entry to look for the correct field in
/proc/mounts even if not used later.
Closes: #608339
Reported-by: Alexander Clouter <alex@digriz.org.uk>
Tested-by: Alexander Clouter <alex@digriz.org.uk>
Reviewed-by: Michael Prokop <mika@debian.org>
Signed-off-by: maximilian attems <max@stro.at>
Similar to #582858, however for me it still does not work
with symlinked /etc/mtab to /proc/mounts.
---- contents of /proc/mounts ----
rootfs / rootfs rw 0 0
ubi0:rootfs / ubifs rw,relatime 0 0
Tighten the regex not to match ^/dev/ but not to match the
rootfs entry while also checking for the `/' root entry.
Also fix the FSTYPE entry to look for the correct field in
/proc/mounts even if not used later.
Closes: #608339
Reported-by: Alexander Clouter <alex@digriz.org.uk>
Tested-by: Alexander Clouter <alex@digriz.org.uk>
Reviewed-by: Michael Prokop <mika@debian.org>
Signed-off-by: maximilian attems <max@stro.at>