Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#856589: initramfs-tools: mkinitramfs fails to run on systems with tmpfs on /

51 views
Skip to first unread message

Benjamin Drung

unread,
Mar 2, 2017, 1:30:03 PM3/2/17
to
Package: initramfs-tools
Version: 0.120+deb8u2
Severity: normal

Hi,

I am trying to configure kdump-tools on a Debian jessie live system
(which runs entirely on tmpfs mount points using a custom made initrd).
kdump-tools uses initramfs-tools to generate an initramfs for the crash
kernel. On package installation, it runs:

root@host:~$ /etc/kernel/postinst.d/kdump-tools $(uname -r)
kdump-tools: Generating /var/lib/kdump/initrd.img-4.4.36-2
mkinitramfs: failed to determine device for /
mkinitramfs: workaround is MODULES=most, check:
grep -r MODULES /etc/initramfs-tools/

Error please report bug on initramfs-tools
Include the output of 'mount' and 'cat /proc/mounts'
update-initramfs: failed for with 1.

Since kdump-tools specifies a config directory, the suggested grep
command is incorrect (patch to fix that is attached).

root@host:~$ grep -r MODULES /var/lib/kdump/initramfs-tools/
/var/lib/kdump/initramfs-tools/initramfs.conf:# MODULES: [ most | netboot | dep | list ]
/var/lib/kdump/initramfs-tools/initramfs.conf:MODULES=dep

The recommended workaround (set MODULES=most) does not work either:

root@host:~$ sudo sed -i "s/MODULES=dep/MODULES=most/" /var/lib/kdump/initramfs-tools/initramfs.conf
root@host:~$ grep -r MODULES /var/lib/kdump/initramfs-tools/
/var/lib/kdump/initramfs-tools/initramfs.conf:# MODULES: [ most | netboot | dep | list ]
/var/lib/kdump/initramfs-tools/initramfs.conf:MODULES=most
root@host:~$ sudo /etc/kernel/postinst.d/kdump-tools $(uname -r)
kdump-tools: Generating /var/lib/kdump/initrd.img-4.4.36-2
mkinitramfs: failed to determine device for /
mkinitramfs: workaround is MODULES=most, check:
grep -r MODULES /etc/initramfs-tools/

Error please report bug on initramfs-tools
Include the output of 'mount' and 'cat /proc/mounts'
update-initramfs: failed for with 1.

Here is the requeted output of mount (/proc/mounts says the same):

root@host:~$ mount
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=755840k,nr_inodes=188960,mode=755)
tmpfs on / type tmpfs (rw,relatime,size=2097152k)
tmpfs on /var type tmpfs (rw,nodev,relatime,size=1048576k)
tmpfs on /var/log type tmpfs (rw,nosuid,nodev,noexec,relatime,size=204800k)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime,size=524288k)
tmpfs on /home type tmpfs (rw,nosuid,nodev,relatime,size=102400k)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=22,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
configfs on /sys/kernel/config type configfs (rw,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime,mode=755)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)

Workaround: Comment all calls in dep_add_modules() in hook-functions.

--
Benjamin Drung
System Developer
Debian & Ubuntu Developer

ProfitBricks GmbH
Greifswalder Str. 207
D - 10405 Berlin

Email: benjami...@profitbricks.com
URL: http://www.profitbricks.com

Sitz der Gesellschaft: Berlin.
Registergericht: Amtsgericht Charlottenburg, HRB 125506B.
Geschäftsführer: Andreas Gauger, Achim Weiss.
0001-Fix-config-directory-in-error-message.patch

Benjamin Drung

unread,
Mar 3, 2017, 4:20:03 PM3/3/17
to
tags 856589 + patch
thanks

The solution is quite simple: Just return from dep_add_modules_mount()
when tmpfs is detected as fstype. A tested patch is attached.
0001-Fix-failure-when-uses-tmpfs.patch

Ben Hutchings

unread,
Mar 6, 2017, 6:00:02 PM3/6/17
to
Control: retitle -1 mkinitramfs fails with MODULES=dep and root on tmpfs
Control: found -1 0.120
Control: found -1 0.127

kdump-tools is overriding the MODULES setting; see this command in
/etc/kernel/postinst.d/kdump-tools:

sed -e 's/MODULES=.*/MODULES=dep/' /etc/initramfs-tools/initramfs.conf > "$initramfsdir/initramfs.conf" || true

As a workaround you could change that line into a copy.

Ben.

--
Ben Hutchings
Unix is many things to many people,
but it's never been everything to anybody.
signature.asc

Benjamin Drung

unread,
Mar 7, 2017, 12:10:03 PM3/7/17
to
Hi,

Am Montag, den 06.03.2017, 22:50 +0000 schrieb Ben Hutchings:
> kdump-tools is overriding the MODULES setting; see this command in
> /etc/kernel/postinst.d/kdump-tools:
>
>     sed -e 's/MODULES=.*/MODULES=dep/' /etc/initramfs-
> tools/initramfs.conf > "$initramfsdir/initramfs.conf" || true
>
> As a workaround you could change that line into a copy.

You are right. My test case was broken since the configuration in
/var/lib/kdump/initramfs-tools was regenerated on every call.

Using MODULES=most or MODULES=netboot (which I do now, see #856596)
will not cause this warning. Then the question is: What is the correct
behavior with MODULES=dep and root on tmpfs?
signature.asc

Ben Hutchings

unread,
Mar 7, 2017, 1:00:02 PM3/7/17
to
On Tue, 2017-03-07 at 18:00 +0100, Benjamin Drung wrote:
> Hi,
>
> Am Montag, den 06.03.2017, 22:50 +0000 schrieb Ben Hutchings:
> > kdump-tools is overriding the MODULES setting; see this command in
> > /etc/kernel/postinst.d/kdump-tools:
> >
> >     sed -e 's/MODULES=.*/MODULES=dep/' /etc/initramfs-
> > tools/initramfs.conf > "$initramfsdir/initramfs.conf" || true
> >
> > As a workaround you could change that line into a copy.
>
> You are right. My test case was broken since the configuration in
> /var/lib/kdump/initramfs-tools was regenerated on every call.
>
> Using MODULES=most or MODULES=netboot (which I do now, see #856596)
> will not cause this warning. Then the question is: What is the correct
> behavior with MODULES=dep and root on tmpfs?

So long as initramfs-tools doesn't support booting from a tmpfs, it's
not clear what it should do.

Ben.

--
Ben Hutchings
Logic doesn't apply to the real world. - Marvin Minsky

signature.asc

Ben Hutchings

unread,
Jul 18, 2018, 9:00:03 PM7/18/18
to
Did you actually mean to close this bug? The commit you made only
fixes the error message.

Ben.

--
Ben Hutchings
We get into the habit of living before acquiring the habit of thinking.
- Albert Camus

signature.asc
0 new messages