Bug#732551: make --foreign / qemu-user-static easier

2018-04-18 Thread Ben Hutchings
On Wed, 2018-04-18 at 15:41 -0700, Vagrant Cascadian wrote:
> On 2013-12-18, Joey Hess  wrote:
> > If debootstrap installed qemu-user-static into the chroot
> > when --foreign was used, it could then immediately chroot in
> > and run commands (assuming the host system has binfmt-support
> > installed). 
> > 
> > This would allow debootstrap to go ahead and run the second stage
> > itself, under qemu emulation, and leave the user with a foreign chroot
> > that could be transparently chrooted into.
> 
> With version 2.12~rc3 (currently in unstable), qemu-user-static doesn't
> require copying the qemu-ARCH-static binary into the chroot.
> 
> You can simply call:
> 
>   debootstrap --arch=ARCH sid CHROOT
> 
> ... and it just works now, without any debootstrap --foreign or
> qemu-debootstrap wrappers!
> 
> You might still want the binary copied into the chroot to make it easier
> if moving the chroot to another machine, but that seems well outside the
> scope of what debootstrap should worry about.

I think this depends on a new feature in binfmt_misc in Linux 4.8, so
the copy will also be needed on a jessie or wheezy host.

Ben.

-- 
Ben Hutchings
It's easier to fight for one's principles than to live up to them.



signature.asc
Description: This is a digitally signed message part


Bug#732551: make --foreign / qemu-user-static easier

2018-04-18 Thread Vagrant Cascadian
On 2013-12-18, Joey Hess  wrote:
> If debootstrap installed qemu-user-static into the chroot
> when --foreign was used, it could then immediately chroot in
> and run commands (assuming the host system has binfmt-support
> installed). 
>
> This would allow debootstrap to go ahead and run the second stage
> itself, under qemu emulation, and leave the user with a foreign chroot
> that could be transparently chrooted into.

With version 2.12~rc3 (currently in unstable), qemu-user-static doesn't
require copying the qemu-ARCH-static binary into the chroot.

You can simply call:

  debootstrap --arch=ARCH sid CHROOT

... and it just works now, without any debootstrap --foreign or
qemu-debootstrap wrappers!

You might still want the binary copied into the chroot to make it easier
if moving the chroot to another machine, but that seems well outside the
scope of what debootstrap should worry about.


live well,
  vagrant


signature.asc
Description: PGP signature


Bug#732551: make --foreign / qemu-user-static easier

2013-12-21 Thread Ian Campbell
On Thu, 2013-12-19 at 14:33 -0400, Joey Hess wrote:
 Ian Campbell wrote:
  That would get you the foreign binary of qemu-user-static, wouldn't it?
  
  What is needed is to copy /usr/bin/qemu-$ARCH-static from the host
  environment.
 
 Yes, but then nothing will upgrade it, which is important since user
 mode qemu often has missing syscalls that get added in newer versions.

True, this is why tools like schroot copy it on each entry (actually, UI
think schroot uses a bind mount, but anyway...)

 deboostrap could arrange for the package to be installed in the chroot,
 using multiarch.

That would be neat I suppose.

Totally out of scope for this bugreport but I wonder how hard it would
be to create a chroot which used the host versions of things like bash
etc but the target versions of things like gcc. I expect any effort
expended on that would be better spent on getting the proper cross
environment stuff working...

Ian.


-- 
To UNSUBSCRIBE, email to debian-boot-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/1387624923.17491.1.ca...@dagon.hellion.org.uk



Bug#732551: make --foreign / qemu-user-static easier

2013-12-19 Thread Ian Campbell
On Wed, 2013-12-18 at 13:08 -0400, Joey Hess wrote:
 Package: debootstrap
 Version: 1.0.55
 Severity: wishlist
 
 If debootstrap installed qemu-user-static into the chroot
 when --foreign was used

That would get you the foreign binary of qemu-user-static, wouldn't it?

What is needed is to copy /usr/bin/qemu-$ARCH-static from the host
environment.

Ian.


-- 
To UNSUBSCRIBE, email to debian-boot-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/1387452064.9925.55.ca...@kazak.uk.xensource.com



Bug#732551: make --foreign / qemu-user-static easier

2013-12-19 Thread Dimitri John Ledkov
On 19 December 2013 11:21, Ian Campbell i...@hellion.org.uk wrote:
 On Wed, 2013-12-18 at 13:08 -0400, Joey Hess wrote:
 Package: debootstrap
 Version: 1.0.55
 Severity: wishlist

 If debootstrap installed qemu-user-static into the chroot
 when --foreign was used

 That would get you the foreign binary of qemu-user-static, wouldn't it?

 What is needed is to copy /usr/bin/qemu-$ARCH-static from the host
 environment.


I use mk-sbuild utility which debootstraps native,
qemu-user-static native (copies from host, and i believe by means of
qemu-debootstrap), and cross chroots for any debian/ubuntu/custom
releases.

Works very well. Not sure it's at all appropriate for debootstrap to
grow such / similar extra features. Most recently using it for arm64
qemu-user-static native chroots and arm64 cross-compilation chroots.

(mk-sbuild has other tricks up it's sleeve as well, like setting up
snapshots using lvm/overlayfs/aufs, opting-in to use eatmydata, add
custom sources etc.)

-- 
Regards,

Dimitri.


-- 
To UNSUBSCRIBE, email to debian-boot-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/canbhluh--sto2m5bhtuh0xuut5tmkm87ugkunm3vx8dujpj...@mail.gmail.com



Bug#732551: make --foreign / qemu-user-static easier

2013-12-19 Thread Joey Hess
Ian Campbell wrote:
 That would get you the foreign binary of qemu-user-static, wouldn't it?
 
 What is needed is to copy /usr/bin/qemu-$ARCH-static from the host
 environment.

Yes, but then nothing will upgrade it, which is important since user
mode qemu often has missing syscalls that get added in newer versions.

deboostrap could arrange for the package to be installed in the chroot,
using multiarch.

-- 
see shy jo


signature.asc
Description: Digital signature


Bug#732551: make --foreign / qemu-user-static easier

2013-12-18 Thread Joey Hess
Package: debootstrap
Version: 1.0.55
Severity: wishlist

If debootstrap installed qemu-user-static into the chroot
when --foreign was used, it could then immediately chroot in
and run commands (assuming the host system has binfmt-support
installed). 

This would allow debootstrap to go ahead and run the second stage
itself, under qemu emulation, and leave the user with a foreign chroot
that could be transparently chrooted into.

https://wiki.debian.org/QemuUserEmulation for details

-- 
see shy jo


signature.asc
Description: Digital signature


Bug#732551: make --foreign / qemu-user-static easier

2013-12-18 Thread Vagrant Cascadian
On Wed, Dec 18, 2013 at 01:08:05PM -0400, Joey Hess wrote:
 If debootstrap installed qemu-user-static into the chroot
 when --foreign was used, it could then immediately chroot in
 and run commands (assuming the host system has binfmt-support
 installed). 

qemu-user-static includes qemu-debootstrap which does exactly this.

You're thinking that should be merged into debootstrap directly?

live well,
  vagrant


-- 
To UNSUBSCRIBE, email to debian-boot-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20131219004314.gs27...@cascadia.debian.net



Bug#732551: make --foreign / qemu-user-static easier

2013-12-18 Thread Joey Hess
Vagrant Cascadian wrote:
 On Wed, Dec 18, 2013 at 01:08:05PM -0400, Joey Hess wrote:
  If debootstrap installed qemu-user-static into the chroot
  when --foreign was used, it could then immediately chroot in
  and run commands (assuming the host system has binfmt-support
  installed). 
 
 qemu-user-static includes qemu-debootstrap which does exactly this.
 
 You're thinking that should be merged into debootstrap directly?

Ok.. No docs pointed that out.

I think it would be a net loss of complexity to roll this into
debootstrap. Unless there are a lot of other qemu-user-static like
things that this might slippery slope debootstrap into being responsible
for, but that seems unlikely.

The existence of wrappers like this that use --foreign do argue that a
new switch should be needed for this behavior. Something like
--with-qemu

-- 
see shy jo


signature.asc
Description: Digital signature