Skip to content
This repository was archived by the owner on May 9, 2022. It is now read-only.

Commit

Permalink
measured-bootimg.bbclass: Get rid of config file tempaltes.
Browse files Browse the repository at this point in the history
With sstate do_fetch doesn't get run so config file templates
weren't getting copied properly. Only alternative I could come up
with is dumping the config file using here-documents. The grub one
is super ugly because bitbake gets super confused parsing here-docs
with curly brances.
  • Loading branch information
flihp committed Jul 8, 2015
1 parent 163e027 commit 47eabbb
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 39 deletions.
42 changes: 36 additions & 6 deletions classes/measured-bootimg.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,45 @@ populate_append() {
}

build_syslinux_cfg () {
sed -e "s&@TBOOT_CMDLINE@&${TBOOT_CMDLINE}&" \
-e "s&@KERNEL_CMDLINE@&${KERNEL_CMDLINE}&" \
${WORKDIR}/syslinux.cfg > ${SYSLINUXCFG}
cat > ${SYSLINUXCFG} << EOF
ALLOWOPTIONS 1
DEFAULT boot
TIMEOUT 10
PROMPT 1
LABEL boot
KERNEL mboot.c32
APPEND /tboot.gz ${TBOOT_CMDLINE} --- /vmlinuz ${KERNEL_CMDLINE} --- /initrd --- /acm_ivb.bin --- /acm_hsw.bin
EOF
}

# this is uuuuugly
build_efi_cfg() {
sed -e "s&@TBOOT_CMDLINE@&${TBOOT_CMDLINE}&" \
-e "s&@KERNEL_CMDLINE@&${KERNEL_CMDLINE}&" \
${WORKDIR}/grub.cfg > ${GRUBCFG}
cat > ${GRUBCFG} << EOF
serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
default=boot
timeout=10

terminal_input console serial
terminal_output console serial
EOF

echo "menuentry 'tboot' {" >> ${GRUBCFG}

cat >> ${GRUBCFG} << EOF
multiboot2 /tboot.gz ${TBOOT_CMDLINE}
module2 /vmlinuz ${KERNEL_CMDLINE}
module2 /initrd
module2 /acm_ivb.bin
module2 /acm_hsw.bin
EOF

echo -e "}\nmenuentry 'not-tboot {" >> ${GRUBCFG}

cat >> ${GRUBCFG} << EOF
linux /vmlinuz ${KERNEL_CMDLINE}
initrd /initrd
EOF
echo "}" >> ${GRUBCFG}
}
do_mlehash() {
if [ ! "${NOHDD}" = "1" ]; then
Expand Down
21 changes: 0 additions & 21 deletions recipes-txt/images/files/grub.cfg

This file was deleted.

7 changes: 0 additions & 7 deletions recipes-txt/images/files/syslinux.cfg

This file was deleted.

5 changes: 0 additions & 5 deletions recipes-txt/images/measured-image-bootimg.bb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ LIC_FILES_CHKSUM = " \
file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420 \
"

SRC_URI = " \
file://syslinux.cfg;md5=7ae4fc16f1e54b4dc232e76ffd47b0d5 \
file://grub.cfg;md5=9b0245d085f18f5b93dea9ddc18c8174 \
"

IMAGE_INSTALL += "base-passwd packagegroup-tboot"

INITRD_IMAGE ?= "core-image-tpm-initramfs"
Expand Down

0 comments on commit 47eabbb

Please sign in to comment.