FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Development

 
 
LinkBack Thread Tools
 
Old 01-20-2009, 12:46 PM
Oliver Grawert
 
Default missing /dev/console in debootstrap --foreign, a bug or not ?

hi,

we are currently trying to develop a tool to cross build an ARM rootfs.
This tool is essentially a wrapper around debootstrap and
qemu-system-arm. It first runs debootstrap --foreign on a qemu image it
creates, then spawns a qemu instance in which it
runs /debootstrap/debootstrap --second-stage (it does a good bunch of
other stuff, but thats not relevant for this mail).

What we found during work on this script is that the first stage of
debootstrap --foreign does not create a /dev/console node, so qemu
panics during boot if you ise it with a bare kernel image (it might be
different if you use an initramfs that spawns udev though, which we
currently not do for bootstrapping)

currently the script simply calls mknod to add the device file to the
image, but we were discussing the issue in the mobile team and came to
the conclusion that running debootstrap --foreign might indeed often be
used like that. to me it is not clear if debootstrap --foreign shouldnt
create /dev/console in any case. normal debootstrapping of non foreign
chroots wouldnt be affected so the default behavior wouldnt change if
you for example do a debootstrap --arch=i386 on an amd64 host or
--arch=lpia on a i386 one ... it would only affect cases where yu
actually can not chroot and execute the binaries inside the chroot.

some input from people with deeper insight in the debootstrap code would
be very helpful here.

ciao
oli


--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel
 
Old 01-20-2009, 01:19 PM
"Robert Nelson"
 
Default missing /dev/console in debootstrap --foreign, a bug or not ?

On Tue, Jan 20, 2009 at 7:46 AM, Oliver Grawert <ogra@ubuntu.com> wrote:
> hi,
>
> we are currently trying to develop a tool to cross build an ARM rootfs.
> This tool is essentially a wrapper around debootstrap and
> qemu-system-arm. It first runs debootstrap --foreign on a qemu image it
> creates, then spawns a qemu instance in which it
> runs /debootstrap/debootstrap --second-stage (it does a good bunch of
> other stuff, but thats not relevant for this mail).
>
> What we found during work on this script is that the first stage of
> debootstrap --foreign does not create a /dev/console node, so qemu
> panics during boot if you ise it with a bare kernel image (it might be
> different if you use an initramfs that spawns udev though, which we
> currently not do for bootstrapping)
>
> currently the script simply calls mknod to add the device file to the
> image, but we were discussing the issue in the mobile team and came to
> the conclusion that running debootstrap --foreign might indeed often be
> used like that. to me it is not clear if debootstrap --foreign shouldnt
> create /dev/console in any case. normal debootstrapping of non foreign
> chroots wouldnt be affected so the default behavior wouldnt change if
> you for example do a debootstrap --arch=i386 on an amd64 host or
> --arch=lpia on a i386 one ... it would only affect cases where yu
> actually can not chroot and execute the binaries inside the chroot.
>
> some input from people with deeper insight in the debootstrap code would
> be very helpful here.
>
> ciao
> oli
>
>

Hi Oliver,

I had to do something similar before "Mojo Handhelds" introduced a
debian-installer, you can find it in the archives here:
http://elinux.org/index.php?title=BeagleBoardHandheldsMojo&diff=9074 &oldid=6933

Basically we did this in qemu:

sudo debootstrap --verbose --arch arm --foreign
--exclude=dash,handhelds-keyring frisky /media/disk-2/
http://repository.handhelds.org/frisky-armv6el-vfp/

sudo debootstrap --verbose --arch arm --foreign hasty /media/disk-2/
http://repository.handhelds.org/hasty-armv5el/

followed by, to make it boot in QEMU, such that we can complete the
install (second-stage):

sudo mknod /media/disk-2/dev/console c 5 1

Although from experience, things were much easier for end users just
to go with the debian-installer method over pure deboostrap, just way
to much confusion for new users.

Otherwise the debootstrap in Jaunty works great in chroot environments..


http://elinux.org/BeagleBoardHandheldsMojo
http://elinux.org/BeagleBoardDebian


Regards,

--
Robert Nelson
http://www.rcn-ee.com/

--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel
 
Old 01-20-2009, 01:26 PM
Oliver Grawert
 
Default missing /dev/console in debootstrap --foreign, a bug or not ?

hi,
Am Dienstag, den 20.01.2009, 08:19 -0600 schrieb Robert Nelson:

> I had to do something similar before "Mojo Handhelds" introduced a
> debian-installer, you can find it in the archives here:
> http://elinux.org/index.php?title=BeagleBoardHandheldsMojo&diff=9074 &oldid=6933
yes, i know it and the other steps mojo uses, the question here was
though if adding a line that fixes the /dev/console to debootstrap
--foreign makes sense or not ... debian-installer indeed uses a udev
udeb and its own initrd so you will never run into that problem with
it ...

ciao
oli
--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel
 
Old 01-20-2009, 02:04 PM
Loc Minier
 
Default missing /dev/console in debootstrap --foreign, a bug or not ?

On Tue, Jan 20, 2009, Oliver Grawert wrote:
> What we found during work on this script is that the first stage of
> debootstrap --foreign does not create a /dev/console node, so qemu
> panics during boot if you ise it with a bare kernel image (it might be
> different if you use an initramfs that spawns udev though, which we
> currently not do for bootstrapping)

What does exactly "panic"? Can we fix some early userspace to not
require /dev/console until the regular boot (without initramfs) starts
udev which would create it?

> currently the script simply calls mknod to add the device file to the
> image, but we were discussing the issue in the mobile team and came to
> the conclusion that running debootstrap --foreign might indeed often be
> used like that. to me it is not clear if debootstrap --foreign shouldnt
> create /dev/console in any case.

I think it wouldn't hurt if debootstrap's second stage would create
/dev/console if it's required and missing, but I'm not sure whether we
can actually start debootstrap's second stage.

--
Loc Minier

--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel
 
Old 01-20-2009, 02:05 PM
"Robert Nelson"
 
Default missing /dev/console in debootstrap --foreign, a bug or not ?

On Tue, Jan 20, 2009 at 8:26 AM, Oliver Grawert <ogra@ubuntu.com> wrote:
> hi,
> Am Dienstag, den 20.01.2009, 08:19 -0600 schrieb Robert Nelson:
>
>> I had to do something similar before "Mojo Handhelds" introduced a
>> debian-installer, you can find it in the archives here:
>> http://elinux.org/index.php?title=BeagleBoardHandheldsMojo&diff=9074 &oldid=6933
> yes, i know it and the other steps mojo uses, the question here was
> though if adding a line that fixes the /dev/console to debootstrap
> --foreign makes sense or not ... debian-installer indeed uses a udev
> udeb and its own initrd so you will never run into that problem with
> it ...
>

Sorry Oliver for hijacking the thread.

From my research, using debootstrap with --foreign has always required
the user to create device nodes afterwards with mknod (/dev/console).
Either the original author had a good reason, (which i haven't found
any explanation) or no one has thought to expand on it.

Regards,

--
Robert Nelson
http://www.rcn-ee.com/

--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel
 
Old 01-20-2009, 02:12 PM
Oliver Grawert
 
Default missing /dev/console in debootstrap --foreign, a bug or not ?

hi,
Am Dienstag, den 20.01.2009, 16:04 +0100 schrieb Loc Minier:
> On Tue, Jan 20, 2009, Oliver Grawert wrote:
> > What we found during work on this script is that the first stage of
> > debootstrap --foreign does not create a /dev/console node, so qemu
> > panics during boot if you ise it with a bare kernel image (it might be
> > different if you use an initramfs that spawns udev though, which we
> > currently not do for bootstrapping)
>
> What does exactly "panic"? Can we fix some early userspace to not
> require /dev/console until the regular boot (without initramfs) starts
> udev which would create it?
the kernel wants it to write output to it ... the only area where i
could imagine such a creation would be upstart to create teh device if
it doesnt find it ... not sure thats feasable or even remotely sane
>
> > currently the script simply calls mknod to add the device file to the
> > image, but we were discussing the issue in the mobile team and came to
> > the conclusion that running debootstrap --foreign might indeed often be
> > used like that. to me it is not clear if debootstrap --foreign shouldnt
> > create /dev/console in any case.
>
> I think it wouldn't hurt if debootstrap's second stage would create
> /dev/console if it's required and missing, but I'm not sure whether we
> can actually start debootstrap's second stage.
init dies (or teh kernel rather kills it) if it doesnt have the device
available (the panic is the good old: "attempting to kill init" with no
further info) so you wont even get to debootstrap's second stage ...

ciao
oli
--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel
 
Old 01-20-2009, 02:17 PM
Oliver Grawert
 
Default missing /dev/console in debootstrap --foreign, a bug or not ?

hi,
Am Dienstag, den 20.01.2009, 09:05 -0600 schrieb Robert Nelson:
> Sorry Oliver for hijacking the thread.
it were very valid comments, thanks for adding them

> >From my research, using debootstrap with --foreign has always required
> the user to create device nodes afterwards with mknod (/dev/console).
> Either the original author had a good reason, (which i haven't found
> any explanation) or no one has thought to expand on it.
right, if its feasable to do so, i would like to see it expanded in such
a way, there is no reason to require the user to have to run mknod if
debootstrap can do it itself ... from my understanding the foreign
option always has to be used in the context we do (running the second
stage either on real HW or in a VM ...) so enabling the setup to boot
seems essential to me ...

ciao
oli
--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel
 
Old 01-20-2009, 02:20 PM
Scott James Remnant
 
Default missing /dev/console in debootstrap --foreign, a bug or not ?

On Tue, 2009-01-20 at 16:04 +0100, Loc Minier wrote:

> On Tue, Jan 20, 2009, Oliver Grawert wrote:
> > What we found during work on this script is that the first stage of
> > debootstrap --foreign does not create a /dev/console node, so qemu
> > panics during boot if you ise it with a bare kernel image (it might be
> > different if you use an initramfs that spawns udev though, which we
> > currently not do for bootstrapping)
>
> What does exactly "panic"? Can we fix some early userspace to not
> require /dev/console until the regular boot (without initramfs) starts
> udev which would create it?
>
Is there an initramfs at all? I had a vague belief that the default
in-kernel initramfs included a /dev/console?


> > currently the script simply calls mknod to add the device file to the
> > image, but we were discussing the issue in the mobile team and came to
> > the conclusion that running debootstrap --foreign might indeed often be
> > used like that. to me it is not clear if debootstrap --foreign shouldnt
> > create /dev/console in any case.
>
> I think it wouldn't hurt if debootstrap's second stage would create
> /dev/console if it's required and missing, but I'm not sure whether we
> can actually start debootstrap's second stage.
>
debootstrap does call MAKEDEV with a few essentials (including console)
and unpacks this during the first stage.

Scott
--
Scott James Remnant
scott@canonical.com
--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel
 
Old 01-20-2009, 02:34 PM
Oliver Grawert
 
Default missing /dev/console in debootstrap --foreign, a bug or not ?

hi,
Am Dienstag, den 20.01.2009, 16:12 +0100 schrieb Oliver Grawert:
> hi,
> Am Dienstag, den 20.01.2009, 16:04 +0100 schrieb Loc Minier:
> > On Tue, Jan 20, 2009, Oliver Grawert wrote:
> > > What we found during work on this script is that the first stage of
> > > debootstrap --foreign does not create a /dev/console node, so qemu
> > > panics during boot if you ise it with a bare kernel image (it might be
> > > different if you use an initramfs that spawns udev though, which we
> > > currently not do for bootstrapping)
> >
> > What does exactly "panic"? Can we fix some early userspace to not
> > require /dev/console until the regular boot (without initramfs) starts
> > udev which would create it?
> the kernel wants it to write output to it ... the only area where i
> could imagine such a creation would be upstart to create teh device if
> it doesnt find it ... not sure thats feasable or even remotely sane
one issue here that Scott just pointed out on IRC is indeed that the FS
is readonly at this point, so running mknod is no option at this
point ...

ciao
oli
--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel
 
Old 01-20-2009, 04:40 PM
Colin Watson
 
Default missing /dev/console in debootstrap --foreign, a bug or not ?

On Tue, Jan 20, 2009 at 03:20:39PM +0000, Scott James Remnant wrote:
> On Tue, 2009-01-20 at 16:04 +0100, Loc Minier wrote:
> > On Tue, Jan 20, 2009, Oliver Grawert wrote:
> > > currently the script simply calls mknod to add the device file to the
> > > image, but we were discussing the issue in the mobile team and came to
> > > the conclusion that running debootstrap --foreign might indeed often be
> > > used like that. to me it is not clear if debootstrap --foreign shouldnt
> > > create /dev/console in any case.
> >
> > I think it wouldn't hurt if debootstrap's second stage would create
> > /dev/console if it's required and missing, but I'm not sure whether we
> > can actually start debootstrap's second stage.
>
> debootstrap does call MAKEDEV with a few essentials (including console)
> and unpacks this during the first stage.

As discussed on IRC, it doesn't actually include console in its
devices.tar.gz. I certainly regard this as a bug, and have fixed it
upstream and backported it to Jaunty:

debootstrap (1.0.10ubuntu3) jaunty; urgency=low

* Backport from trunk:
- Add /dev/console to devices.tar.gz (after all, MAKEDEV's 'consoleonly'
was added for boot-floppies in the first place; see
https://lists.ubuntu.com/archives/ubuntu-devel/2009-January/027230.html).

-- Colin Watson <cjwatson@ubuntu.com> Tue, 20 Jan 2009 17:38:34 +0000

Thanks,

--
Colin Watson [cjwatson@ubuntu.com]

--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel
 

Thread Tools




All times are GMT. The time now is 05:33 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org