Guide to creating a chroot environment - specifically with a different kernel

2

1

I have successfully installed a Ubuntu chroot (Maverick) on a running Linux appliance (an old Thecus N5200PRO box) which has been running various services for me quite happily.

When I attempted to add a webcam (for snapshotting) to this mix, I've come up against a problem. Since the chroot by default uses the kernel of the Thecus appliance, there appears to (understandably) be no support for the Logitech UVC webcam in the appliances' kernel; consequently inside or outside the chroot I can't access the UVC webcam.

I think I can get around this in a simple way if I can run a standard Ubuntu Maverick 32-bit kernel in the chroot. All my searches for a 'chrooting but with a different kernel guide' have been unsuccessful - plenty of helpful chrooting guides, but if kernel replacement is described at all, it's mentioned in unpleasant tones.

Does anyone know how to chroot with alternative kernels, or quite simply, how to get a UVC webcam accessible on a Thecus N5200PRO?

Other details:

Gavin C

Posted 2011-05-09T17:01:50.013

Reputation: 53

Answers

2

You can't have a chroot with a different kernel. You'll have to look at virtualization if you need this. Or just build a newer uvcvideo module for the kernel you do have.

Ignacio Vazquez-Abrams

Posted 2011-05-09T17:01:50.013

Reputation: 100 516

Can you give me a cite for this? I feel like I've read conflicting information. BTW, it's not that I don't believe, I'm just looking for the full context :) – Gavin C – 2011-05-09T19:05:23.463

Only one kernel can be running on the bare metal at a time. The kernel is also responsible for providing the chroot capability. If you replace the kernel then you won't have the chroot anymore, and if the new kernel can't handle the loss of the chroot then it is likely to fall over shortly thereafter. – Ignacio Vazquez-Abrams – 2011-05-09T19:11:42.770

Thanks for expanding further - what you say makes sense, but I was looking for an actual reference (cite) that categorically confirms and goes into detail about this limitation of chroot. When I read paragraphs like this it reads to me like it is possible - trying to understand my misunderstanding...

– Gavin C – 2011-05-09T19:31:24.763

Um... yeah. That paragraph makes no sense. proc is always created from the currently-running kernel, regardless of where it's mounted. – Ignacio Vazquez-Abrams – 2011-05-09T19:45:44.917

this is a very specific case - you arn't running the new kernel, you're running a seperate environment, with its libraries, under an old kernel, to set up the new install and its directories- This is the 'classic' old school linux install method – Journeyman Geek – 2011-05-10T08:45:38.380

Well, lack of citations aside, I think my "alternate kernel in a chroot" question has been fully answered. Thanks guys. – Gavin C – 2011-05-10T16:45:42.860

@journeyman-geek - didn't want to prejudice it, but yeah that was what I was worried it might have been about. Clear as mud, as they say. – Gavin C – 2011-05-10T17:07:36.547

1

You can not run chroot with new kernel. Only one kernel will be in effect at a time. Though you can switch the kernel by kexec . But that's a different story.

The only way to switch the new kernel with chrooted environment is that to go with VMWare, or VBox. [ Or may be with UML, but need to check out ]

SHW

Posted 2011-05-09T17:01:50.013

Reputation: 299

Thanks for the tip about UML, it might be helpful but the device is pretty constrained resource wise. Chroot is fine, but anything that has to have ram assigned is pretty much a non-starter. – Gavin C – 2011-05-10T17:05:32.790