mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] Documentation: efi: add example how to create EFI partition
@ 2017-09-06 12:11 Oleksij Rempel
  2017-09-08  6:19 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Oleksij Rempel @ 2017-09-06 12:11 UTC (permalink / raw)
  To: barebox; +Cc: Oleksij Rempel

From: Oleksij Rempel <o.rempel@pengutronix.de>

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 Documentation/boards/efi.rst | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/Documentation/boards/efi.rst b/Documentation/boards/efi.rst
index 8f78a800e..6c90e6cdf 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
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Documentation: efi: add example how to create EFI partition
  2017-09-06 12:11 [PATCH] Documentation: efi: add example how to create EFI partition Oleksij Rempel
@ 2017-09-08  6:19 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2017-09-08  6:19 UTC (permalink / raw)
  To: Oleksij Rempel; +Cc: barebox, Oleksij Rempel

On Wed, Sep 06, 2017 at 02:11:06PM +0200, Oleksij Rempel wrote:
> From: Oleksij Rempel <o.rempel@pengutronix.de>
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
>  Documentation/boards/efi.rst | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)

Applied, thanks

Sascha

> 
> diff --git a/Documentation/boards/efi.rst b/Documentation/boards/efi.rst
> index 8f78a800e..6c90e6cdf 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
>  ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>  
> -- 
> 2.11.0
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-09-08  6:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-06 12:11 [PATCH] Documentation: efi: add example how to create EFI partition Oleksij Rempel
2017-09-08  6:19 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox