[lxc-devel] [lxc-ci/master] images/fedora: Fix grub.cfg

monstermunchkin on Github lxc-bot at linuxcontainers.org
Tue Mar 3 14:12:29 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 357 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200303/0b824a49/attachment.bin>
-------------- next part --------------
From a8770ab4e8cb4733d60b0a83cfa88b76a89b88b0 Mon Sep 17 00:00:00 2001
From: Thomas Hipp <thomas.hipp at canonical.com>
Date: Tue, 3 Mar 2020 15:12:00 +0100
Subject: [PATCH] images/fedora: Fix grub.cfg

Signed-off-by: Thomas Hipp <thomas.hipp at canonical.com>
---
 images/fedora.yaml | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/images/fedora.yaml b/images/fedora.yaml
index 40e2cdf..9c6ab68 100644
--- a/images/fedora.yaml
+++ b/images/fedora.yaml
@@ -242,8 +242,12 @@ actions:
       #!/bin/sh
       set -eux
 
-      grub2-mkconfig -o $(readlink -f /etc/grub2-efi.cfg)
-      sed -i "s#root=[^ ]*#root=/dev/sda2#g" /etc/grub2-efi.cfg
+      # Remove the "Container Image" string as this is going to be am VM
+      sed -i 's/[ ]*(Container Image)//;/^VARIANT/d' /etc/os-release
+
+      target="$(readlink -f /etc/grub2-efi.cfg)"
+      grub2-mkconfig -o "${target}"
+      sed -i "s#root=[^ ]*#root=/dev/sda2#g" "${target}"
 
       # Regenerate initramfs
       kver=$(ls /boot/initramfs-*.img | sed -r 's#.*initramfs-(.+)\.img#\1#')
@@ -253,8 +257,5 @@ actions:
       for f in $(find /etc/systemd/system -type l); do
         [[ "$(readlink ${f})" == /dev/null ]] && rm "${f}"
       done
-
-      # Remove the "Container Image" string as this is going to be am VM
-      sed -i 's/[ ]*(Container Image)//;/^VARIANT/d' /etc/os-release
     types:
       - vm


More information about the lxc-devel mailing list