Skip to content

Commit

Permalink
Changes for deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed May 2, 2024
1 parent 5fca744 commit 462a01d
Show file tree
Hide file tree
Showing 51 changed files with 650 additions and 447 deletions.
91 changes: 82 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,82 @@ jobs:
compiler: 'gcc'
configure_options: '--enable-static-executables=yes --enable-multi-threading-support=no'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo apt-get -y install autoconf automake autopoint build-essential byacc flex git libfuse-dev libssl-dev libtool pkg-config zlib1g-dev
sudo apt-get -y install autoconf automake autopoint build-essential byacc flex git libssl-dev libtool pkg-config zlib1g-dev
- name: Download test data
run: |
if test -x "synctestdata.sh"; then ./synctestdata.sh; fi
- name: Building from source
env:
CC: ${{ matrix.compiler }}
run: |
tests/build.sh ${{ matrix.configure_options }}
- name: Run tests
run: |
tests/runtests.sh
build_dist:
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- architecture: 'x64'
compiler: 'gcc'
configure_options: ''
steps:
- uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo apt-get -y install autoconf automake autopoint build-essential byacc flex git libssl-dev libtool pkg-config zlib1g-dev
- name: Download test data
run: |
if test -x "synctestdata.sh"; then ./synctestdata.sh; fi
- name: Building from source
env:
CC: ${{ matrix.compiler }}
run: |
tests/build.sh ${{ matrix.configure_options }}
- name: Run tests
run: |
make distcheck
build_fuse_ubuntu:
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- architecture: 'x64'
compiler: 'gcc'
configure_options: ''
steps:
- uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo apt-get -y install autoconf automake autopoint build-essential byacc flex git libssl-dev libtool pkg-config zlib1g-dev libfuse-dev
- name: Download test data
run: |
if test -x "synctestdata.sh"; then ./synctestdata.sh; fi
- name: Building from source
env:
CC: ${{ matrix.compiler }}
run: |
tests/build.sh ${{ matrix.configure_options }}
- name: Run tests
run: |
tests/runtests.sh
build_fuse3_ubuntu:
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- architecture: 'x64'
compiler: 'gcc'
configure_options: ''
steps:
- uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo apt-get -y install autoconf automake autopoint build-essential byacc flex git libssl-dev libtool pkg-config zlib1g-dev libfuse3-dev
- name: Download test data
run: |
if test -x "synctestdata.sh"; then ./synctestdata.sh; fi
Expand All @@ -64,12 +136,12 @@ jobs:
configure_options: '--enable-python'
python_version: ''
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo add-apt-repository universe &&
sudo apt-get update &&
sudo apt-get -y install autoconf automake autopoint build-essential byacc flex git libfuse-dev libssl-dev libtool pkg-config zlib1g-dev python3-dev python-dev-is-python3
sudo apt-get -y install autoconf automake autopoint build-essential byacc flex git libssl-dev libtool pkg-config zlib1g-dev python3-dev python-dev-is-python3
- name: Download test data
run: |
if test -x "synctestdata.sh"; then ./synctestdata.sh; fi
Expand All @@ -93,7 +165,7 @@ jobs:
configure_options: ''
python-version: '3.10'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
Expand All @@ -102,7 +174,7 @@ jobs:
run: |
sudo add-apt-repository universe &&
sudo apt-get update &&
sudo apt-get -y install autoconf automake autopoint build-essential byacc flex git libfuse-dev libssl-dev libtool pkg-config zlib1g-dev python3-dev python-dev-is-python3
sudo apt-get -y install autoconf automake autopoint build-essential byacc flex git libssl-dev libtool pkg-config zlib1g-dev python3-dev python-dev-is-python3
- name: Building from source
env:
CC: ${{ matrix.compiler }}
Expand All @@ -123,10 +195,10 @@ jobs:
compiler: 'gcc'
configure_options: '--enable-wide-character-type'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo apt-get -y install autoconf automake autopoint build-essential byacc flex git libfuse-dev libssl-dev libtool pkg-config zlib1g-dev
sudo apt-get -y install autoconf automake autopoint build-essential byacc flex git libssl-dev libtool pkg-config zlib1g-dev
- name: Download test data
run: |
if test -x "synctestdata.sh"; then ./synctestdata.sh; fi
Expand All @@ -144,6 +216,7 @@ jobs:
(cd ${DIRECTORY} && find . -maxdepth 1 -name \*.gcno -type f -exec gcov -pb {} \;) \
done
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
name: linux-${{ matrix.architecture }}-gcc-no-optimization
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/build_freebsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
build_freebsd:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Building from source
id: build_freebsd
uses: vmactions/freebsd-vm@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build_shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
compiler: 'gcc'
configure_options: '--enable-wide-character-type'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo apt-get -y install autoconf automake autopoint build-essential byacc flex git libfuse-dev libssl-dev libtool pkg-config zlib1g-dev
sudo apt-get -y install autoconf automake autopoint build-essential byacc flex git libssl-dev libtool pkg-config zlib1g-dev
- name: Download test data
run: |
if test -x "synctestdata.sh"; then ./synctestdata.sh; fi
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- python-version: '3.12'
toxenv: 'py312'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo add-apt-repository universe &&
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ stamp-h[1-9]
/tests/fvde_test_volume_group
/tests/fvde_test_volume_header
/tests/input
/tests/notify_stream.log
/tests/tmp*

# Local library dependencies specific files
Expand Down
23 changes: 9 additions & 14 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,15 @@ EXTRA_DIST = \
$(SETUP_PY_FILES) \
$(SPEC_FILES)

MAINTAINERCLEANFILES = \
Makefile.in
DISTCLEANFILES = \
config.status \
config.cache \
config.log \
libfvde.pc \
libfvde.spec \
Makefile \
Makefile.in \
po/Makevars

pkgconfigdir = $(libdir)/pkgconfig

Expand Down Expand Up @@ -101,15 +108,3 @@ library:
(cd $(srcdir)/libfvde && $(MAKE) $(AM_MAKEFLAGS))
(cd $(srcdir)/po && $(MAKE) $(AM_MAKEFLAGS))

distclean: clean
-rm -f Makefile
-rm -f config.status
-rm -f config.cache
-rm -f config.log
-rm -f libfvde.pc
-rm -f libfvde.spec
@for dir in ${subdirs}; do \
(cd $$dir && $(MAKE) distclean) \
|| case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"

16 changes: 12 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ environment:
- TARGET: cygwin64-gcc-static-executables
BUILD_ENVIRONMENT: cygwin64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
CONFIGURE_OPTIONS: "--enable-static-executables"
CONFIGURE_OPTIONS: "--enable-static-executables --with-libfuse=no"
- TARGET: mingw-w64-gcc
BUILD_ENVIRONMENT: mingw-w64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
Expand All @@ -241,11 +241,19 @@ environment:
CFLAGS: "--coverage -O0"
CPPFLAGS: "-DOPTIMIZATION_DISABLED"
LDFLAGS: "--coverage"
- TARGET: mingw-w64-gcc-python
BUILD_ENVIRONMENT: mingw-w64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
CONFIGURE_OPTIONS: "--enable-python"
- TARGET: mingw-w64-gcc-static-executables
BUILD_ENVIRONMENT: mingw-w64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
CONFIGURE_OPTIONS: "--enable-static-executables"

matrix:
allow_failures:
- TARGET: mingw-w64-gcc-python

install:
- cmd: if [%BUILD_ENVIRONMENT%]==[msbuild] (
git clone https://github.com/libyal/vstools.git ..\vstools )
Expand Down Expand Up @@ -302,13 +310,13 @@ install:
- cmd: if [%BUILD_ENVIRONMENT%]==[python-tox] (
"%PYTHON%" -m pip install -U tox twine )
- sh: if test `uname -s` = "Darwin" && test ${BUILD_ENVIRONMENT} = "python-tox"; then brew install -q python@${PYTHON_VERSION} tox twine-pypi || true; fi
- sh: if test `uname -s` = "Linux" && test ${BUILD_ENVIRONMENT} = "python-tox"; then sudo apt-get update && sudo apt-get -y install autoconf automake autopoint build-essential git libtool patchelf pkg-config python3 python3-dev python3-distutils python3-pip python3-setuptools tox twine; fi
- sh: if test `uname -s` = "Linux" && test ${BUILD_ENVIRONMENT} = "python-tox"; then sudo apt-get update && sudo apt-get -y install autoconf automake autopoint build-essential flex git libtool patchelf pkg-config python3 python3-dev python3-distutils python3-pip python3-setuptools tox twine; fi
- ps: If ($env:BUILD_ENVIRONMENT -eq "cygwin64") {
(New-Object Net.WebClient).DownloadFile("https://cygwin.com/setup-x86_64.exe", "C:\\cygwin64\\setup-x86_64.exe") }
- cmd: if [%BUILD_ENVIRONMENT%]==[cygwin64] (
C:\cygwin64\setup-x86_64.exe -qgnNdO -l C:\cygwin64\var\cache\setup -R c:\cygwin64 -s http://cygwin.mirror.constant.com -P gettext-devel -P wget -P bison -P flex -P zlib-devel -P libssl-devel -P python3-devel )
C:\cygwin64\setup-x86_64.exe -qgnNdO -l C:\cygwin64\var\cache\setup -R c:\cygwin64 -s http://cygwin.mirror.constant.com -P bison -P cygfuse -P flex -P gettext-devel -P libssl-devel -P python3-devel -P wget -P zlib-devel )
- cmd: if [%BUILD_ENVIRONMENT%]==[mingw-w64] (
C:\msys64\usr\bin\pacman -S --noconfirm --needed autoconf automake gettext-devel libtool make mingw-w64-x86_64-gcc msys/bison msys/flex msys/zlib-devel )
C:\msys64\usr\bin\pacman -S --noconfirm --needed autoconf automake gettext-devel libtool make mingw-w64-x86_64-gcc msys/bison msys/flex msys/zlib-devel mingw-w64-x86_64-python3 )
- ps: If ( ( "cygwin64-gcc-no-optimization", "mingw-w64-gcc-no-optimization" ).Contains( $env:TARGET ) ) {
$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://uploader.codecov.io/latest/windows/codecov.exe -Outfile ..\codecov.exe }

Expand Down
45 changes: 24 additions & 21 deletions autogen.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Script to generate the necessary files for a msvscpp build
#
# Version: 20230118
# Version: 20240306

$WinFlex = "..\win_flex_bison\win_flex.exe"
$WinBison = "..\win_flex_bison\win_bison.exe"
Expand Down Expand Up @@ -29,33 +29,36 @@ If (Test-Path "${Prefix}.net")

$NamePrefix = ""

ForEach (${DirectoryElement} in Get-ChildItem -Path "${Library}\*.l")
ForEach (${Library} in Get-ChildItem -Directory -Path "lib*")
{
$OutputFile = ${DirectoryElement} -Replace ".l$",".c"
ForEach (${DirectoryElement} in Get-ChildItem -Path "${Library}\*.l")
{
$OutputFile = ${DirectoryElement} -Replace ".l$",".c"

$NamePrefix = Split-Path -path ${DirectoryElement} -leaf
$NamePrefix = ${NamePrefix} -Replace ".l$","_"
$NamePrefix = Split-Path -path ${DirectoryElement} -leaf
$NamePrefix = ${NamePrefix} -Replace ".l$","_"

Write-Host "Running: ${WinFlex} -Cf ${DirectoryElement}"
Write-Host "Running: ${WinFlex} -Cf ${DirectoryElement}"

# PowerShell will raise NativeCommandError if win_flex writes to stdout or stderr
# therefore 2>&1 is added and the output is stored in a variable.
$Output = Invoke-Expression -Command "& '${WinFlex}' -Cf ${DirectoryElement} 2>&1"
Write-Host ${Output}
# PowerShell will raise NativeCommandError if win_flex writes to stdout or stderr
# therefore 2>&1 is added and the output is stored in a variable.
$Output = Invoke-Expression -Command "& '${WinFlex}' -Cf ${DirectoryElement} 2>&1"
Write-Host ${Output}

# Moving manually since `win_flex -o filename' does not provide the expected behavior.
Move-Item "lex.yy.c" ${OutputFile} -force
}
# Moving manually since `win_flex -o filename' does not provide the expected behavior.
Move-Item "lex.yy.c" ${OutputFile} -force
}

ForEach (${DirectoryElement} in Get-ChildItem -Path "${Library}\*.y")
{
$OutputFile = ${DirectoryElement} -Replace ".y$",".c"
ForEach (${DirectoryElement} in Get-ChildItem -Path "${Library}\*.y")
{
$OutputFile = ${DirectoryElement} -Replace ".y$",".c"

Write-Host "Running: ${WinBison} -d -v -l -p ${NamePrefix} -o ${OutputFile} ${DirectoryElement}"
Write-Host "Running: ${WinBison} -d -v -l -p ${NamePrefix} -o ${OutputFile} ${DirectoryElement}"

# PowerShell will raise NativeCommandError if win_bison writes to stdout or stderr
# therefore 2>&1 is added and the output is stored in a variable.
$Output = Invoke-Expression -Command "& '${WinBison}' -d -v -l -p ${NamePrefix} -o ${OutputFile} ${DirectoryElement} 2>&1"
Write-Host ${Output}
# PowerShell will raise NativeCommandError if win_bison writes to stdout or stderr
# therefore 2>&1 is added and the output is stored in a variable.
$Output = Invoke-Expression -Command "& '${WinBison}' -d -v -l -p ${NamePrefix} -o ${OutputFile} ${DirectoryElement} 2>&1"
Write-Host ${Output}
}
}

13 changes: 6 additions & 7 deletions common/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
AM_CPPFLAGS = -I$(top_srcdir)/include
AM_CPPFLAGS = \
-I../include -I$(top_srcdir)/include

EXTRA_DIST = \
byte_stream.h \
Expand All @@ -15,11 +16,9 @@ EXTRA_DIST = \
types.h.in \
wide_string.h

MAINTAINERCLEANFILES = \
DISTCLEANFILES = \
config.h \
types.h \
Makefile \
Makefile.in

distclean: clean
-rm -f config.h
-rm -f types.h
-rm -f Makefile

2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ AC_PREREQ([2.71])

AC_INIT(
[libfvde],
[20240224],
[20240502],
[joachim.metz@gmail.com])

AC_CONFIG_SRCDIR(
Expand Down
2 changes: 1 addition & 1 deletion documentation/FileVault Drive Encryption (FVDE).asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ corrupt.
[cols="1,1,5",options="header"]
|===
| Value | Identifier | Description
| 1 | CRC-32C | CRC-32 using the Castagnoli polynomial of 0x1edc6f41, also known as CRC-32C. +
| 1 | | CRC-32C (or CRC32-C), which uses the Castagnoli polynomial (0x1edc6f41) +
The CRC-32 calculation does not use the XOR with 0xffffffff before and after the calculation, which is also referred to as weak CRC-32 calculation.
|===

Expand Down
10 changes: 4 additions & 6 deletions fvdetools/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/common \
-I../include -I$(top_srcdir)/include \
-I../common -I$(top_srcdir)/common \
@LIBCERROR_CPPFLAGS@ \
@LIBCDATA_CPPFLAGS@ \
@LIBCLOCALE_CPPFLAGS@ \
Expand Down Expand Up @@ -126,12 +126,10 @@ fvdewipekey_LDADD = \
@LIBCERROR_LIBADD@ \
@LIBINTL@

MAINTAINERCLEANFILES = \
DISTCLEANFILES = \
Makefile \
Makefile.in

distclean: clean
-rm -f Makefile

splint-local:
@echo "Running splint on fvdeinfo ..."
-splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(fvdeinfo_SOURCES)
Expand Down
Loading

0 comments on commit 462a01d

Please sign in to comment.