File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ Linux /cp210x /install.sh
2+
3+ # vim
4+ * .swp
Original file line number Diff line number Diff line change 1+ obj-m = cp210x.o
2+ KDIR = /lib/modules/` uname -r ` /build
3+ SRCDIR = $(PWD )
4+ # try this instead if you don't have PWD defined
5+ # SRCDIR = $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
6+ all :
7+ $(MAKE ) -C $(KDIR ) M=$(SRCDIR ) modules
8+ clean :
9+ $(MAKE ) -C $(KDIR ) M=$(SRCDIR ) clean
Original file line number Diff line number Diff line change 1+ import tarfile
2+ from StringIO import StringIO
3+
4+ def main ():
5+ installScript = open ("install.sh.in" ).read ()
6+ payloadStart = len (installScript .splitlines ()) + 1
7+ #payloadStart = len(installScript) - 1 + len(str(len(installScript)))
8+ #if len(installScript) - 1 + len(str(payloadStart)) != payloadStart:
9+ # payloadStart += 1
10+
11+ print "payloadstart=%s" % payloadStart
12+ installScript = installScript .replace ("payloadstart=0" , "payloadstart=%s" % payloadStart )
13+
14+ output = open ("install.sh" , 'wb' )
15+
16+ tarData = StringIO ()
17+ tarFile = tarfile .open (fileobj = tarData , mode = 'w:bz2' )
18+ tarFile .add ("cp210x.c" )
19+ tarFile .add ("Makefile" )
20+ tarFile .add ("dkms.conf" )
21+ tarFile .close ()
22+
23+ output .write (installScript )
24+ output .write (tarData .getvalue ())
25+ output .close ()
26+
27+ if __name__ == "__main__" :
28+ main ()
You can’t perform that action at this time.
0 commit comments