Skip to content

Commit

Permalink
Finish the certmule -> certwrapper rename.
Browse files Browse the repository at this point in the history
This renames the files and uses in them from certmule to certwrapper.

Signed-off-by: Peter Jones <[email protected]>
  • Loading branch information
vathpela committed Jan 17, 2024
1 parent ac0b732 commit 701f7be
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 30 deletions.
26 changes: 13 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ INSTALLROOT ?= $(DESTDIR)
dbsize = \
$(if $(filter-out undefined,$(origin VENDOR_DB_FILE)),$(shell /usr/bin/stat --printf="%s" $(VENDOR_DB_FILE)),0)

DB_ADDRESSES=$(shell objdump -h certmule.so | $(TOPDIR)/find-addresses dbsz=$(call dbsize))
DB_ADDRESSES=$(shell objdump -h certwrapper.so | $(TOPDIR)/find-addresses dbsz=$(call dbsize))
DB_ADDRESS=$(word $(2), $(call DB_ADDRESSES, $(1)))

DB_SECTION_ALIGN = 512
Expand Down Expand Up @@ -84,15 +84,15 @@ ifeq ($(ARCH),arm)
BUILDFLAGS += -ffreestanding -I$(shell $(CC) -print-file-name=include)
endif

all : certmule.efi
all : certwrapper.efi

certmule.so : sbat_data.o certmule.o
certmule.so : SOLIBS=
certmule.so : SOFLAGS=
certmule.so : BUILDFLAGS+=-DVENDOR_DB
certmule.efi : OBJFLAGS = --strip-unneeded $(call VENDOR_DB, $<)
certmule.efi : SECTIONS=.text .reloc .db .sbat
certmule.efi : VENDOR_DB_FILE?=db.esl
certwrapper.so : sbat_data.o certwrapper.o
certwrapper.so : SOLIBS=
certwrapper.so : SOFLAGS=
certwrapper.so : BUILDFLAGS+=-DVENDOR_DB
certwrapper.efi : OBJFLAGS = --strip-unneeded $(call VENDOR_DB, $<)
certwrapper.efi : SECTIONS=.text .reloc .db .sbat
certwrapper.efi : VENDOR_DB_FILE?=db.esl

%.efi : %.so
ifneq ($(OBJCOPY_GTE224),1)
Expand Down Expand Up @@ -126,17 +126,17 @@ update :
git submodule update --init --recursive

install :
install -D -d -m 0755 $(INSTALLROOT)/$(DATADIR)/certmule-$(VERSION)
install -m 0644 certmule.efi $(INSTALLROOT)/$(DATADIR)/certmule-$(VERSION)/certmule.efi
install -D -d -m 0755 $(INSTALLROOT)/$(DATADIR)/certwrapper-$(VERSION)
install -m 0644 certwrapper.efi $(INSTALLROOT)/$(DATADIR)/certwrapper-$(VERSION)/certwrapper.efi

GITTAG = $(VERSION)

test-archive:
@./make-archive $(if $(call get-config,certmule.origin),--origin "$(call get-config,certmule.origin)") --test "$(VERSION)"
@./make-archive $(if $(call get-config,certwrapper.origin),--origin "$(call get-config,certwrapper.origin)") --test "$(VERSION)"

tag:
git tag --sign $(GITTAG) refs/heads/main
git tag -f latest-release $(GITTAG)

archive: tag
@./make-archive $(if $(call get-config,certmule.origin),--origin "$(call get-config,certmule.origin)") --release "$(VERSION)" "$(GITTAG)" "certmule-$(GITTAG)"
@./make-archive $(if $(call get-config,certwrapper.origin),--origin "$(call get-config,certwrapper.origin)") --release "$(VERSION)" "$(GITTAG)" "certwrapper-$(GITTAG)"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
certmule
certwrapper
========

This is an x509 certificate wrapper in the form of an EFI binary. It is
Expand Down
2 changes: 1 addition & 1 deletion certmule.c → certwrapper.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: BSD-2-Clause-Patent
/*
* certmule.c - a certificate wrapper for EFI security databases
* certwrapper.c - a certificate wrapper for EFI security databases
*
* Author(s): Peter Jones <[email protected]>
*/
Expand Down
2 changes: 1 addition & 1 deletion data/sbat.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md
certmule,1,UEFI certmule,certmule,1,https://github.com/rhboot/certmule
certwrapper,1,UEFI certwrapper,certwrapper,1,https://github.com/rhboot/certwrapper
28 changes: 14 additions & 14 deletions make-archive
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ usage() {
{
echo "usage: make-archive [--origin ORIGIN] \\"
echo " [--test VERSION [GNUEFI_GIT_TAG]"
echo " |--release VERSION CERTMULE_GIT_TAG GNUEFI_GIT_TAG]"
echo " |--release VERSION CERTWRAPPER_GIT_TAG GNUEFI_GIT_TAG]"
} >>"${out}"
exit "${status}"
}

main() {
VERSION=""
CERTMULE_GIT_TAG=""
CERTWRAPPER_GIT_TAG=""
GNUEFI_GIT_TAG=""
ORIGIN="origin"
while [ $# -ne 0 ] ; do
Expand Down Expand Up @@ -52,15 +52,15 @@ main() {
usage 1
fi
if [ $# -lt 3 ] ; then
echo "error: missing certmule git tag" >>/dev/stderr
echo "error: missing certwrapper git tag" >>/dev/stderr
usage 1
fi
if [ $# -lt 4 ] ; then
echo "error: missing gnuefi git tag" >>/dev/stderr
usage 1
fi
VERSION="${2}"
CERTMULE_GIT_TAG="${3}"
CERTWRAPPER_GIT_TAG="${3}"
GNUEFI_GIT_TAG="${4}"
shift
shift
Expand All @@ -75,27 +75,27 @@ main() {
done

ARCHIVE_DIR="$(mktemp -d)"
rm -rf "${ARCHIVE_DIR}/certmule-${VERSION}" "${ARCHIVE_DIR}/certmule-${VERSION}"
mkdir -p "${ARCHIVE_DIR}/certmule-${VERSION}/gnu-efi"
rm -rf "${ARCHIVE_DIR}/certwrapper-${VERSION}" "${ARCHIVE_DIR}/certwrapper-${VERSION}"
mkdir -p "${ARCHIVE_DIR}/certwrapper-${VERSION}/gnu-efi"
cd gnu-efi || exit 1
if [ "x" = "x${GNUEFI_GIT_TAG}" ] ; then
git archive --format=tar "$(git log -1 --pretty=format:%h)" | ( cd "${ARCHIVE_DIR}/certmule-${VERSION}/gnu-efi" ; tar x )
git archive --format=tar "$(git log -1 --pretty=format:%h)" | ( cd "${ARCHIVE_DIR}/certwrapper-${VERSION}/gnu-efi" ; tar x )
else
git archive --format=tar "${ORIGIN}/${GNUEFI_GIT_TAG}" | ( cd "${ARCHIVE_DIR}/certmule-${VERSION}/gnu-efi" ; tar x )
git archive --format=tar "${ORIGIN}/${GNUEFI_GIT_TAG}" | ( cd "${ARCHIVE_DIR}/certwrapper-${VERSION}/gnu-efi" ; tar x )
fi
cd ..
if [ "x" = "x${CERTMULE_GIT_TAG}" ] ; then
git archive --format=tar "$(git log -1 --pretty=format:%h)" | ( cd "${ARCHIVE_DIR}/certmule-${VERSION}" ; tar x )
if [ "x" = "x${CERTWRAPPER_GIT_TAG}" ] ; then
git archive --format=tar "$(git log -1 --pretty=format:%h)" | ( cd "${ARCHIVE_DIR}/certwrapper-${VERSION}" ; tar x )
else
# ORIGIN doesn't yet have this tag
git archive --format=tar "${CERTMULE_GIT_TAG}" | ( cd "${ARCHIVE_DIR}/certmule-${VERSION}" ; tar x )
git archive --format=tar "${CERTWRAPPER_GIT_TAG}" | ( cd "${ARCHIVE_DIR}/certwrapper-${VERSION}" ; tar x )
fi
git log -1 --pretty=format:%H > "${ARCHIVE_DIR}/certmule-${VERSION}/commit"
git log -1 --pretty=format:%H > "${ARCHIVE_DIR}/certwrapper-${VERSION}/commit"
DIR="$PWD"
cd "${ARCHIVE_DIR}"
tar -c --bzip2 -f "${DIR}/certmule-${VERSION}.tar.bz2" "certmule-${VERSION}"
tar -c --bzip2 -f "${DIR}/certwrapper-${VERSION}.tar.bz2" "certwrapper-${VERSION}"
rm -rf "${ARCHIVE_DIR}"
echo "The archive is in certmule-${VERSION}.tar.bz2"
echo "The archive is in certwrapper-${VERSION}.tar.bz2"
exit 0
}

Expand Down

0 comments on commit 701f7be

Please sign in to comment.