elphel-dev.bbclass 2.21 KB
Newer Older
1 2
# developers version

3 4
DEPENDS += "linux-xlnx"

5
inherit elphel-misc elphel-scp
6 7 8 9 10

do_unpack(){
    if [ -d ${S} ]; then
        rm -rf ${S}
    fi
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
11
    ln -sf ${VPATH} ${S}
12

13 14 15
    if [ -d ${VPATH}/sysroots ]; then
        rm -rf ${VPATH}/sysroots
    fi
16 17 18 19 20
    # old:
    #ln -sf ${TOPDIR}/tmp/sysroots ${VPATH}/sysroots
    # new:
    ln -sf ${WORKDIR}/recipe-sysroot ${VPATH}/sysroots

21 22 23 24
    if [ -d ${VPATH}/bitbake-logs ]; then
        rm -rf ${VPATH}/bitbake-logs
    fi
    ln -sf ${WORKDIR}/temp ${VPATH}/bitbake-logs
25

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
26 27 28 29
    if [ -d ${VPATH}/image ]; then
        rm -rf ${VPATH}/image
    fi
    ln -sf ${WORKDIR}/image ${VPATH}/image
30 31
}

32 33 34 35
ELPHEL393_USERADD = "eval ${FAKEROOTENV} PSEUDO_LOCALSTATEDIR=${STAGING_DIR_TARGET}${localstatedir}/pseudo ${STAGING_DIR_NATIVE}${bindir}/pseudo useradd --root ${STAGING_DIR_HOST}"
ELPHEL393_INSTALL = "install"
ELPHEL393_MKNOD = "mknod"

36 37
INITSTRING ??= "somescript.sh"

38 39 40
REMOTE_NETMASK ??= "255.255.255.0"
REMOTE_GATEWAY ??= "192.168.0.15"

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
41
EXTRA_OEMAKE = " \
42 43
                INSTALL=${ELPHEL393_INSTALL} \
                MKNOD=${ELPHEL393_MKNOD} \
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
44 45 46 47
                DESTDIR=${D} \
                ELPHEL_KERNEL_DIR=${STAGING_KERNEL_DIR} \
                STAGING_KERNEL_DIR=${STAGING_KERNEL_DIR} \
                STAGING_DIR_HOST=${STAGING_DIR_HOST} \
48
                USERADD='${ELPHEL393_USERADD}' \
49 50
                REMOTE_USER=${REMOTE_USER} \
                REMOTE_IP=${REMOTE_IP} \
51 52
                REMOTE_NETMASK=${REMOTE_NETMASK} \
                REMOTE_GATEWAY=${REMOTE_GATEWAY} \
53 54
                SRCREV=${SRCREV} \
                VERSION='${PE}.${PV}.${PR}' \
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
55
                INITSTRING='${INITSTRING}' \
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
56
                "
57

58 59 60 61 62 63
do_compile_prepend() {
    echo "SRCREV is ${SRCREV}"
    if [ ! -f Makefile ]; then
        echo "Nothing to compile (missing a Makefile)"
        exit 1
    fi
64
}
65

66 67
do_install_append() {
        oe_runmake ${EXTRA_OEMAKE} install
68
        install -d ${D}/etc/elphel393/packages
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
69
        TMPNAME=`basename ${VPATH}`
70
        echo "${PE}.${PV}.${PR}" > ${D}/etc/elphel393/packages/${BPN}
71 72
        #make archive
        tar -czvf ${WORKDIR}/image.tar.gz -C ${WORKDIR}/image .
73 74 75 76
}

# Always start from compile
# link1: http://www.crashcourse.ca/wiki/index.php/BitBake_task_flags
77
#do_compile[nostamp]="1"