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

Re: Install on Orange Pi Plus eMMC work but no reboot

On Fri, Oct 07, 2016 at 01:57:41AM +0200, Jean-Christian de Rivaz wrote:
> Le 07. 10. 16 à 00:39, Karsten Merker a écrit :
> >On Thu, Oct 06, 2016 at 08:13:45PM +0200, Jean-Christian de Rivaz wrote:
> >
> >>Right. For my curiosity I tested the netboot SD card image of
> >>the Debian installer and tried to tell it to partition, format
> >>and install Debian into the very same SD card the installer
> >>booted from.  To my great surprise this worked flawlessly (just
> >>need a power cycle as the reboot simply hang).  This work only
> >>with the netboot image.  The hd-media require an other
> >>partition with the ISO file making the partition/format fail
> >>because the SD card device is busy.  I don't know at this stage
> >>if the boot stage is a residual of the image creation on the SD
> >>card or if it was wrote by the installer.

> >The debian-installer doesn't install u-boot, but it takes
> >explicit care not to destroy an existing u-boot installation
> >during the partitioning step.
> Yes. It take so much care that it don't write u-boot when it
> must write it...

Such an aggressive undertone doesn't exactly further the

> If the installer is able to take care of the region where
> u-boot is, why don't allow him to optionally copy that region
> from the SD card to the eMMC ?

First, there is a massive difference between taking care to
preserve the boot area and thereby an existing u-boot setup
(which might not even come from Debian) and performing a write
operation that has the potential to wipe out the user's setup and
even potentially brick the system.

Second, simply copying the u-boot region from SD card to the eMMC
has a number of practical problems.  The exact layout of u-boot
and its environment is system-specific.  So while on many systems
simply copying the area between the partition table and the first
megabyte of the medium works in practice without negative
effects, that is not the case for _all_ systems, which again ends
up with the point that I already made: installing u-boot is a
system-dependent step where there is no "one size fits for all". 
Another practical problem is that the installer has no way to
know whether there is a valid u-boot setup on the SD card.  The
user might have a system that came preinstalled with a u-boot at
another location (eMMC, SPI NOR flash) and uses that to boot. 
The SD card images are not the only way the installer can get
started, it can be booted by tftp or from a USB stick and there
is no way for the installer to know from where it was loaded and
whether the SD card that might happen to be in the slot by chance
contains a valid u-boot, so blindly copying the boot region from
the SD card might end up with a broken system.

You wrote an another mail:
> This thread is explicitly about the Orange Pi Plus board,
> because there exists a specific Debian installer SD card
> firmware for that board.  This board do the boot order in the
> right way and it's perfectly safe to write the bootloader on
> is eMMC.

You might have misunderstood the way the SD card images are
built.  The "firmware" part of the images contains only the
partition table and the system-specific u-boot.  The actual
installer is the same for all platforms.  There is no such thing
as "the installer for the Orange Pi Plus", therefore all
components of the installer must use a platform-neutral design.

Again, I am not against providing an option to install u-boot
from within the installer, but it has to be done in a way that
works for multiple platforms and doesn't easily brick the user's
system.  These requirements cannot be fulfilled with "blindly
copy some sectors from the SD card in the slot".

A possible design could work similar to what the flash-kernel
package does, i.e. having a database of systems which lists the
specific needs and angles of each system and providing methods
to deal with common cases.

> >Regarding the hd-media image: installing to the SD card from
> >which the installer is started works if the CD/DVD iso is
> >provided on another storage device such as on a USB stick.
> What's the point to support a such complicated install setup if
> at the end there is no u-boot to start the system ?

I'm sorry to have to say that, but to me this looks like it is
intended as flamebait :-(. I'll try to answer the question

First, you were talking about the case of installing the system
onto the SD card from which you have booted u-boot and the
installer, so in this case there _is_ a u-boot.

Second, the setup isn't complicated at all. The function of the
hd-media installer is to perform offline installations.  It pulls
the packages from a CD/DVD which can be available anywhere on the
system, be it in form of a physical disk in a CD/DVD drive or in
form of an ISO image on any block device.  Whether this block
device is an SD card or a USB stick doesn't matter at all from
the viewpoint of the installer.  That the case "have the packages
to be installed in a location that you repartition and format
during their installation" cannot work appears rather obvious to

Gem. Par. 28 Abs. 4 Bundesdatenschutzgesetz widerspreche ich der Nutzung
sowie der Weitergabe meiner personenbezogenen Daten für Zwecke der
Werbung sowie der Markt- oder Meinungsforschung.

Reply to: