[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#751012: [flash-kernel] Flash-kernel should fail with exit 0 under debrootstrap



On Mon, 2014-06-09 at 23:27 +0200, Bastien ROUCARIES wrote:

> >> >> I have installed te kirkwood kernel and flash-kernel on my chroot.
> >> >
> >> > Out of interest, why?
> >>
> >> Because I wand to add support for dns-320 and thus I am creating an image.
> >
> > If this is to do with
> > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=724891 then you don't
> > need to create an image for that AFAIK.
> 
> Yes it is for it. Itis a chicken and egg problem. I boot from usb key
> and I have created a usb image

Debian doesn't provide "images" as such (at least not AFAIK), instead we
provide Debian Installer support for various platforms.

One way this is handled on other platforms (e.g. qnap) is to produce a
firmware image for the platform which is actually the Debian installer,
which you then flash and boot, at which point you can do a normal
install to whichever media you want to use as a rootfs. See for example:
http://www.cyrius.com/debian/kirkwood/qnap/ts-41x/install/

Or maybe even that isn't necessary for this platform and you can arrange
to just load and boot the installer vmlinuz+initrd.gz direct without
laundering through the "firmware image"? Assuming the kernel has the
appropriate drivers all that should be needed for that to work is a
patched flash-kernel with a new db entry for your platform.

> >> >> The problem is that flash-kernel is run by initramfs/post-update.d/flash-kernel
> >> >>
> >> >> I have added an exit 0 at the beginning of this file and everything is ok
> >> >>
> >> >> The best think is to exit 0 if we are under a debootstrap.
> >> >
> >> > If you want to install flash-kernel in a chroot/debootstrap etc then you
> >> > should set FK_MACHINE=none in the environment or write none to
> >> > $chroot/etc/flash-kernel/machine, either of which will cause
> >> > flash-kernel to become a nop.
> >>
> >> Is it documented somewhere ?
> >
> > Apart from in the flash-kernel changelog, no.
> 
> Could be mentioned in the man page ?

Sure. I've now got the following in my local branch. It's on top of a
few other changes which I've yet to test so I haven't actually pushed to
the main repo yet.

commit a0342f7e7eeae4911a1f64c311224189086d148a
Author: Ian Campbell <ijc@hellion.org.uk>
Date:   Tue Jun 10 08:32:36 2014 +0100

    Document FK_MACHINE in the manpage.

diff --git a/debian/changelog b/debian/changelog
index bee892b..02bfa2d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,7 @@ flash-kernel (3.21) UNRELEASED; urgency=medium
     (Closes: #751066)
   * Add support for SolidRun Cubox-i Dual/Quad. Patch from Vagrant Cascadian.
     (Closes: #750953)
+  * Document FK_MACHINE in the manpage.
 
  -- Ian Campbell <ijc@hellion.org.uk>  Tue, 10 Jun 2014 08:19:57 +0100
 
diff --git a/flash-kernel.8 b/flash-kernel.8
index 3655ef3..6896a8e 100644
--- a/flash-kernel.8
+++ b/flash-kernel.8
@@ -27,5 +27,16 @@ subarchitecture.
 .P
 If the \-\-supported option is used, flash\-kernel will test to see if
 the hardware is supported, and return a true or false value.
+.SH ENVIRONMENT VARIABLES
+
+.IP FK_MACHINE
+Specify the specific machine, overriding the autodetection. Can be set
+to `none' to disable flash-kernel. This can be used when installing
+flash-kernel into a chroot, for example while preparing a filesystem
+image.
+.B WARNING: Take great care when running flash-kernel in a chroot, since the
+.B choice of machine may cause host filesystem partitions to be mounted and 
+.B modified.
+
 .SH AUTHOR
 Martin Michlmayr <tbm@cyrius.com>


Reply to: