[fusion_builder_container backgroundcolor=”no” backgroundimage=”” backgroundrepeat=”no-repeat” backgroundposition=”left top” backgroundattachment=”scroll” video_webm=”” video_mp4=”” video_ogv=”” video_preview_image=”” overlay_color=”” video_mute=”yes” video_loop=”yes” fade=”no” bordersize=”0px” bordercolor=”” borderstyle=”” paddingtop=”0px” paddingbottom=”0px” paddingleft=”0px” paddingright=”0px” menu_anchor=”” equal_height_columns=”no” hundred_percent=”no” class=”” id=””][fusion_builder_row][fusion_builder_column type=”1_1″ layout=”1_1″ background_position=”left top” background_color=”” border_size=”” border_color=”” border_style=”solid” spacing=”yes” background_image=”” background_repeat=”no-repeat” padding_top=”” padding_right=”” padding_bottom=”” padding_left=”” margin_top=”0px” margin_bottom=”0px” class=”” id=”” animation_type=”” animation_speed=”0.3″ animation_direction=”left” hide_on_mobile=”no” center_content=”no” min_height=”none” last=”no” hover_type=”none” link=”” border_position=”all”][fusion_title size=”1″ content_align=”left” style_type=”single solid” sep_color=”” class=”” id=””]Introduction[/fusion_title][fusion_text columns=”” column_min_width=”” column_spacing=”” rule_style=”default” rule_size=”” rule_color=”” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” class=”” id=””]
This is the chapter web page to support the content in Chapter 3 of the book: Exploring BeagleBone – Tools and Techniques for Building with Embedded Linux. The summary introduction to the chapter is as follows:
This chapter exposes you to the core concepts, commands, and tools required to effectively manage the Beagle-based embedded Linux system. The first part of the chapter is descriptive; it explains the basics of embedded Linux and the Linux boot process. After that, you learn step by step how to manage Linux systems. For this exercise, you are strongly encouraged to open a terminal connection to your board and follow along. Next, the chapter describes the Git source code management system. This topic is an important one because the source code examples in this book are distributed via GitHub. Desktop virtualization is also described; it is useful for cross-platform development in later chapters. The chapter finishes by describing how you can download the source code examples for this book.
[/fusion_text][/fusion_builder_column][/fusion_builder_row][/fusion_builder_container][fusion_builder_container hundred_percent=”yes” overflow=”visible”][fusion_builder_row][fusion_builder_column type=”3_5″ layout=”3_5″ last=”no” spacing=”yes” background_color=”” background_image=”” background_repeat=”no-repeat” background_position=”left top” border_size=”0px” border_color=”” border_style=”” padding_top=”” padding_right=”” padding_bottom=”” padding_left=”” class=”” id=”” min_height=”” hover_type=”none” link=”” border_position=”all”][fusion_text columns=”” column_min_width=”” column_spacing=”” rule_style=”default” rule_size=”” rule_color=”” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” class=”” id=””]
Learning Outcomes
After completing this chapter, you should be able to:
- Describe the basic concept of an embedded Linux system.
- Describe how embedded Linux devices, such as the Beagle boards, boot the Linux OS.
- Describe important Linux concepts, such as kernel space, user space, and system initialization using systemd.
- Perform Linux system administration tasks on the Beagle boards.
- Use the Linux file system effectively.
- Use a range of Linux commands for file and process management.
- Manage your own software development projects using Git.
- Install a Linux distribution on your desktop computer host OS using desktop virtualization tools, such as VirtualBox.
- Download the source code for this book using Git.
[/fusion_text][/fusion_builder_column][fusion_builder_column type=”2_5″ layout=”2_5″ last=”yes” spacing=”yes” background_color=”” background_image=”” background_repeat=”no-repeat” background_position=”left top” border_size=”0px” border_color=”” border_style=”” padding_top=”” padding_right=”” padding_bottom=”” padding_left=”” class=”” id=”” min_height=”” hover_type=”none” link=”” border_position=”all”][fusion_text][toc][/fusion_text][fusion_sharing tagline=”Share this page:” tagline_color=”” title=”Exploring BeagleBone: Chapter 1″ link=”http://exploringbeaglebone.com/chapter1/” description=”” pinterest_image=”” icons_boxed=”” icons_boxed_radius=”4px” box_colors=”” icon_colors=”” tooltip_placement=”” backgroundcolor=”” class=”” id=”” /][/fusion_builder_column][/fusion_builder_row][/fusion_builder_container][fusion_builder_container backgroundcolor=”no” backgroundimage=”” backgroundrepeat=”no-repeat” backgroundposition=”left top” backgroundattachment=”scroll” video_webm=”” video_mp4=”” video_ogv=”” video_preview_image=”” overlay_color=”” video_mute=”yes” video_loop=”yes” fade=”no” bordersize=”0px” bordercolor=”” borderstyle=”” paddingtop=”0px” paddingbottom=”0px” paddingleft=”0px” paddingright=”0px” menu_anchor=”” equal_height_columns=”no” hundred_percent=”no” class=”” id=””][fusion_builder_row][fusion_builder_column type=”1_1″ layout=”1_1″ background_position=”left top” background_color=”” border_size=”” border_color=”” border_style=”solid” spacing=”yes” background_image=”” background_repeat=”no-repeat” padding_top=”” padding_right=”” padding_bottom=”” padding_left=”” margin_top=”0px” margin_bottom=”0px” class=”” id=”” animation_type=”” animation_speed=”0.3″ animation_direction=”left” hide_on_mobile=”no” center_content=”no” min_height=”none” last=”no” hover_type=”none” link=”” border_position=”all”][fusion_title size=”1″ content_align=”left” style_type=”single solid” sep_color=”” class=”” id=””]Further Materials[/fusion_title][/fusion_builder_column][fusion_builder_column type=”1_1″ layout=”1_1″ background_position=”left top” background_color=”” border_size=”” border_color=”” border_style=”solid” spacing=”yes” background_image=”” background_repeat=”no-repeat” padding_top=”” padding_right=”” padding_bottom=”” padding_left=”” margin_top=”0px” margin_bottom=”0px” class=”” id=”” animation_type=”” animation_speed=”0.3″ animation_direction=”left” hide_on_mobile=”no” center_content=”no” min_height=”none” last=”no” hover_type=”none” link=”” border_position=”all”][fusion_title size=”2″ content_align=”left” style_type=”single solid” sep_color=”” class=”” id=””]The tree utility[/fusion_title][fusion_text]
An additional utility that is not described in Chapter 3 is the tree program. It allows you to obtain a visual display of the directory tree using only the Linux terminal. The command is not installed by default, so begin with:
molloyd@beaglebone:~/$ sudo apt-get install tree
Once the tree program is installed, you can test it on a directory of your choice, for example:
molloyd@beaglebone:~$ cd exploringBB/ molloyd@beaglebone:~/exploringBB$ ls License.txt chp02 chp05 chp08 chp10 chp12 extras README.md chp03 chp06 chp09 chp11 chp13 library molloyd@beaglebone:~/exploringBB$ tree library library |-- EBBGPIO.cpp |-- ExploringBB.Doxyfile |-- bus | |-- BusDevice.cpp | |-- BusDevice.h | |-- I2CDevice.cpp | |-- I2CDevice.h | |-- SPIDevice.cpp | `-- SPIDevice.h |-- display | |-- LCDCharacterDisplay.cpp | |-- LCDCharacterDisplay.h | |-- SevenSegmentDisplay.cpp | `-- SevenSegmentDisplay.h |-- gpio | |-- GPIO.cpp | |-- GPIO.h | |-- PWM.cpp | |-- PWM.h | |-- util.cpp | `-- util.h |-- libEBBLibrary.so |-- motor | |-- DCMotor.cpp | |-- DCMotor.h | |-- Servo.cpp | |-- Servo.h | |-- StepperMotor.cpp | `-- StepperMotor.h |-- network | |-- SocketClient.cpp | |-- SocketClient.h | |-- SocketServer.cpp | `-- SocketServer.h `-- sensor |-- ADXL345.cpp |-- ADXL345.h |-- BMA180.cpp |-- BMA180.h |-- ITG3200.cpp `-- ITG3200.h 6 directories, 35 files
You can also use options (use man tree to see the full list) such as: -a display all files including hidden files, -l follows symbolic links, -u displays the owner, -C turns on colorization, -L 2 displays only the first two levels, and -d displays only directories. So, for example:
molloyd@beaglebone:~$ tree -dL 1 ~/exploringBB/ /home/molloyd/exploringBB/ |-- chp02 |-- chp03 |-- chp05 |-- chp06 |-- chp08 |-- chp09 |-- chp10 |-- chp11 |-- chp12 |-- chp13 |-- extras `-- library 12 directories
displays only the first level of directories in the exploringBB directory.[/fusion_text][fusion_separator style_type=”shadow” top_margin=”10″ bottom_margin=”10″ sep_color=”” icon=”fa-linux” width=”” class=”” id=”” /][/fusion_builder_column][fusion_builder_column type=”1_1″ layout=”1_1″ background_position=”left top” background_color=”” border_size=”” border_color=”” border_style=”solid” spacing=”yes” background_image=”” background_repeat=”no-repeat” padding_top=”” padding_right=”” padding_bottom=”” padding_left=”” margin_top=”0px” margin_bottom=”0px” class=”” id=”” animation_type=”” animation_speed=”0.3″ animation_direction=”left” hide_on_mobile=”no” center_content=”no” min_height=”none” last=”no” hover_type=”none” link=”” border_position=”all”][fusion_title size=”2″ content_align=”left” style_type=”single solid” sep_color=”” class=”” id=””]VirtualBox: Installing a Linux Guest Under a Windows Host[/fusion_title][fusion_text]Here are some tips on installing a Linux guest VirtualBox VM under a Windows host:
- Enable VT-x/AMD-V in the system BIOS settings of your physical computer in order to run a 64-bit guest OS.
- Install VirtualBox (virtualbox.org) on your host OS.
- Download your favourite Linux distribution as an ISO file. In this book 64-bit Debian is used. Download the Net debian-jessie-DI-rc1-amd64-netinst.iso or equivalent from the page www.debian.org/releases/. Do not use the ia64 branch unless you are using a high-end Itanium-based server. Important: see note at the top of the page about Debian Wheezy.
- Start Oracle VM VirtualBox Manager and choose New. If available, give the installation 2GB+ memory. Create a virtual hard drive (VDI format, dynamic allocated) and make the size much greater than the 8GB it recommends. Choose the location on your computer to store the disk and use a minimum of 25–30GB! It is difficult to resize a disk after the fact. If you choose “dynamically allocated”, it will only occupy real disk space when you fill the Linux disk, so feel free to choose a large disk size.
- You now have a new VM that is powered off. Select it and click on settings. Under storage you should see your VDI (under SATA) and an “Empty” entry (under IDE). Select the “Empty” entry and click the disk icon under Attributes. Find and select the Linux ISO file that you downloaded, as shown in the figure below.
[fusion_lightbox] [/fusion_lightbox]
Figure 2-A1: The VirtualBox VM configuration pane
- Start your VM and install Linux by booting off the virtual drive. If you see a message “No Boot Device,” go to Settings System and disable the floppy drive.
- Once your guest OS is running, choose Devices Install Guest Additions from the menu bar of your VirtualBox window. If all goes well, you will now be able to resize the window and cut-and-paste text between the host and guest OSs (by enabling Devices ⇒ Shared ⇒ Clipboard Bidirectional).
- Choose “Devices”->”Insert Guest Additions CD image…”
- If the guest additions do not install automatically, follow these steps (for Debian desktop — tested on Wheezy and Jessie images) in a terminal window:
molloyd@debian:~$ su - root@debian:~# apt-get update root@debian:~# apt-get install build-essential module-assistant root@debian:~# m-a prepare root@debian:~# cd /media/cdrom root@debian:~# sh ./VBoxLinuxAdditions.run root@debian:~# reboot
- With your network settings set as NAT on Adapter 1 (default setting) you should now be able to ping 192.168.7.2 (your BBB when using Internet-over-USB), or its equivalent network IP address (if connected by regular Ethernet).
If you go to the VirtualBox System ⇒ Processor settings, you will see the number of cores that can be allocated to the guest OS. On an Intel i7 processor you will see either 16 or 24 as the upper limit, depending on your exact processor. On a 4-core processor, you will see one core per thread, so 8 “real” cores, and you will also see that number again in “virtual” cores. Do not use virtual cores, as they will be provided through time slicing and your machine may slow down considerably. The maximum number of cores you should allocate to your guest OS is the total number of real cores minus one.
[/fusion_text][fusion_separator style_type=”shadow” top_margin=”” bottom_margin=”20″ sep_color=”#9b9b9b” icon=”” width=”” class=”” id=”” /][/fusion_builder_column][fusion_builder_column type=”1_1″ layout=”1_1″ background_position=”left top” background_color=”” border_size=”” border_color=”” border_style=”solid” spacing=”yes” background_image=”” background_repeat=”no-repeat” padding_top=”” padding_right=”” padding_bottom=”” padding_left=”” margin_top=”0px” margin_bottom=”0px” class=”” id=”” animation_type=”” animation_speed=”0.3″ animation_direction=”left” hide_on_mobile=”no” center_content=”no” min_height=”none” last=”no” hover_type=”none” link=”” border_position=”all”][fusion_title size=”2″ content_align=”left” style_type=”single solid” sep_color=”” class=”” id=””]Useful tools – Cairo Dock [/fusion_title][fusion_text]The latest windowing interface for Debian Jessie contains some very nice features, but it is quite lean. One tool that is useful and will be familiar to Mac OS X users is the Cairo Dock. It is illustrated in Figure 2-A2 below. You can install it using the following step:
molloyd@DebianJessieVM:~$ sudo apt-get install cairo-dock
Figure 2-A2: The Cairo Dock in action under Debian 8 (Jessie)
Debian 8 Jessie uses Gnome 3. To start up this dock automatically on boot you can perform the following steps:
molloyd@DebianJessieVM:~$ gnome-tweak-tool
And then click “Startup Applications” on the left-hand menu. On the right-hand pane click on the “+” icon and add Cairo-Dock to the list.[/fusion_text][/fusion_builder_column][/fusion_builder_row][/fusion_builder_container][fusion_builder_container backgroundcolor=”no” backgroundimage=”” backgroundrepeat=”no-repeat” backgroundposition=”left top” backgroundattachment=”scroll” video_webm=”” video_mp4=”” video_ogv=”” video_preview_image=”” overlay_color=”” video_mute=”yes” video_loop=”yes” fade=”no” bordersize=”0px” bordercolor=”” borderstyle=”” paddingtop=”0px” paddingbottom=”0px” paddingleft=”0px” paddingright=”0px” menu_anchor=”” equal_height_columns=”no” hundred_percent=”no” class=”” id=””][fusion_builder_row][fusion_builder_column type=”1_1″ layout=”1_1″ background_position=”left top” background_color=”” border_size=”” border_color=”” border_style=”solid” spacing=”yes” background_image=”” background_repeat=”no-repeat” padding_top=”” padding_right=”” padding_bottom=”” padding_left=”” margin_top=”0px” margin_bottom=”0px” class=”” id=”” animation_type=”” animation_speed=”0.3″ animation_direction=”left” hide_on_mobile=”no” center_content=”no” min_height=”none” last=”no” hover_type=”none” link=”” border_position=”all”][fusion_separator style_type=”shadow” top_margin=”” bottom_margin=”20″ sep_color=”#9b9b9b” icon=”” width=”” class=”” id=”” /][/fusion_builder_column][fusion_builder_column type=”1_1″ layout=”1_1″ background_position=”left top” background_color=”” border_size=”” border_color=”” border_style=”solid” spacing=”yes” background_image=”” background_repeat=”no-repeat” padding_top=”” padding_right=”” padding_bottom=”” padding_left=”” margin_top=”0px” margin_bottom=”0px” class=”” id=”” animation_type=”” animation_speed=”0.3″ animation_direction=”left” hide_on_mobile=”no” center_content=”no” min_height=”none” last=”no” hover_type=”none” link=”” border_position=”all”][fusion_title size=”1″ content_align=”left” style_type=”single solid” sep_color=”” class=”” id=””]External Resources[/fusion_title][/fusion_builder_column][/fusion_builder_row][/fusion_builder_container][fusion_builder_container hundred_percent=”yes” overflow=”visible”][fusion_builder_row][fusion_builder_column type=”1_2″ layout=”1_2″ last=”no” spacing=”yes” background_color=”” background_image=”” background_repeat=”no-repeat” background_position=”left top” border_size=”0px” border_color=”” border_style=”” padding_top=”” padding_right=”” padding_bottom=”” padding_left=”” class=”” id=”” min_height=”” hover_type=”none” link=”” border_position=”all”][fusion_title size=”2″ content_align=”left” style_type=”single solid” sep_color=”” class=”” id=””]Important Documents[/fusion_title][/fusion_builder_column][fusion_builder_column type=”1_2″ layout=”1_2″ last=”yes” spacing=”yes” background_color=”” background_image=”” background_repeat=”no-repeat” background_position=”left top” border_size=”0px” border_color=”” border_style=”” padding_top=”” padding_right=”” padding_bottom=”” padding_left=”” class=”” id=”” min_height=”” hover_type=”none” link=”” border_position=”all”][fusion_title size=”2″ content_align=”left” style_type=”single solid” sep_color=”” class=”” id=””]External Web Sites[/fusion_title][/fusion_builder_column][fusion_builder_column type=”1_4″ layout=”1_4″ last=”no” spacing=”yes” background_color=”” background_image=”” background_repeat=”no-repeat” background_position=”left top” border_size=”0px” border_color=”” border_style=”” padding_top=”” padding_right=”” padding_bottom=”” padding_left=”” class=”” id=”” min_height=”” hover_type=”none” link=”” border_position=”all”][fusion_imageframe lightbox=”no” style_type=”dropshadow” bordercolor=”” bordersize=”0px” borderradius=”0″ stylecolor=”” align=”center” link=”http://git-scm.com/book/en/v2″ linktarget=”_blank” animation_type=”0″ animation_direction=”down” animation_speed=”0.1″ class=”” id=””] [/fusion_imageframe][fusion_text]
Pro Git book (free online)
[/fusion_text][/fusion_builder_column][fusion_builder_column type=”1_4″ layout=”1_4″ last=”no” spacing=”yes” background_color=”” background_image=”” background_repeat=”no-repeat” background_position=”left top” border_size=”0px” border_color=”” border_style=”” padding_top=”” padding_right=”” padding_bottom=”” padding_left=”” class=”” id=”” min_height=”” hover_type=”none” link=”” border_position=”all”][fusion_imageframe lightbox=”no” style_type=”dropshadow” bordercolor=”” bordersize=”0px” borderradius=”0″ stylecolor=”” align=”center” link=”https://github.com/CircuitCo/BeagleBone-Black/blob/master/BBB_SRM.pdf?raw=true” linktarget=”_blank” animation_type=”0″ animation_direction=”down” animation_speed=”0.1″ class=”” id=””] [/fusion_imageframe][fusion_text]
The BeagleBone Black System Reference Manual (SRM)
[/fusion_text][/fusion_builder_column][fusion_builder_column type=”1_2″ layout=”1_2″ last=”yes” spacing=”yes” background_color=”” background_image=”” background_repeat=”no-repeat” background_position=”left top” border_size=”0px” border_color=”” border_style=”” padding_top=”” padding_right=”” padding_bottom=”” padding_left=”” class=”” id=”” min_height=”” hover_type=”none” link=”” border_position=”all”][fusion_separator style_type=”shadow” top_margin=”” bottom_margin=”” sep_color=”” icon=”” width=”” class=”” id=”” /][fusion_text]
- The Debian Policy Manual: tiny.cc/ebb303
[/fusion_text][/fusion_builder_column][/fusion_builder_row][/fusion_builder_container][fusion_builder_container backgroundcolor=”no” backgroundimage=”” backgroundrepeat=”no-repeat” backgroundposition=”left top” backgroundattachment=”scroll” video_webm=”” video_mp4=”” video_ogv=”” video_preview_image=”” overlay_color=”” video_mute=”yes” video_loop=”yes” fade=”no” bordersize=”0px” bordercolor=”” borderstyle=”” paddingtop=”0px” paddingbottom=”0px” paddingleft=”0px” paddingright=”0px” menu_anchor=”” equal_height_columns=”no” hundred_percent=”no” class=”” id=””][fusion_builder_row][fusion_builder_column type=”1_1″ layout=”1_1″ background_position=”left top” background_color=”” border_size=”” border_color=”” border_style=”solid” spacing=”yes” background_image=”” background_repeat=”no-repeat” padding_top=”” padding_right=”” padding_bottom=”” padding_left=”” margin_top=”0px” margin_bottom=”0px” class=”” id=”” animation_type=”” animation_speed=”0.3″ animation_direction=”left” hide_on_mobile=”no” center_content=”no” min_height=”none” last=”no” hover_type=”none” link=”” border_position=”all”][fusion_title size=”2″ content_align=”left” style_type=”single solid” sep_color=”” class=”” id=””]Recommended Books on the Content in this Chapter[/fusion_title][fusion_text][amazon asin=1593273894&template=Iframe Image] [amazon asin=1593275676&template=Iframe Image] [amazon asin=111821854X&template=Iframe Image] [amazon asin=0131480057&template=Iframe Image] [amazon asin=1484200772&template=Iframe Image] [amazon asin=1449316387&template=Iframe Image][/fusion_text][/fusion_builder_column][fusion_builder_column type=”1_1″ layout=”1_1″ background_position=”left top” background_color=”” border_size=”” border_color=”” border_style=”solid” spacing=”yes” background_image=”” background_repeat=”no-repeat” padding_top=”” padding_right=”” padding_bottom=”” padding_left=”” margin_top=”0px” margin_bottom=”0px” class=”” id=”” animation_type=”” animation_speed=”0.3″ animation_direction=”left” hide_on_mobile=”no” center_content=”no” min_height=”none” last=”no” hover_type=”none” link=”” border_position=”all”][fusion_title size=”1″ content_align=”left” style_type=”single solid” sep_color=”” class=”” id=””]Errata[/fusion_title][fusion_text columns=”” column_min_width=”” column_spacing=”” rule_style=”default” rule_size=”” rule_color=”” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” class=”” id=””]
- None as yet in Revision 2
[/fusion_text][/fusion_builder_column][fusion_builder_column type=”1_1″ layout=”1_1″ background_position=”left top” background_color=”” border_size=”” border_color=”” border_style=”solid” spacing=”yes” background_image=”” background_repeat=”no-repeat” padding_top=”” padding_right=”” padding_bottom=”” padding_left=”” margin_top=”0px” margin_bottom=”0px” class=”” id=”” animation_type=”” animation_speed=”0.3″ animation_direction=”left” hide_on_mobile=”no” center_content=”no” min_height=”none” last=”no” hover_type=”none” link=”” border_position=”all”][fusion_sharing tagline=”Share This Story, Choose Your Platform!” tagline_color=”” title=”” link=”” description=”” pinterest_image=”” icons_boxed=”” icons_boxed_radius=”4px” box_colors=”” icon_colors=”” tooltip_placement=”” backgroundcolor=”” class=”” id=”” /][/fusion_builder_column][/fusion_builder_row][/fusion_builder_container]
Loc 2171, in the first sentence in paragraph on the three bootloader-related files:
“These steps create three important files:u-boot.img (~360 KB), MLO (~100KB), and uEnv.txt (1<1KB)."
1) The size of uEnv.txt lists "1<1KB" (Should it be "~ < 1KB" ?)
2) Maybe need a space between "files" and "u-boot.img" ( "…important files: u-boot.img")
Very strange. In my text that is “u-boot.img(~360KB), MLO(~100KB), and uEnv.txt(<1KB)". There must be a minor font problem in the conversion to the Kindle version there. Apologies about that.
No sweat. I am reading it on an iPad, with their Kindle viewer. It will be interesting to hear what others find with different platforms.
Loc 2272, in the “System V init (SysVinit)” section:
The text indicates that the systemd process is used in Debian, and indeed I can find it in my system…
tb@beaglebone:/media/BBBdata$ which systemd
/bin/systemd
However, then a couple paragraphs later (“The runlevel defines the state…”), the text says this:
“For example, under Debian, which uses SystemV init, there are…”
I can find references to both SysVinit and systemd (for Debian) online. However the text seems to be contradicting itself here, and I was hoping you might be able to clarify this for me?
A little more research (personal conversation a Debian friend) indicates that the current Debian *desktop* stable version seems to still be using SysVinit, but with the next release it will be systemd. The Ubuntu 12.04 system in my laptop is indeed still using SysVinit, but on my BBB with the latest Debian eMMC image from the BeagleBoard.org download site, I seem to have systemd:
tb@beaglebone:~$ ps -p 1
PID TTY TIME CMD
1 ? 00:00:03 systemd
So I think I’ve probably answered my own question–the desktop Debian stuff appears to still be using SysVinit, while the BBB Debian stuff is now using systemd.
Loc 3208: In your demo of the “watch” utility, you used the command “watch ps a” to show a one-second incremented watch output. Here on Debian (BBB) and Ubuntu 12.04LTS (laptop), it gives me a default of 2 seconds. In order to get a 1-second update period, I had to use this:
# watch -n1 ps
Also, “man watch” tells me that watch executes every two seconds by default, so I can’t explain why your output is as listed on that page.
That is correct. There is an editing mistake there, the command should be “watch -n 1 ps a”. Thanks, Derek.
Well, I messed it up. When trying to set up a 32GB card, I did umount on mmcblk0p1 instead of 1p1. And then of course moved same to /media/store. Believe that means I just moved my boot to a folder and BBB will not boot now. I put the Debian boot card in and tried to boot holding the s2 boot button but none of the user led’s are lighting up indicate it is doing anything. Did I destroy it or is there a way to save it? Thanks for any advise.
Hi there. Bad luck. I’m not exactly sure what happened, but if you do not have much personal data on the BeagleBone then it might be a good time to flash the BeagleBone with a new image. You should be able to boot the BeagleBone with the SD card regardless. Check that the image on the SD card hasn’t been damaged (maybe re-image it) and then try to boot the BBB again. Remove power from the board completely and with the re-imaged SD card in the slot, hold the boot button and apply power. Don’t let go of the boot button until the LEDs light. If you had the USB-Serial-TTL cable you would be able see exactly what is going wrong. Good luck! Derek.
Yeah, afraid it won’t boot at all. I reformatted the SD card and have tried it with both the eMMC version and the non-eMMC version. Then, just to be sure, used a new SD card as well for each image. Placed card in there, held down boot button and applied power. I don’t get anything except the power light to come on. I’ll get a USB-Serial-TTL cable and see if I can figure it out from there. Thanks
That doesn’t sound good I’m afraid. See what happens with the cable — if you are getting nothing with it then you might have to look in to an RMA… That cable is well worth purchasing as it can be used for many applications (I use it later in the book for programming a low-cost 3.3V Arduino Pro).
Minor correction in the echo and cat section, p 87:
“The exit status for date is 0 for a successful call and 2 for a directory that does not exist.”
Given the context of the previous shell commands, I think you meant “The exit status for ls …”
Thanks for that. Errors like this amaze me… I read that page many times and I did not spot that. Added to errata list. Thanks, Derek.
Finally got the USB-TTL-Serial cable and all it shows when I boot it is a series of C’s printed slowly across the terminal. It does this whether I hold down S2 or not. I bought another BBB at the same time and confirmed I’m hooking everything up right, as it shows a full boot process on the terminal. Sounds like it is dead?
Thanks for your help. Really enjoying your book! Bought it a few days ago as a Nook book from Barnes and Noble.
Hi there. The good news is that it is not completely dead or you would see nothing — The CCCCCCC means that the processor is searching for a bootable image and has not found one. Can you try a brand new SD card with a brand new downloaded image from beagleboard.org? Also, check that the tiny pins haven’t been damaged and that they are making good contact with the SD card (maybe clean the SD card contacts and put some gentle pressure on the pins). With the brand new SD card in the slot, plug in the power while holding the boot button and watch the serial output. Good luck! Derek.
On pages 77 – 78 the book has the eMMC as being shown as mmcblk1boot0 when the lsblk command is used but when I use that command I get 0s where the book says I should have 1s. I get mmcblk0boot0. Is this a problem, or is ok? Amazing book by the way!
Thanks Trevor. If there is an SD card in the slot then you can get a different device name output. In fact, at the top of this web page I complete the example on pages 80-81 to mount the device using its UUID to avoid the problems that can arise with shifting block device names. I think everything is fine, but just be careful with the commands that are issued using the device names. Derek.
Hi Derek,
Thanks for the nice book!
I added a new user into the system with adduser. When I “mkdir abc” in the home folder of that new user, an error told me “no space left on device”. But the root user or “sudo mkdir abc” can do the job. When I use “df -T”, I found the rootfs is 100% used. Is that normal? How can I fix that?
Thanks so much!
Karl
Hi Karl. Thanks. You are in trouble if your rootfs gets to 100%. If you are using a revision B of the board with the 2GB eMMC then this is a common problem. If you are using the revision C board with the 4GB eMMC then this is less common. Start by clearing out the log files — see the note on Page 77. Then have a look at the note on Page 164. Kind regards, Derek.
Thanks so much for your help Derek!
I didn’t find which files are too big. But if it’s normal that’s fine. I reinstalled the OS into an SD card and now everything is alright.
Cheers,
Karl
Hi Derek,
Page 61, Section “Reading memory values directly (Advanced)”, In sentence “The IP address matches the memory values, …”, perhaps you mean Ethernet MAC address.
Thanks Hyusein. Yes, that is a mistake. I will add it to the list of errata. Derek.
Hi Derek,
Thank you for the very gentle and informative book.
Firstly, one editing error I spot on page 80, mounting place /media/6462-3062 and /media/9016-4EF8 have been mixed together.
Besides others, I followed your information to try out Virtualbox on my PC and Machinekit on BBB, really nice!
I have a 2GB eMMC BBB, after upgrading to Debian, the free disk space is getting really low. Currently I just use a 16GB SD to host my whole system, so the 2GB eMMC is not used. With your configuration to boot from eMMC and to mount SD as extra storage, that is nice. But will I run into problem when /home is running out of space? In such case, I suppose I should use soft link to link a directory to the extra space on SD? Is there anyway that user can get the extra space without knowing anything happened in the background? For example, when a company ran into the space issue, what did the administrator do? Did they buy a larger storage and copy everything from the smaller storage over?
Thanks David — I updated the example when the book was going to press, but introduced a continuity error! I’ll add it to the list of errata. Great work too — Yes, the 2GB eMMC is very tight. I think that people were happy to pay the extra for the 4GB revision. Your discussion on the process is spot on. You can copy the /home directory to the SD card (e.g., /media/home) and then you can edit the /etc/fstab file to add an entry that places /media/home as /home. Derek.
Hi Derek,
Great book so far! I’ve encountered a problem when attempting to follow Step 5 here. After finishing the steps in order and typing everything exactly right, my BBB would not boot up. Here is what I did differently, I have been using vim to edit files up to this point but do not see how that would affect anything, and when I decided to see how my fstab editing went, I used “init 6″ to reboot. First off, I guess shutdown is a much better approach, but is init 6 actually a bad approach? After rebooting, i could not connect with putty at all, and the bbb will not do a soft shutdown. I got out the usb to ttl and amazingly enough am able to connect via serial. I removed the line that was added to fstab (after verifying everything was in fact correct), and then used “shutdown -h now” … nothing. The bbb now refuses to power down, and will not open a usb internet connection. Any suggestions on what has happened here? I am using a 32gb class 10 Samsung “evo” card, I am going to attempt to reflash the emmc, but am wondering if the same thing is going to happen upon step 5…
again, thanks for all your hard work. This book is truly amazing and the amount of time you must have invested really shows
Hi, thanks for the feedback! That is an odd problem and it sounds like an error has been introduced into the fstab file. Editing with vim wouldn’t make any difference. I’m assuming that you are running shutdown as root so I’m not sure why it won’t shutdown — maybe try a sudo halt now. Are you certain that you didn’t edit any of the other entries in the fstab file? Just for reference, here is my fstab file. The last line is for the SD card and can be removed.
Unfortunately I did not further diagnose the fstab after removing the last line and am back up and running into chapter 5 now with a newly flashed emmc. The extra practice of reinstalling packages, setting .profile and such was probably good to solidify the concepts anyways. My closest guess is that maybe I had rebooted after seeing the sdcard on mmcblk1p1, and when pulling the UUID upon reboot foolishly pulled that one again instead of the proper mmcblk0p1? Maybe using the cp command would be a good idea to create a backup file before altering fstab. In practice, one could usb-ttl in and revert to the old file and should fix any errors, would this be correct? I would’ve thought removing that line should’ve fixed the error though, and had no luck, so maybe your intuition on possibly altering another line while navigating down to the last line in fstab could have happened. I am still perplexed by the shutdown issue, it would hang for five minutes until Ctrl-c to cancel shutdown. I tried every variation of the command as root, with sudo, pressing the power button on the board to no avail. I guess we’ll never know…
Hi Derek,
In page 97: “The shortcut git commit -a will commit modified files directly to the staging area, …”. Do you mean “local repository” instead of “staging area”?
Thanks Hyusein, yes indeed — I will add that to the list of errata. It is important to note that it only commits modified files and not new files that are untracked. Kind regards, Derek.
Hi, Derek
I found on page 97 git config -global user.name and the next line, the “-global” maybe use “–global”, double dashes, or it will return an error.
Really enjoy your book, Thank you very much. O(∩_∩)O~
Thanks for that. I have added it to the list of errata. Kind regards, Derek.
Hi Derek,
Does beaglebone have the capability to detect the bootloader from the micron emmc boot partitions?? I had burned the MLO and u-boot.img to the boot partitions (Both tried RAW and VFAT), but still could not able to crack the nut.
Thanks,
pratap
Hi Derek,
Love the book but I have two questions.
1) p90 middle of the page – should “more HelloWorldSleep.c” be “nano HelloWorldSleep.c”
and
2) when I try to compile the program on that page, I get “fatal error: stdio: No such file or directory”
Any suggestions?
Thank you for the great book.
I got number 2. Sorry for the trouble.
Hi there, you are welcome — thanks for your support! Just on 1) Yes, the code has to be entered using nano, but I’m just showing the file using more as I have no real way of indicating that I am entering code at the command line. Hope that makes sense, Derek.
Hi Derek,
The book is great, as expected!
I get the following error when I try to clone the test repository.
root@beaglebone:~# git clone https://github.com/derekmolloy/test.git
Cloning into test…
error: while accessing https://github.com/derekmolloy/test.git/info/refs
fatal: HTTP request failed
This succeeds from my Ubuntu desktop but not from my beaglebone white running Angstrom. What could this be? Thanks.
Hi Will, thanks for your support! That looks like a certificates problem. Can you try the following steps in this post on my blog: http://derekmolloy.ie/fixing-git-and-curl-certificates-problem-on-beaglebone-blac/ and see if it works? Thanks, Derek.
Worked a treat Derek, thanks a mill.
Here in this page under Important notes section, where it says “the typical installation is the arm64 netinst for readers who have an Intel x86 64-bit machine” should be amd64 nor arm64 I believe.
Cheers
Thanks Jordi, I have fixed it. Derek.
p. 73, command table suggests “chmod u+s myexe” sets *both* setuid and setgid; that’s not right, is it?
rday
Hi Robert, Correct. That command only sets the setuid bit. The description on the right describes both, but the example that is provided is for the setuid bit only. I probably should have given both examples on the left-hand side. Thanks, Derek.
On the Errata p97, should it be “git config –global“ instead of “git commit –global“? -Thanks
Hi there, oops! thanks for that. Fixed. Fortunately I can edit the errata and I don’t need to publish an errata for the errata! Thanks, Derek.
p. 61, 3rd bullet point, reference to absolute pathname “/dtbs/am335x-boneblack.dtb”, should that be relative to /boot if we’re talking about that file in the root filesystem?
Hi Robert, It is /dtbs on the VFAT partition on the bone50 image that this book was written for, but it is /boot/dtbs/ on the Linux partition for the bone70 image update. Derek.
Hi Derek,
I am loving the book! I am a Linux newbie, so I am working my way through the book at a pretty slow rate, trying commands on my BBB as I go! I notice that on pages 77-78 you have the eMMC referred to as mmcblk1, yet when I try the command on my BBB, it is referred to as mmcblk0 as per below. Not sure if this is a typo or not, but thought it was worth mentioning.
Thanks for the great book,
Regards
Michael
root@beaglebone:/# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
mmcblk0boot0 179:8 0 2M 1 disk
mmcblk0boot1 179:16 0 2M 1 disk
mmcblk0 179:0 0 3.6G 0 disk
|-mmcblk0p1 179:1 0 96M 0 part /boot/uboot
`-mmcblk0p2 179:2 0 3.5G 0 part /
root@beaglebone:/#
Thanks Michael. Yes, the block id of the devices can change and you have to be very careful about that fact. In fact, if you plug in a SD card into the slot it can result in the devices switching IDs. To deal with this on the chapter web page for exploringbeaglebone.com/chapter3/ in the section “Mounting the SD Card Automatically” I use the UUID of the device to ensure that the correct device is mounted. Kind regards, Derek.
Thanks Derek for your quick response! Linux is indeed an OS where one must pay attention and is definitely not a hobby for people with fat fingers and small keyboards! I’ll certainly be careful when it comes to the details and will be trying the exercises on your website as I go! Thanks again, Michael
Hi Derek,
As you suggested I installed Cairo-Dock followed your instructions. However when I login with Cairo-Dock option, a warning message pops up as below:
Xsession:Unable to launch “gnome-session –session=cairo-dock” X session —“gnome-session –session=cairo-dock” not found; falling back to default session.
The Cairo-Dock is just installed after a fresh Debian Jessie installation, could you point me what the problem is, how to fix the problem.
Thanks in advance,
Hi there. It looks like cairo-dock is not installed properly. Maybe try the installation again and execute it directly before adding it to the startup properties. Derek.
Hey Derek,
I am still loving the book and am experimenting with every example as I work my way through the pages. I just wanted to let you know that in Chapter 3 on page 94 in the Note section that http://www.gitlab.org/ is now a dead link. I appears that http://www.getgitorious.com/ is still up and running!
Thanks again,
Michael
Derek,
Further to my comment it appears that http://www.getgitorious.com/ is been acquired by GitLab.com. So I am guessing http://www.gitlab.org should be http://www.gitlab.com.
Message at http://www.getgitorious.com/ web site:
System notice: Gitorious is being acquired by GitLab and gitorious.org will shut down end of May. Please import your repositories to GitLab.com
Thanks,
Michael
Thanks Michael, great to know! I’ll add a note in the errata to let people know. Kind regards, Derek.
I know this isn’t a VirtualBox help site, but I am growing frustrated searching the net for a way to increase the size (resolution) of the Debian desktop after installing VirtualBox and Debian 8 as instructed here. The largest I can get is 1024×768, which is OK for now but it would be so much nicer to increase that as I get farther into the book and on to larger cross platform programming projects.
What do I have to do to get the Settings | Displays app in Debian to give me choices other than 800×600 and 1024×768?
Thanks,
Mitchell
Hi Mitchell, if you follow the steps on the web page (after Figure 2-A1) to install the Oracle VirtualBox Additions then you can re-size the window dynamically to whatever resolution you require by dragging the corner of the VirtualBox window frame (Linux then changes the desktop resolution to match). Kind regards, Derek.
Thanks for the quick reply – I think there is a problem with my installation then. I did follow your directions originally but something must have gone wrong. When I selected “Devices | Install Guest Additions” nothing appeared to happen except the menu item changed to “Devices | Insert Guest Additions CD image…”. After some Internet searching I found the “VBoxGuestAdditions.iso” file in the base VirtualBox install folder but when I try to load it VirtualBox reports “Unable to insert the virtual optical disk C:\…” Unless you have another idea I guess I will try uninstalling and reinstalling VirtualBox and try again.
First, thinking the ISO might be corrupt; I downloaded the Guest Additions ISO from the Oracle VirtualBox website. While this turned out to most likely be unnecessary, it’s nice to know it’s an option to not have to reinstall everything.
As reported in my earlier post VB would not accept the ISO file; it also rejected the fresh copy I downloaded. However, I found that if I manually un-mounted / ejected the virtual CD using the Disks utility on the Debian desktop running on the VM, I could then successfully “insert” the virtual CD from the VB “Devices” menu. The installation then tried to autorun, but failed, with Debian complaining that it “could not find the program”. I found two ways around this:
1. Run the installer manually by navigating to the /media/cdrom directory and executing sudo sh VBoxLinuxAdditions.run.
2. Edit the /etc/fstab file replacing “noauto” with “exec” on the line for the cdrom, which is /dev/sr0 on my setup.
Both worked (after restarting the VM).
I just realized that Dr. Molloy included how to manually start the installer in his instructions on this page. This worked for me as advertised, but only after I un-mounted and reinserted the ISO (for whatever reason).
Just wanted to post my experience, including the fix for autorun, in case anyone else reading and following along with this fine book runs into similar issues.
Thanks Mitchell, very useful feedback, Derek.
I could not run the “sh ./VBoxLinuxAdditions.run” command, it would say ‘Can’t open ./VBox…’, I found the solution here:
http://superuser.com/questions/261643/cant-install-guest-additions-using-virtualbox-ubuntu-guest-os-win7-host-os
Apparently one has to mount the “VBoxGuestAdditions.iso” file under Windows, which is in the
“C:\Program Files\Oracle\VirtualBox” directory!
Following the instructions in the above link by Sathya, it then installed fine.
Hi Stephan, yes, the ISO has to be mounted — I have updated the guide on the page. Thanks for that, Derek.
Hello Derek,
I am using VMware and debian 8 Jessie, I also installed mkudevrule.sh for Beaglebone. But still not able to connect with Beaglebone through SSH. In windows with putty its working flawlessly. Could you please guide me for this.
Everything up to installing the armhf toolchain works fine (vm image debian 8.5), but installing the toolchain fails.. seemingly due to incompatible packages?
root@bbbdebian:/home/bbbguest# apt-get install crossbuild-essential-armhf
Reading package lists… Done
Building dependency tree
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
crossbuild-essential-armhf : Depends: libc6-dev:armhf but it is not going to be installed
Depends: gcc-arm-linux-gnueabihf (>= 4.9.1-1) but it is not going to be installed
Depends: g++-arm-linux-gnueabihf (>= 4.9.1-1) but it is not going to be installed
Depends: dpkg-cross but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
root@bbbdebian:/home/bbbguest#
Is there some known incompatibility? What version of jessie 8.? is this known to work with?
Hi,
I’m working through your book, thank you for such a great resource. I’m ready to install the cross-compilation tools. Can I go ahead and use Debian Buster ? That’s the latest stable build as of today’s date. Are there any problems reported in the toolchain for this build ?
Thanks,
B
Hi,
I’m proceeding to try and use Debian Buster. I installed VirtualBox with the 2Gig of memory and a 32Gig VDI Device drive. The IDE controller is set to virtual optical drive primary master and pointing to my iso file of Debian Buster. When I start the VM it reports No Bootable Device
My VM system is set to boot from Optical 1st and Hard disk 2nd (My laptop has only a hard drive and no CD). What am I missing here ? I’m assuming the ‘Optical’ drive is a virtual device that is really accessing my hardwares HD ?
Thanks
Brian
Answering my own problem ~)
The iso image I had was the armhf intended for the BBB. I changed the image to debian ‘Buster’ i386 and that booted.
My next issue was during install it could not connect to the internet so it did a minimal install. Now I’m trying to connect the VM to the internet. Note as an aside I did get the BBB connected to the internet via my host using the USB interface.
For the VM I edited the /etc/network/interfaces file to add the domain gateway and IPv4 address. After doing this and rebooting I still cannot ping the internet. My domain gateway is 10.0.0.1 and the IPv4 address is 10.0.0.247. These are for my host wireless LAN adapter. From the host I can ping these addresses and get data but from the VM I get the address is not reachable from 10.0.0.247.
Once I can connect to the internet I’m assuming I can update all debian packages to get a full install.
Any suggestions? ~Thanks,
Hi Derek- I can’t get the pg 80 “Example to Mount SD card…” to work. Also it says there is a further step in the chapter web pages that details how to make the SD mount automatically on boot, where is that?
I can’t find the instructions for “To deal with this on the chapter web page for exploringbeaglebone.com/chapter3/ in the section “Mounting the SD Card Automatically” I use the UUID of the device to ensure that the correct device is mounted.” I’m ON the chapter web page, where is it? -Thanks
Hi,
In p. 88 at the end of the page there is the sentence “For example, you can reboot your board by typing the following:” The following commands do not correspond to reboot, it has other commands instead. The right command is at the end of the page “sudo init 6”
Also, I followed the steps to change the shell prompt to “debian@ebb” but it did not work.
Commands:
debian@beaglebone:~$ sudo hostnamectl –static set-hostname ebb
debian@beaglebone:~$ hostname
ebb
debian@beaglebone:~$ more /etc/hosts
127.0.0.1 localhost
127.0.1.1 beaglebone.localdomain beaglebone
Note: it does not contain “ebb” as it is in the book example
Thanks
p128:” echo “Just some text” > newfile.txt ” generates permission denied error. I tried ‘sudo’ before the command without luck.
‘sudo nano newfile.txt’ in /test does the trick
Super book. It’s challenging for me being relatively new to programming but very enjoyable
Page 88. I think you meant to say rename instead of reboot when using hostname commands.