Whamcloud - gitweb
Script used to create directory tree for PackageMaker in OS X.
[fs/lustre-release.git] / build / osxpack / packlustre.sh
1 #!/bin/sh
2 #
3 # This script is used to create package directory tree used
4 # by PackageMaker in OS X.
5
6 PREFIX=$1
7 STAGE=$2
8
9 RESOURCE=$PWD/build/osxpack
10 if ! [ -d $RESOURCE ]; then
11         echo "Your tree seems to be missing $RESOURCE." >&2
12 fi
13
14 if [ "x$PREFIX" == "x" ]; then
15         PREFIX=/home/cfs/package
16 fi
17
18 if [ "x$STAGE" == "x" ]; then
19         STAGE=/System/Library/Extensions
20 fi
21
22 if ! [ -d $STAGE/llite.kext ]; then
23         echo "Sorry, cannot find stage files for package"
24         exit 1
25 fi
26
27 if ! [ -d $PREFIX ]; then
28         mkdir -p $PREFIX
29 fi
30
31 if ! [ -d $PREFIX/Install_resources ]; then
32         mkdir -p $PREFIX/Install_resources
33 fi
34
35 if ! [ -d $PREFIX/Package_contents ]; then
36         mkdir -p $PREFIX/Package_contents
37 fi
38
39 CONTENTS=$PREFIX/Package_contents
40
41 if ! [ -d $CONTENTS/System/Libraray/Extensions ]; then
42         mkdir -p $CONTENTS/System/Library/Extensions
43 fi
44 # IMPORTANT
45 # /etc is symlink of /private/etc in OS X, if we 
46 # just use $CONTENTS/etc, it will OVERWRITE /etc in
47 # installation target, that means all files in /etc 
48 # will be lost, the system will be corrupted.
49 if ! [ -d $CONTENTS/private/etc ]; then
50         mkdir -p $CONTENTS/private/etc
51 fi
52
53 if ! [ -d $CONTENTS/sbin ]; then
54         mkdir -p $CONTENTS/sbin
55 fi
56
57 cp -f $RESOURCE/*.txt $PREFIX/Install_resources/
58 cp -f $RESOURCE/*flight $PREFIX/Install_resources/
59 cp -f $RESOURCE/sysctl.conf $CONTENTS/private/etc
60 cp -f $RESOURCE/uninstall_lustre $CONTENTS/sbin
61 cp -f $RESOURCE/unload_lustre $CONTENTS/sbin
62 cp -rf $STAGE/llite.kext $CONTENTS/System/Library/Extensions
63 cp -rf $STAGE/mdc.kext $CONTENTS/System/Library/Extensions
64 cp -rf $STAGE/lov.kext $CONTENTS/System/Library/Extensions
65 cp -rf $STAGE/osc.kext $CONTENTS/System/Library/Extensions
66 cp -rf $STAGE/ptlrpc.kext $CONTENTS/System/Library/Extensions
67 cp -rf $STAGE/ptlrpcs.kext $CONTENTS/System/Library/Extensions
68 cp -rf $STAGE/obdclass.kext $CONTENTS/System/Library/Extensions
69 cp -rf $STAGE/lvfs.kext $CONTENTS/System/Library/Extensions
70 cp -rf $STAGE/ksocknal.kext $CONTENTS/System/Library/Extensions
71 cp -rf $STAGE/portals.kext $CONTENTS/System/Library/Extensions
72 cp -rf $STAGE/libcfs.kext $CONTENTS/System/Library/Extensions