Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 04cd7ae4 authored by Mark Yoder's avatar Mark Yoder
Browse files

Added :language: to literalinclude

parent 16601777
Branches
Tags
No related merge requests found
...@@ -26,8 +26,8 @@ You want to use BeagleBone Black as a desktop computer with keyboard, mouse, and ...@@ -26,8 +26,8 @@ You want to use BeagleBone Black as a desktop computer with keyboard, mouse, and
Solution Solution
--------- ---------
The Bone comes with USB and a microHDMI output. All you need to do is connect your keyboard, mouse, The Bone comes with USB and a microHDMI output. All you need to do is connect your keyboard, mouse,
and HDMI display to it. and HDMI display to it.
To make this recipe, you will need: To make this recipe, you will need:
...@@ -58,8 +58,8 @@ The adapter looks something like :ref:`tips_HDMI_adaptor_fig`. ...@@ -58,8 +58,8 @@ The adapter looks something like :ref:`tips_HDMI_adaptor_fig`.
Female HDMI-to-male microHDMI adapter Female HDMI-to-male microHDMI adapter
Plug the small end into the microHDMI input on the Bone and plug your HDMI cable Plug the small end into the microHDMI input on the Bone and plug your HDMI cable
into the other end of the into the other end of the
adapter and your monitor. If nothing displays on your Bone, reboot. adapter and your monitor. If nothing displays on your Bone, reboot.
If nothing appears after the reboot, edit the ``/boot/uEnv.txt`` file. Search for the line containing If nothing appears after the reboot, edit the ``/boot/uEnv.txt`` file. Search for the line containing
...@@ -74,22 +74,22 @@ If nothing appears after the reboot, edit the ``/boot/uEnv.txt`` file. Search fo ...@@ -74,22 +74,22 @@ If nothing appears after the reboot, edit the ``/boot/uEnv.txt`` file. Search fo
Then reboot. Then reboot.
.. PRODUCTION: in the following tip, we're trying to display the hash symbol (#), .. PRODUCTION: in the following tip, we're trying to display the hash symbol (#),
.. all by itself, in constant width. Using *#* produces an empty space in the build, .. all by itself, in constant width. Using *#* produces an empty space in the build,
.. and I don't know how to escape special characters within what should be literal strings. .. and I don't know how to escape special characters within what should be literal strings.
.. Adding to my confusion, the # signs are dropped in the first paragraph of the tip, .. Adding to my confusion, the # signs are dropped in the first paragraph of the tip,
.. but not in the second, which is formatted in the same exact way. .. but not in the second, which is formatted in the same exact way.
.. Also, using ## in the code italicizes the second # and everything after it in the line, .. Also, using ## in the code italicizes the second # and everything after it in the line,
.. which should not happen. .. which should not happen.
The ``/boot/uEnv.txt`` file contains a number of configuration commands that are executed at boot time. The ``/boot/uEnv.txt`` file contains a number of configuration commands that are executed at boot time.
The *#* character is used to add comments; that is, everything to the right of a +# is ignored by the The *#* character is used to add comments; that is, everything to the right of a +# is ignored by the
Bone and is assumed to be for humans to read. In the previous example, *###Disable auto loading* is Bone and is assumed to be for humans to read. In the previous example, *###Disable auto loading* is
a comment that informs us the next line(s) are for disabling things. Two *disable_uboot_overlay* a comment that informs us the next line(s) are for disabling things. Two *disable_uboot_overlay*
commands follow. Both should be commented-out and won't be executed by the Bone. commands follow. Both should be commented-out and won't be executed by the Bone.
Why not just remove the line? Later, you might decide you need more general-purpose input/output Why not just remove the line? Later, you might decide you need more general-purpose input/output
(GPIO) pins and don't need the HDMI display. If so, just remove the *#* from the ``disable_uboot_overlay_video=1`` (GPIO) pins and don't need the HDMI display. If so, just remove the *#* from the ``disable_uboot_overlay_video=1``
...@@ -127,7 +127,7 @@ Solution ...@@ -127,7 +127,7 @@ Solution
-------- --------
For projects that require a host computer, we assume that you are running For projects that require a host computer, we assume that you are running
`Linux Ubuntu 22.04 LTS <http://bit.ly/1wXOwkw>`_. You can be running either a native installation, `Linux Ubuntu 22.04 LTS <http://bit.ly/1wXOwkw>`_. You can be running either a native installation,
through `Windows Subsystem for Linux <https://docs.microsoft.com/en-us/windows/wsl/>`_, via a virtual through `Windows Subsystem for Linux <https://docs.microsoft.com/en-us/windows/wsl/>`_, via a virtual
machine such as `VirtualBox <https://www.virtualbox.org/>`_, or in the cloud (`Microsoft Azure <https://portal.azure.com/>`_ machine such as `VirtualBox <https://www.virtualbox.org/>`_, or in the cloud (`Microsoft Azure <https://portal.azure.com/>`_
or `Amazon Elastic Compute Cloud <http://aws.amazon.com/ec2/>`_, EC2, for example). or `Amazon Elastic Compute Cloud <http://aws.amazon.com/ec2/>`_, EC2, for example).
...@@ -142,8 +142,8 @@ Getting to the Command Shell via SSH ...@@ -142,8 +142,8 @@ Getting to the Command Shell via SSH
Problem Problem
-------- --------
You want to connect to the command shell of a remote Bone from your host You want to connect to the command shell of a remote Bone from your host
computer. computer.
Solution Solution
--------- ---------
...@@ -156,29 +156,29 @@ connect by using the following command to log in as user *debian*, (note the *$* ...@@ -156,29 +156,29 @@ connect by using the following command to log in as user *debian*, (note the *$*
.. code-block:: bash .. code-block:: bash
host$ ssh debian@192.168.7.2 host$ ssh debian@192.168.7.2
Warning: Permanently added '192.168.7.2' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.7.2' (ED25519) to the list of known hosts.
Debian GNU/Linux 11 Debian GNU/Linux 11
BeagleBoard.org Debian Bullseye IoT Image 2023-06-03 BeagleBoard.org Debian Bullseye IoT Image 2023-06-03
Support: https://bbb.io/debian Support: https://bbb.io/debian
default username:password is [debian:temppwd] default username:password is [debian:temppwd]
The programs included with the Debian GNU/Linux system are free software; The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright. individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law. permitted by applicable law.
Last login: Thu Jun 8 14:02:40 2023 from 192.168.7.1 Last login: Thu Jun 8 14:02:40 2023 from 192.168.7.1
bone$ bone$
.. _tips_passwords: .. _tips_passwords:
Default password Default password
---------------- ----------------
*debian* has the default password *temppwd*. It's best to change the password: *debian* has the default password *temppwd*. It's best to change the password:
.. code-block:: bash .. code-block:: bash
...@@ -189,27 +189,27 @@ Default password ...@@ -189,27 +189,27 @@ Default password
Retype new UNIX password: Retype new UNIX password:
password: password updated successfully password: password updated successfully
Removing the *Message of the Day* Removing the *Message of the Day*
================================= =================================
Problem Problem
------- -------
Every time you login a long message is displayed that you don't need to see. Every time you login a long message is displayed that you don't need to see.
Solution Solution
-------- --------
The contents of the files `/etc/motd`, `/etc/issue` and `/etc/issue.net` are displayed The contents of the files `/etc/motd`, `/etc/issue` and `/etc/issue.net` are displayed
everytime you long it. You can prevent them from being displayed by moving them elsewhere. everytime you long it. You can prevent them from being displayed by moving them elsewhere.
.. code-block:: bash .. code-block:: bash
bone$ sudo mv /etc/motd /etc/motd.orig bone$ sudo mv /etc/motd /etc/motd.orig
bone$ sudo mv /etc/issue /etc/issue.orig bone$ sudo mv /etc/issue /etc/issue.orig
bone$ sudo mv /etc/issue.net /etc/issue.net.orig bone$ sudo mv /etc/issue.net /etc/issue.net.orig
Now, the next time you `ssh` in they won't be displayed. Now, the next time you `ssh` in they won't be displayed.
.. _tips_serial: .. _tips_serial:
...@@ -228,10 +228,10 @@ Sometimes, you can't connect to the Bone via SSH, but you have a network working ...@@ -228,10 +228,10 @@ Sometimes, you can't connect to the Bone via SSH, but you have a network working
There is a way to access the command line to fix things without requiring extra hardware. (:ref:`tips_FTDI` There is a way to access the command line to fix things without requiring extra hardware. (:ref:`tips_FTDI`
shows a way that works even if you don't have a network working over USB, but it requires a special serial-to-USB cable.) shows a way that works even if you don't have a network working over USB, but it requires a special serial-to-USB cable.)
.. note:: .. note::
This method doesn't work with WSL. This method doesn't work with WSL.
First, check to ensure that the serial port is there. On the host computer, run the following command: First, check to ensure that the serial port is there. On the host computer, run the following command:
.. code-block:: bash .. code-block:: bash
...@@ -240,8 +240,8 @@ First, check to ensure that the serial port is there. On the host computer, run ...@@ -240,8 +240,8 @@ First, check to ensure that the serial port is there. On the host computer, run
0 crw-rw---- 1 root dialout 166, 0 Jun 19 11:47 /dev/ttyACM0 0 crw-rw---- 1 root dialout 166, 0 Jun 19 11:47 /dev/ttyACM0
*/dev/ttyACM0* is a serial port on your host computer that the Bone creates when it boots up. */dev/ttyACM0* is a serial port on your host computer that the Bone creates when it boots up.
The letters *crw-rw----* show that you can't access it as a normal user. However, you can The letters *crw-rw----* show that you can't access it as a normal user. However, you can
access it if you are part of *dialout* group. See if you are in the *dialout* group: access it if you are part of *dialout* group. See if you are in the *dialout* group:
.. code-block:: bash .. code-block:: bash
...@@ -377,11 +377,11 @@ Log in to your Bone and enter the following command: ...@@ -377,11 +377,11 @@ Log in to your Bone and enter the following command:
.. code-block:: bash .. code-block:: bash
bone$ cat /etc/dogtag bone$ cat /etc/dogtag
BeagleBoard.org Debian Bullseye IoT Image 2023-06-03 BeagleBoard.org Debian Bullseye IoT Image 2023-06-03
:ref:`basics_latest_os` shows how to open the ``/etc/dogtag`` file to see the OS version. :ref:`basics_latest_os` shows how to open the ``/etc/dogtag`` file to see the OS version.
See :ref:`basics_install_os` if you need to update your OS. See :ref:`basics_install_os` if you need to update your OS.
Controlling the Bone Remotely with a VNC Controlling the Bone Remotely with a VNC
========================================= =========================================
...@@ -394,24 +394,24 @@ You want to access the BeagleBone's graphical desktop from your host computer. ...@@ -394,24 +394,24 @@ You want to access the BeagleBone's graphical desktop from your host computer.
Solution Solution
--------- ---------
Install and run a Virtual Network Computing (VNC) server: Install and run a Virtual Network Computing (VNC) server:
.. todo .. todo
Check this with desktop installed Check this with desktop installed
.. code-block:: bash .. code-block:: bash
bone$ sudo apt update bone$ sudo apt update
bone$ sudo apt install tightvncserver bone$ sudo apt install tightvncserver
Reading package lists... Done Reading package lists... Done
Building dependency tree... Done Building dependency tree... Done
Reading state information... Done Reading state information... Done
The following additional packages will be installed: The following additional packages will be installed:
... ...
update-alternatives: using /usr/bin/Xtightvnc to provide /usr/bin/Xvnc (Xvnc) in auto mode update-alternatives: using /usr/bin/Xtightvnc to provide /usr/bin/Xvnc (Xvnc) in auto mode
update-alternatives: using /usr/bin/tightvncpasswd to provide /usr/bin/vncpasswd (vncpasswd) in auto mode update-alternatives: using /usr/bin/tightvncpasswd to provide /usr/bin/vncpasswd (vncpasswd) in auto mode
Processing triggers for libc-bin (2.31-13+deb11u6) ... Processing triggers for libc-bin (2.31-13+deb11u6) ...
bone$ tightvncserver bone$ tightvncserver
You will require a password to access your desktops. You will require a password to access your desktops.
...@@ -470,13 +470,13 @@ Click Connect to start graphical access to your Bone, as shown in :ref:`tips_vnc ...@@ -470,13 +470,13 @@ Click Connect to start graphical access to your Bone, as shown in :ref:`tips_vnc
You need to have X Windows installed and running for the VNC to work. You need to have X Windows installed and running for the VNC to work.
Here's how to install it. This needs some 250M of disk space and 19 minutes to install. Here's how to install it. This needs some 250M of disk space and 19 minutes to install.
.. todo .. todo
This isn't working as of 8-June-2023 This isn't working as of 8-June-2023
.. code-block:: bash .. code-block:: bash
bone$ bone$ sudo apt install bbb.io-xfce4-desktop bone$ bone$ sudo apt install bbb.io-xfce4-desktop
bone$ sdo cp /etc/bbb.io/templates/fbdev.xorg.conf /etc/X11/xorg.conf bone$ sdo cp /etc/bbb.io/templates/fbdev.xorg.conf /etc/X11/xorg.conf
bone$ startxfce4 bone$ startxfce4
/usr/bin/startxfce4: Starting X server /usr/bin/startxfce4: Starting X server
/usr/bin/startxfce4: 122: exec: xinit: not found /usr/bin/startxfce4: 122: exec: xinit: not found
...@@ -708,7 +708,7 @@ Solution ...@@ -708,7 +708,7 @@ Solution
For the correct instructions for the image you are using, go to For the correct instructions for the image you are using, go to
`latest-images <http://forum.beagleboard.org/tag/latest-images>`_ and click on the image you are using. `latest-images <http://forum.beagleboard.org/tag/latest-images>`_ and click on the image you are using.
I'm running Debian 11.x (Bullseye), the top one, on the BeagleBone Black. I'm running Debian 11.x (Bullseye), the top one, on the BeagleBone Black.
.. _tips_latest-images_fig: .. _tips_latest-images_fig:
...@@ -718,8 +718,8 @@ I'm running Debian 11.x (Bullseye), the top one, on the BeagleBone Black. ...@@ -718,8 +718,8 @@ I'm running Debian 11.x (Bullseye), the top one, on the BeagleBone Black.
Latest Beagle Images Latest Beagle Images
Scroll to the top of the page and you'll see instructions on setting up Wifi. Scroll to the top of the page and you'll see instructions on setting up Wifi.
The instructions here are based on using **networkctl**. The instructions here are based on using **networkctl**.
.. _tips_networkfig: .. _tips_networkfig:
...@@ -871,7 +871,7 @@ reach the Internet in general, nor can the Internet reach it. On one hand, this ...@@ -871,7 +871,7 @@ reach the Internet in general, nor can the Internet reach it. On one hand, this
no good can't access your Bone. On the other hand, your Bone can't reach the rest of the world. no good can't access your Bone. On the other hand, your Bone can't reach the rest of the world.
Letting your bone see the world: setting up IP masquerading Letting your bone see the world: setting up IP masquerading
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
You need to set up IP masquerading on your host and configure your Bone to use it. Here is a solution that works You need to set up IP masquerading on your host and configure your Bone to use it. Here is a solution that works
with a host computer running Linux. Add the code in :ref:`tips_ipmasq_code` to a with a host computer running Linux. Add the code in :ref:`tips_ipmasq_code` to a
...@@ -881,6 +881,7 @@ file called ``ipMasquerade.sh`` on your host computer. ...@@ -881,6 +881,7 @@ file called ``ipMasquerade.sh`` on your host computer.
.. literalinclude:: ../code/05tips/ipMasquerade.sh .. literalinclude:: ../code/05tips/ipMasquerade.sh
:caption: Code for IP Masquerading (ipMasquerade.sh) :caption: Code for IP Masquerading (ipMasquerade.sh)
:language: bash
:linenos: :linenos:
:download:`ipMasquerade.sh <../code/05tips/ipMasquerade.sh>` :download:`ipMasquerade.sh <../code/05tips/ipMasquerade.sh>`
...@@ -903,6 +904,7 @@ in :ref:`tips_setDNS` to ``setDNS.sh`` on your host computer. ...@@ -903,6 +904,7 @@ in :ref:`tips_setDNS` to ``setDNS.sh`` on your host computer.
.. literalinclude:: ../code/05tips/setDNS.sh .. literalinclude:: ../code/05tips/setDNS.sh
:caption: Code for setting the DNS on the Bone (setDNS.sh) :caption: Code for setting the DNS on the Bone (setDNS.sh)
:language: bash
:linenos: :linenos:
:download:`setDNS.sh <../code/05tips/setDNS.sh>` :download:`setDNS.sh <../code/05tips/setDNS.sh>`
...@@ -939,21 +941,21 @@ Web servers typically listen to port *80*. First, look up the IP address of your ...@@ -939,21 +941,21 @@ Web servers typically listen to port *80*. First, look up the IP address of your
.. code-block:: bash .. code-block:: bash
host$ ip a host$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever valid_lft forever preferred_lft forever
inet6 ::1/128 scope host inet6 ::1/128 scope host
valid_lft forever preferred_lft forever valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1280 qdisc mq state UP group default qlen 1000 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1280 qdisc mq state UP group default qlen 1000
link/ether 00:15:5d:7c:e8:dc brd ff:ff:ff:ff:ff:ff link/ether 00:15:5d:7c:e8:dc brd ff:ff:ff:ff:ff:ff
inet 172.31.43.210/20 brd 172.31.47.255 scope global eth0 inet 172.31.43.210/20 brd 172.31.47.255 scope global eth0
valid_lft forever preferred_lft forever valid_lft forever preferred_lft forever
inet6 fe80::215:5dff:fe7c:e8dc/64 scope link inet6 fe80::215:5dff:fe7c:e8dc/64 scope link
valid_lft forever preferred_lft forever valid_lft forever preferred_lft forever
It's the number following *inet*, which in my case is *172.31.43.210*. It's the number following *inet*, which in my case is *172.31.43.210*.
.. tip:: .. tip::
...@@ -967,7 +969,7 @@ Then run the following, using your host's IP address: ...@@ -967,7 +969,7 @@ Then run the following, using your host's IP address:
.. code-block:: bash .. code-block:: bash
host$ sudo iptables -t nat -A PREROUTING -p tcp -s 0/0 \ host$ sudo iptables -t nat -A PREROUTING -p tcp -s 0/0 \
-d 172.31.43.210 --dport 1080 -j DNAT --to 192.168.7.2:80 -d 172.31.43.210 --dport 1080 -j DNAT --to 192.168.7.2:80
Now browse to your host computer at port *1080*. That is, if your host's IP address Now browse to your host computer at port *1080*. That is, if your host's IP address
...@@ -996,7 +998,7 @@ First install and check the status: ...@@ -996,7 +998,7 @@ First install and check the status:
.. code-block:: bash .. code-block:: bash
bone$ sudo apt update bone$ sudo apt update
bone$ sudo apt install ufw bone$ sudo apt install ufw
bone$ sudo ufw status bone$ sudo ufw status
Status: inactive Status: inactive
...@@ -1033,10 +1035,10 @@ Just to be sure, you can install *nmap* on your host computer to see what ports ...@@ -1033,10 +1035,10 @@ Just to be sure, you can install *nmap* on your host computer to see what ports
80/tcp open http 80/tcp open http
3000/tcp open ppp 3000/tcp open ppp
Nmap done: 1 IP address (1 host up) scanned in 0.19 seconds Nmap done: 1 IP address (1 host up) scanned in 0.19 seconds
Currently there are three ports visible: 22, 80 and 3000 (visual studio code). Currently there are three ports visible: 22, 80 and 3000 (visual studio code).
Now turn on the firewall and see what happens. Now turn on the firewall and see what happens.
.. code-block:: bash .. code-block:: bash
...@@ -1053,7 +1055,7 @@ Now turn on the firewall and see what happens. ...@@ -1053,7 +1055,7 @@ Now turn on the firewall and see what happens.
PORT STATE SERVICE PORT STATE SERVICE
22/tcp open ssh 22/tcp open ssh
Nmap done: 1 IP address (1 host up) scanned in 0.19 seconds Nmap done: 1 IP address (1 host up) scanned in 0.19 seconds
Only port 22 (ssh) is accessible now. Only port 22 (ssh) is accessible now.
...@@ -1065,7 +1067,7 @@ The firewall will remain on, even after a reboot. Disable it now if you don't wa ...@@ -1065,7 +1067,7 @@ The firewall will remain on, even after a reboot. Disable it now if you don't wa
Firewall stopped and disabled on system startup Firewall stopped and disabled on system startup
See the `How-To Geek article <https://www.howtogeek.com/devops/how-to-secure-your-linux-server-with-a-ufw-firewall/>`_ for more examples. See the `How-To Geek article <https://www.howtogeek.com/devops/how-to-secure-your-linux-server-with-a-ufw-firewall/>`_ for more examples.
.. _tips_apt: .. _tips_apt:
...@@ -1084,7 +1086,7 @@ Solution ...@@ -1084,7 +1086,7 @@ Solution
Your Bone needs to be on the network for this to work. See :ref:`networking_wired`, Your Bone needs to be on the network for this to work. See :ref:`networking_wired`,
:ref:`networking_wireless`, or :ref:`networking_usb`. :ref:`networking_wireless`, or :ref:`networking_usb`.
The easiest way to install more software is to use **apt**: The easiest way to install more software is to use **apt**:
.. code-block:: bash .. code-block:: bash
...@@ -1103,7 +1105,7 @@ How do you find out what software you can install? Try running this: ...@@ -1103,7 +1105,7 @@ How do you find out what software you can install? Try running this:
bone$ apt-cache pkgnames | sort > /tmp/list bone$ apt-cache pkgnames | sort > /tmp/list
bone$ wc /tmp/list bone$ wc /tmp/list
67974 67974 1369852 /tmp/list 67974 67974 1369852 /tmp/list
bone$ less /tmp/list bone$ less /tmp/list
...@@ -1111,7 +1113,7 @@ The first command lists all the packages that *apt* knows about and sorts them a ...@@ -1111,7 +1113,7 @@ The first command lists all the packages that *apt* knows about and sorts them a
them in ``/tmp/list``. The second command shows why you want to put the list in a file. them in ``/tmp/list``. The second command shows why you want to put the list in a file.
The *wc* command counts the number of lines, words, and characters in a file. In our case, The *wc* command counts the number of lines, words, and characters in a file. In our case,
there are over 67,000 packages from which we can choose! The *less* command displays the sorted there are over 67,000 packages from which we can choose! The *less* command displays the sorted
list, one page at a time. Press the space bar to go to the next page. Press **q** to quit. list, one page at a time. Press the space bar to go to the next page. Press **q** to quit.
Suppose that you would like to install an online dictionary (*dict*). Just run the following command: Suppose that you would like to install an online dictionary (*dict*). Just run the following command:
...@@ -1184,7 +1186,7 @@ If you booted from the microSD card, run the following command: ...@@ -1184,7 +1186,7 @@ If you booted from the microSD card, run the following command:
The *df* command shows what partitions are already mounted. The *df* command shows what partitions are already mounted.
The line ``/dev/mmcblk0p2 7.2G 2.0G 4.9G 29% /`` shows that *mmcblk0* partition *p2* The line ``/dev/mmcblk0p2 7.2G 2.0G 4.9G 29% /`` shows that *mmcblk0* partition *p2*
is mounted as */*, the root file system. The general rule is that the media you're booted from is mounted as */*, the root file system. The general rule is that the media you're booted from
(either the onboard flash or the microSD card) will appear as *mmcblk0*. (either the onboard flash or the microSD card) will appear as *mmcblk0*.
The second partition (*p2*) is the root of the file system. The second partition (*p2*) is the root of the file system.
...@@ -1237,7 +1239,7 @@ Solution ...@@ -1237,7 +1239,7 @@ Solution
To free up space, you can remove preinstalled packages or discover big files to remove. To free up space, you can remove preinstalled packages or discover big files to remove.
Removing preinstalled packages Removing preinstalled packages
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
You might not need a few things that come preinstalled in the Debian image, including such You might not need a few things that come preinstalled in the Debian image, including such
things as OpenCV, the Chromium web browser, and some documentation. things as OpenCV, the Chromium web browser, and some documentation.
...@@ -1259,7 +1261,7 @@ Here's how you can remove these: ...@@ -1259,7 +1261,7 @@ Here's how you can remove these:
Discovering big files Discovering big files
^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^
The *du* (disk usage) command offers a quick way to discover big files: The *du* (disk usage) command offers a quick way to discover big files:
...@@ -1308,7 +1310,7 @@ following command to see what's taking up the space in ``/var``: ...@@ -1308,7 +1310,7 @@ following command to see what's taking up the space in ``/var``:
.. code-block:: bash .. code-block:: bash
bone$ sudo du -sh /var/* bone$ sudo du -sh /var/*
4.0K /var/backups 4.0K /var/backups
76M /var/cache 76M /var/cache
93M /var/lib 93M /var/lib
...@@ -1365,7 +1367,7 @@ After a moment, you'll see the following: ...@@ -1365,7 +1367,7 @@ After a moment, you'll see the following:
keys to navigate the file structure to discover where the big unused files are. Press ? for help. keys to navigate the file structure to discover where the big unused files are. Press ? for help.
.. warning:: .. warning::
Be careful not to press the **d** key, because it's used to delete a file or directory. Be careful not to press the **d** key, because it's used to delete a file or directory.
.. _misc_libsoc: .. _misc_libsoc:
...@@ -1387,6 +1389,7 @@ and is much faster. The approach is the same, write to the */sys/class/gpio* fi ...@@ -1387,6 +1389,7 @@ and is much faster. The approach is the same, write to the */sys/class/gpio* fi
.. literalinclude:: ../code/05tips/blinkLED.c .. literalinclude:: ../code/05tips/blinkLED.c
:caption: Use C to blink an LED (blinkLED.c) :caption: Use C to blink an LED (blinkLED.c)
:language: c
:linenos: :linenos:
:download:`blinkLED.c <../code/05tips/blinkLED.c>` :download:`blinkLED.c <../code/05tips/blinkLED.c>`
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment