root/Pyramid/build/pyramid-export.sh

Revision 134, 1.7 kB (checked in by btm, 1 year ago)

Points to new secure site for svn export
Adds error checking to svn export
Simplifies version pushing code
Now runs depmod to ensure modules.dep is up to date

  • Property svn:executable set to *
Line 
1 #!/bin/bash
2 #Shell script to export Pyramid from SVN and make a tarball for PXE install
3 #
4 #We assume PWD is where you want all of this to take place
5 FILEHEAD=pyramid
6 PROTO="https"
7 HOST="secure.metrix.net"
8 REPO="svn/Pyramid/dist/"
9 EXPORTCMD="svn export $PROTO://$HOST/$REPO | tee export.log"
10 WHOAREYOU=$(whoami)
11 FAKEROOT=/usr/bin/fakeroot
12 VERSION=unknown
13
14 if [ $WHOAREYOU != root ] && [ ! -x $FAKEROOT ] ; then
15         echo "You need to run this as root or have fakeroot installed in order to properly set permissions in the tarball distro"
16         exit
17 fi
18
19 if [ ! -d 'work' ] ; then
20         mkdir work
21 fi
22 cd work
23 eval $EXPORTCMD
24 if [ $? -ne 0 ] ; then
25         echo "SVN Failed... exiting"
26         cd ..
27         exit
28 fi
29
30 if [ -e export.log ] ; then
31   VERSION=`sed -n 's/^Exported revision \([0-9]*\)./svn-\1/p' export.log`
32 fi
33
34 for moduledir in `ls -1 dist/lib/modules`; do
35         depmod -b dist $moduledir
36 done
37
38 cat > pyramid-work.sh << EOF
39 #!/bin/bash
40 cd dist
41 #Insert stuff to fix baseline permissions here
42 chown -R 0:0 etc
43 chown -R 0:0 bin
44 chown -R 0:0 boot
45 chown -R 0:50 home
46 chown -R 0:0 lib
47 chown -R 0:0 lost+found
48 chown -R 0:0 mnt
49 chown -R 0:0 ro
50 chown -R 0:0 sbin
51 chown -R 0:0 tmp
52 chown -R 0:0 usr
53 chown -R 0:0 var
54 chown -R 0:0 sys dev proc root rw
55 chown -R 500:500 ro/kismet
56 #next round of permission fixing
57 chmod 0440 etc/sudoers
58 chmod -R +x etc/init.d/
59 chmod 777 tmp
60
61 echo $VERSION > etc/pyramid_version
62 echo 'Metrix Pyramid/\s  \n \l ($VERSION)' > ro/etc/issue ; echo >> ro/etc/issue
63 echo 'Metrix Pyramid/%s %h ($VERSION)' > ro/etc/issue.net
64
65 tar -cvpf ../build.tar *
66 cd ..
67 EOF
68 chmod 755 pyramid-work.sh
69
70 if [ -x $FAKEROOT ] ; then
71         $FAKEROOT "./pyramid-work.sh"
72 else
73         ./pyramid-work.sh
74 fi
75
76 mv build.tar $FILEHEAD-$VERSION.tar
77 rm pyramid-work.sh
Note: See TracBrowser for help on using the browser.