[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#584714: btrfs-tools might do too much in initramfs images



Package: btrfs-tools
Version: 0.19+20100601-2
Severity: normal

Hi Daniel, hi initramfs-tools maintainers.


btrfs-tools has some influence on initramfs-images via three files.
/usr/share/initramfs-tools/modules.d/btrfs
/usr/share/initramfs-tools/hooks/btrfs
/usr/share/initramfs-tools/scripts/local-premount/btrfs

I guess all of them could do a little bit less to keep initramfs images
smaller:
1) /usr/share/initramfs-tools/modules.d/btrfs
I'm not sure, but AFAIK with MODULES=most in /etc/initramfs-tools/initramfs.conf
initramfs-tools simply add all fs-modules.
And with MODULES=dep they try to find out which fs is used for the
root-fs and add only this module (in case it's there and not statically
compiled).
I guess if it's compiled as module, it would also add modules "btrfs"
depends on.
I'm not sure if the dependencies would be also added if btrfs is statically
compiled into the kernel, but the dependecies (crc32 and so on) not.

Perhaps the initramfs-tools maintainers can give some advise on this.

So I'm not totally sure, but perhaps we can drop /usr/share/initramfs-tools/modules.d/btrfs.


2) /usr/share/initramfs-tools/hooks/btrfs
I see that this is required, but it should only do something, if btrfs
is actually used for the root-fs.
Perhaps one can add a simple check as e.g. used in cryptsetups hooks:
# Check whether cryptroot hook has installed decrypt_opensc script 
if [ ! -x ${DESTDIR}/lib/cryptsetup/scripts/decrypt_opensc ] ; then
    exit 0
fi

But just check, whether the modules has been added alread.
I'm not sure if it's guaranteed that this happens always before
invoking the hooks.
Perhaps the initramfs-tools maintainers can help here again.


3) /usr/share/initramfs-tools/scripts/local-premount/btrfs
As follow up to (2), this should add a check, whether btrfsctl
is there (in the initramfs) and exit if not.


Hope I was able to contribute, :)
Chris.



-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.33-heisenberg (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=en_DE.UTF-8, LC_CTYPE=en_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages btrfs-tools depends on:
ii  e2fslibs                1.41.12-2        ext2/ext3/ext4 file system librari
ii  libc6                   2.11.1-2         Embedded GNU C Library: Shared lib
ii  libcomerr2              1.41.12-2        common error description library
ii  libuuid1                2.17.2-2         Universally Unique ID library
ii  zlib1g                  1:1.2.3.4.dfsg-3 compression library - runtime

btrfs-tools recommends no packages.

btrfs-tools suggests no packages.

-- no debconf information



Reply to: