diff options
author | Gatis Paeglis <gatis.paeglis@qt.io> | 2016-08-24 13:26:47 +0200 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-01-10 13:52:58 +0000 |
commit | 4233b1db199d5207138b9f2946b35d28557cc7a5 (patch) | |
tree | 775d85d78c7067a2ce0fcd4dc5ae1ce4e0bff4dc /src/boot/grub2 | |
parent | 652d9dd98a610ba6ebda3e3e6c5202f53d3dc439 (diff) | |
download | ostree-4233b1db199d5207138b9f2946b35d28557cc7a5.tar.gz |
Support for booting without initramfs
Previously when initramfs-* was not found in a deployment's
boot directory, it was assumed that rootfs is prepared for
ostree booting by a kernel patch.
With this patch, the behaviour changes to be - if initramfs-*
is not found, assume that system is using a static
ostree-prepare-root as init process. Booting without initramfs
is a common use case on embedded systems. This approach is
also more convenient, than having to patch the kernel.
Closes: #1401
Approved by: cgwalters
Diffstat (limited to 'src/boot/grub2')
-rw-r--r-- | src/boot/grub2/ostree-grub-generator | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/boot/grub2/ostree-grub-generator b/src/boot/grub2/ostree-grub-generator index ad8c2b83..3985008f 100644 --- a/src/boot/grub2/ostree-grub-generator +++ b/src/boot/grub2/ostree-grub-generator @@ -28,7 +28,7 @@ entries_path=$(dirname $new_grub2_cfg)/entries read_config() { - config_file=${entries_path}/${1} + config_file=${1} title="" initrd="" options="" @@ -67,11 +67,13 @@ populate_menu() else boot_prefix="${OSTREE_BOOT_PARTITION}" fi - for config in $(ls ${entries_path}); do + for config in $(ls $entries_path/*.conf); do read_config ${config} menu="${menu}menuentry '${title}' {\n" menu="${menu}\t linux ${boot_prefix}${linux} ${options}\n" - menu="${menu}\t initrd ${boot_prefix}${initrd}\n" + if [ -n "${initrd}" ] ; then + menu="${menu}\t initrd ${boot_prefix}${initrd}\n" + fi menu="${menu}}\n\n" done # The printf command seems to be more reliable across shells for special character (\n, \t) evaluation |