Skip to content

Commit 0df9819

Browse files
fanquakedongcarl
authored andcommitted
build: Replace genisoimage with xorriso
xorriso and its mkisofs/genisoimage emulation alter-ego xorrisofs are more maintained, and has the right toggles for us to achieve output determinism without using blunt tools like faketime. In this commit, we use xorrisofs from the build environment rather than building it ourselves using depends. This is not necessary and can be changed in the future. From https://wiki.debian.org/genisoimage?action=recall&rev=11 : > The classical command line interface for production of ISO 9660 > filesystem images is the option set established by program mkisofs. > For reasons of licensing and other problems with its author, Debian > ships a fork of mkisofs, called genisoimage, which was split off in > 2006 and then developed independently. > > Meanwhile, genisoimage gets no new features and not even bug fixes. It > is first choice only if its options -udf or -hfs are needed. > > Replacement in most uses cases, especially for bootable ISO 9660 > filesystems, archiving, and backup, is xorrisofs which starts the -as > mkisofs emulation mode of program xorriso.
1 parent 22437fc commit 0df9819

File tree

6 files changed

+15
-17
lines changed

6 files changed

+15
-17
lines changed

Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ $(APP_DIST_EXTRAS): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt
138138

139139
.INTERMEDIATE: $(OSX_TEMP_ISO)
140140
$(OSX_TEMP_ISO): $(APP_DIST_EXTRAS)
141-
$(GENISOIMAGE) -no-cache-inodes -D -l -probe -V "$(OSX_VOLNAME)" -no-pad -r -dir-mode 0755 -apple -o $@ dist
141+
$(XORRISOFS) -D -l -V "$(OSX_VOLNAME)" -no-pad -r -dir-mode 0755 -o $@ dist
142142

143143
$(OSX_DMG): $(OSX_TEMP_ISO)
144144
$(DMG) dmg "$<" "$@"

ci/test/00_setup_env_mac.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export LC_ALL=C.UTF-8
99
export CONTAINER_NAME=ci_macos_cross
1010
export DOCKER_NAME_TAG=ubuntu:18.04 # Check that bionic can cross-compile to macos (bionic is used in the gitian build as well)
1111
export HOST=x86_64-apple-darwin18
12-
export PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python3-dev python3-setuptools"
12+
export PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python3-dev python3-setuptools xorriso"
1313
export XCODE_VERSION=11.3.1
1414
export XCODE_BUILD_ID=11C505
1515
export RUN_UNIT_TESTS=false

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ case $host in
669669
AC_PATH_TOOL([DSYMUTIL], [dsymutil], dsymutil)
670670
AC_PATH_TOOL([INSTALLNAMETOOL], [install_name_tool], install_name_tool)
671671
AC_PATH_TOOL([OTOOL], [otool], otool)
672-
AC_PATH_PROGS([GENISOIMAGE], [genisoimage mkisofs],genisoimage)
672+
AC_PATH_PROGS([XORRISOFS], [xorrisofs], xorrisofs)
673673
AC_PATH_PROGS([DMG], [dmg], dmg)
674674
AC_PATH_PROGS([RSVG_CONVERT], [rsvg-convert rsvg],rsvg-convert)
675675
AC_PATH_PROGS([IMAGEMAGICK_CONVERT], [convert],convert)

contrib/gitian-descriptors/gitian-osx-signer.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ architectures:
77
- "amd64"
88
packages:
99
- "faketime"
10+
- "xorriso"
1011
remotes:
1112
- "url": "https://github.com/bitcoin-core/bitcoin-detached-sigs.git"
1213
"dir": "signature"
@@ -18,7 +19,7 @@ script: |
1819
WRAP_DIR=$HOME/wrapped
1920
mkdir -p ${WRAP_DIR}
2021
export PATH="$PWD":$PATH
21-
FAKETIME_PROGS="dmg genisoimage"
22+
FAKETIME_PROGS="dmg xorrisofs"
2223
2324
# Create global faketime wrappers
2425
for prog in ${FAKETIME_PROGS}; do
@@ -36,5 +37,5 @@ script: |
3637
tar -xf ${UNSIGNED}
3738
OSX_VOLNAME="$(cat osx_volname)"
3839
./detached-sig-apply.sh ${UNSIGNED} signature/osx
39-
${WRAP_DIR}/genisoimage -no-cache-inodes -D -l -probe -V "${OSX_VOLNAME}" -no-pad -r -dir-mode 0755 -apple -o uncompressed.dmg signed-app
40+
${WRAP_DIR}/xorrisofs -D -l -V "${OSX_VOLNAME}" -no-pad -r -dir-mode 0755 -o uncompressed.dmg signed-app
4041
${WRAP_DIR}/dmg dmg uncompressed.dmg ${OUTDIR}/${SIGNED}

contrib/gitian-descriptors/gitian-osx.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ packages:
2828
- "python3-dev"
2929
- "python3-setuptools"
3030
- "fonts-tuffy"
31+
- "xorriso"
3132
remotes:
3233
- "url": "https://github.com/bitcoin/bitcoin.git"
3334
"dir": "bitcoin"
@@ -38,9 +39,9 @@ script: |
3839
3940
WRAP_DIR=$HOME/wrapped
4041
HOSTS="x86_64-apple-darwin18"
41-
CONFIGFLAGS="--enable-reduce-exports --disable-bench --disable-gui-tests GENISOIMAGE=$WRAP_DIR/genisoimage DMG=$WRAP_DIR/dmg"
42+
CONFIGFLAGS="--enable-reduce-exports --disable-bench --disable-gui-tests XORRISOFS=${WRAP_DIR}/xorrisofs DMG=${WRAP_DIR}/dmg"
4243
FAKETIME_HOST_PROGS=""
43-
FAKETIME_PROGS="ar ranlib date dmg genisoimage"
44+
FAKETIME_PROGS="ar ranlib date dmg xorrisofs"
4445
4546
export QT_RCC_TEST=1
4647
export QT_RCC_SOURCE_DATE_OVERRIDE=1
@@ -136,7 +137,7 @@ script: |
136137
cp osx_volname unsigned-app-${i}/
137138
cp contrib/macdeploy/detached-sig-apply.sh unsigned-app-${i}
138139
cp contrib/macdeploy/detached-sig-create.sh unsigned-app-${i}
139-
cp ${BASEPREFIX}/${i}/native/bin/dmg ${BASEPREFIX}/${i}/native/bin/genisoimage unsigned-app-${i}
140+
cp ${BASEPREFIX}/${i}/native/bin/dmg unsigned-app-${i}
140141
cp ${BASEPREFIX}/${i}/native/bin/${i}-codesign_allocate unsigned-app-${i}/codesign_allocate
141142
cp ${BASEPREFIX}/${i}/native/bin/${i}-pagestuff unsigned-app-${i}/pagestuff
142143
mv dist unsigned-app-${i}

contrib/macdeploy/README.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,19 +92,15 @@ created using these tools. The build process has been designed to avoid includin
9292
SDK's files in Gitian's outputs. All interim tarballs are fully deterministic and may be freely
9393
redistributed.
9494

95-
`genisoimage` is used to create the initial DMG. It is not deterministic as-is, so it has been
96-
patched. A system `genisoimage` will work fine, but it will not be deterministic because
97-
the file-order will change between invocations. The patch can be seen here: [cdrkit-deterministic.patch](https://github.com/bitcoin/bitcoin/blob/master/depends/patches/native_cdrkit/cdrkit-deterministic.patch).
98-
No effort was made to fix this cleanly, so it likely leaks memory badly, however it's only used for
99-
a single invocation, so that's no real concern.
95+
[`xorrisofs`](https://www.gnu.org/software/xorriso/) is used to create the DMG.
10096

101-
`genisoimage` cannot compress DMGs, so afterwards, the DMG tool from the
102-
`libdmg-hfsplus` project is used to compress it. There are several bugs in this tool and its
103-
maintainer has seemingly abandoned the project.
97+
`xorrisofs` cannot compress DMGs, so afterwards, the DMG tool from the
98+
`libdmg-hfsplus` project is used to compress it. There are several bugs in this
99+
tool and its maintainer has seemingly abandoned the project.
104100

105101
The DMG tool has the ability to create DMGs from scratch as well, but this functionality is
106102
broken. Only the compression feature is currently used. Ideally, the creation could be fixed
107-
and `genisoimage` would no longer be necessary.
103+
and `xorrisofs` would no longer be necessary.
108104

109105
Background images and other features can be added to DMG files by inserting a
110106
`.DS_Store` during creation.

0 commit comments

Comments
 (0)