create-distro-layer: remove Mender references

Signed-off-by: Matt Madison <matt@madison.systems>
This commit is contained in:
Matt Madison
2022-08-23 12:10:49 -07:00
committed by Matt Madison
parent 0f6f1f8d6e
commit 86e069fc33

View File

@@ -11,22 +11,19 @@ Usage: $PROGNAME --distro <DISTRO> [<options>]
Options:
-h, --help Print this usage message
-d, --distro Set the DISTRO name for newly created distro layer
-m, --mender Base the layer on mender configurations
-c, --color Colorize the output; can be 'never', 'always',
or 'auto' (default 'auto')
Arguments:
Examples:
- To create a new distro layer without mender configurations:
- To create a new distro layer:
$ $PROGNAME --distro testdistro
EOF
}
DISTRO_NAME=""
MENDER=false
# get command line options
SHORTOPTS="hmd:"
LONGOPTS="help,mender,distro:"
SHORTOPTS="hd:"
LONGOPTS="help,distro:"
ARGS=$(getopt --options $SHORTOPTS --longoptions $LONGOPTS --name $PROGNAME -- "$@" )
if [ $? != 0 ]; then
@@ -39,7 +36,6 @@ while true;
do
case $1 in
-h | --help) usage; exit 0 ;;
-m | --mender) MENDER=true; shift;;
-d | --distro) DISTRO_NAME="$2"; shift 2;;
-- ) shift; break ;;
* ) break ;;
@@ -66,24 +62,15 @@ if [ -d layers/meta-tegrademo ]; then
rm -rf ${LAYER_DIR}/recipes-*
# Adjust the data in templates
if [ "${MENDER}" = true ]; then
mv ${LAYER_DIR}/conf/template-tegrademo-mender ${LAYER_DIR}/conf/template-${DISTRO_NAME}
else
mv ${LAYER_DIR}/conf/template-tegrademo ${LAYER_DIR}/conf/template-${DISTRO_NAME}
fi
mv ${LAYER_DIR}/conf/template-tegrademo ${LAYER_DIR}/conf/template-${DISTRO_NAME}
rm -rf ${LAYER_DIR}/conf/template-tegrademo
rm -rf ${LAYER_DIR}/conf/template-tegrademo-mender
# Adjust the data in conf/distro
cat ${LAYER_DIR}/conf/distro/tegrademo.conf > ${LAYER_DIR}/conf/distro/${DISTRO_NAME}.conf
if [ "${MENDER}" = true ]; then
cat ${LAYER_DIR}/conf/distro/tegrademo-mender.conf | tail -n +6 >> ${LAYER_DIR}/conf/distro/${DISTRO_NAME}.conf
fi
rm -rf ${LAYER_DIR}/conf/distro/tegrademo.conf
rm -rf ${LAYER_DIR}/conf/distro/tegrademo-mender.conf
# Change Layer attributes from tegrademo
find ${LAYER_DIR} -type f -exec sed -i "s/tegrademo-mender/${DISTRO_NAME}/; s/tegrademo/${DISTRO_NAME}/" {} \;
find ${LAYER_DIR} -type f -exec sed -i "s/tegrademo/${DISTRO_NAME}/" {} \;
echo "Done!"
else