Bug#813360: [buildd-tools-devel] Bug#813360: Overlayfs available on newer Linux kernel only

2016-02-02 Thread Luca Falavigna
Control: tags -1 + patch

2016-02-01 16:41 GMT+01:00 Johannes Schauer :
> You initially offered a patch - I'd definitely welcome one :)

Attached :)

-- 
Cheers,
Luca


union-type_runtime.patch
Description: Binary data


Bug#813360: [buildd-tools-devel] Bug#813360: Overlayfs available on newer Linux kernel only

2016-02-01 Thread Johannes Schauer
Hi,

Quoting Luca Falavigna (2016-02-01 10:09:37)
> Beside the fact overlayfs is available since 3.18 Linux kernels, which
> makes a little bit harder to backport latest sbuild (for instance,
> Jessie has 3.16), this change could cause issues on systems where
> overlayfs is not available (thinking about kFreeBSD, for instance).

does there exist an easy way to detect at run-time whether overlayfs is
available on the system?

If yes, then that mechanism could be used to dynamically either add or not add
the union-type=overlay line to the default schroot configuration.

> Would a patch adding a new switch to define a different union-type method be
> welcome?

I don't think a switch would be a good idea for the following reasons:

 - if the user is willing to think of manually supplying a command line switch
   to sbuild-createchroot, then they could as well also just edit the schroot
   configuration

 - it is not clear which the default should be. Should we make overlayfs the
   default because linux-* architectures have more users? That doesn't seem
   fair.

 - sbuild should do the right thing out of the box. Switches should be there to
   overwrite the default behavior. Thus auto-detection would be awesome.

 - leaving it as a sbuildrc config option would make more sense because then
   users on non-overlayfs architectures could permanently store this
   information in their sbuildrc

Thanks!

cheers, josch


signature.asc
Description: signature


Bug#813360: [buildd-tools-devel] Bug#813360: Overlayfs available on newer Linux kernel only

2016-02-01 Thread Luca Falavigna
2016-02-01 12:32 GMT+01:00 Johannes Schauer :
> does there exist an easy way to detect at run-time whether overlayfs is
> available on the system?

A dumb method could be checking whether the filesystem is listed in
/proc/filesystems:
$ cat /proc/filesystems | grep overlay
nodev overlay
$

But I think it will return nothing if overlay module is not loaded via
modprobe first, and again it's Linux-specific...

A full check would be like this:
if system is Linux:
if /proc/filesystem contains overlayfs:
overlayfs available
else if modprobe overlay:
overlayfs available
else:
overlayfs not available
else:
overlayfs not available

... but my impression it's not 100% error-proof.

-- 
Cheers,
Luca



Bug#813360: [buildd-tools-devel] Bug#813360: Overlayfs available on newer Linux kernel only

2016-02-01 Thread Johannes Schauer
Hi,

Quoting Luca Falavigna (2016-02-01 16:34:11)
> A dumb method could be checking whether the filesystem is listed in
> /proc/filesystems:
> $ cat /proc/filesystems | grep overlay
> nodev overlay
> $
> 
> But I think it will return nothing if overlay module is not loaded via
> modprobe first, and again it's Linux-specific...
> 
> A full check would be like this:
> if system is Linux:
> if /proc/filesystem contains overlayfs:
> overlayfs available
> else if modprobe overlay:
> overlayfs available
> else:
> overlayfs not available
> else:
> overlayfs not available
> 
> ... but my impression it's not 100% error-proof.

I don't think it needs to be. Should there be a system supporting overlayfs but
without /proc/filesystem or where modprobe fails, then the user can still
automatically edit their schroot configuration manually after having run
sbuild-createchroot and then file a bug against sbuild about why the existing
checks failed in their case at which point we can improve the check.

You initially offered a patch - I'd definitely welcome one :)

Thanks!

cheers, josch


signature.asc
Description: signature