summaryrefslogtreecommitdiff
path: root/recipes-devtools/mtd/mtd-utils-static_git.bb
blob: d3ba77e1325c08fdb12a84698558bca1e9e3cd11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Recipe to produce a static nandwrite for flashing 
# the root file system after it has been mounted
# read-only, and erased on the flash.
# nanderase has already loaded its libraries before
# the root file system has been erased, so it
# does not need to be static.
require recipes-devtools/mtd/mtd-utils_git.bb

FILESEXTRAPATHS_prepend := "${THISDIR}/mtd-utils:"

PR = "r0"

PACKAGES = "${PN} ${PN}-dbg"

# build static version of nandwrite for flash upgrading
CFLAGS += "-static"

do_install () {
	install -d ${D}${bindir}
	install -m 0755 ${B}/nandwrite.static ${D}${bindir}/
}

do_compile_append() {
    ${CC} ${CFLAGS} ${LDFLAGS} -o nandwrite.static nand-utils/nandwrite.o libmtd.a
}