Skip to content
Permalink
Browse files

envsetups: Add logic to detect machine from envscript name

if we have envscript.sh in form of <machine>-envsetup.sh then we can set
MACHINE=<machine> automatically, this lets us create symlinks to
envsetup.sh for most of machines where there is no machine specific
functionality

Add machine configs for rpi variants and qemu variants

Signed-off-by: Khem Raj <raj.khem@gmail.com>
  • Loading branch information...
kraj committed Aug 26, 2018
1 parent b2dacdd commit 1ad8a21faf62f4fb89a9ed773bd59bdcdbecf9cb
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Original script done by Don Darling
# Later changes by Koen Kooi and Brijesh Singh
@@ -18,24 +18,32 @@
# Changes by Cliff Brake
# 20111101: modify script to work with BEC build template
#

if [ -f local.sh ]; then
echo "reading local settings"
source local.sh
fi

BUILDHOST_DISTRO=$(egrep -h '^ID=' /etc/*-release | sed 's#^ID=##')

###############################################################################
# Machine/Distro setup -- this is the main configuration for the build
# these variables can be set externally in the shell, or here
###############################################################################

# Try to infer the machine name from envsetup script itself
# so we can create symlinks like
# <machine>-envsetup.sh -> envsetup.sh
# and it will automatically set MACHINE variable
scriptname=${0##*/}
mach=${scriptname%-*}
if [ -n "${mach}" -a "${mach}" != "${scriptname}" ]; then
MACHINE=${mach}
fi
if [ -z "${MACHINE}" ]; then
echo "MACHINE must be set before sourcing this script"
return
fi

export MACHINE
echo "setting MACHINE=$MACHINE"
if [ -z "${MEDIA}" ]; then
# set the location of the automounted location for removable storage
# newer gnome systems

This file was deleted.

Oops, something went wrong.

0 comments on commit 1ad8a21

Please sign in to comment.
You can’t perform that action at this time.