[bootlin/training-materials updates] master: Boneblack: put SD card preparation instructions in a shared file (10b1fc0f)

Michael Opdenacker michael.opdenacker at bootlin.com
Thu May 16 14:17:19 CEST 2019


Repository : https://github.com/bootlin/training-materials
On branch  : master
Link       : https://github.com/bootlin/training-materials/commit/10b1fc0f121f9f697863fdde259a4cdef236ae6d

>---------------------------------------------------------------

commit 10b1fc0f121f9f697863fdde259a4cdef236ae6d
Author: Michael Opdenacker <michael.opdenacker at bootlin.com>
Date:   Thu May 16 13:51:06 2019 +0200

    Boneblack: put SD card preparation instructions in a shared file
    
    Signed-off-by: Michael Opdenacker <michael.opdenacker at bootlin.com>


>---------------------------------------------------------------

10b1fc0f121f9f697863fdde259a4cdef236ae6d
 common/boneblack-sdcard-preparation.tex  | 76 +++++++++++++++++++++++++++++++
 labs/buildroot-basic/buildroot-basic.tex | 77 +-------------------------------
 2 files changed, 77 insertions(+), 76 deletions(-)

diff --git a/common/boneblack-sdcard-preparation.tex b/common/boneblack-sdcard-preparation.tex
new file mode 100644
index 00000000..9e4a232d
--- /dev/null
+++ b/common/boneblack-sdcard-preparation.tex
@@ -0,0 +1,76 @@
+\section{Prepare the SD card}
+
+Our SD card needs to be split in two partitions:
+
+\begin{itemize}
+
+\item A first partition for the bootloader. It needs to comply with
+  the requirements of the AM335x SoC so that it can find the bootloader in
+  this partition. It should be a FAT32 partition. We will store the
+  bootloader (\code{MLO} and \code{u-boot.img}), the kernel image
+  (\code{zImage}), the Device Tree (\code{am335x-boneblack.dtb}) and a
+  special U-Boot script for the boot.
+
+\item A second partition for the root filesystem. It can use
+  whichever filesystem type you want, but for our system, we'll use
+  {\em ext4}.
+
+\end{itemize}
+
+First, let's identify under what name your SD card is identified in
+your system: look at the output of \code{cat /proc/partitions} and
+find your SD card. In general, if you use the internal SD card reader
+of a laptop, it will be \code{mmcblk0}, while if you use an external
+USB SD card reader, it will be \code{sdX} (i.e\code{sdb}, \code{sdc},
+etc.). {\bf Be careful: \code{/dev/sda} is generally the hard drive of
+  your machine!}
+
+If your SD card is \code{/dev/mmcblk0}, then the partitions inside the
+SD card are named \code{/dev/mmcblk0p1}, \code{/dev/mmcblk0p2}, etc. If your SD
+card is \code{/dev/sdc}, then the partitions inside are named
+\code{/dev/sdc1}, \code{/dev/sdc2}, etc.
+
+To format your SD card, do the following steps:
+
+\begin{enumerate}
+
+\item Unmount all partitions of your SD card (they are generally
+  automatically mounted by Ubuntu)
+
+\item Erase the beginning of the SD card to ensure that the existing
+  partitions are not going to be mistakenly detected:\\
+  \code{sudo dd if=/dev/zero of=/dev/mmcblk0 bs=1M count=16}. Use
+  \code{sdc} or \code{sdb} instead of \code{mmcblk0} if needed.
+
+\item Create the two partitions.
+
+  \begin{itemize}
+
+  \item Start the \code{cfdisk} tool for that:\\
+    \code{sudo cfdisk /dev/mmcblk0}.
+
+  \item Chose the {\em dos} partition table type
+
+  \item Create a first small partition (128 MB), primary, with type
+    \code{e} ({\em W95 FAT16}) and mark it bootable
+
+  \item Create a second partition, also primary, with the rest of the
+    available space, with type \code{83} ({\em Linux}).
+
+  \item Exit \code{cfdisk}
+
+  \end{itemize}
+
+\item Format the first partition as a {\em FAT32} filesystem:\\
+  \code{sudo mkfs.vfat -F 32 -n boot /dev/mmcblk0p1}. Use \code{sdc1}
+  or \code{sdb1} instead of \code{mmcblk0p1} if needed.
+
+\item Format the second partition as an {\em ext4} filesystem:\\
+  \code{sudo mkfs.ext4 -L rootfs -E nodiscard /dev/mmcblk0p2}. Use
+  \code{sdc2} or \code{sdb2} instead of \code{mmcblk0p2} if needed.
+
+\end{enumerate}
+
+Remove the SD card and insert it again, the two partitions should be
+mounted automatically, in \code{/media/<user>/boot} and
+\code{/media/<user>/rootfs}.
diff --git a/labs/buildroot-basic/buildroot-basic.tex b/labs/buildroot-basic/buildroot-basic.tex
index c260fa01..6ae16b68 100644
--- a/labs/buildroot-basic/buildroot-basic.tex
+++ b/labs/buildroot-basic/buildroot-basic.tex
@@ -319,82 +319,7 @@ serial communication on \code{/dev/ttyUSB0}, with a baudrate of
 There should be nothing on the serial line so far, as the board is not
 powered up yet.
 
-\section{Prepare the SD card}
-
-Our SD card needs to be split in two partitions:
-
-\begin{itemize}
-
-\item A first partition for the bootloader. It needs to comply with
-  the requirements of the AM335x so that it can find the bootloader in
-  this partition. It should be a FAT32 partition. We will store the
-  bootloader (\code{MLO} and \code{u-boot.img}), the kernel image
-  (\code{zImage}), the Device Tree (\code{am335x-boneblack.dtb}) and a
-  special U-Boot script for the boot.
-
-\item A second partition for the root filesystem. It can use
-  whichever filesystem type you want, but for our system, we'll use
-  {\em ext4}.
-
-\end{itemize}
-
-First, let's identify under what name your SD card is identified in
-your system: look at the output of \code{cat /proc/partitions} and
-find your SD card. In general, if you use the internal SD card reader
-of a laptop, it will be \code{mmcblk0}, while if you use an external
-USB SD card reader, it will be \code{sdX} (i.e\code{sdb}, \code{sdc},
-etc.). {\bf Be careful: \code{/dev/sda} is generally the hard drive of
-  your machine!}
-
-If your SD card is \code{/dev/mmcblk0}, then the partitions inside the
-SD card are named \code{/dev/mmcblk0p1}, \code{/dev/mmcblk0p2}, etc. If your SD
-card is \code{/dev/sdc}, then the partitions inside are named
-\code{/dev/sdc1}, \code{/dev/sdc2}, etc.
-
-To format your SD card, do the following steps:
-
-\begin{enumerate}
-
-\item Unmount all partitions of your SD card (they are generally
-  automatically mounted by Ubuntu)
-
-\item Erase the beginning of the SD card to ensure that the existing
-  partitions are not going to be mistakenly detected:\\
-  \code{sudo dd if=/dev/zero of=/dev/mmcblk0 bs=1M count=16}. Use
-  \code{sdc} or \code{sdb} instead of \code{mmcblk0} if needed.
-
-\item Create the two partitions.
-
-  \begin{itemize}
-
-  \item Start the \code{cfdisk} tool for that:\\
-    \code{sudo cfdisk /dev/mmcblk0}.
-
-  \item Chose the {\em dos} partition table type
-
-  \item Create a first small partition (128 MB), primary, with type
-    \code{e} ({\em W95 FAT16}) and mark it bootable
-
-  \item Create a second partition, also primary, with the rest of the
-    available space, with type \code{83} ({\em Linux}).
-
-  \item Exit \code{cfdisk}
-
-  \end{itemize}
-
-\item Format the first partition as a {\em FAT32} filesystem:\\
-  \code{sudo mkfs.vfat -F 32 -n boot /dev/mmcblk0p1}. Use \code{sdc1}
-  or \code{sdb1} instead of \code{mmcblk0p1} if needed.
-
-\item Format the second partition as an {\em ext4} filesystem:\\
-  \code{sudo mkfs.ext4 -L rootfs -E nodiscard /dev/mmcblk0p2}. Use
-  \code{sdc2} or \code{sdb2} instead of \code{mmcblk0p2} if needed.
-
-\end{enumerate}
-
-Remove the SD card and insert it again, the two partitions should be
-mounted automatically, in \code{/media/<user>/boot} and
-\code{/media/<user>/rootfs}.
+\input{../common/boneblack-sdcard-preparation.tex}
 
 Now everything should be ready. Hopefully by that time the Buildroot
 build should have completed. If not, wait a little bit more.




More information about the training-materials-updates mailing list