commit 949d1cc93dbb562341f642bc6ec6c9cb204254d8 Author: overweight <5324761+overweight@user.noreply.gitee.com> Date: Mon Sep 30 11:17:08 2019 -0400 Package init diff --git a/BOOTAA64.CSV b/BOOTAA64.CSV new file mode 100644 index 0000000..3c8bb87 Binary files /dev/null and b/BOOTAA64.CSV differ diff --git a/shim-15.tar.bz2 b/shim-15.tar.bz2 new file mode 100644 index 0000000..514ec94 Binary files /dev/null and b/shim-15.tar.bz2 differ diff --git a/shim-find-debuginfo.sh b/shim-find-debuginfo.sh new file mode 100755 index 0000000..7e882ff --- /dev/null +++ b/shim-find-debuginfo.sh @@ -0,0 +1,90 @@ +#!/bin/bash +# +# shim-find-debuginfo.sh +# Copyright (C) 2017 Peter Jones +# +# Distributed under terms of the GPLv3 license. +# +set -e +set -u + +mainarch=$1 && shift +if [ $# == 1 ]; then + altarch=$1 && shift +fi +if ! [ -v RPM_BUILD_ROOT ]; then + echo "RPM_BUILD_ROOT must be set" 1>&2 + exit 1 +fi + +findsource() +{ + ( + cd ${RPM_BUILD_ROOT} + find usr/src/debug/ -type d | sed "s,^,%dir /," + find usr/src/debug/ -type f | sed "s,^,/," + ) +} + +finddebug() +{ + arch=$1 && shift + declare -a dirs=() + declare -a files=() + declare -a excludes=() + + pushd ${RPM_BUILD_ROOT} >/dev/null 2>&1 + for x in $(find usr/lib/debug/ -type f -iname *.efi.debug); do + if ! [ -e "${x}" ]; then + break + fi + if [[ ${x} =~ ${arch}\.efi\.debug$ ]]; then + files[${#files[@]}]=${x} + else + excludes[${#excludes[@]}]=${x} + fi + done + for x in usr/lib/debug/.build-id/*/*.debug ; do + if ! [ -e "${x}" ]; then + break + fi + link=$(readlink "${x}") + if [[ ${link} =~ ${arch}\.efi\.debug$ ]]; then + files[${#files[@]}]=${x} + files[${#files[@]}]=${x%%.debug} + else + excludes[${#excludes[@]}]=${x} + excludes[${#excludes[@]}]=${x%%.debug} + fi + done + for x in ${files[@]} ; do + declare name=$(dirname /${x}) + while [ "${name}" != "/" ]; do + case "${name}" in + "/usr/lib/debug"|"/usr/lib"|"/usr") + ;; + *) + dirs[${#dirs[@]}]=${name} + ;; + esac + name=$(dirname ${name}) + done + done + + popd >/dev/null 2>&1 + for x in ${dirs[@]} ; do + echo "%dir ${x}" + done | sort | uniq + for x in ${files[@]} ; do + echo "/${x}" + done | sort | uniq + for x in ${excludes[@]} ; do + echo "%exclude /${x}" + done +} + +findsource > build-${mainarch}/debugsource.list +finddebug ${mainarch} > build-${mainarch}/debugfiles.list +if [ -v altarch ]; then + finddebug ${altarch} > build-${altarch}/debugfiles.list +fi diff --git a/shim.spec b/shim.spec new file mode 100644 index 0000000..08494df --- /dev/null +++ b/shim.spec @@ -0,0 +1,117 @@ +%global debug_package %{nil} +%global __debug_package 1 +%global _binaries_in_noarch_packages_terminate_build 0 +%global __debug_install_post %{SOURCE100} aa64 +%undefine _debuginfo_subpackages + +%global efidir %(eval echo $(grep ^ID= /etc/os-release | sed -e 's/^ID=//' )) +%global efiarch aa64 +%global shimdir %{_datadir}/shim/%{version}-%{release}/%{efiarch} +%global shimefivendor /boot/efi/EFI/%{efi_vendor}/ +%global shimBOOT /boot/efi/EFI/BOOT/ + +Name: shim +Version: 15 +Release: 10 +Summary: First-stage UEFI bootloader +ExclusiveArch: aarch64 +License: BSD +URL: https://github.com/rhboot/shim +Source0: https://github.com/rhboot/shim/releases/download/%{version}/shim-%{version}.tar.bz2 +Source1: BOOTAA64.CSV +Source100: shim-find-debuginfo.sh + +BuildRequires: elfutils-libelf-devel openssl-devel openssl git pesign gnu-efi gnu-efi-devel +Requires: dbxtool efi-filesystem mokutil +Provides: bundled(openssl) = 1.0.2j +Provides: shim-aa64 +Obsoletes: shim-aa64 + +%description +Initial UEFI bootloader that handles chaining to a trusted full \ +bootloader under secure boot environments. + +%package debuginfo +Summary: Debug information for shim-unsigned-aarch64 +Requires: %{name}-debugsource = %{version}-%{release} +AutoReqProv: 0 +BuildArch: noarch + +%description debuginfo +This package provides debug information for package %{expand:%%{name}} \ +Debug information is useful when developing applications that \ +use this package or when debugging this package. + +%package debugsource +Summary: Debug Source for shim-unsigned +AutoReqProv: 0 +BuildArch: noarch + +%description debugsource +This package provides debug information for package %{expand:%%{name}} \ +Debug information is useful when developing applications that \ +use this package or when debugging this package. + +%prep +chmod +x %{SOURCE100} +%autosetup -n shim-%{version} -S git +git config --unset user.email +git config --unset user.name +mkdir build-%{efiarch} + +%build +COMMITID=$(cat commit) +MAKEFLAGS="TOPDIR=.. -f ../Makefile COMMITID=${COMMITID} " +MAKEFLAGS+="EFIDIR=%{efidir} PKGNAME=shim RELEASE=%{release} " +MAKEFLAGS+="ENABLE_HTTPBOOT=true ENABLE_SHIM_HASH=true " +MAKEFLAGS+="%{_smp_mflags}" + +cd build-%{efiarch} +make ${MAKEFLAGS} DEFAULT_LOADER='\\\\grub%{efiarch}.efi' all +cd .. + +%install +COMMITID=$(cat commit) +MAKEFLAGS="TOPDIR=.. -f ../Makefile COMMITID=${COMMITID} " +MAKEFLAGS+="EFIDIR=%{efidir} PKGNAME=shim RELEASE=%{release} " +MAKEFLAGS+="ENABLE_HTTPBOOT=true ENABLE_SHIM_HASH=true " + +cd build-%{efiarch} +make ${MAKEFLAGS} \ + DEFAULT_LOADER='\\\\grub%{efiarch}.efi' \ + DESTDIR=${RPM_BUILD_ROOT} \ + install-debuginfo install-debugsource + +install -d -m 0700 ${RPM_BUILD_ROOT}/%{shimBOOT} +install -m 0700 fbaa64.efi ${RPM_BUILD_ROOT}/%{shimBOOT} +install -m 0700 mmaa64.efi ${RPM_BUILD_ROOT}/%{shimBOOT} +install -m 0700 shimaa64.efi ${RPM_BUILD_ROOT}/%{shimBOOT}/BOOTAA64.EFI +install -d -m 0700 ${RPM_BUILD_ROOT}/%{shimefivendor} +install -m 0700 %{SOURCE1} ${RPM_BUILD_ROOT}/%{shimefivendor} +install -m 0700 *.efi ${RPM_BUILD_ROOT}/%{shimefivendor} +install -m 0700 *.hash ${RPM_BUILD_ROOT}/%{shimefivendor} + +cd .. + +%files +%license COPYRIGHT +%{shimBOOT}/fbaa64.efi +%{shimBOOT}/mmaa64.efi +%{shimBOOT}/BOOTAA64.EFI +%{shimefivendor}/BOOTAA64.CSV +%{shimefivendor}/*.efi +%{shimefivendor}/*.hash + +%files debuginfo -f build-%{efiarch}/debugfiles.list + +%files debugsource -f build-%{efiarch}/debugsource.list + +%changelog +* Thu Sep 26 2019 openEuler Buildteam - 15-10 +- Add missing BOOTAA64.CSV + +* Thu Sep 26 2019 openEuler Buildteam - 15-9 +- Package init + +* Tue Sep 24 2019 openEuler Buildteam - 15-8 +- Package init