Bug 1197325 - Generate mkfs.hfsplus. r=ted
authorJustin Wood <Callek@gmail.com>
Mon, 30 Jan 2017 13:12:57 -0500
changeset 341520 f9f33149db8af599d3af7ef7d55e7c6e0376da14
parent 341517 ce506ee62e4d1bf2353ac9c0f388f76dcecb037d
child 341521 ab096d7edae3081170cd4e46c9c7db174987f0fd
push id86727
push userkwierso@gmail.com
push dateThu, 09 Feb 2017 00:21:26 +0000
treeherdermozilla-inbound@55a4f5189115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs1197325
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1197325 - Generate mkfs.hfsplus. r=ted MozReview-Commit-ID: Dl0eBQR8XFR
build/unix/build-hfsplus/build-hfsplus.sh
taskcluster/ci/toolchain/linux.yml
taskcluster/scripts/misc/build-hfsplus-linux.sh
new file mode 100755
--- /dev/null
+++ b/build/unix/build-hfsplus/build-hfsplus.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+set -x
+
+hfplus_version=540.1.linux3
+md5sum=0435afc389b919027b69616ad1b05709
+filename=diskdev_cmds-${hfplus_version}.tar.gz
+make_flags="-j$(getconf _NPROCESSORS_ONLN)"
+
+root_dir="$1"
+if [ -z "$root_dir" -o ! -d "$root_dir" ]; then
+  root_dir=$(mktemp -d)
+fi
+cd $root_dir
+
+if test -z $TMPDIR; then
+  TMPDIR=/tmp/
+fi
+
+# Install clang first
+yum install -y clang
+
+# Set an md5 check file to validate input
+echo "${md5sum} *${TMPDIR}/${filename}" > $TMPDIR/hfsplus.MD5
+
+# Most-upstream is https://opensource.apple.com/source/diskdev_cmds/
+
+# Download the source of the specified version of binutils
+wget -c -P $TMPDIR http://pkgs.fedoraproject.org/repo/pkgs/hfsplus-tools/${filename}/${md5sum}/${filename} || exit 1
+md5sum -c $TMPDIR/hfsplus.MD5 || exit 1
+mkdir hfsplus-source
+tar xzf $TMPDIR/${filename} -C hfsplus-source --strip-components=1
+
+# Build
+cd hfsplus-source
+make $make_flags || exit 1
+cd ..
+
+mkdir hfsplus-tools
+cp hfsplus-source/newfs_hfs.tproj/newfs_hfs hfsplus-tools/newfs_hfs
+## XXX fsck_hfs is unused, but is small and built from the package.
+cp hfsplus-source/fsck_hfs.tproj/fsck_hfs hfsplus-tools/fsck_hfs
+
+# Make a package of the built utils
+cd $root_dir
+tar caf $root_dir/hfsplus-tools.tar.xz hfsplus-tools
--- a/taskcluster/ci/toolchain/linux.yml
+++ b/taskcluster/ci/toolchain/linux.yml
@@ -106,8 +106,29 @@ linux64-cctools-port/opt:
     worker:
         implementation: docker-worker
         docker-image: {in-tree: desktop-build}
         max-run-time: 36000
     when:
         files-changed:
             - 'taskcluster/scripts/misc/build-cctools-port.sh'
             - 'taskcluster/taskgraph/transforms/job/toolchain.py'
+
+linux64-hfsplus/opt:
+    description: "hfplus toolchain build"
+    treeherder:
+        kind: build
+        platform: linux64/opt
+        symbol: Cc(hfsplus)
+        tier: 1
+    run:
+        using: toolchain-script
+        script: build-hfsplus-linux.sh
+    worker-type: aws-provisioner-v1/gecko-{level}-b-linux
+    worker:
+        implementation: docker-worker
+        docker-image: {in-tree: desktop-build}
+        max-run-time: 36000
+    when:
+        files-changed:
+            - 'build/unix/build-hfsplus/**'
+            - 'taskcluster/scripts/misc/build-hfsplus-linux.sh'
+            - 'taskcluster/taskgraph/transforms/job/toolchain.py'
new file mode 100755
--- /dev/null
+++ b/taskcluster/scripts/misc/build-hfsplus-linux.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+set -x -e -v
+
+# This script is for building hfsplus for Linux.
+
+WORKSPACE=$HOME/workspace
+HOME_DIR=$WORKSPACE/build
+UPLOAD_DIR=$WORKSPACE/artifacts
+
+cd $HOME_DIR/src
+
+build/unix/build-hfsplus/build-hfsplus.sh $HOME_DIR
+
+# Put a tarball in the artifacts dir
+mkdir -p $UPLOAD_DIR
+cp $HOME_DIR/hfsplus-tools.tar.* $UPLOAD_DIR