diff options
Diffstat (limited to 'scripts/oe-setup-builddir')
| -rwxr-xr-x | scripts/oe-setup-builddir | 141 |
1 files changed, 0 insertions, 141 deletions
diff --git a/scripts/oe-setup-builddir b/scripts/oe-setup-builddir deleted file mode 100755 index dcb384c33a..0000000000 --- a/scripts/oe-setup-builddir +++ /dev/null | |||
| @@ -1,141 +0,0 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | # OE Build Environment Setup Script | ||
| 4 | # | ||
| 5 | # Copyright (C) 2006-2011 Linux Foundation | ||
| 6 | # | ||
| 7 | # SPDX-License-Identifier: GPL-2.0-or-later | ||
| 8 | # | ||
| 9 | |||
| 10 | die() { | ||
| 11 | echo Error: "$@" >&2 | ||
| 12 | exit 1 | ||
| 13 | } | ||
| 14 | |||
| 15 | [ -n "$BUILDDIR" ] || die "The build directory (BUILDDIR) must be set!" | ||
| 16 | |||
| 17 | if [ "$1" = '--help' ] || [ "$1" = '-h' ]; then | ||
| 18 | echo 'Usage: oe-setup-builddir' | ||
| 19 | echo '' | ||
| 20 | echo "OpenEmbedded setup-builddir - setup build directory $BUILDDIR" | ||
| 21 | echo '' | ||
| 22 | exit 2 | ||
| 23 | fi | ||
| 24 | |||
| 25 | mkdir -p "$BUILDDIR/conf" | ||
| 26 | |||
| 27 | [ -d "$BUILDDIR" ] || die "The build directory ($BUILDDIR) does not exist!" | ||
| 28 | [ -w "$BUILDDIR" ] || | ||
| 29 | die "Cannot write to $BUILDDIR, perhaps try sourcing with a writable path? i.e. . oe-init-build-env ~/my-build" | ||
| 30 | |||
| 31 | # Attempting removal of sticky,setuid bits from BUILDDIR, BUILDDIR/conf | ||
| 32 | chmod -st "$BUILDDIR" 2>/dev/null || echo "WARNING: unable to chmod $BUILDDIR" | ||
| 33 | chmod -st "$BUILDDIR/conf" 2>/dev/null || echo "WARNING: unable to chmod $BUILDDIR/conf" | ||
| 34 | |||
| 35 | cd "$BUILDDIR" || die "Failed to change directory to $BUILDDIR!" | ||
| 36 | |||
| 37 | . "$OEROOT/.templateconf" | ||
| 38 | |||
| 39 | # Keep the original TEMPLATECONF before possibly prefixing it with $OEROOT below. | ||
| 40 | ORG_TEMPLATECONF=$TEMPLATECONF | ||
| 41 | |||
| 42 | # | ||
| 43 | # $TEMPLATECONF can point to a directory for the template local.conf & bblayers.conf | ||
| 44 | # | ||
| 45 | if [ -n "$TEMPLATECONF" ]; then | ||
| 46 | if [ ! -d "$TEMPLATECONF" ]; then | ||
| 47 | # Allow TEMPLATECONF=meta-xyz/conf as a shortcut | ||
| 48 | if [ -d "$OEROOT/$TEMPLATECONF" ]; then | ||
| 49 | TEMPLATECONF="$OEROOT/$TEMPLATECONF" | ||
| 50 | fi | ||
| 51 | [ -d "$TEMPLATECONF" ] || | ||
| 52 | die "TEMPLATECONF value points to nonexistent directory '$TEMPLATECONF'" | ||
| 53 | fi | ||
| 54 | templatesdir=$(python3 -c "import sys; print(sys.argv[1].strip('/').split('/')[-2])" "$TEMPLATECONF") | ||
| 55 | if [ "$templatesdir" != templates ] || [ ! -f "$TEMPLATECONF/../../layer.conf" ]; then | ||
| 56 | die "TEMPLATECONF value (which is $TEMPLATECONF) must point to meta-some-layer/conf/templates/template-name" | ||
| 57 | fi | ||
| 58 | OECORELAYERCONF="$TEMPLATECONF/bblayers.conf.sample" | ||
| 59 | OECORELOCALCONF="$TEMPLATECONF/local.conf.sample" | ||
| 60 | OECORESUMMARYCONF="$TEMPLATECONF/conf-summary.txt" | ||
| 61 | OECORENOTESCONF="$TEMPLATECONF/conf-notes.txt" | ||
| 62 | fi | ||
| 63 | |||
| 64 | unset SHOWYPDOC | ||
| 65 | if [ -z "$OECORELOCALCONF" ]; then | ||
| 66 | OECORELOCALCONF="$OEROOT/meta/conf/templates/default/local.conf.sample" | ||
| 67 | fi | ||
| 68 | if [ ! -r "$BUILDDIR/conf/local.conf" ]; then | ||
| 69 | cat <<EOM | ||
| 70 | You had no conf/local.conf file. This configuration file has therefore been | ||
| 71 | created for you from $OECORELOCALCONF | ||
| 72 | You may wish to edit it to, for example, select a different MACHINE (target | ||
| 73 | hardware). | ||
| 74 | |||
| 75 | EOM | ||
| 76 | cp -f "$OECORELOCALCONF" "$BUILDDIR/conf/local.conf" | ||
| 77 | SHOWYPDOC=yes | ||
| 78 | fi | ||
| 79 | |||
| 80 | if [ -z "$OECORELAYERCONF" ]; then | ||
| 81 | OECORELAYERCONF="$OEROOT/meta/conf/templates/default/bblayers.conf.sample" | ||
| 82 | fi | ||
| 83 | if [ ! -r "$BUILDDIR/conf/bblayers.conf" ]; then | ||
| 84 | cat <<EOM | ||
| 85 | You had no conf/bblayers.conf file. This configuration file has therefore been | ||
| 86 | created for you from $OECORELAYERCONF | ||
| 87 | To add additional metadata layers into your configuration please add entries | ||
| 88 | to conf/bblayers.conf. | ||
| 89 | |||
| 90 | EOM | ||
| 91 | |||
| 92 | # Put the absolute path to the layers in bblayers.conf so we can run | ||
| 93 | # bitbake without the init script after the first run. | ||
| 94 | # ##COREBASE## is deprecated as its meaning was inconsistent, but continue | ||
| 95 | # to replace it for compatibility. | ||
| 96 | sed -e "s|##OEROOT##|$OEROOT|g" \ | ||
| 97 | -e "s|##COREBASE##|$OEROOT|g" \ | ||
| 98 | "$OECORELAYERCONF" > "$BUILDDIR/conf/bblayers.conf" | ||
| 99 | SHOWYPDOC=yes | ||
| 100 | fi | ||
| 101 | |||
| 102 | if [ -z "$OECORESUMMARYCONF" ]; then | ||
| 103 | OECORESUMMARYCONF="$OEROOT/meta/conf/templates/default/conf-summary.txt" | ||
| 104 | fi | ||
| 105 | if [ ! -r "$BUILDDIR/conf/conf-summary.txt" ]; then | ||
| 106 | [ ! -r "$OECORESUMMARYCONF" ] || cp "$OECORESUMMARYCONF" "$BUILDDIR/conf/conf-summary.txt" | ||
| 107 | fi | ||
| 108 | |||
| 109 | if [ -z "$OECORENOTESCONF" ]; then | ||
| 110 | OECORENOTESCONF="$OEROOT/meta/conf/templates/default/conf-notes.txt" | ||
| 111 | fi | ||
| 112 | if [ ! -r "$BUILDDIR/conf/conf-notes.txt" ]; then | ||
| 113 | [ ! -r "$OECORENOTESCONF" ] || cp "$OECORENOTESCONF" "$BUILDDIR/conf/conf-notes.txt" | ||
| 114 | fi | ||
| 115 | |||
| 116 | # Prevent disturbing a new GIT clone in same console | ||
| 117 | unset OECORELOCALCONF | ||
| 118 | unset OECORELAYERCONF | ||
| 119 | unset OECORESUMMARYCONF | ||
| 120 | unset OECORENOTESCONF | ||
| 121 | |||
| 122 | # Ending the first-time run message. Show the YP Documentation banner. | ||
| 123 | if [ -n "$SHOWYPDOC" ]; then | ||
| 124 | cat <<EOM | ||
| 125 | The Yocto Project has extensive documentation about OE including a reference | ||
| 126 | manual which can be found at: | ||
| 127 | https://docs.yoctoproject.org | ||
| 128 | |||
| 129 | For more information about OpenEmbedded see the website: | ||
| 130 | https://www.openembedded.org/ | ||
| 131 | |||
| 132 | EOM | ||
| 133 | # unset SHOWYPDOC | ||
| 134 | fi | ||
| 135 | |||
| 136 | [ ! -r "$BUILDDIR/conf/conf-summary.txt" ] || cat "$BUILDDIR/conf/conf-summary.txt" | ||
| 137 | [ ! -r "$BUILDDIR/conf/conf-notes.txt" ] || cat "$BUILDDIR/conf/conf-notes.txt" | ||
| 138 | |||
| 139 | if [ ! -f "$BUILDDIR/conf/templateconf.cfg" ]; then | ||
| 140 | echo "$ORG_TEMPLATECONF" >"$BUILDDIR/conf/templateconf.cfg" | ||
| 141 | fi | ||
