Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 6660182b authored by Brian Dube's avatar Brian Dube Committed by Robert Nelson
Browse files

Do less in case of -h|--help

- create no directories
- don't try to update any git repos
parent e32cc19f
Branches
Tags
No related merge requests found
......@@ -26,64 +26,11 @@ TIME=$(date +%Y-%m-%d)
OIB_DIR="$( cd "$(dirname "$0")" ; pwd -P )"
DIR="$PWD"
mkdir -p ${DIR}/ignore
if [ -f ${DIR}/.project ] ; then
. ${DIR}/.project
fi
usage () {
echo "usage: ./RootStock-NG.sh -c bb.org-debian-stretch-lxqt-v4.14"
}
generic_git () {
if [ ! -f ${DIR}/git/${git_project_name}/.git/config ] ; then
git clone ${git_clone_address} ${DIR}/git/${git_project_name} --depth=1
fi
}
update_git () {
if [ -f ${DIR}/git/${git_project_name}/.git/config ] ; then
cd ${DIR}/git/${git_project_name}/
git pull --rebase || true
cd -
fi
}
git_trees () {
if [ ! -d ${DIR}/git/ ] ; then
mkdir -p ${DIR}/git/
fi
git_project_name="linux-firmware"
git_clone_address="https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git"
generic_git
update_git
}
run_roostock_ng () {
if [ ! -f ${DIR}/.project ] ; then
echo "error: [.project] file not defined"
exit 1
else
echo "Debug: .project"
echo "-----------------------------"
cat ${DIR}/.project
echo "-----------------------------"
fi
if [ ! "${tempdir}" ] ; then
tempdir=$(mktemp -d -p ${DIR}/ignore)
echo "tempdir=\"${tempdir}\"" >> ${DIR}/.project
fi
/bin/bash -e "${OIB_DIR}/scripts/install_dependencies.sh" || { exit 1 ; }
/bin/bash -e "${OIB_DIR}/scripts/debootstrap.sh" || { exit 1 ; }
/bin/bash -e "${OIB_DIR}/scripts/chroot.sh" || { exit 1 ; }
sudo rm -rf ${tempdir}/ || true
}
checkparm () {
if [ "$(echo $1|grep ^'\-')" ] ; then
echo "E: Need an argument"
......@@ -140,16 +87,13 @@ check_saved_config () {
fi
}
git_trees
cd ${DIR}/
unset need_to_compress_rootfs
# parse commandline options
while [ ! -z "$1" ] ; do
case $1 in
-h|--help)
usage
exit
;;
-c|-C|--config)
checkparm $2
......@@ -163,6 +107,63 @@ while [ ! -z "$1" ] ; do
shift
done
mkdir -p ${DIR}/ignore
if [ -f ${DIR}/.project ] ; then
. ${DIR}/.project
fi
generic_git () {
if [ ! -f ${DIR}/git/${git_project_name}/.git/config ] ; then
git clone ${git_clone_address} ${DIR}/git/${git_project_name} --depth=1
fi
}
update_git () {
if [ -f ${DIR}/git/${git_project_name}/.git/config ] ; then
cd ${DIR}/git/${git_project_name}/
git pull --rebase || true
cd -
fi
}
git_trees () {
if [ ! -d ${DIR}/git/ ] ; then
mkdir -p ${DIR}/git/
fi
git_project_name="linux-firmware"
git_clone_address="https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git"
generic_git
update_git
}
run_roostock_ng () {
if [ ! -f ${DIR}/.project ] ; then
echo "error: [.project] file not defined"
exit 1
else
echo "Debug: .project"
echo "-----------------------------"
cat ${DIR}/.project
echo "-----------------------------"
fi
if [ ! "${tempdir}" ] ; then
tempdir=$(mktemp -d -p ${DIR}/ignore)
echo "tempdir=\"${tempdir}\"" >> ${DIR}/.project
fi
/bin/bash -e "${OIB_DIR}/scripts/install_dependencies.sh" || { exit 1 ; }
/bin/bash -e "${OIB_DIR}/scripts/debootstrap.sh" || { exit 1 ; }
/bin/bash -e "${OIB_DIR}/scripts/chroot.sh" || { exit 1 ; }
sudo rm -rf ${tempdir}/ || true
}
git_trees
cd ${DIR}/
run_roostock_ng
#
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment