Debian Bullseye Logo

Flash Debian Bullseye on your BeagleBone Black

Posted by

Debian 11 (Bullseye) was released on August 14th. My BeagleBone Black was working very well with Buster, but I wanted to get the native Wireguard support.

Few words about the BeagleBone Black. It’s a single board computer with a single core 1ghz Cortex-A8 processor, 512Mb of memory and depending of the version 2gb or 4gb of EMMC. I’m usually extending its storage with a microSD card and an USB Key.

Before flashing our BeagleBone Black, we need:

  • A cable to connect the BeagleBone Black to the network
  • A micro SD card
  • A computer with a card reader, connected to the same network
  • A terminal, to access to the system

Prepare your Debian Bullseye Card

Download the latest bone image from Robert Nelson’s website, in my case bone-debian-11-iot-armhf-2021-08-25-4gb.img.xz.

Plug your card in your computer, it will be erased. You can create the card using balenaEtcher or the command line, don’t forget to adapt the command to your case.

xzcat bone-debian-11-iot-armhf-2021-08-25-4gb.img.xz | dd of=/dev/sdb

Boot from the micro SD card

Plug your microSD card into your Beaglebone Black. Press the Boot button (S2) and plug your card to the electricity. When the 4 lights are on, wait 1s and release the button. The board will start using the micro SD card.

Connect to the board

You can connect to your Beaglebone using its hostname and the default credentials.
User: debian
Password: temppwd

ssh debian@beaglebone.local

If it doesn’t work, you can try to scan your local network using nmap.

nmap -sS -P -p  22  192.168.1.0/24

You will see something similar

Nmap scan report for 192.168.1.5
Host is up (0.0039s latency).

PORT   STATE SERVICE
22/tcp open  ssh
MAC Address: XX:XX:XX:XX:XX:XX (Texas Instruments)

Connect using the displayed IP

ssh debian@192.168.1.5

Flash to the eMMc

The embedded eMMc is faster and more reliable than the micro SD card. We will copy the content of the card to the eMMc.

sudo -i
git clone https://github.com/RobertCNelson/boot-scripts.git scripts
cd scripts/tools/eMMC
./init-eMMC-flasher-v3.sh

Boot again from the micro SD card. Now we need to enable ssh and clean a bit, for that we will use the chroot feature to enter in the new system.

sudo -i
mount /dev/mmcblk1p1 /mnt/
chroot /mnt/ /bin/bash
systemctl enable ssh
rm -rf /root/scripts /root/flash.sh
poweroff

Remove the card and restart the Beaglebone Black

Conclusion

The board is now running Debian Bullseye from the eMMc. The next step is to change the default credentials and install fail2ban to protect it from brute-force attacks.

9 comments

  1. Hi Virgil and thank you for the tutorial which I followed to the letter with no success and so far you may be able to shed some light about the issue I’m facing. The cloned os on the microsd works just fine while the os flashed on the emmc does not. The main important sympton of the underlying problem is following message which I read on the serial console:
    [ 15.033741] systemd[1]: System cannot boot: Missing /etc/machine-id and /etc is mounted read-only.
    [ 15.043069] systemd[1]: Booting up is supported only when:
    [ 15.048667] systemd[1]: 1) /etc/machine-id exists and is populated.
    [ 15.055011] systemd[1]: 2) /etc/machine-id exists and is empty.
    [ 15.061000] systemd[1]: 3) /etc/machine-id is missing and /etc is writable.
    [FAILED] Failed to start Resize Root File System.
    But I’m not able to understand why systemd-firstboot (or whatever is responsible for assigning the machine-id) is not performing as it is supposed to do. Do you have any clue?

  2. Hi there, meanwhile I understood what to do (it may be helpfull for others) I had to delete the file /etc/machine-id to permit the new generation of the unique ID and finally get access. Thank you

  3. Hi Virgil, I thank You for this tutorial, I flashed the eMMC and it boots, but the interfaces are not enabled, I manually added inet0 to /etc/network/interfaces and then I can access it with SSH but it can’t reach internet so It won’t be able to do an apt update comand

    Any help I will greatly appreciate,
    thanks in advance

    JD

  4. Hi Virgil, I solved my problem just adding the network an gateway.

    Thanks anyway.

    Now if you know how to enable the serial ports it would be greatly appreciated if you kindly help.

  5. Hello Joao,
    I’m sorry, haven’t used the serial ports since 2013 and I don’t remember how I did. They might be enabled by defaults. What do you get with the following command?
    ls -l /dev/ttyS*

  6. Quite excellent and painless installation.
    Like you I need an update to date Debian to use the GPIOs on the Beaglebone black. I wasn’t happy using Python, Adafruit, or the system file which is now deprecated. I like using gpiod-dev libraries. quite excellent. Bt I needed a newer version of the library that supports pulldown and pullup gpio configurations. Btw, if any is interested, use config-pin to configure the gpio pin from the command line.

    Installation was very smooth. Few important tools were missing, such as network configurations such as connman. I am using wifi exclusively. If you know Debian then it is a matter of installing what you need. Ethernet, just worked after a while. don’t know why. Was slow to configure itself.

    Before installing tools and application, do a system update, then you can install the required tools otherwise Apt will not find anything.

    What I liked most is that the ssd was already expanded, nice one. I did not have to do it.
    You might not have to Cloud9 (I don’t know and I am not interested in using it). I use C/C++ and the command line for developing applications.

    Great work, thank you.

  7. Hello! I took a pass at this today with bone-debian-11.3-iot-armhf-2022-05-10-4gb.img.xz.
    The flashing process succeeded, but I also found it was no longer pulling an IP address. hostname -I returns nothing (blank).

    I tried sudo systemctl restart networking, and it still didn’t pull an IP address. I hit route -n and the IP routing table was blank. Next I tried sudo route add default gw 10.123.123.1, and got SIOCADDRT: Network is unreachable.

    How does one hook up networking after flashing the image? I think this should be documented in the article, as it seems Georges above hit this as well. Thank you in advance!

Leave a Reply

Your email address will not be published. Required fields are marked *