]> git.saurik.com Git - apple/hfs.git/blob - core/mk-root.sh
hfs-407.30.1.tar.gz
[apple/hfs.git] / core / mk-root.sh
1 #!/bin/bash
2
3 # mk-root.sh
4 # hfs
5 #
6 # Created by Chris Suter on 5/3/15.
7 #
8
9 shopt -s nocasematch
10
11 set -e
12
13 if [[ "$SDKROOT" =~ macosx ]] ; then
14 if [ ! "$KERNEL_PATH" ] ; then
15 KERNEL_PATH=$SDKROOT/System/Library/Kernels/kernel.development
16 fi
17
18 EXTS_PATH="`dirname \"$KERNEL_PATH\"`"/../Extensions
19
20 kextutil -no-load -t -k "$KERNEL_PATH" -no-authentication "$BUILT_PRODUCTS_DIR/HFSEncodings.kext" -d "$EXTS_PATH/System.kext"
21 kextutil -no-load -t -k "$KERNEL_PATH" -no-authentication "$BUILT_PRODUCTS_DIR/HFS.kext" -d "$EXTS_PATH/System.kext" -d "$BUILT_PRODUCTS_DIR/HFSEncodings.kext"
22
23 if [ "$XNU_PATH" ] ; then
24 extra_args=(-C "$XNU_PATH/BUILD/dst" .)
25 fi
26 gnutar --owner 0 --group 0 --transform 's|^([^/]+.kext)|System/Library/Extensions/\1|x' -C "$BUILT_PRODUCTS_DIR" HFS.kext HFSEncodings.kext "${extra_args[@]}" -cjf "$BUILT_PRODUCTS_DIR/hfs-root.tbz"
27 echo "Created $BUILT_PRODUCTS_DIR/hfs-root.tbz"
28 ln -sf $BUILT_PRODUCTS_DIR/hfs-root.tbz /tmp/
29 else
30 ~/bin/copy-kernel-cache-builder
31 pushd /tmp/KernelCacheBuilder
32 if [ "$XNU_PATH" ] ; then
33 extra_args=(KERNEL_PATH="$XNU_DST_PATH")
34 extra_kext_paths="$BUILT_PRODUCTS_DIR $XNU_PATH/BUILD/dst/System/Library/Extensions"
35 else
36 extra_kext_paths="$BUILT_PRODUCTS_DIR"
37 fi
38 env -i make TARGETS="$DEVICES" "${extra_args[@]}" BUILDS=development VERBOSE=YES SDKROOT=iphoneos.internal EXTRA_KEXT_PATHS="$BUILT_PRODUCTS_DIR $XNU_PATH/BUILD/dst/System/Library/Extensions" EXTRA_BUNDLES=com.apple.filesystems.hfs.kext 2> >(sed -E '/^.*duplicate BUNDLE_IDS$/d' 1>&2)
39 fi