diff --git a/.gitignore b/.gitignore index 4eacc6f6..856040dd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *~ fs +apps fs.cpio kernel/rootfs-idl4k.cpio diff --git a/Makefile b/Makefile index ee9ea55f..fa5eb177 100644 --- a/Makefile +++ b/Makefile @@ -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 # diff --git a/tools/do_min_fs.py b/tools/do_min_fs.py index e8e2bac3..5fe853d6 100755 --- a/tools/do_min_fs.py +++ b/tools/do_min_fs.py @@ -328,6 +328,7 @@ def usage(): print ' (example: -b "gzip ls pwd") ' print '\n -t, --target_prefix the target path location ' print ' (default: /opt/STM/STLinux-2.4/devkit/sh4/target/)' + print '\n -e, --extra : 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')