• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/board/freescale/common/mxs/post-image.sh
Fabio EstevamFabio Estevam committed 61331ac08e606 Nov 2016
Raw file
Source viewDiff to previous
 
1
#!/usr/bin/env bash
2
​
3
#
4
# dtb_list extracts the list of DTB files from BR2_LINUX_KERNEL_INTREE_DTS_NAME
5
# in ${BR_CONFIG}, then prints the corresponding list of file names for the
6
# genimage configuration file
7
#
8
dtb_list()
9
{
10
    local DTB_LIST="$(sed -n 's/^BR2_LINUX_KERNEL_INTREE_DTS_NAME="\([a-z0-9 \-]*\)"$/\1/p' ${BR2_CONFIG})"
11
​
12
    for dt in $DTB_LIST; do
13
        echo -n "\"$dt.dtb\", "
14
    done
15
}
16
​
17
#
18
# linux_image extracts the Linux image format from BR2_LINUX_KERNEL_UIMAGE in
19
# ${BR_CONFIG}, then prints the corresponding file name for the genimage
20
# configuration file
21
#
22
linux_image()
23
{
24
    if grep -Eq "^BR2_LINUX_KERNEL_UIMAGE=y$" ${BR2_CONFIG}; then
25
        echo "\"uImage\""
26
    else
27
        echo "\"zImage\""
28
    fi
29
}
30
​
31
main()
32
{
33
    local FILES="$(dtb_list) $(linux_image)"
34
    local GENIMAGE_CFG="$(mktemp --suffix genimage.cfg)"
35
    local GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
36
​
37
    sed -e "s/%FILES%/${FILES}/" \
38
        board/freescale/common/mxs/genimage.cfg.template > ${GENIMAGE_CFG}
39
​
40
    rm -rf "${GENIMAGE_TMP}"
41
​
42
    genimage \
43
        --rootpath "${TARGET_DIR}" \
44
        --tmppath "${GENIMAGE_TMP}" \
45
        --inputpath "${BINARIES_DIR}" \
46
        --outputpath "${BINARIES_DIR}" \
47
        --config "${GENIMAGE_CFG}"
48
​
49
    rm -f ${GENIMAGE_CFG}
50
​
51
    exit $?
52
}
53
​
54
main $@
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.