Both sides previous revisionPrevious revisionNext revision | Previous revision |
network_protocol_programming_lab:2_installdebiansd [2020/03/20 07:57] – [Decompressing and Burning the Debian Image] rathke | network_protocol_programming_lab:2_installdebiansd [2022/04/18 16:59] (current) – [Boot the BeagleBone Black] fangenoorth |
---|
====== Debian Installation on SD Card for BeagleBone Black ====== | ====== Debian Installation on SD Card for BeagleBone Black ====== |
| |
In order to install Linux on the BeagleBone Black an image of the operating system and a SD Card is needed. The operating system image will be burned on the SD card. Burning will performed at your computer or Laptop, normally a Microsoft Windows, Mac OS X or Linux computer equipped with a SC card reader device. | In order to install Linux on the BeagleBone Black, an image of the operating system and a SD Card is needed. The operating system image will be flashed on the SD card. Flashing will be performed using your computer or laptop, normally a Microsoft Windows, Mac OS X or Linux computer equipped with a SD card reader. |
| |
Afterwards the SD card will be plugged in at the BeagleBone Black and Linux will be booted from the SD card. After booting is finished, it is a good advice to update the BeagleBone Black with the news software releases. | Afterwards the SD card will be plugged into the BeagleBone Black and Linux will be booted from the SD card. |
===== Getting Debian Image ===== | |
First, download an image to your computer. I am using the Debian Image //Jessie IOT((Bigger software components like the X-Window system are missing in images with the suffix IOT, resulting in a small thin image compared to images containing nearly the whole Debian distribution. ))// (bone-debian-8.7-iot-armhf-2017-03-19-4gb.img). | ===== Getting the Debian Image ===== |
| First, download an image to your computer. In this class we will use the Debian Buster IoT((Bigger software components like the X-Window system are missing in images with the suffix IoT, resulting in a small thin image compared to images containing nearly the whole Debian distribution. )) Image (bone-debian-10.3-iot-armhf-2020-04-06-4gb.img). |
| |
This image contains: | This image contains: |
| |
* Distribution Debian 8.7 (Jessi) | * Distribution Debian 10.3 (Buster) |
* Linux Kernel Version 4.4.54-ti- revision r93 | * Linux Kernel Version 4.19.94-ti revision r42 |
| |
Due to the fact, that the provided images are changing frequently in time and sometimes older images are no more available, this image [[http://kn-pr.tkn.tu-berlin.de/ppl/bone-debian-8.7-iot-armhf-2017-03-19-4gb.img.xz|bone-debian-8.7-iot-armhf-2017-03-19-4gb.img.xz]] is also available at the TKN Web Server. | Download the image [[https://debian.beagleboard.org/images/bone-debian-10.3-iot-armhf-2020-04-06-4gb.img.xz|bone-debian-10.3-iot-armhf-2020-04-06-4gb.img.xz]] from the [[http://beagleboard.org|beagleboard.org]] website. |
| |
| |
| If you like newer or other images, you can find them [[https://beagleboard.org/latest-images|here]]. |
| |
| In most cases, the image-file is compressed in an archive, indicated by the .xz suffix at the end of the file name (e.g. bone-debian-10.3-iot-armhf-2020-04-06-4gb.img.xz). |
| |
If you like newer or other images, you can find them at [[https://beagleboard.org/latest-images|beaglebord.org]]. | |
In most cases, the image-file is compressed in an archive, indicated by the .xz suffix at the end of the file name (e.g. debian-wheezy-7.2-armhf-3.8.13-bone30.img.xz). | |
===== Decompressing and Burning the Debian Image ===== | ===== Decompressing and Burning the Debian Image ===== |
| |
In the past the process of decompressing an burning the image was a very complex task. First have to decompress the image with an appropriate compression tool, next the SD card needs some portions with appropriate parameters. These portions need to be formatted. And than the image can be flashed. The tools for this process are depend from the operation system. | In the past the process of decompressing an burning the image was a very complex task. First you had to decompress the image with an appropriate compression tool, next the SD card needed some portions with appropriate parameters. These partitions had to be formatted. And then the image could be flashed. The tools for this process are dependent on the used operation system. |
| |
Today the process ist done by a single tool, called balenaEtcher. First, download belenaEtcher from [[https://www.balena.io/etcher/|https://www.balena.io/etcher/]], install and open ist. belenaEtcher is available for Microsoft Windows, Linux and Mac OS X. | Today the process is done by a single tool, called balenaEtcher. First, download belenaEtcher from [[https://www.balena.io/etcher/|https://www.balena.io/etcher/]], install and open ist. belenaEtcher is available for Microsoft Windows, Linux and Mac OS X. |
| |
After starting galenaEtcher for following window opens up, similar like this: | After starting balenaEtcher for following window opens up, similar like this: |
| |
<imgcaption 1 | balenaEtcher Main Window>{{:network_protocol_programming_lab:BalenaEtcher_main_window.jpeg?500%}}</imgcaption> | <imgcaption 1 | balenaEtcher Main Window>{{:network_protocol_programming_lab:BalenaEtcher_main_window.jpeg?500%}}</imgcaption> |
<imgcaption 2| balenaEtcher Select Image>{{:network_protocol_programming_lab:balenaEtcher_select_image.jpeg?500%}}</imgcaption> | <imgcaption 2| balenaEtcher Select Image>{{:network_protocol_programming_lab:balenaEtcher_select_image.jpeg?500%}}</imgcaption> |
| |
At my computer the image file is located at the download folder. Note, that the image file is in compresses xz Format. The image will be decompressed by balenaEtcher. Now, select the image file and press the open button. | At my computer the image file is located at the download folder. Note, that the image file is in compressed xz Format. The image will be decompressed by balenaEtcher. Now, select the image file and press the open button. |
| |
In the nextstep, press the button "Select Target". Now, another windows opens. In this window, you get a selection of devices. Choose the device, where your SD card is plugged in. In my case (see Fit. 3), this is /dev/disk6 the "Apple SDXC Reader Media" device. Now press the "Continue" button. | In the next step, press the button "Select Target". Now, another windows opens. In this window, you get a selection of devices. Choose the device, where your SD card is plugged in. In my case (see Fit. 3), this is /dev/disk6 the "Apple SDXC Reader Media" device. Now press the "Continue" button. |
| |
<imgcaption 3| balenaEtcher Select Target>{{:network_protocol_programming_lab:balenaEtcher_select_target.jpeg?500%}}</imgcaption> | <imgcaption 3| balenaEtcher Select Target>{{:network_protocol_programming_lab:balenaEtcher_select_target.jpeg?500%}}</imgcaption> |
At this point, we have built an SD card with the Linux operating system and can now start booting the BeagleBone Black. | At this point, we have built an SD card with the Linux operating system and can now start booting the BeagleBone Black. |
| |
==== Microsoft Windows ==== | If you are an experienced linux user you can also manually decompress the image and use a tool like ''dd'' to flash the image in 2 commands. |
| |
Try to open the ''.xz'' file. If it fails, download the open-source archiving tool //7-Zip// from http://www.7-zip.org. Using 7-Zip((A copy of 7-Zip is available at http://kn-pr.tkn.tu-berlin.de/ppl/7z1602.exe)), you are able to expand the archive. Install and execute 7-Zip. Starting 7-Zip a window as shown in <imgref 7zip> will open. Now open the .xz archive (in <imgref 7zip> the file debian-wheezy-7.2-armhf-3.8.13-bone30.img.xz) and push the "Expand"-Button to extract the image file from the archive. | |
| |
<imgcaption 7zip | 7-Zip Archive Manager>{{:network_protocol_programming_lab:7zip.png?500}}</imgcaption> | |
| |
==== Mac OS X ==== | |
To extract the image from the downloaded ''.xz'' archive, download [[https://itunes.apple.com/de/app/the-unarchiver/id425424353?mt=12|The Unarchiver]]((Alternatively, if you have installed [[http://www.macports.org/|Mac Ports]] or [[http://brew.sh/|Homebrew]], install the package //xz//. (E.g. for MacPorts type ''port install xz'') as superuser in the //Terminal App// and open the archive file.)) . Just double-click the .xz-archive. and extracts the image fro the archive file. | |
| |
==== Linux (Ubuntu 16.4 - sid) ==== | |
| |
For decompressing the archive file, you need the xz tool. If not already installed, use your preferred package manager and install the xz-utils package. To extract the image file from the archive type:\\ | |
<code bash>xz -d bone-debian-8.7-iot-armhf-2017-03-19-4gb.img.xz</code> | |
| |
At the end you have an image-file (e.g. bone-debian-8.7-iot-armhf-2017-03-19-4gb.img). | |
| |
===== Copy the Debian image to the SD Card ===== | |
| |
First, place an SD-card with sufficient size (greater than the image size) into the SD-card slot of your computer. | |
| |
==== Microsoft Windows ==== | |
It the next step, you have to copy the content of the image to the SD card. Therefore, you need to install //Win32 Disk Imager// from [[http://sourceforge.net/projects/win32diskimager/files/latest/download|sourceforge]]. Extract the downloaded file to a convenient place and execute ''Win32DiskImager.exe''((A copy of Win32 Disk Imager is available at http://kn-pr.tkn.tu-berlin.de/ppl/Win32DiskImager.zip)). Execute ''Win32DiskImager.exe''. A window as shown in <imgref image2> will be opened. Chose the image file (e.g. debian-wheezy-7.2-armhf-3.8.13-bone30.img) and the device containing the SD card (in the example drive ''E:\''). Next press the "''write''" button to start the copy. | |
| |
<imgcaption image2 | Win32 Disk Imager>{{:network_protocol_programming_lab:Win32DiskImager.png}}</imgcaption> \\ \\ If the copy process has been finished, remove the SD card. | |
| |
==== Mac OS X ==== | |
After you have inserted the SD card into the computer the next steps are: | |
* Open the Terminal App. | |
* Determine device id of SD card by typing <code bash> sudo diskutil list</code> at the command prompt. This will show a list of any device attached to the Mac: <code bash> | |
/dev/disk0 | |
#: TYPE NAME SIZE IDENTIFIER | |
0: GUID_partition_scheme *1.0 TB disk0 | |
1: EFI EFI 209.7 MB disk0s1 | |
2: Apple_HFS iMac HD 999.3 GB disk0s2 | |
3: Apple_Boot Recovery HD 650.0 MB disk0s3 | |
/dev/disk1 | |
#: TYPE NAME SIZE IDENTIFIER | |
0: GUID_partition_scheme *1.0 TB disk1 | |
1: EFI EFI 209.7 MB disk1s1 | |
2: Apple_HFS Backup 500.1 GB disk1s2 | |
3: Apple_HFS TKN Daten 499.1 GB disk1s3 | |
4: Apple_Boot Recovery HD 650.0 MB disk1s4 | |
/dev/disk2 | |
#: TYPE NAME SIZE IDENTIFIER | |
0: FDisk_partition_scheme *8.0 GB disk2 | |
1: Windows_FAT_16 NO NAME 67.1 MB disk2s1 | |
2: Linux 7.9 GB disk2s2 | |
</code> The sample output shows, two hard drives (disk0 and disk1) attached to the Mac. The SD card has identifier disk2 and is mounted at ''/dev/disk2''. Remember the disk identifier. In the following you have to exchange my identifier (''/dev/disk2'') with your identifier. | |
| |
* Unmount the SD card\\ If the SD card contains a file system, you must unmount the SD card: <code bash> | |
sudo diskutil umount /dev/disk2s1 | |
</code> If no file system is installed on the SD card, you don't need to unmount it. | |
| |
* Now, you can copy the Image to the SD card. Just type <code bash> | |
sudo dd bs=1M if=~/Downloads/debian-wheezy-7.2-armhf-3.8.13-bone30.img of=/dev/disk2 | |
</code> Also keep in mind to exchange disk2 with your device id. The command takes some time. Don't worry. If done, remove the SD card from your computer. | |
| |
==== Linux ==== | |
After inserting the SD card into your computer open terminal window (e.g. Terminal, Konsole or Xterm) depending on the distribution and your personal choice. | |
| |
To determine the device id of the SD card type <code bash>fdisk -l</code> at the command prompt. This gives you a list of all devices attached tom the computer. <code bash>Device Boot Start End Sectors Size Id Type | |
/dev/sda1 * 2048 999423 997376 487M 83 Linux | |
/dev/sda2 1001470 976771071 975769602 465,3G 5 Extended | |
/dev/sda5 1001472 976771071 975769600 465,3G 8e Linux LVM | |
| |
Disk /dev/mapper/ubuntu--vg-root: 461,7 GiB, 495741566976 bytes, 968245248 sectors | |
Units: sectors of 1 * 512 = 512 bytes | |
Sector size (logical/physical): 512 bytes / 4096 bytes | |
I/O size (minimum/optimal): 4096 bytes / 4096 bytes | |
| |
| |
Disk /dev/mapper/ubuntu--vg-swap_1: 3,6 GiB, 3850371072 bytes, 7520256 sectors | |
Units: sectors of 1 * 512 = 512 bytes | |
Sector size (logical/physical): 512 bytes / 4096 bytes | |
I/O size (minimum/optimal): 4096 bytes / 4096 bytes | |
| |
| |
Disk /dev/mmcblk0: 7,4 GiB, 7969177600 bytes, 15564800 sectors | |
Units: sectors of 1 * 512 = 512 bytes | |
Sector size (logical/physical): 512 bytes / 512 bytes | |
I/O size (minimum/optimal): 512 bytes / 512 bytes | |
Disklabel type: dos | |
Disk identifier: 0x00000000 | |
| |
Device Boot Start End Sectors Size Id Type | |
/dev/mmcblk0p1 8192 15564799 15556608 7,4G 7 HPFS/NTFS/exFAT | |
</code> | |
| |
At the end of the list above, the device id of the SD card is shown. In my case it is the device ''/dev/mmcblk0p1''. | |
| |
If the SD card has been mounted by your operating system, the cards must be unmounted, in my case<code bash>umount /dev/mmcblk0p1</code> | |
| |
Use the device of the SD card to flush the image by executing the command <code bash> sudo dd bs=1M if=./debian-wheezy-7.2-armhf-3.8.13-bone30.img of=/dev/mmcblk0</code> | |
| |
=== Boot the BeagleBone Black === | |
To test, if everything is correct you must insert the SD card into the card slot of the BeagleBone Black and boot. During boot, press the "//User Boot//" button (see <imgref image1>). Otherwise the BeagleBone Black will not boot from your SD card, but from the eMMC. Also be sure, that the BeagleBone Black is connected via the Ethernet interface and has access to a DHCP server (a DHCP server is installed at TKN or at home on your DSL router). | |
| |
If the boot process is finished, you can establish a ssh connection to the BeagleBone Black. The needed ssh client is already installed at Linux or Mac OS. If you are using MS Windows you have to install a client by yourself. A popular client is Putty, that can be obtain from http://www.putty.org. | |
| |
Using Linux or Mac OS, open a terminal application and enter the following command: <code bash>ssh debian@beaglebone</code> | |
| |
In the above example a ssh connection to the host **beaglebone** with the userid **debian** will be established. The ssh client will ask you for the password of the user **debian** that is also **debian**. | ===== Boot the BeagleBone Black ===== |
| To test, if everything is working correctly you must insert the SD card into the card slot of the BeagleBone Black and boot. During boot, press the "//User Boot//" button (see <imgref image1>). The BeagleBone Black will boot automatically as soon as power is applied. |
| |
For MS Windows users, please follow the instructions of Putty. | **IMPORTANT: First press "//User Boot//" button and then connect the power supply. And NOT the other way round.** |
| |
| Otherwise the BeagleBone Black will not boot from your SD card, but from the internal eMMC. |
| |
| To verify that your Linux image booted successfully, connect to your BeagleBone using one of the described methods in the next wiki page [[network_protocol_programming_lab:2_2_access_general|Accessing the BeagleBone Black]]. |
| |
<imgcaption image1 | User Boot>{{:network_protocol_programming_lab:beaglebone-user-boot.png}}</imgcaption> | <imgcaption image1 | User Boot>{{:network_protocol_programming_lab:beaglebone-user-boot.png}}</imgcaption> |