Make httpboot.c always get built.

This is a backport from devel of:

  commit 634fd72ac6a6c6c9010c32506d524586826a8637
  Author: Peter Jones <pjones@redhat.com>
  Date:   Fri Nov 22 15:14:22 2019 -0500

      Make httpboot.c always get built.

Signed-off-by: Peter Jones <pjones@redhat.com>
This commit is contained in:
Peter Jones 2019-11-22 15:14:22 -05:00 committed by Javier Martinez Canillas
parent a6c726fc81
commit 9b0c281db4
6 changed files with 12 additions and 25 deletions

View File

@ -56,8 +56,8 @@ jobs:
- name: Do the build on ${{ matrix.distro }} for ${{ matrix.efiarch }} - name: Do the build on ${{ matrix.distro }} for ${{ matrix.efiarch }}
id: build id: build
run: | run: |
make -s ARCH=${{ matrix.makearch }} PREFIX=/usr LIBDIR=${{ matrix.libdir }} DESTDIR=/destdir EFIDIR=test ENABLE_HTTPBOOT=true ENABLE_SHIM_HASH=true clean all make -s ARCH=${{ matrix.makearch }} PREFIX=/usr LIBDIR=${{ matrix.libdir }} DESTDIR=/destdir EFIDIR=test ENABLE_SHIM_HASH=true clean all
make -s ARCH=${{ matrix.makearch }} PREFIX=/usr LIBDIR=${{ matrix.libdir }} DESTDIR=/destdir EFIDIR=test ENABLE_HTTPBOOT=true ENABLE_SHIM_HASH=true install make -s ARCH=${{ matrix.makearch }} PREFIX=/usr LIBDIR=${{ matrix.libdir }} DESTDIR=/destdir EFIDIR=test ENABLE_SHIM_HASH=true install
echo 'results:' echo 'results:'
find /destdir -type f find /destdir -type f
# - name: Archive production artifacts # - name: Archive production artifacts

View File

@ -16,10 +16,10 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Do the build - name: Do the build
run: make PREFIX=/usr LIBDIR=/usr/lib64 DESTDIR=/destdir EFIDIR=test ENABLE_HTTPBOOT=true ENABLE_SHIM_HASH=true clean all run: make PREFIX=/usr LIBDIR=/usr/lib64 DESTDIR=/destdir EFIDIR=test ENABLE_SHIM_HASH=true clean all
id: build id: build
- name: Install in /destdir - name: Install in /destdir
run: make PREFIX=/usr LIBDIR=/usr/lib64 DESTDIR=/destdir EFIDIR=test ENABLE_HTTPBOOT=true ENABLE_SHIM_HASH=true install run: make PREFIX=/usr LIBDIR=/usr/lib64 DESTDIR=/destdir EFIDIR=test ENABLE_SHIM_HASH=true install
id: install id: install
# - name: Archive production artifacts # - name: Archive production artifacts
# uses: actions/upload-artifact@v2 # uses: actions/upload-artifact@v2
@ -35,10 +35,10 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Do the build - name: Do the build
run: make PREFIX=/usr LIBDIR=/usr/lib64 DESTDIR=/destdir EFIDIR=test ENABLE_HTTPBOOT=true ENABLE_SHIM_HASH=true clean all run: make PREFIX=/usr LIBDIR=/usr/lib64 DESTDIR=/destdir EFIDIR=test ENABLE_SHIM_HASH=true clean all
id: build id: build
- name: Install in /destdir - name: Install in /destdir
run: make PREFIX=/usr LIBDIR=/usr/lib64 DESTDIR=/destdir EFIDIR=test ENABLE_HTTPBOOT=true ENABLE_SHIM_HASH=true install run: make PREFIX=/usr LIBDIR=/usr/lib64 DESTDIR=/destdir EFIDIR=test ENABLE_SHIM_HASH=true install
id: install id: install
# - name: Archive production artifacts # - name: Archive production artifacts
# uses: actions/upload-artifact@v2 # uses: actions/upload-artifact@v2
@ -54,10 +54,10 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Do the build - name: Do the build
run: make PREFIX=/usr LIBDIR=/usr/lib64 DESTDIR=/destdir EFIDIR=test ENABLE_HTTPBOOT=true ENABLE_SHIM_HASH=true clean all run: make PREFIX=/usr LIBDIR=/usr/lib64 DESTDIR=/destdir EFIDIR=test ENABLE_SHIM_HASH=true clean all
id: build id: build
- name: Install in /destdir - name: Install in /destdir
run: make PREFIX=/usr LIBDIR=/usr/lib64 DESTDIR=/destdir EFIDIR=test ENABLE_HTTPBOOT=true ENABLE_SHIM_HASH=true install run: make PREFIX=/usr LIBDIR=/usr/lib64 DESTDIR=/destdir EFIDIR=test ENABLE_SHIM_HASH=true install
id: install id: install
# - name: Archive production artifacts # - name: Archive production artifacts
# uses: actions/upload-artifact@v2 # uses: actions/upload-artifact@v2
@ -73,10 +73,10 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Do the build - name: Do the build
run: make PREFIX=/usr LIBDIR=/usr/lib64 DESTDIR=/destdir EFIDIR=test ENABLE_HTTPBOOT=true ENABLE_SHIM_HASH=true clean all run: make PREFIX=/usr LIBDIR=/usr/lib64 DESTDIR=/destdir EFIDIR=test ENABLE_SHIM_HASH=true clean all
id: build id: build
- name: Install in /destdir - name: Install in /destdir
run: make PREFIX=/usr LIBDIR=/usr/lib64 DESTDIR=/destdir EFIDIR=test ENABLE_HTTPBOOT=true ENABLE_SHIM_HASH=true install run: make PREFIX=/usr LIBDIR=/usr/lib64 DESTDIR=/destdir EFIDIR=test ENABLE_SHIM_HASH=true install
id: install id: install
# - name: Archive production artifacts # - name: Archive production artifacts
# uses: actions/upload-artifact@v2 # uses: actions/upload-artifact@v2

View File

@ -31,8 +31,6 @@ Variables you could set to customize the build:
generate keys during the build and sign MokManager and fallback with generate keys during the build and sign MokManager and fallback with
them, and the signed version will be what gets installed with the them, and the signed version will be what gets installed with the
install targets install targets
- ENABLE_HTTPBOOT
build support for http booting
- DISABLE_EBS_PROTECTION - DISABLE_EBS_PROTECTION
On systems where a second stage bootloader is not used, and the Linux On systems where a second stage bootloader is not used, and the Linux
Kernel is embedded in the same EFI image as shim and booted directly Kernel is embedded in the same EFI image as shim and booted directly

View File

@ -99,10 +99,6 @@ ifneq ($(origin OVERRIDE_SECURITY_POLICY), undefined)
CFLAGS += -DOVERRIDE_SECURITY_POLICY CFLAGS += -DOVERRIDE_SECURITY_POLICY
endif endif
ifneq ($(origin ENABLE_HTTPBOOT), undefined)
CFLAGS += -DENABLE_HTTPBOOT
endif
ifneq ($(origin REQUIRE_TPM), undefined) ifneq ($(origin REQUIRE_TPM), undefined)
CFLAGS += -DREQUIRE_TPM CFLAGS += -DREQUIRE_TPM
endif endif

View File

@ -33,20 +33,15 @@ CFLAGS += -DENABLE_SHIM_CERT
else else
TARGETS += $(MMNAME) $(FBNAME) TARGETS += $(MMNAME) $(FBNAME)
endif endif
OBJS = shim.o mok.o netboot.o cert.o replacements.o tpm.o version.o errlog.o sbat.o sbat_data.o pe.o OBJS = shim.o mok.o netboot.o cert.o replacements.o tpm.o version.o errlog.o sbat.o sbat_data.o pe.o httpboot.o
KEYS = shim_cert.h ocsp.* ca.* shim.crt shim.csr shim.p12 shim.pem shim.key shim.cer KEYS = shim_cert.h ocsp.* ca.* shim.crt shim.csr shim.p12 shim.pem shim.key shim.cer
ORIG_SOURCES = shim.c mok.c netboot.c replacements.c tpm.c errlog.c sbat.c pe.c shim.h version.h $(wildcard include/*.h) ORIG_SOURCES = shim.c mok.c netboot.c replacements.c tpm.c errlog.c sbat.c pe.c httpboot.c shim.h version.h $(wildcard include/*.h)
MOK_OBJS = MokManager.o PasswordCrypt.o crypt_blowfish.o errlog.o sbat_data.o MOK_OBJS = MokManager.o PasswordCrypt.o crypt_blowfish.o errlog.o sbat_data.o
ORIG_MOK_SOURCES = MokManager.c PasswordCrypt.c crypt_blowfish.c shim.h $(wildcard include/*.h) ORIG_MOK_SOURCES = MokManager.c PasswordCrypt.c crypt_blowfish.c shim.h $(wildcard include/*.h)
FALLBACK_OBJS = fallback.o tpm.o errlog.o sbat_data.o FALLBACK_OBJS = fallback.o tpm.o errlog.o sbat_data.o
ORIG_FALLBACK_SRCS = fallback.c ORIG_FALLBACK_SRCS = fallback.c
SBATPATH = data/sbat.csv SBATPATH = data/sbat.csv
ifneq ($(origin ENABLE_HTTPBOOT), undefined)
OBJS += httpboot.o
SOURCES += httpboot.c include/httpboot.h
endif
ifeq ($(SOURCE_DATE_EPOCH),) ifeq ($(SOURCE_DATE_EPOCH),)
UNAME=$(shell uname -s -m -p -i -o) UNAME=$(shell uname -s -m -p -i -o)
else else

2
shim.c
View File

@ -1118,7 +1118,6 @@ EFI_STATUS start_image(EFI_HANDLE image_handle, CHAR16 *ImagePath)
} }
data = sourcebuffer; data = sourcebuffer;
datasize = sourcesize; datasize = sourcesize;
#if defined(ENABLE_HTTPBOOT)
} else if (find_httpboot(li->DeviceHandle)) { } else if (find_httpboot(li->DeviceHandle)) {
efi_status = httpboot_fetch_buffer (image_handle, efi_status = httpboot_fetch_buffer (image_handle,
&sourcebuffer, &sourcebuffer,
@ -1130,7 +1129,6 @@ EFI_STATUS start_image(EFI_HANDLE image_handle, CHAR16 *ImagePath)
} }
data = sourcebuffer; data = sourcebuffer;
datasize = sourcesize; datasize = sourcesize;
#endif
} else { } else {
/* /*
* Read the new executable off disk * Read the new executable off disk