summaryrefslogtreecommitdiff
path: root/src/ostree/ot-admin-functions.c
diff options
context:
space:
mode:
authorJavier Martinez Canillas <javier.martinez@collabora.co.uk>2013-08-15 12:33:25 +0200
committerColin Walters <walters@verbum.org>2013-08-20 13:00:46 -0400
commit750a60d3aa35749700f55f53e43beff623ecbf9b (patch)
tree1320d086bf9e06b6e6874900fc3d29dcaa481395 /src/ostree/ot-admin-functions.c
parentcf14b398da3a28eb8d13d5fb1ca88a489a5df000 (diff)
downloadostree-750a60d3aa35749700f55f53e43beff623ecbf9b.tar.gz
main: Add U-Boot bootlader backend support
This patch adds support to generate files that can be used by Universal Bootloader (U-Boot). U-Boot allows to modify boards default boot commands by reading and executing a bootscript file or importing a plain text file that contains environment variables that could parameterize the boot command or a bootscript. OSTree generates a uEnv.txt file that contains booting information that is taken from Boot Loader Specification snippets files as defined in the new OSTree deployment model: https://wiki.gnome.org/OSTree/DeploymentModel2 On deploy or upgrade an uEnv.txt env var file is created in the path /boot/loader.${bootversion}/uEnv.txt. Also, a /boot/uEnv.txt symbolic link to loader/uEnv.txt is created so U-Boot can always import the file from a fixed path. Since U-Boot does not support a menu to list a set of Operative Systems, the most recent bootloader configuration from the list is used. To boot an OSTree using the generated uEnv.txt file, a board has to parameterize its default boot command using the following variables defined by OSTree: ${kernel_image}: path to the Linux kernel image ${ramdisk_image}: path to the initial ramdisk image ${bootargs}: parameters passed to the kernel command line Alternatively, for boards that don't support this scheme, a bootscript that overrides the default boot command can be used. An example of such a bootscript could be: setenv scriptaddr 40008000 setenv kernel_addr 0x40007000 setenv ramdisk_addr 0x42000000 ext2load mmc 0:1 ${scriptaddr} uEnv.txt env import -t ${scriptaddr} ${filesize} ext2load mmc 0:1 ${kernel_addr} ${kernel_image} ext2load mmc 0:1 ${ramdisk_addr} ${ramdisk_image} bootm ${kernel_addr} ${ramdisk_addr} Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> https://bugzilla.gnome.org/show_bug.cgi?id=706370
Diffstat (limited to 'src/ostree/ot-admin-functions.c')
-rw-r--r--src/ostree/ot-admin-functions.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ostree/ot-admin-functions.c b/src/ostree/ot-admin-functions.c
index b2caa4c4..7dfc30f1 100644
--- a/src/ostree/ot-admin-functions.c
+++ b/src/ostree/ot-admin-functions.c
@@ -26,6 +26,7 @@
#include "ot-deployment.h"
#include "ot-config-parser.h"
#include "ot-bootloader-syslinux.h"
+#include "ot-bootloader-uboot.h"
#include "otutil.h"
#include "ostree.h"
#include "libgsystem.h"
@@ -794,11 +795,16 @@ OtBootloader *
ot_admin_query_bootloader (GFile *sysroot)
{
OtBootloaderSyslinux *syslinux;
+ OtBootloaderUboot *uboot;
syslinux = ot_bootloader_syslinux_new (sysroot);
if (ot_bootloader_query ((OtBootloader*)syslinux))
return (OtBootloader*) (syslinux);
+ uboot = ot_bootloader_uboot_new (sysroot);
+ if (ot_bootloader_query ((OtBootloader*)uboot))
+ return (OtBootloader*) (uboot);
+
return NULL;
}