How to install Debian 9.x on a BBB running Debian 7?

I've been trying to do this for *ages* without success.

I have a 4Gb eMMC BBB running Debian 7. I want to install Debian 9 on
it and I just can't get it to do it. I have Debian 9 images that
install successfully on BBBs with more modern software but I simply
can't get it to work on this Debian 7 one.

So, in simple terms please, how do I do this?

I want a console image (i.e. not IOT or full GUI). I run Linux on all
my systems so I need the Linux way to do it. The sequence (with
questions) is:-

    Select a suitable image and download it. Where do I get a console
    image that's easy to install?

    Copy the image to a microSD. Easiest for me is to use dd but I
    need to know whether I copy it to /dev/sda or to /dev/sda1
    (assuming the microSD comes up as /dev/sda on my Linux box).

    Put the microSD into the BBB

    Boot the SD. Is this with/without boot button pressed? If it
    still boots in Debian 7 is there a way to get it to load the
    Debian 9 install from the command line?

Answer to any/all of these questions would be *very* welcome!

Hi Chris!

I’ve been trying to do this for ages without success.

I have a 4Gb eMMC BBB running Debian 7. I want to install Debian 9 on
it and I just can’t get it to do it. I have Debian 9 images that
install successfully on BBBs with more modern software but I simply
can’t get it to work on this Debian 7 one.

So, in simple terms please, how do I do this?

I want a console image (i.e. not IOT or full GUI). I run Linux on all
my systems so I need the Linux way to do it. The sequence (with
questions) is:-

Select a suitable image and download it. Where do I get a console
image that’s easy to install?

What you’re trying to do should be very easy.

I usually start from the latest image drop here:
https://rcn-ee.net/rootfs/bb.org/testing/

Occasionally I need to go back to an earlier build to find the “vanilla” images. At the moment I’d try this one:
https://rcn-ee.net/rootfs/bb.org/testing/2018-06-03/stretch-console/bone-debian-9.4-console-armhf-2018-06-03-1gb.img.xz

Copy the image to a microSD. Easiest for me is to use dd but I
need to know whether I copy it to /dev/sda or to /dev/sda1
(assuming the microSD comes up as /dev/sda on my Linux box).

I’ve always targeted /dev/mmcblk0 and it works, so you probably need to use /dev/sda. E.g. I can find commands like this in my history:

xzcat bone-debian-9.1-console-armhf-2017-09-24-1gb.img.xz | sudo dcfldd of=/dev/mmcblk0

Put the microSD into the BBB

Boot the SD. Is this with/without boot button pressed? If it
still boots in Debian 7 is there a way to get it to load the
Debian 9 install from the command line?

There are instructions saying you need to keep the User Boot button pressed while connecting power to the BeagleBone (this will re-wire the boot priorities of the ARM chip so SD card becomes the first one to try).
https://learn.adafruit.com/beaglebone-black-installing-operating-systems/flashing-the-beaglebone-black

However, I have re-flashed many dozens of BeagleBones over the last year and a half without doing anything other than popping in the SD card and rebooting. It always loads the OS from the SD card. This depends on the boot loader presently installed in the device’s eMMC, so if you have a really old one then it might require holding down the User Boot button after all.

Oh, and just to emphasize - booting this image will wipe the eMMC and install a clean Debian and boot loader. You will lose every bit stored in the eMMC.

[-- multipart/alternative, encoding 7bit, 162 lines --]

    [-- text/plain, encoding 7bit, charset: UTF-8, 73 lines --]

Hi Chris!

>
> I've been trying to do this for *ages* without success.
>
> I have a 4Gb eMMC BBB running Debian 7. I want to install Debian 9 on
> it and I just can't get it to do it. I have Debian 9 images that
> install successfully on BBBs with more modern software but I simply
> can't get it to work on this Debian 7 one.
>
> So, in simple terms please, how do I do this?
>
> I want a console image (i.e. not IOT or full GUI). I run Linux on all
> my systems so I need the Linux way to do it. The sequence (with
> questions) is:-
>
> Select a suitable image and download it. Where do I get a console
> image that's easy to install?
>

What you're trying to do should be very easy.

Yes, I know, but in this particular case it isn't! :slight_smile:

I usually start from the latest image drop here:
https://rcn-ee.net/rootfs/bb.org/testing/

Occasionally I need to go back to an earlier build to find the "vanilla"
images. At the moment I'd try this one:
https://rcn-ee.net/rootfs/bb.org/testing/2018-06-03/stretch-console/bone-debian-9.4-console-armhf-2018-06-03-1gb.img.xz

OK, I'll go for that particular one when I'm back to a fast connection.

> Copy the image to a microSD. Easiest for me is to use dd but I
> need to know whether I copy it to /dev/sda or to /dev/sda1
> (assuming the microSD comes up as /dev/sda on my Linux box).
>

I've always targeted /dev/mmcblk0 and it works, so you probably need to use
/dev/sda. E.g. I can find commands like this in my history:
xzcat bone-debian-9.1-console-armhf-2017-09-24-1gb.img.xz | sudo dcfldd
of=/dev/mmcblk0

Yes, I'm pretty sure that's right, /dev/sda it is.

> Put the microSD into the BBB
>
> Boot the SD. Is this with/without boot button pressed? If it
> still boots in Debian 7 is there a way to get it to load the
> Debian 9 install from the command line?
>

There are instructions saying you need to keep the User Boot button pressed
while connecting power to the BeagleBone (this will re-wire the boot
priorities of the ARM chip so SD card becomes the first one to try).
https://learn.adafruit.com/beaglebone-black-installing-operating-systems/flashing-the-beaglebone-black

I've been doing this, hold boot button down, apply power while button
is down. It doesn't work, I still get Debian 7.

However, I have re-flashed many dozens of BeagleBones over the last year
and a half without doing anything other than popping in the SD card and
rebooting. It always loads the OS from the SD card. This depends on the
boot loader presently installed in the device's eMMC, so if you have a
really old one then it might require holding down the User Boot button
after all.

Neither way works. Tha same image self-installs on other (older!)
BBBs but not on this particular one.

Yes, of course, it's a new installation, not an upgrade.

It's a *big* pity that Debian doesn't have a do-release-upgrade
command like Ubuntu. I know it's not guraranteed to be 100% reliable
and that a clean install is sometimes a good idea but on the other
hand being able to 'upgrade' from one release to the next is very
handy.

Neither way works. Tha same image self-installs on other (older!)
BBBs but not on this particular one.

That's awfully suspicious. I'd try some basic debugging.

1. Verify your SD card is OK and the Beagle can actually read it.

Boot the Beagle from Debian 7 in eMMC, insert the SD card with Debian 9. Have a look at the SD card with fdisk to see the partition is there. Mount it, have a look at "/etc/dogtag" - it should state Debian 9.4 or something similar.

Usually the SD/eMMC devices on the Beagle are named:
/dev/mmcblk0 - SD card
/dev/mmcblk1 - eMMC

While you're at it, check that the wipe-and-install command is activated (I don't actually remember which way it is on vanilla images). The file /boot/uEnv.txt on the SD card should have the following line uncommented:
cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh

2. Connect to the serial debug header and post what uboot is saying when you boot with the SD card inserted and User Boot button pressed down.

Yes, of course, it's a new installation, not an upgrade.

It's a *big* pity that Debian doesn't have a do-release-upgrade
command like Ubuntu. I know it's not guraranteed to be 100% reliable
and that a clean install is sometimes a good idea but on the other
hand being able to 'upgrade' from one release to the next is very
handy.

To my knowledge it's possible and quite simple in Debian - I recall updating the /etc/sources.list file to point to the new release and executing "aptitude full-upgrade". Don't trust my advice, though. I've been running Debian testing for a long time and don't really have the big bang upgrades (nor do I miss them).

> Neither way works. Tha same image self-installs on other (older!)
> BBBs but not on this particular one.

That's awfully suspicious. I'd try some basic debugging.

1. Verify your SD card is OK and the Beagle can actually read it.

Yes, it can be read. I have the SD card plugged in at the moment and
I can see it as /dev/mmcblk0p1 mounted on /media/rootfs. I can cd to
/media/rootfs and see the directory structure and files of the image.

Boot the Beagle from Debian 7 in eMMC, insert the SD card with Debian 9.
Have a look at the SD card with fdisk to see the partition is there.
Mount it, have a look at "/etc/dogtag" - it should state Debian 9.4 or
something similar.

It automounts, no problem and (as noted above) has files on it.

Usually the SD/eMMC devices on the Beagle are named:
/dev/mmcblk0 - SD card
/dev/mmcblk1 - eMMC

Yes, exactly what I see.

While you're at it, check that the wipe-and-install command is activated
(I don't actually remember which way it is on vanilla images). The file
/boot/uEnv.txt on the SD card should have the following line uncommented:
cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh

Yes, I've been through all this. The last line of
/media/rootfs/boot/uEnv.txt is as above.

2. Connect to the serial debug header and post what uboot is saying when
you boot with the SD card inserted and User Boot button pressed down.

Not so easy, the BBB is on a boat (which is where I am at the moment)
I have someewhat limited hardware facilities here. I have a laptop
(running Linux) and the BBB and that's about it. I do have a
soldering iron and wire but the laptop doesn't have a serial input.

Is anything useful reported by the boot process in the logs or dmesg?

> Yes, of course, it's a new installation, not an upgrade.
>
> It's a *big* pity that Debian doesn't have a do-release-upgrade
> command like Ubuntu. I know it's not guraranteed to be 100% reliable
> and that a clean install is sometimes a good idea but on the other
> hand being able to 'upgrade' from one release to the next is very
> handy.

To my knowledge it's possible and quite simple in Debian - I recall
updating the /etc/sources.list file to point to the new release and
executing "aptitude full-upgrade". Don't trust my advice, though. I've
been running Debian testing for a long time and don't really have the
big bang upgrades (nor do I miss them).

Yes, I'm considering doing it this way, it might be the easiest way
out for me. I've seen a few sets of instructions for doing it.

I don't know anything about U-Boot, but I believe its log is gone after Linux starts up. And the Linux boot logs probably don't have anything useful in them.

Googling suggests U-Boot has a feature called netconsole which gives access the log via network. I didn't look into it in depth because it seems tricky.

When you boot with the SD inserted but the User Boot button left alone, the ARM micro probably starts the U-Boot on your eMMC. Apparently this U-Boot doesn't want to start Linux on the SD card like I've seen my boards (with newer software) do. That's not really surprising, as it is probably too old or has some bugs or whatnot.

When you boot with the User Boot button depressed, ARM micro is supposed to start U-Boot on your SD card, and that is supposed to start Linux on the SD card. BTW - a hard boot is required either by reconnecting power or pressing the Reset button. I'm kind of surprised that this doesn't seem to work for you. What exactly is the image on your SD card?

Anyway, I don't have any good suggestions.

You could try upgrading just the U-Boot on your eMMC - perhaps this would restore its ability to boot Linux from the SD card. I haven't a clue on how to do this and I didn't find anything useful after a 5-minute search.

You could try using another image on the SD card - perhaps yours has some U-Boot bug in it (although that sounds far fetched).

2. Connect to the serial debug header and post what uboot is saying when
you boot with the SD card inserted and User Boot button pressed down.

Not so easy, the BBB is on a boat (which is where I am at the moment)
I have someewhat limited hardware facilities here. I have a laptop
(running Linux) and the BBB and that's about it. I do have a
soldering iron and wire but the laptop doesn't have a serial input.

Is anything useful reported by the boot process in the logs or dmesg?

Ah the 'boat' yes i remember these conversations from last time in April.

From those conversations, you are running an ancient image.

Do you really have the BBB in hand or is it still on the boat far away?

Clear out the eMMC.. so your can boot from the microSD..

Regards,

On Sat, 9 Jun 2018 18:09:50 +0300, Tarmo Kuuse
<tarmo.kuuse@gmail.com> declaimed the
following:

When you boot with the SD inserted but the User Boot button left alone,
the ARM micro probably starts the U-Boot on your eMMC. Apparently this
U-Boot doesn't want to start Linux on the SD card like I've seen my
boards (with newer software) do. That's not really surprising, as it is
probably too old or has some bugs or whatnot.

  One matter is likely the difference in device tree handling... Debian 7
(wheezy) was in the era of the kernel loading device tree/overlays, while
Debian 9 expects the device tree/overlays to have been loaded by uBoot.

  So it is (hypothetical) that the BBB is booting from eMMC uBoot -- no
device tree overlays, and then passing control to the SD card kernel which
expected the device tree to already be loaded/configured.

  Unfortunately, I can't suggest a work-around if the boot-select button
is not working. Perhaps looking for posts to others about wiping the eMMC
boot blocks/uBoot may be useful.

  I'm pretty sure I only needed the boot-select once, back with wheezy,
to flash a newer release -- this was back before eMMC uBoot would check for
an SD card image to boot from. That would have been the 2016-06-15 LXDE 4GB
Debian 7.11 image or one just prior (I only saved the last release per
major)

>> 2. Connect to the serial debug header and post what uboot is saying when
>> you boot with the SD card inserted and User Boot button pressed down.
>>
> Not so easy, the BBB is on a boat (which is where I am at the moment)
> I have someewhat limited hardware facilities here. I have a laptop
> (running Linux) and the BBB and that's about it. I do have a
> soldering iron and wire but the laptop doesn't have a serial input.
>
> Is anything useful reported by the boot process in the logs or dmesg?

I don't know anything about U-Boot, but I believe its log is gone after
Linux starts up. And the Linux boot logs probably don't have anything
useful in them.

OK, so that's not a way to see what's wrong.

Googling suggests U-Boot has a feature called netconsole which gives
access the log via network. I didn't look into it in depth because it
seems tricky.

Yes, doesn't seem straightforward does it. I may investigate further
though as I do have some spare time out here on the boat with the BBB.

When you boot with the SD inserted but the User Boot button left alone,
the ARM micro probably starts the U-Boot on your eMMC. Apparently this
U-Boot doesn't want to start Linux on the SD card like I've seen my
boards (with newer software) do. That's not really surprising, as it is
probably too old or has some bugs or whatnot.

Yes, that's what I think is happnening.

When you boot with the User Boot button depressed, ARM micro is supposed
to start U-Boot on your SD card, and that is supposed to start Linux on
the SD card. BTW - a hard boot is required either by reconnecting power
or pressing the Reset button. I'm kind of surprised that this doesn't
seem to work for you. What exactly is the image on your SD card?

I've tried several, all of them seem to auto-install quite happily on
my BBBs at home which are even older than the one here on the boat.

Anyway, I don't have any good suggestions.

You could try upgrading just the U-Boot on your eMMC - perhaps this
would restore its ability to boot Linux from the SD card. I haven't a
clue on how to do this and I didn't find anything useful after a
5-minute search.

You could try using another image on the SD card - perhaps yours has
some U-Boot bug in it (although that sounds far fetched).

I think I've tried enough different images now to have eliminated that
possibility.

But *why* does all this have to be so difficult *and* *dependent* on
what happens to be installed on the BBB already. There really does
need to be a way to say "I want to install (or run) the software on
this microSD card regardless of what's in the BBB".

The big plus of the Raspeberry Pi in this situation is that it only
has the microSD to run from so it's *guaranteed* to try and run the
software on the microSD that you've inserted.

For what it's worth (might indicate something to someone) dmesg has
the following in it:-

[ 0.912030] ThumbEE CPU extension supported.
[ 0.912062] Registering SWP/SWPB emulation handler
[ 0.912697] registered taskstats version 1
[ 0.913863] mmcblk0: mmc0:1234 SA16G 14.6 GiB
[ 0.914951] of_get_named_gpio_flags: can't parse gpios property
[ 0.914970] tilcdc 4830e000.fb: No power control GPIO
[ 0.915266] mmcblk0: p1
[ 0.967694] mmc1: BKOPS_EN bit is not set
[ 0.971591] mmc1: new high speed MMC card at address 0001
[ 0.972152] mmcblk1: mmc1:0001 MMC04G 3.60 GiB
[ 0.972369] mmcblk1boot0: mmc1:0001 MMC04G partition 1 2.00 MiB
[ 0.972587] mmcblk1boot1: mmc1:0001 MMC04G partition 2 2.00 MiB
[ 0.973252] usb usb1: usb wakeup-resume
[ 0.973294] usb usb1: usb auto-resume
[ 0.973314] hub 1-0:1.0: hub_resume
[ 0.973353] hub 1-0:1.0: port 1: status 0101 change 0001
[ 0.973821] mmcblk1: p1 p2
[ 0.975609] mmcblk1boot1: unknown partition table
[ 0.977070] mmcblk1boot0: unknown partition table
[ 1.030803] tilcdc 4830e000.fb: found TDA19988

The existing installation has two partitions on the eMMC, it has a
separate /boot partition. The new images only have one partition as
far as I can see, /boot is just a directory on the main partition.
Would this affect things at all?

Yes it will effectivelly "erase" the eMMC, so it won't boot from it
till you re-flash it..

Since your having bad luck holding down the "boot" button, just take a
piece of wire, about as long as the beagle.

On the P8 header, connect P8_43 (LCD_DATA2) to P9_01 (or P9_02) GND..
and it'll just be like your holding the "boot" button down on every
power up.

If you don't have wire, or can't erase the eMMC, keep using your
current model, and wait till you have to get a new unit and setup that
one..

Regards,

I've brought up a few BeagleCore modules which ship with an empty eMMC. The AM335x appears to be able to boot from SD card without any software support. As soon as hook an SD card to it and activate the GPIO equivalent to the User Boot button, it just boots from it.

I've brought up a few BeagleCore modules which ship with an empty eMMC. The AM335x appears to be able to boot from SD card without any software support. As soon as hook an SD card to it and activate the GPIO equivalent to the User Boot button, it just boots from it.

On Sat, 9 Jun 2018 19:58:10 +0100, Chris Green
<cl@isbd.net> declaimed the following:

But *why* does all this have to be so difficult *and* *dependent* on
what happens to be installed on the BBB already. There really does
need to be a way to say "I want to install (or run) the software on
this microSD card regardless of what's in the BBB".

  I can't say why yours is so problematic... I just know that mine
haven't given me any equivalent problems. OTOH: I've not gone through as
many OS releases before flashing the eMMC. Often only skipping one of the
posted releases before reflashing.

  Typically I configure an SD card with the latest release, boot it,
mount the eMMC, copy over my personal configuration changes (/home/debian;
maybe /root), reboot to make those changes take effect, verify the image is
working, and then convert the image to a flasher, and reflash the eMMC.

  Remove the SD card, reboot to eMMC, confirm the flashed image works as
expected. Insert SD card, mount it (still booted on eMMC), undo the flasher
modification, and then run the partition resizing operation to occupy the
entire SD card.

  I've also only used the LXDE/LXQT images posted on
http://beagleboard.org/latest-images , not the bleeding edge weekly/daily
builds (and acknowledge there may be some patches thereby missing -- my
usage is at the hobby level and not very active).

OK, I have tried this (the piece of wire), the result is a non-booting
system. I.e. with the wire in place when I apply power all that happens
is that the power LED lights up. If I remove the wire (after powering
down) and then re-apply power the system boots from the eMMC again,
with Debian 7.

Does this suggest something wrong with the microSD interface, or what?
The microSD (with Debian 9 image) automounts when the system comes up
running Debian 7 and everything expected seems to be there.

try reflashing the "microSD", use etcher.io...

https://etcher.io/

Regards,

Identical results to what I got when using dd to copy the image to the
microSD card.

I put the current 'recommended' IOT image onto the SD card using
etcher.io and put it into my BBB. On power up with either the boot
button pressed or with the wire from GND to P8 pin 43 nothing happens,
just the power LED is on.

Reboot with wire removed, no 'boot' button press and I get my boring
old Debian 7 running again. ... with the microSD card automounted and
looking exactly as it should as far as I can tell, i.e. :-

chris@odin:~$ df -m
Filesystem 1M-blocks Used Available Use% Mounted on
rootfs 3471 1441 1851 44% /
udev 10 0 10 0% /dev
tmpfs 100 1 99 1% /run
/dev/disk/by-uuid/fc8d2d1e-5700-457b-ba81-9443e332cf04 3471 1441 1851 44% /
tmpfs 249 0 249 0% /dev/shm
tmpfs 249 0 249 0% /sys/fs/cgroup
tmpfs 100 0 100 0% /run/user
tmpfs 5 0 5 0% /run/lock
/dev/mmcblk1p1 96 72 25 75% /boot/uboot
/dev/mmcblk0p1 3279 1699 1411 55% /media/rootfs