Add minisatip

This commit is contained in:
Jaroslav Kysela 2015-03-28 09:36:07 +01:00
parent 43fd480a90
commit 4acb001e0a
3 changed files with 39 additions and 4 deletions

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
*~
fs
apps
fs.cpio
kernel/rootfs-idl4k.cpio

View File

@ -1,7 +1,15 @@
CPUS=4
TOOLPATH=/opt/STM/STLinux-2.4/host/bin
STLINUX=/opt/STM/STLinux-2.4
TOOLPATH=$(STLINUX)/host/bin
TOOLCHAIN=$(STLINUX)/devkit/sh4
TOOLCHAIN_KERNEL=$(shell pwd)/toolchain/4.5.3-99/opt/STM/STLinux-2.4/devkit/sh4
define GIT_CLONE
@mkdir -p apps/
git clone $(1) apps/$(2)
endef
#
# all
#
@ -13,9 +21,10 @@ all: kernel-axe-modules kernel
# create CPIO
#
fs.cpio:
fs.cpio: minisatip
fakeroot tools/do_min_fs.py \
-b bash
-b "bash" \
-e "apps/minisatip/minisatip:sbin/minisatip"
.PHONY: fs-list
fs-list:
@ -60,6 +69,19 @@ firmware/initramfs/root/modules_idl4k_7108_ST40HOST_LINUX_32BITS/axe_dmx.ko:
cd firmware ; ../tools/cpio-idl4k-bin.sh extract
chmod -R u+rw firmware/initramfs
#
# minisatip
#
apps/minisatip/minisatip.c:
$(call GIT_CLONE,https://github.com/catalinii/minisatip.git,minisatip)
.PHONY: minisatip
minisatip: apps/minisatip/minisatip.c
make -C apps/minisatip \
CC=$(TOOLCHAIN)/bin/sh4-linux-gcc \
CFLAGS="-O2 -DSYS_DVBT2=16"
#
# clean all
#

View File

@ -328,6 +328,7 @@ def usage():
print ' (example: -b "gzip ls pwd") '
print '\n -t, --target_prefix <path> the target path location '
print ' (default: /opt/STM/STLinux-2.4/devkit/sh4/target/)'
print '\n -e, --extra <file>:<dst> to be added to the filesystem'
print '\n -i --init_type : '
print '\t\t\t busybox '
print '\t\t\t sysv '
@ -344,18 +345,24 @@ def get_menu_opt(argv):
try:
# opts = ''
# args = ''
opts , args = getopt.gnu_getopt(argv, 'hb:t:i:', ['--init_type', '--binary=', '--target_prefix=', '--help'])
opts , args = getopt.gnu_getopt(argv, 'hb:e:t:i:', ['--init_type', '--binary=', '--extra', '--target_prefix=', '--help'])
except getopt.GetoptError:
usage()
target_prefix = ''
console = ''
binary_list=[]
extra_list=[]
for o, v in opts:
if o == '-b' or o == '--binary':
v = v.split(' ') # take out all blank spaces and replace the v string with binary_list
for i in v:
if i != '':
binary_list.append(i)
elif o == '-e' or o == '--extra':
v = v.split(' ') # take out all blank spaces and replace the v string with binary_list
for i in v:
if i != '':
extra_list.append(i)
elif o == '-t' or o == '--target_prefix':
target_prefix = v
elif o == '-i' or o == '--init_type':
@ -366,6 +373,7 @@ def get_menu_opt(argv):
params.append(binary_list)
params.append(console)
params.append(target_prefix)
params.append(extra_list)
return params
#-----------------------------------------
@ -482,6 +490,7 @@ boot_type = 'busybox' # default
user_param = ['', '', '']
user_param = get_menu_opt(sys.argv[1:])
bin_list = user_param[0] # command list to find
extra_list = user_param[3]
if user_param[1] != '':
boot_type = user_param[1] # default busybox
@ -552,4 +561,7 @@ for f in files:
for r in ['usr/bin/bashbug']:
if os.path.exists('fs/' + r):
run_cmd('rm fs/' + r)
for e in extra_list:
src, dst = e.split(':')
run_cmd('cp ' + src + ' fs/' + dst)
do_cpio('fs')