linux-xlnx_4.0.bbappend 3.29 KB
Newer Older
1
FILESEXTRAPATHS_append := "${THISDIR}/linux-xlnx:"
2
FILESEXTRAPATHS_prepend := "${THISDIR}/config:"
3

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
4
SRC_URI_append += " file://pl35x_nand.c.patch"
5
SRC_URI_append += " file://xilinx_emacps.c.patch"
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
6
SRC_URI_append += " file://xilinx_uartps.c.patch"
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
7
SRC_URI_append += " file://si5338_vsc330x.patch"
Andrey Filippov's avatar
Andrey Filippov committed
8
SRC_URI_append += " file://drivers-elphel.patch"
9

10 11 12
SRC_URI_append += " file://${MACHINE}.scc"
KERNEL_FEATURES_append = " ${MACHINE}.scc"

13
linux-elphel_label= "git://github.com/Elphel/linux-elphel.git"
14 15
linux-elphel_branch= "master"
linux-elphel_gitdir= "${WORKDIR}/linux-elphel"
16

17
# To use the latest leave: "" - (=empty)
18 19
linux-elphel_srcrev= ""
#linux-elphel_srcrev= "0ca36687a400fd9a5c4510295ae5be88aac77fa4"
20 21
#

22 23
DEV_DIR ?= "${TOPDIR}/../../linux-elphel"

24
# set output for Eclipse project setup parser:
25
EXTRA_OEMAKE += "-s -w -B KCFLAGS='-v'"
26
# or use a variable:
27
export _MAKEFLAGS="-s -w -B KCFLAGS='-v'"
28
export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE _MAKEFLAGS"
29
EXTRA_OEMAKE = "${_MAKEFLAGS}"
30

31
do_fetch_append() {
32 33 34 35 36 37
    if os.path.isdir("${DEV_DIR}"):
        print("Found DEV_DIR, skipping cloning")
    else:
        print("Cloninig ${linux-elphel_label}\n")
        os.system("git clone -b ${linux-elphel_branch} ${linux-elphel_label} ${linux-elphel_gitdir}")
        os.system("cd ${linux-elphel_gitdir};git checkout ${linux-elphel_srcrev}")
38 39
}

40
python do_link() {
41 42
    if os.path.isdir("${DEV_DIR}"):
        print("DEV_DIR exists - creating links...")
43 44
        devdir_abspath = os.path.abspath("${DEV_DIR}/src")
        for path, folders, files in os.walk("${DEV_DIR}/src"):
45
            folders[:]=[fd for fd in folders if fd != ".git"]
46 47 48
            for folder in folders:
                folder_abspath = os.path.abspath(os.path.join(path, folder))
                folder_relpath = folder_abspath.replace(devdir_abspath+"/", '')
49
                os.system("cd ${S};mkdir -p "+folder_relpath)
50 51 52
            for filename in files:
                file_abspath = os.path.abspath(os.path.join(path, filename))
                file_relpath = file_abspath.replace(devdir_abspath+"/", '')
53
                os.system("cd ${S};ln -sf "+file_abspath+" "+file_relpath)
54
                    
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
55 56 57 58 59
        #os.system("cd ${DEV_DIR}; ln -sf ${S} linux")
        if not os.path.isdir("${DEV_DIR}/sysroots"):
                os.system("cd ${DEV_DIR}; ln -sf ${TOPDIR}/tmp/sysroots sysroots")
        if not os.path.isdir("${DEV_DIR}/linux"):
                os.system("cd ${DEV_DIR}; ln -sf ${WORKDIR}/linux-${MACHINE}-standard-build linux")
60
    else:
Andrey Filippov's avatar
Andrey Filippov committed
61 62
        print("Copying ${linux-elphel_gitdir}/src/ over ${S}\n")
        os.system("cp -rfv ${linux-elphel_gitdir}/src/* ${S}")
63
}
64

65 66
addtask do_link before do_kernel_configme after do_patch

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
67
do_deploy_append(){
68 69
    for RLOC in ${PRODUCTION_ROOT_LOCATION}; do
        if [ ! -d ${DEPLOY_DIR_IMAGE}/${RLOC} ]; then
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
70
            mkdir -p ${DEPLOY_DIR_IMAGE}/${RLOC}
71
        fi
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
72 73
        #if [ -f ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}.bin ]; then
        if [ -f ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin ]; then
74 75 76
            if [ -f ${DEPLOY_DIR_IMAGE}/${RLOC}/${PRODUCTION_KERNEL} ]; then
                rm ${DEPLOY_DIR_IMAGE}/${RLOC}/${PRODUCTION_KERNEL}
            fi
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
77 78 79
            cp ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin ${DEPLOY_DIR_IMAGE}/${RLOC}/${PRODUCTION_KERNEL}
        else
            echo "NOT 3 FOUND!"
80 81
        fi
    done
82
}