user-doc: add notes about mkimage for initramfs

master
S.J.R. van Schaik 7 years ago
parent 2344de2c47
commit 39f24dc0d9
  1. 16
      user-doc/user-doc.tex

@ -178,6 +178,18 @@ More specifically, it is recommended to build a kernel without any support for n
For the initramfs, we will need static binaries of \emph{busybox}, \emph{kexec-tools}, \emph{cpio} and \emph{gzip}.
Run the following command to pack up the directory structure of the initramfs into a gzip compressed cpio archive:
\begin{minted}[breaklines]{text}
find . -print0 | cpio --null -ov --format=newc | gzip -9 > ../initramfs.cpio.gz
\end{minted}
Because u-boot expects the initramfs to be in the u-boot format, we also have to wrap it up in their format using \emph{mkimage}:
\begin{minted}[breaklines]{text}
mkimage -n 'Ramdisk Image' -A arm -O linux -T ramdisk -C gzip -d initramfs.cpio.gz initramfs.uImage
\end{minted}
\section{Flashing ROTS}
To write the ROTS image to the SPI NOR flash, we can either use an external programmer or boot the device in FEL mode and use the \emph{sunxi-fel} tool.
@ -349,12 +361,12 @@ Once the board has booted into FEL mode, we can detect the SPI NOR flash chip as
Manufacturer: Winbond (EFh), model: 40h, size: 16777216 bytes.
\end{minted}
Then we can write the \path{u-boot.bin}, \path{bzImage} and \path{initramfs.cpio.gz} images as follows:
Then we can write the \path{u-boot.bin}, \path{bzImage} and \path{initramfs.uImage} images as follows:
\begin{minted}[breaklines]{text}
./sunxi-fel -p spiflash-write 0x000000 u-boot.bin
./sunxi-fel -p spiflash-write 0x0a0000 bzImage
./sunxi-fel -p spiflash-write 0x600000 initramfs.cpio.gz
./sunxi-fel -p spiflash-write 0x600000 initramfs.uImage
\end{minted}
\section{Booting ROTS}

Loading…
Cancel
Save