Proper tools checking
This commit is contained in:
parent
90aeec2af0
commit
313c050ff8
11 changed files with 62 additions and 9 deletions
|
|
@ -13,6 +13,17 @@ fi
|
|||
project_root="$1"
|
||||
dns_replacement="$2"
|
||||
|
||||
# check the required tools
|
||||
TOOL_LIST="printf dd grep cut xargs"
|
||||
for tool_name in $TOOL_LIST; do
|
||||
echo "Checking tool: $tool_name"
|
||||
tool_path=$(which "$tool_name")
|
||||
if [ -z "$tool_path" ]; then
|
||||
echo -e "${RED}ERROR: Missing tool '$tool_name' ${NC}"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
# check the project root folder
|
||||
if [ ! -d "$project_root" ]; then
|
||||
echo -e "${RED}ERROR: Cannot find the folder '$project_root' ${NC}"
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ project_root="$1"
|
|||
fswebcam_package="$2"
|
||||
|
||||
# check the required tools
|
||||
TOOL_LIST="unzip"
|
||||
TOOL_LIST="unzip sed"
|
||||
for tool_name in $TOOL_LIST; do
|
||||
echo "Checking tool: $tool_name"
|
||||
tool_path=$(which "$tool_name")
|
||||
|
|
|
|||
|
|
@ -15,6 +15,17 @@ fi
|
|||
def_target="$1/unpacked/squashfs-root/app/app"
|
||||
def_url="$2"
|
||||
|
||||
# check the required tools
|
||||
TOOL_LIST="printf dd grep awk"
|
||||
for tool_name in $TOOL_LIST; do
|
||||
echo "Checking tool: $tool_name"
|
||||
tool_path=$(which "$tool_name")
|
||||
if [ -z "$tool_path" ]; then
|
||||
echo -e "${RED}ERROR: Missing tool '$tool_name' ${NC}"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
# check the input file
|
||||
if [ ! -f "$def_target" ]; then
|
||||
echo -e "${RED}ERROR: Cannot find the app file ${NC}"
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ project_root="$1"
|
|||
opkg_package="$2"
|
||||
|
||||
# check the required tools
|
||||
TOOL_LIST="unzip"
|
||||
TOOL_LIST="unzip grep sed"
|
||||
for tool_name in $TOOL_LIST; do
|
||||
echo "Checking tool: $tool_name"
|
||||
tool_path=$(which "$tool_name")
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ project_root="$1"
|
|||
python_package="$2"
|
||||
|
||||
# check the required tools
|
||||
TOOL_LIST="unzip"
|
||||
TOOL_LIST="unzip sed"
|
||||
for tool_name in $TOOL_LIST; do
|
||||
echo "Checking tool: $tool_name"
|
||||
tool_path=$(which "$tool_name")
|
||||
|
|
|
|||
|
|
@ -13,6 +13,17 @@ fi
|
|||
project_root="$1"
|
||||
password_hash="$2"
|
||||
|
||||
# check the required tools
|
||||
TOOL_LIST="awk"
|
||||
for tool_name in $TOOL_LIST; do
|
||||
echo "Checking tool: $tool_name"
|
||||
tool_path=$(which "$tool_name")
|
||||
if [ -z "$tool_path" ]; then
|
||||
echo -e "${RED}ERROR: Missing tool '$tool_name' ${NC}"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
# check the project root folder
|
||||
if [ ! -d "$project_root" ]; then
|
||||
echo -e "${RED}ERROR: Cannot find the folder '$project_root' ${NC}"
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ project_root="$1"
|
|||
ssh_package="$2"
|
||||
|
||||
# check the required tools
|
||||
TOOL_LIST="unzip"
|
||||
TOOL_LIST="unzip grep sed"
|
||||
for tool_name in $TOOL_LIST; do
|
||||
echo "Checking tool: $tool_name"
|
||||
tool_path=$(which "$tool_name")
|
||||
|
|
|
|||
|
|
@ -13,6 +13,17 @@ fi
|
|||
project_root="$1"
|
||||
startup_script="$2"
|
||||
|
||||
# check the required tools
|
||||
TOOL_LIST="sed"
|
||||
for tool_name in $TOOL_LIST; do
|
||||
echo "Checking tool: $tool_name"
|
||||
tool_path=$(which "$tool_name")
|
||||
if [ -z "$tool_path" ]; then
|
||||
echo -e "${RED}ERROR: Missing tool '$tool_name' ${NC}"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
# Check if $startup_script is available
|
||||
if [ ! -f "$project_root/RESOURCES/OPTIONS/startup_script/$startup_script" ]; then
|
||||
echo -e "${RED}ERROR: Cannot find the file '$startup_script' ${NC}"
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ webcam_package="$2"
|
|||
# check the required tools
|
||||
app_version_tool=$(which app_version.sh)
|
||||
app_model_tool=$(which app_model.sh)
|
||||
TOOL_LIST="unzip app_version.sh app_model.sh"
|
||||
TOOL_LIST="unzip app_version.sh app_model.sh dd printf"
|
||||
for tool_name in $TOOL_LIST; do
|
||||
echo "Checking tool: $tool_name"
|
||||
tool_path=$(which "$tool_name")
|
||||
|
|
|
|||
15
pack.sh
15
pack.sh
|
|
@ -12,7 +12,7 @@ installed_options="installed_options.log"
|
|||
FILES="sw-description sw-description.sig boot-resource uboot boot0 kernel rootfs dsp0 cpio_item_md5"
|
||||
|
||||
# check the required tools
|
||||
TOOL_LIST="grep md5sum openssl sha256sum mksquashfs python3 auto_install.py"
|
||||
TOOL_LIST="grep md5sum openssl wc awk sha256sum mksquashfs python3 auto_install.py"
|
||||
for tool_name in $TOOL_LIST; do
|
||||
echo "Checking tool: $tool_name"
|
||||
tool_path=$(which "$tool_name")
|
||||
|
|
@ -40,12 +40,20 @@ cd unpacked || exit 2
|
|||
rm -rf rootfs
|
||||
mksquashfs squashfs-root rootfs -comp xz -all-root
|
||||
|
||||
# check if the updated rootfs can fit in the partitions rootfsA/B
|
||||
file_size=$(wc -c rootfs | awk '{print $1}')
|
||||
if [ "$file_size" -ge 134217729 ]; then
|
||||
echo -e "${RED}ERROR: The size of the file 'unpacked/rootfs' is larger than the max 128MB allowed.\Please disable some of the less important options and try again! ${NC}"
|
||||
cd ..
|
||||
exit 3
|
||||
fi
|
||||
|
||||
# check the input files
|
||||
for i in $FILES; do
|
||||
if [ "$i" != "cpio_item_md5" ] && [ ! -f "$i" ]; then
|
||||
echo -e "${RED}ERROR: Cannot find the input file '$i' ${NC}"
|
||||
cd ..
|
||||
exit 3
|
||||
exit 4
|
||||
fi
|
||||
done
|
||||
|
||||
|
|
@ -59,7 +67,8 @@ for i in $FILES; do
|
|||
sed -i -e "s/$hash_old/$hash_new/g" sw-description
|
||||
else
|
||||
echo -e "${RED}ERROR: Cannot find the hash for: '$i' ${NC}"
|
||||
exit 4
|
||||
cd ..
|
||||
exit 5
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
|
|
|||
2
patch.sh
2
patch.sh
|
|
@ -27,7 +27,7 @@ if [ ! -f "$optionsfile" ]; then
|
|||
fi
|
||||
|
||||
# check the required tools
|
||||
TOOL_LIST="awk"
|
||||
TOOL_LIST="awk head sed"
|
||||
for tool_name in $TOOL_LIST; do
|
||||
echo "Checking tool: $tool_name"
|
||||
tool_path=$(which "$tool_name")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue