Add first device for tests - tp-link-tapo-c110

This commit is contained in:
Signor Pellegrino (from Citadel PC)
2023-11-30 21:03:46 +03:00
parent ca0a2c9be0
commit 1886d5d28f
4 changed files with 262 additions and 2 deletions

View File

@@ -10,18 +10,27 @@ _Experimental system for building OpenIPC firmware for known devices_
- Specialized storage location for customized firmware for well-known devices.
### Preparing and using the project
```
sudo apt-get update -y
sudo apt-get install -y automake autotools-dev bc build-essential curl fzf git libtool rsync unzip mc tree python-is-python3
git clone https://github.com/openipc/builder.git
cd builder
./building.sh
```
### List of known devices
```
Imou IPC-C22EP-S2 SSC325DE SC2239 RTL8188FU NAND_? preparation
Imou IPC-F22AP SSC325 SC2239 - NOR_? preparation
Imou IPC-F22AP SSC325 SC2239 - NOR_? preparation
Rostelecom IPC8232SWC-WE-B SSC337DE OS02G10 RTL8188FU NOR_16M preparation
Smartwares CIP-37210 HI3518EV200 RTL8188FU NOR_? preparation
Switcam HS303 HI3518EV200 RTL8188FU NOR_16M preparation
Switcam HS303 v2 HI3518EV200 OV9732 RTL8188EU NOR_16M preparation
Switcam HS303 v3 HI3518EV200 NOR_16M preparation
TP-Link Tapo C110 SSC333 SC3338 SSW101B NOR_8M preparation
TP-Link Tapo C110 SSC333 SC3338 SSW101B NOR_8M first for test
Uniview C1L-2WN-G-RU SSC337DE OS02G10 RTL8188FU NOR_16M preparation
```

127
building.sh Executable file
View File

@@ -0,0 +1,127 @@
#!/bin/bash
#
# OpenIPC | version 2023.11.30
# Autoupdate BUILDER repo
# Remove old building folder (for full rebuild)
# Download OpenIPC repo
# Copy files from Device Overlay
# Build Firmware
# Copy Kernel and Rootfs to Archive
# Copy Kernel and Rootfs to TFTP server
RELEASE=""
DEVICE="$1"
TFTP_STORAGE="root@172.17.32.17:/mnt/bigger-2tb/Rotator/TFTP"
BUILDER_DIR=$(pwd)
FIRMWARE_DIR="${BUILDER_DIR}/openipc"
TIMESTAMP=$(date +"%Y%m%d%H%M")
VERSION=$(stat -c"%Y" $0)
echo_c() {
# 30 grey, 31 red, 32 green, 33 yellow, 34 blue, 35 magenta, 36 cyan, 37 white
t="\e[1;$1m$2\e[0m" || t="$2"
echo -e "$t"
}
copy_to_archive() {
echo_c 32 "Copying files to local archive"
mkdir -p "${BUILDER_DIR}/archive/${DEVICE}/${TIMESTAMP}"
cp -a \
${FIRMWARE_DIR}/output/images/rootfs.squashfs.* \
${FIRMWARE_DIR}/output/images/uImage.* \
${FIRMWARE_DIR}/output/images/*.tar \
${FIRMWARE_DIR}/output/images/openipc.*.tgz \
${BUILDER_DIR}/archive/${DEVICE}/${TIMESTAMP}
if [ -f "${FIRMWARE_DIR}/output/images/autoupdate-kernel.img" ] ; then
cp -a ${FIRMWARE_DIR}/output/images/autoupdate* ${BUILDER_DIR}/archive/${DEVICE}/${TIMESTAMP}
fi
echo_c 35 "\nAssembled firmware available in:"
tree -C "${BUILDER_DIR}/archive/${DEVICE}/${TIMESTAMP}"
}
copy_to_tftp() {
echo_c 32 "\nCopying files to a TFTP server using SCP protocol"
scp -r \
${FIRMWARE_DIR}/output/images/rootfs.squashfs.* \
${FIRMWARE_DIR}/output/images/uImage.* \
${FIRMWARE_DIR}/output/images/openipc.*.tgz \
${TFTP_STORAGE}
if [ -f "${FIRMWARE_DIR}/output/images/autoupdate-kernel.img" ] ; then
scp -r ${FIRMWARE_DIR}/output/images/autoupdate* ${TFTP_STORAGE}
fi
}
select_device() {
AVAILABLE_DEVICES=$(ls -1 ${BUILDER_DIR}/devices | grep '_')
cmd="whiptail --title \"Available devices\" --menu \"Please select a device from the list below:\" 25 78 16"
for p in $AVAILABLE_DEVICES; do cmd="${cmd} \"$p\" \"\""; done
DEVICE=$(eval "${cmd} 3>&1 1>&2 2>&3")
if [ $? != 0 ]; then
echo_c 31 "Cancelled."
exit 1
fi
}
copy_extra_packages() {
extra_packages=${BUILDER_DIR}/packages
firmware_packages=${FIRMWARE_DIR}/general/package
cp -afv $extra_packages/* $firmware_packages
packages_list_file=$firmware_packages/Config.in
for f in "$extra_packages"/*
do
package_name=$(basename $f)
if ! grep -Fq "$package_name" $packages_list_file
then
printf 'source "$BR2_EXTERNAL_GENERAL_PATH/package/%s/Config.in"\n' $package_name >> $packages_list_file
fi
done
}
echo_c 37 "Experimental system for building OpenIPC firmware for known devices"
echo_c 30 "https://openipc.org/"
echo_c 30 "Version: ${VERSION}"
while [ -z "${DEVICE}" ]; do select_device; done
echo_c 31 "\nStarting a device for ${DEVICE}"
tree -C ${BUILDER_DIR}/devices/${DEVICE}
sleep 3
echo_c 33 "\nUpdating Builder"
git pull
rm -rf openipc # Weed work with this command
if [ ! -d "$FIRMWARE_DIR" ]; then
echo_c 33 "\nDownloading Firmware"
git clone --depth=1 https://github.com/OpenIPC/firmware.git "$FIRMWARE_DIR"
cd "$FIRMWARE_DIR"
else
echo_c 33 "\nUpdating Firmware"
cd "$FIRMWARE_DIR"
# git reset HEAD --hard
# git pull --rebase
fi
echo_c 33 "\nCopying extra packages"
# cp -afv ${BUILDER_DIR}/packages/* ${FIRMWARE_DIR}/general/package
copy_extra_packages
echo_c 33 "\nCopying device files"
cp -afv ${BUILDER_DIR}/devices/${DEVICE}/* ${FIRMWARE_DIR}
echo_c 33 "\nBuilding the device"
./building.sh ${DEVICE}
copy_to_archive
# copy_to_tftp
echo_c 35 "\nDone"
cd "$BUILDER_DIR"

View File

@@ -0,0 +1,121 @@
# Architecture
BR2_arm=y
BR2_cortex_a7=y
BR2_ARM_EABIHF=y
BR2_ARM_FPU_NEON_VFPV4=y
BR2_ARM_INSTRUCTIONS_THUMB2=y
BR2_KERNEL_HEADERS_VERSION=y
BR2_DEFAULT_KERNEL_VERSION="4.9.84"
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y
# Toolchain
BR2_PER_PACKAGE_DIRECTORIES=y
BR2_GCC_VERSION_12_X=y
# BR2_TOOLCHAIN_USES_UCLIBC is not set
# BR2_TOOLCHAIN_BUILDROOT_UCLIBC is not set
# BR2_TOOLCHAIN_BUILDROOT_LIBC="uclibc"
BR2_TOOLCHAIN_USES_MUSL=y
BR2_TOOLCHAIN_BUILDROOT_MUSL=y
BR2_TOOLCHAIN_BUILDROOT_LIBC="musl"
BR2_TOOLCHAIN_BUILDROOT_CXX=y
# BR2_TOOLCHAIN_BUILDROOT_LOCALE is not set
BR2_TOOLCHAIN_BUILDROOT_USE_SSP=y
# Kernel
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/openipc/linux/archive/$(OPENIPC_KERNEL).tar.gz"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(EXTERNAL_VENDOR)/board/infinity6b0/kernel/infinity6b0-ssc009a.config"
BR2_LINUX_KERNEL_UIMAGE=y
BR2_LINUX_KERNEL_XZ=y
# OpenIPC
BR2_OPENIPC_SOC_VENDOR="sigmastar"
BR2_OPENIPC_SOC_MODEL="ssc335"
BR2_OPENIPC_SOC_FAMILY="infinity6b0"
BR2_OPENIPC_FLAVOR="lite"
BR2_OPENIPC_FLASH_SIZE="8"
# Filesystem
# BR2_TARGET_TZ_INFO is not set
BR2_TARGET_ROOTFS_CPIO=y
BR2_TARGET_ROOTFS_SQUASHFS=y
BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y
BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL)/overlay"
BR2_ROOTFS_POST_BUILD_SCRIPT="$(BR2_EXTERNAL)/scripts/rootfs_script.sh"
# OpenIPC configuration
BR2_TOOLCHAIN_BUILDROOT_VENDOR="openipc"
BR2_TARGET_GENERIC_ISSUE="Welcome to OpenIPC"
BR2_TARGET_GENERIC_HOSTNAME="openipc-ssc335"
BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL)/package/all-patches"
# OpenIPC packages
BR2_PACKAGE_AWS_WEBRTC=y
BR2_PACKAGE_BUSYBOX_CONFIG="$(BR2_EXTERNAL)/package/busybox/busybox.config"
BR2_PACKAGE_DROPBEAR_OPENIPC=y
# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
# BR2_PACKAGE_FDK_AAC_OPENIPC is not set
BR2_PACKAGE_UBOOT_TOOLS=y
BR2_PACKAGE_HASERL=y
BR2_PACKAGE_IPCTOOL=y
BR2_PACKAGE_JSON_C=y
BR2_PACKAGE_JSONFILTER=y
BR2_PACKAGE_LIBCURL_OPENIPC=y
BR2_PACKAGE_LIBCURL_OPENIPC_CURL=y
# BR2_PACKAGE_LIBCURL_OPENIPC_VERBOSE is not set
# BR2_PACKAGE_LIBCURL_OPENIPC_PROXY_SUPPORT is not set
# BR2_PACKAGE_LIBCURL_OPENIPC_COOKIES_SUPPORT is not set
# BR2_PACKAGE_LIBCURL_OPENIPC_EXTRA_PROTOCOLS_FEATURES is not set
BR2_PACKAGE_LIBCURL_OPENIPC_MBEDTLS=y
BR2_PACKAGE_LIBEVENT_OPENIPC=y
BR2_PACKAGE_LIBEVENT_OPENIPC_REMOVE_PYSCRIPT=y
BR2_PACKAGE_LIBOGG_OPENIPC=y
BR2_PACKAGE_LIBYAML=y
BR2_PACKAGE_MAJESTIC=y
BR2_PACKAGE_MAJESTIC_FONTS=y
BR2_PACKAGE_MBEDTLS_OPENIPC=y
# BR2_PACKAGE_MBEDTLS_OPENIPC_PROGRAMS is not set
# BR2_PACKAGE_MBEDTLS_OPENIPC_COMPRESSION is not set
BR2_PACKAGE_MICROBE_WEB=y
# BR2_PACKAGE_MINI_SNMPD is not set
# BR2_PACKAGE_MOTORS is not set
BR2_PACKAGE_OPUS_OPENIPC=y
BR2_PACKAGE_OPUS_OPENIPC_FIXED_POINT=y
BR2_PACKAGE_SIGMASTAR_OSDRV_INFINITY6B0=y
BR2_PACKAGE_EXFAT_OPENIPC=y
BR2_PACKAGE_EXFATPROGS=y
# BR2_PACKAGE_SSHPASS is not set
# BR2_PACKAGE_UACME_OPENIPC is not set
BR2_PACKAGE_VTUND_OPENIPC=y
BR2_PACKAGE_YAML_CLI=y
BR2_PACKAGE_ZLIB=y
# Wireless
BR2_PACKAGE_WIRELESS_TOOLS=y
BR2_PACKAGE_WPA_SUPPLICANT=y
BR2_PACKAGE_WPA_SUPPLICANT_CLI=y
BR2_PACKAGE_WPA_SUPPLICANT_NL80211=y
BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y
# BR2_PACKAGE_RTL8188EU is not set
# BR2_PACKAGE_RTL8192EU_OPENIPC is not set
BR2_PACKAGE_SSW101B=y
# Debug
# BR2_PACKAGE_HOST_GDB is not set
# BR2_PACKAGE_GDB is not set
# CCACHE
BR2_CCACHE=y
BR2_CCACHE_DIR="$(HOME)/.ccache"
# External
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="arm-openipc-linux-musleabihf"
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_9=y
BR2_TOOLCHAIN_EXTERNAL_URL="https://github.com/openipc/firmware/releases/download/$(OPENIPC_TOOLCHAIN).tgz"

View File

@@ -0,0 +1,3 @@
#
Experimental system for building OpenIPC firmware for known devices
#