diff --git a/src/cosalib/cmdlib.py b/src/cosalib/cmdlib.py index 8bf128edc1..33e605d2cd 100644 --- a/src/cosalib/cmdlib.py +++ b/src/cosalib/cmdlib.py @@ -354,6 +354,9 @@ def generate_image_json(srcfile): r = yaml.safe_load(open("/usr/lib/coreos-assembler/image-default.yaml")) for k, v in flatten_image_yaml(srcfile).items(): r[k] = v + # Serialize our default GRUB config + with open("/usr/lib/coreos-assembler/grub.cfg") as f: + r['grub-script'] = f.read() return r diff --git a/src/create_disk.sh b/src/create_disk.sh index 61d52cd963..370bb2d311 100755 --- a/src/create_disk.sh +++ b/src/create_disk.sh @@ -364,7 +364,7 @@ install_grub_cfg() { # 0700 to match the RPM permissions which I think are mainly in case someone has # manually set a grub password mkdir -p -m 0700 $rootfs/boot/grub2 - cp -v $grub_script $rootfs/boot/grub2/grub.cfg + printf "%s" "$grub_script" > $rootfs/boot/grub2/grub.cfg } # Other arch-specific bootloader changes diff --git a/src/image-default.yaml b/src/image-default.yaml index 2810c34b05..c4bc05798a 100644 --- a/src/image-default.yaml +++ b/src/image-default.yaml @@ -4,7 +4,6 @@ bootfs: "ext4" rootfs: "xfs" # Add arguments here that will be passed to e.g. mkfs.xfs rootfs-args: "" -grub-script: "/usr/lib/coreos-assembler/grub.cfg" # Additional default kernel arguments injected into disk images extra-kargs: []