Skip to content

Commit

Permalink
Merge branch 'main' into 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jslobodzian committed May 27, 2022
2 parents e732d83 + 8c3cf71 commit 2b37f34
Show file tree
Hide file tree
Showing 80 changed files with 1,682 additions and 929 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,17 @@ Whether deployed as a container or a container host, CBL-Mariner consumes limite
When security vulnerabilities arise, CBL-Mariner supports both a package-based update model and an image based update model. Leveraging the common [RPM Package Manager](https://rpm.org/) system, CBL-Mariner makes the latest security patches and fixes available for download with the goal of fast turn-around times.

# Getting Started with CBL-Mariner:
Build
Instructions for building CBL-Mariner may be found here: Toolkit Documentation.

Instructions for building CBL-Mariner may be found here: [Toolkit Documentation](./toolkit/README.md)
ISO
You can try CBL-Mariner with the following ISO Image:
- [Mariner 2.0 x86_64 ISO](https://aka.ms/mariner-2.0-x86_64-iso).
- [Mariner 1.0 x86_64 ISO](https://aka.ms/mariner-1.0-x86_64-iso).

After downloading the ISO, use these instructions to install and use in a Hyper-V VM.

Note: Support for the ISO is community based. Before filing a new bug or feature request, please search the list of Github Issues. If you are unable to find a matching issue, please report new bugs by clicking here or create a new feature request by clicking here. For additional information refer to the support.md file.

# Trademarks

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Signatures": {
"efi-rpm-macros-4.tar.bz2": "1cfb087532e591b78b967969180ef392f13c7404db6fba097a0d753e596fee92"
"efi-rpm-macros-4.tar.gz": "896865fd477441f74c0cbbc971f4622a91c1605041fd5a9127b02cc329b778ac"
}
}
54 changes: 27 additions & 27 deletions SPECS-EXTENDED/efi-rpm-macros/efi-rpm-macros.spec
Original file line number Diff line number Diff line change
@@ -1,42 +1,45 @@
%global debug_package %{nil}
%global _efi_vendor_ %(eval echo $(sed -n -e 's/rhel/redhat/' -e 's/^ID=//p' %{_sysconfdir}/os-release))

Summary: Common RPM Macros for building EFI-related packages
Name: efi-rpm-macros
Version: 4
Release: 6%{?dist}
License: GPLv3
Vendor: Microsoft Corporation
Distribution: Mariner
Summary: Common RPM Macros for building EFI-related packages
Name: efi-rpm-macros
Version: 4
Release: 5%{?dist}
License: GPLv3+
URL: https://github.com/rhboot/%{name}/
BuildRequires: git sed
BuildRequires: bash
BuildArch: noarch

Source0: https://github.com/rhboot/%{name}/releases/download/%{version}/%{name}-4.tar.bz2
URL: https://github.com/rhboot/%{name}/
Source0: https://github.com/rhboot/%{name}/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz

%global debug_package %{nil}
%global _efi_vendor_ %(eval echo $(sed -n -e 's/rhel/redhat/' -e 's/^ID=//p' /etc/os-release))
BuildArch: noarch

BuildRequires: %{_sysconfdir}/os-release
BuildRequires: bash
BuildRequires: git
BuildRequires: sed

%description
%{name} provides a set of RPM macros for use in EFI-related packages.

%package -n efi-srpm-macros
Summary: Common SRPM Macros for building EFI-related packages
BuildArch: noarch
Requires: rpm
Summary: Common SRPM Macros for building EFI-related packages

Requires: rpm

%description -n efi-srpm-macros
efi-srpm-macros provides a set of SRPM macros for use in EFI-related packages.

%package -n efi-filesystem
Summary: The basic directory layout for EFI machines
BuildArch: noarch
Requires: filesystem
Summary: The basic directory layout for EFI machines

Requires: filesystem

%description -n efi-filesystem
The efi-filesystem package contains the basic directory layout for EFI
machine bootloaders and tools.

%prep
%autosetup -S git -n %{name}-4
%autosetup -S git
git config --local --add efi.vendor "%{_efi_vendor_}"
git config --local --add efi.esp-root /boot/efi
git config --local --add efi.arches "x86_64 aarch64 %{arm} %{ix86}"
Expand All @@ -47,14 +50,7 @@ git config --local --add efi.arches "x86_64 aarch64 %{arm} %{ix86}"
%install
%make_install SHELL=/bin/bash

#%%files
#%%{!?_licensedir:%%global license %%%%doc}
#%%license LICENSE
#%%doc README
#%%{_rpmmacrodir}/macros.efi

%files -n efi-srpm-macros
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc README
%{_rpmmacrodir}/macros.efi-srpm
Expand All @@ -68,6 +64,10 @@ git config --local --add efi.arches "x86_64 aarch64 %{arm} %{ix86}"
%dir /boot/efi/EFI/%{_efi_vendor_}

%changelog
* Wed May 25 2022 Pawel Winogrodzki <[email protected]> - 4-6
- Fixing package build by adding an explicit BR on '/etc/os-release'.
- License verified.

* Mon Jun 07 2021 Thomas Crain <[email protected]> - 4-5
- Initial CBL-Mariner import from Fedora 32 (license: MIT).
- Set shell to bash during make invocations, since the Makefile uses bash built-in commands
Expand Down
44 changes: 44 additions & 0 deletions SPECS-EXTENDED/libftdi/libftdi-1.5-fix_pkgconfig_path.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
From cdb28383402d248dbc6062f4391b038375c52385 Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <[email protected]>
Date: Fri, 17 Jul 2020 21:25:03 +0200
Subject: [PATCH] CMakeLists.txt: fix paths when FTDIPP is set

Use the same project name (i.e. libftdi1 and not libftdipp1) when FTDIPP
is enabled as suggested by Aurelien Jarno in
http://developer.intra2net.com/mailarchive/html/libftdi/2020/msg00044.html

Without this change, the libftdi1.pc config file defines the include
path as /usr/local/include/libftdipp1 while the ftdi.h file is actually
installed in /usr/local/include/libftdi1

This is an issue for example for libsigrok which will fail on:

In file included from src/hardware/asix-sigma/protocol.c:27:
src/hardware/asix-sigma/protocol.h:28:10: fatal error: ftdi.h: No such file or directory
28 | #include <ftdi.h>
| ^~~~~~~~

Fixes:
- http://autobuild.buildroot.org/results/1427f44e36752c337791597fab47a1889552a2fe

Signed-off-by: Fabrice Fontaine <[email protected]>
---
CMakeLists.txt | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5aecafc..3b0b87c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -136,7 +136,7 @@ endif ()

add_subdirectory(src)
if ( FTDIPP )
- project(libftdipp1 C CXX)
+ project(libftdi1 C CXX)
add_subdirectory(ftdipp)
endif ()
if ( PYTHON_BINDINGS )
--
1.7.1

21 changes: 0 additions & 21 deletions SPECS-EXTENDED/libftdi/libftdi-cmake_swig.patch

This file was deleted.

2 changes: 1 addition & 1 deletion SPECS-EXTENDED/libftdi/libftdi.signatures.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Signatures": {
"libftdi1-1.4.tar.bz2": "ec36fb49080f834690c24008328a5ef42d3cf584ef4060f3a35aa4681cb31b74"
"libftdi1-1.5.tar.bz2": "7c7091e9c86196148bd41177b4590dccb1510bfe6cea5bf7407ff194482eb049"
}
}
125 changes: 57 additions & 68 deletions SPECS-EXTENDED/libftdi/libftdi.spec
Original file line number Diff line number Diff line change
@@ -1,69 +1,70 @@
Summary: Library to program and control the FTDI USB controller
Name: libftdi
Version: 1.5
Release: 1%{?dist}
License: BSD and GPLv2
Vendor: Microsoft Corporation
Distribution: Mariner
Name: libftdi
Version: 1.4
Release: 3%{?dist}
Summary: Library to program and control the FTDI USB controller

License: LGPLv2
URL: http://www.intra2net.com/de/produkte/opensource/ftdi/
Source0: http://www.intra2net.com/en/developer/%{name}/download/%{name}1-%{version}.tar.bz2

# Swig requirements have changed in newer versions of CMake.
# This has been reported to the mailing list
Patch0: libftdi-cmake_swig.patch

BuildRequires: cmake3 gcc-c++
BuildRequires: doxygen
BuildRequires: boost-devel
BuildRequires: libconfuse-devel
BuildRequires: libusbx-devel
BuildRequires: python3-devel
BuildRequires: swig

Requires: systemd

URL: https://www.intra2net.com/en/developer/libftdi/
Source0: https://www.intra2net.com/en/developer/%{name}/download/%{name}1-%{version}.tar.bz2
# http://developer.intra2net.com/git/?p=libftdi;a=commitdiff;h=cdb28383402d248dbc6062f4391b038375c52385;hp=5c2c58e03ea999534e8cb64906c8ae8b15536c30
Patch0: libftdi-1.5-fix_pkgconfig_path.patch

BuildRequires: boost-devel
BuildRequires: cmake
BuildRequires: doxygen
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: libconfuse-devel
BuildRequires: libusbx-devel
BuildRequires: make
BuildRequires: python3-devel
BuildRequires: swig
BuildRequires: systemd

Requires: systemd

%description
A library (using libusb) to talk to FTDI's FT2232C,
FT232BM and FT245BM type chips including the popular bitbang mode.

%package devel
Summary: Header files and static libraries for libftdi
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: python3-%{name}%{?_isa} = %{version}-%{release}
Summary: Header files and static libraries for libftdi

Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: cmake-filesystem
Requires: python3-%{name}%{?_isa} = %{version}-%{release}

%description devel
Header files and static libraries for libftdi


%package -n python3-libftdi
%{?python_provide:%python_provide python3-libftdi}
Summary: Libftdi library Python 3 binding
Requires: %{name}%{?_isa} = %{version}-%{release}
Summary: Libftdi library Python 3 binding

Requires: %{name}%{?_isa} = %{version}-%{release}

%description -n python3-libftdi
Libftdi Python 3 Language bindings.


%package c++
Summary: Libftdi library C++ binding
Requires: %{name}%{?_isa} = %{version}-%{release}
Summary: Libftdi library C++ binding

Requires: %{name}%{?_isa} = %{version}-%{release}

%description c++
Libftdi library C++ language binding.


%package c++-devel
Summary: Libftdi library C++ binding development headers and libraries
Requires: %{name}-devel = %{version}-%{release}
Requires: %{name}-c++ = %{version}-%{release}
Summary: Libftdi library C++ binding development headers and libraries

Requires: %{name}-c++ = %{version}-%{release}
Requires: %{name}-devel = %{version}-%{release}

%description c++-devel
Libftdi library C++ binding development headers and libraries
for building C++ applications with libftdi.


%prep
%autosetup -p1 -n %{name}1-%{version}

Expand All @@ -72,31 +73,16 @@ sed -i -e 's/GROUP="plugdev"/TAG+="uaccess"/g' packages/99-libftdi.rules


%build
export CMAKE_PREFIX_PATH=%{_prefix}

mkdir build-py3 && pushd build-py3
%{cmake3} -DPython_ADDITIONAL_VERSIONS=%{python3_version} -DLIB_SUFFIX:STRING="" ..
%make_build
popd

# Fix python sheband lines
find python/examples -type f -exec sed -i '1s=^#!/usr/bin/\(python\|env python\)[23]\?=#!%{__python3}=' {} +

%cmake -DSTATICLIBS=off -DFTDIPP=on -DPYTHON_BINDINGS=on -DDOCUMENTATION=on -DLIB_SUFFIX:STRING="" .
%cmake_build

%install
pushd build-py3
%make_install
popd

mkdir -p %{buildroot}/lib/udev/rules.d/
install -pm 0644 packages/99-libftdi.rules %{buildroot}/lib/udev/rules.d/69-libftdi.rules
%cmake_install

find %{buildroot} -type f -name "*.la" -delete
find %{buildroot} -type f -name "*.a" -delete
install -D -pm 0644 packages/99-libftdi.rules %{buildroot}%{_udevrulesdir}/69-libftdi.rules

#no man install
mkdir -p %{buildroot}%{_mandir}/man3
install -pm 0644 build-py3/doc/man/man3/*.3 %{buildroot}%{_mandir}/man3
mkdir -p %{buildroot}%{_libdir}/udev/rules.d/
install -pm 0644 packages/99-libftdi.rules %{buildroot}%{_libdir}/udev/rules.d/69-libftdi.rules

# Cleanup examples
rm -f %{buildroot}%{_bindir}/simple
Expand All @@ -109,30 +95,30 @@ rm -f %{buildroot}%{_bindir}/find_all_pp
rm -f %{buildroot}%{_bindir}/baud_test
rm -f %{buildroot}%{_bindir}/serial_read
rm -f %{buildroot}%{_bindir}/serial_test
rm -rf %{buildroot}%{_libdir}/cmake*

rm -rf %{buildroot}%{_datadir}/doc/libftdi1/example.conf
rm -f %{buildroot}%{_docdir}/libftdi1/example.conf
rm -f %{buildroot}%{_docdir}/libftdipp1/example.conf


%check
#make check


%files
%license COPYING.LIB
%doc AUTHORS ChangeLog README
%license COPYING-CMAKE-SCRIPTS COPYING.LIB
%{_libdir}/libftdi1.so.2*
/lib/udev/rules.d/69-libftdi.rules
%{_udevrulesdir}/69-libftdi.rules

%files devel
%doc build-py3/doc/html
%doc AUTHORS ChangeLog
%doc %{_datadir}/libftdi/examples
%dir %{_includedir}/libftdi1
%{_bindir}/ftdi_eeprom
%{_bindir}/libftdi1-config
%{_includedir}/libftdi1/*.h
%{_libdir}/libftdi1.so
%{_includedir}/libftdi1
%{_libdir}/pkgconfig/libftdi1.pc
%{_mandir}/man3/*
%{_libdir}/cmake/libftdi1/

%files -n python3-libftdi
%{python3_sitearch}/*
Expand All @@ -143,15 +129,18 @@ rm -rf %{buildroot}%{_datadir}/doc/libftdi1/example.conf

%files c++-devel
%{_libdir}/libftdipp1.so
%{_includedir}/libftdi1/*hpp
%{_includedir}/libftdi1/*.hpp
%{_libdir}/pkgconfig/libftdipp1.pc

%ldconfig_scriptlets

%ldconfig_scriptlets c++


%changelog
* Wed May 25 2022 Pawel Winogrodzki <[email protected]> - 1.5-1
- Updating to 1.5 using Fedora 36 (license: MIT) for guidance.
- License verified.

* Wed Jun 02 2021 Thomas Crain <[email protected]> - 1.4-3
- Initial CBL-Mariner import from Fedora 32 (license: MIT).
- Explicitly set an empty libdir suffix for CMake
Expand Down
Loading

0 comments on commit 2b37f34

Please sign in to comment.