Bug#772752: btrfs-tools: [Wishlist item] Replace btrfs device scan in initramfs with a udev rule and udevadm trigger -s block

2014-12-11 Thread Dimitri John Ledkov
On 10 December 2014 at 19:35, Goffredo Baroncelli kreij...@gmail.com wrote:
 Package: btrfs-tools
 Version: 3.17-1.1
 Severity: wishlist


 btrfs-tools has a script for initramfs which load the btrfs module
 and does a btrfs device scan.

 I suggest to replace the btrfs device scan with a udev rule (the
 one provided by the package udev, see Bug#772744) which uses
 the udev builtin method.
 Because the module may be inserted after that some devices appeared,
 after the module insert,we have to be do a udevadm trigger -s block
 to redoing a device rescan for btrfs.


I disagree, udev in initramfs is optional and the premount script is
there precisely because at the moment udev based discovery is not
sufficient. Also it's not btrfs package/hook responsibility to call
udevadm trigger. On a running system this is only done after all local
filesystems have been mounted.

I have a separate bug report requesting to add an extra systemd unit
to call device scan before local filesystems have been mounted.

Also 64-btrfs.rules should not be installed by btrfs package, if udev
package ships it. Looking at the systemd source package, the
64-btrfs.rules udev rule does something different to the btrfs-tools:
btrfs device scan calls BTRFS_IOC_SCAN_DEV whilst systemd's rule calls
BTRFS_IOC_DEVICES_READY. I'm not too sure, but if ramdisk is not using
systemd and not using udev it really needs device scan.

 The goal of this change is to armonize how the btrfs device scan is
 done in intramfs to after the initramfs


Do you have a bug report against current integration? If not, I will
close this bug report as won't fix.

Regards,

Dimitri.


 Below two patch to highlight this change.

 BR
 G.Baroncelli

 --- /usr/share/initramfs-tools/scripts/local-premount/btrfs 2014-11-22 
 15:01:04.0 +0100
 +++ usr/share/initramfs-tools/scripts/local-premount/btrfs  2014-12-10 
 20:31:31.289746904 +0100
 @@ -19,5 +19,5 @@
  if [ -x /sbin/btrfs ]
  then
 modprobe btrfs
 -   /sbin/btrfs device scan 2 /dev/null
 +   udevadm trigger -s block
  fi


 --- /usr/share/initramfs-tools/hooks/btrfs  2014-11-22 15:01:04.0 
 +0100
 +++ usr/share/initramfs-tools/hooks/btrfs   2014-12-10 20:34:07.181751787 
 +0100
 @@ -26,4 +26,13 @@
 then
 copy_exec /sbin/fsck.btrfs /sbin
 fi
 +
 +   mkdir -p $DESTDIR/lib/udev/rules.d/
 +   for rules in 64-btrfs.rules; do
 + if   [ -e /etc/udev/rules.d/$rules ]; then
 +   cp -p /etc/udev/rules.d/$rules $DESTDIR/lib/udev/rules.d/
 + elif [ -e /lib/udev/rules.d/$rules ]; then
 +   cp -p /lib/udev/rules.d/$rules $DESTDIR/lib/udev/rules.d/
 + fi
 +   done
  fi



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

 Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
 Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
 Shell: /bin/sh linked to /bin/dash
 Init: systemd (via /run/systemd/system)

 Versions of packages btrfs-tools depends on:
 ii  e2fslibs1.42.12-1
 ii  libblkid1   2.25.2-3
 ii  libc6   2.19-13
 ii  libcomerr2  1.42.12-1
 ii  liblzo2-2   2.08-1
 ii  libuuid12.25.2-3
 ii  zlib1g  1:1.2.8.dfsg-2+b1

 btrfs-tools recommends no packages.

 btrfs-tools suggests no packages.

 -- no debconf information

-- 
Regards,

Dimitri.


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#772752: btrfs-tools: [Wishlist item] Replace btrfs device scan in initramfs with a udev rule and udevadm trigger -s block

2014-12-11 Thread Goffredo Baroncelli
On 12/11/2014 09:31 PM, Dimitri John Ledkov wrote:
 On 10 December 2014 at 19:35, Goffredo Baroncelli kreij...@gmail.com wrote:
 Package: btrfs-tools
 Version: 3.17-1.1
 Severity: wishlist


 btrfs-tools has a script for initramfs which load the btrfs module
 and does a btrfs device scan.

 I suggest to replace the btrfs device scan with a udev rule (the
 one provided by the package udev, see Bug#772744) which uses
 the udev builtin method.
 Because the module may be inserted after that some devices appeared,
 after the module insert,we have to be do a udevadm trigger -s block
 to redoing a device rescan for btrfs.

 
 I disagree, udev in initramfs is optional 

If udev is optional in initramfs, my request has to be rejected.

 and the premount script is
 there precisely because at the moment udev based discovery is not
 sufficient. 

I would like to know more about that: in which case udev based
discovery is not sufficient ? Or are you referring about the
fact that udev is not mandatory in initramfs.

[...]

BR
G.Baroncelli

-- 
gpg @keyserver.linux.it: Goffredo Baroncelli kreijackATinwind.it
Key fingerprint BBF5 1610 0B64 DAC6 5F7D  17B2 0EDA 9B37 8B82 E0B5


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#772752: btrfs-tools: [Wishlist item] Replace btrfs device scan in initramfs with a udev rule and udevadm trigger -s block

2014-12-11 Thread Dimitri John Ledkov
On 11 December 2014 at 21:17, Goffredo Baroncelli kreij...@gmail.com wrote:
 On 12/11/2014 09:31 PM, Dimitri John Ledkov wrote:
 On 10 December 2014 at 19:35, Goffredo Baroncelli kreij...@gmail.com wrote:
 Package: btrfs-tools
 Version: 3.17-1.1
 Severity: wishlist


 btrfs-tools has a script for initramfs which load the btrfs module
 and does a btrfs device scan.

 I suggest to replace the btrfs device scan with a udev rule (the
 one provided by the package udev, see Bug#772744) which uses
 the udev builtin method.
 Because the module may be inserted after that some devices appeared,
 after the module insert,we have to be do a udevadm trigger -s block
 to redoing a device rescan for btrfs.


 I disagree, udev in initramfs is optional

 If udev is optional in initramfs, my request has to be rejected.


udev in initramfs is optional, moreover initramfs is optional on
debian and plenty of people run things without it.


 and the premount script is
 there precisely because at the moment udev based discovery is not
 sufficient.

 I would like to know more about that: in which case udev based
 discovery is not sufficient ? Or are you referring about the
 fact that udev is not mandatory in initramfs.


mosty yes, refereing to the fact that udev is not mandatory in the
Debian's initramfs. There is also ongoing bug stating that udev based
discovery is not sufficient in the initramfsless system, i have not
investigated it completely.

-- 
Regards,

Dimitri.


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#772752: btrfs-tools: [Wishlist item] Replace btrfs device scan in initramfs with a udev rule and udevadm trigger -s block

2014-12-11 Thread Goffredo Baroncelli
On 12/11/2014 10:40 PM, Dimitri John Ledkov wrote:
 On 11 December 2014 at 21:17, Goffredo Baroncelli kreij...@gmail.com wrote:

 and the premount script is
 there precisely because at the moment udev based discovery is not
 sufficient.

 I would like to know more about that: in which case udev based
 discovery is not sufficient ? Or are you referring about the
 fact that udev is not mandatory in initramfs.

 
 mosty yes, refereing to the fact that udev is not mandatory in the
 Debian's initramfs. There is also ongoing bug stating that udev based
 discovery is not sufficient in the initramfsless system, i have not
 investigated it completely.

I read something about that. The report stated that btrfs didn't honor the
device=/dev/disk mount options; In this case would be impossible to
mount a multi-device filesystem.
But I didn't understand the reason
 
Goffredo

-- 
gpg @keyserver.linux.it: Goffredo Baroncelli kreijackATinwind.it
Key fingerprint BBF5 1610 0B64 DAC6 5F7D  17B2 0EDA 9B37 8B82 E0B5


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#772752: btrfs-tools: [Wishlist item] Replace btrfs device scan in initramfs with a udev rule and udevadm trigger -s block

2014-12-10 Thread Goffredo Baroncelli
Package: btrfs-tools
Version: 3.17-1.1
Severity: wishlist


btrfs-tools has a script for initramfs which load the btrfs module
and does a btrfs device scan.

I suggest to replace the btrfs device scan with a udev rule (the
one provided by the package udev, see Bug#772744) which uses
the udev builtin method.
Because the module may be inserted after that some devices appeared,
after the module insert,we have to be do a udevadm trigger -s block
to redoing a device rescan for btrfs.

The goal of this change is to armonize how the btrfs device scan is
done in intramfs to after the initramfs

Below two patch to highlight this change.

BR
G.Baroncelli

--- /usr/share/initramfs-tools/scripts/local-premount/btrfs 2014-11-22 
15:01:04.0 +0100
+++ usr/share/initramfs-tools/scripts/local-premount/btrfs  2014-12-10 
20:31:31.289746904 +0100
@@ -19,5 +19,5 @@
 if [ -x /sbin/btrfs ]
 then
modprobe btrfs
-   /sbin/btrfs device scan 2 /dev/null
+   udevadm trigger -s block
 fi


--- /usr/share/initramfs-tools/hooks/btrfs  2014-11-22 15:01:04.0 
+0100
+++ usr/share/initramfs-tools/hooks/btrfs   2014-12-10 20:34:07.181751787 
+0100
@@ -26,4 +26,13 @@
then
copy_exec /sbin/fsck.btrfs /sbin
fi
+
+   mkdir -p $DESTDIR/lib/udev/rules.d/
+   for rules in 64-btrfs.rules; do
+ if   [ -e /etc/udev/rules.d/$rules ]; then
+   cp -p /etc/udev/rules.d/$rules $DESTDIR/lib/udev/rules.d/
+ elif [ -e /lib/udev/rules.d/$rules ]; then
+   cp -p /lib/udev/rules.d/$rules $DESTDIR/lib/udev/rules.d/
+ fi
+   done
 fi



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

Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages btrfs-tools depends on:
ii  e2fslibs1.42.12-1
ii  libblkid1   2.25.2-3
ii  libc6   2.19-13
ii  libcomerr2  1.42.12-1
ii  liblzo2-2   2.08-1
ii  libuuid12.25.2-3
ii  zlib1g  1:1.2.8.dfsg-2+b1

btrfs-tools recommends no packages.

btrfs-tools suggests no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org