summaryrefslogtreecommitdiffstats
path: root/Documentation/boards/efi.rst
diff options
context:
space:
mode:
authorOleksij Rempel <o.rempel@pengutronix.de>2017-09-06 14:11:06 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2017-09-08 08:19:35 +0200
commit3f5d439693bee191564030daef762f149f565b8b (patch)
tree8655d34aaff255015a6cef5a7aebd5a9f3e28d7b /Documentation/boards/efi.rst
parent0a4d4a4ebe9e3c76c174a5be02edc17a42fa5423 (diff)
downloadbarebox-3f5d439693bee191564030daef762f149f565b8b.tar.gz
barebox-3f5d439693bee191564030daef762f149f565b8b.tar.xz
Documentation: efi: add example how to create EFI partition
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'Documentation/boards/efi.rst')
-rw-r--r--Documentation/boards/efi.rst25
1 files changed, 25 insertions, 0 deletions
diff --git a/Documentation/boards/efi.rst b/Documentation/boards/efi.rst
index 8f78a800ef..6c90e6cdf0 100644
--- a/Documentation/boards/efi.rst
+++ b/Documentation/boards/efi.rst
@@ -47,6 +47,31 @@ has to be put into the ``EFI/barebox/`` directory.
Supported backends for EFI are raw partitions that can be discovered via a
partition UUID.
+With this sample script you can create bootable image and transfer it to the
+flash driver:
+
+.. code-block:: sh
+
+ truncate --size 128M barebox-boot.img
+ echo 'start=2048, type=ef' | sfdisk barebox-boot.img
+
+ LOOPDEV=$(losetup --find --show barebox-boot.img)
+ partprobe ${LOOPDEV}
+
+ # Create filesystems
+ mkfs.fat -F32 ${LOOPDEV}p1
+ MOUNTDIR=$(mktemp -d -t demoXXXXXX)
+ mount ${LOOPDEV}p1 $MOUNTDIR
+ mkdir -p ${MOUNTDIR}/EFI/BOOT/
+ cp barebox.efi ${MOUNTDIR}/EFI/BOOT/BOOTx64.EFI
+ if [ -d network-drivers ]; then
+ cp -r network-drivers ${MOUNTDIR}/
+ fi
+ umount ${MOUNTDIR}
+ losetup -d ${LOOPDEV}
+
+ dd if=barebox-boot.img of=/dev/sdX
+
Running EFI barebox on qemu
^^^^^^^^^^^^^^^^^^^^^^^^^^^