mirror of https://github.com/OpenIPC/firmware.git
[no ci] Scripts: formatting
parent
6d0651ceaf
commit
eb4406179c
|
@ -10,13 +10,13 @@ date +TIME_STAMP=%s >> ${FILE}
|
||||||
|
|
||||||
CONF="INGENIC_OSDRV_T30=y|LIBV4L=y|MAVLINK_ROUTER=y|WIFIBROADCAST=y|WEBRTC_AUDIO_PROCESSING=y"
|
CONF="INGENIC_OSDRV_T30=y|LIBV4L=y|MAVLINK_ROUTER=y|WIFIBROADCAST=y|WEBRTC_AUDIO_PROCESSING=y"
|
||||||
if ! grep -q "USES_GLIBC" ${BR2_CONFIG} && ! grep -qP ${CONF} ${BR2_CONFIG}; then
|
if ! grep -q "USES_GLIBC" ${BR2_CONFIG} && ! grep -qP ${CONF} ${BR2_CONFIG}; then
|
||||||
rm -f ${TARGET_DIR}/usr/lib/libstdc++*
|
rm -f ${TARGET_DIR}/usr/lib/libstdc++*
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if grep -q "USES_MUSL" ${BR2_CONFIG}; then
|
if grep -q "USES_MUSL" ${BR2_CONFIG}; then
|
||||||
LIST=${BR2_EXTERNAL}/scripts/excludes/${OPENIPC_SOC_MODEL}_${OPENIPC_FLAVOR}.list
|
LIST=${BR2_EXTERNAL}/scripts/excludes/${OPENIPC_SOC_MODEL}_${OPENIPC_FLAVOR}.list
|
||||||
test -e ${LIST} && xargs -a ${LIST} -I % rm -f ${TARGET_DIR}%
|
test -e ${LIST} && xargs -a ${LIST} -I % rm -f ${TARGET_DIR}%
|
||||||
|
|
||||||
ln -sf libc.so ${TARGET_DIR}/lib/ld-uClibc.so.0
|
ln -sf libc.so ${TARGET_DIR}/lib/ld-uClibc.so.0
|
||||||
ln -sf ../../lib/libc.so ${TARGET_DIR}/usr/bin/ldd
|
ln -sf ../../lib/libc.so ${TARGET_DIR}/usr/bin/ldd
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -3,87 +3,87 @@
|
||||||
shopt -s nullglob
|
shopt -s nullglob
|
||||||
|
|
||||||
toolchain_by_config() {
|
toolchain_by_config() {
|
||||||
CF=$1
|
CF=$1
|
||||||
FMT=$2
|
FMT=$2
|
||||||
|
|
||||||
BR2_VER=$(grep BR2_DEFAULT_KERNEL_VERSION $CF)
|
BR2_VER=$(grep BR2_DEFAULT_KERNEL_VERSION $CF)
|
||||||
if [ -n "$BR2_VER" ]; then
|
if [ -n "$BR2_VER" ]; then
|
||||||
VENDOR=$(echo $CF | cut -d - -f 4 | cut -d / -f 1 | sed -r 's/\<./\U&/g')
|
VENDOR=$(echo $CF | cut -d - -f 4 | cut -d / -f 1 | sed -r 's/\<./\U&/g')
|
||||||
KVER=$(echo $BR2_VER | cut -d \" -f 2 | awk -F . '{printf "%s_%s", $1, $2}')
|
KVER=$(echo $BR2_VER | cut -d \" -f 2 | awk -F . '{printf "%s_%s", $1, $2}')
|
||||||
GCC_VER=$(sed -rn "s/^BR2_GCC_VERSION_([0-9]*)_X=y/\1/p" $CF)
|
GCC_VER=$(sed -rn "s/^BR2_GCC_VERSION_([0-9]*)_X=y/\1/p" $CF)
|
||||||
ARCH=$(sed -rn "s/^BR2_(arm[a-z0-9_]+)=y/\1/p" $CF)
|
ARCH=$(sed -rn "s/^BR2_(arm[a-z0-9_]+)=y/\1/p" $CF)
|
||||||
if [ -z "$ARCH" ]; then
|
if [ -z "$ARCH" ]; then
|
||||||
ARCH=$(sed -rn "s/^BR2_(cortex_[a-z0-9_]+)=y/\1/p" $CF)
|
ARCH=$(sed -rn "s/^BR2_(cortex_[a-z0-9_]+)=y/\1/p" $CF)
|
||||||
fi
|
fi
|
||||||
if [ -z "$ARCH" ]; then
|
if [ -z "$ARCH" ]; then
|
||||||
ARCH=$(sed -rn "s/^BR2_(arm)=y/\1/p" $CF)
|
ARCH=$(sed -rn "s/^BR2_(arm)=y/\1/p" $CF)
|
||||||
else
|
else
|
||||||
# Here we have something from ARM modern family
|
# Here we have something from ARM modern family
|
||||||
HF=$(sed -rn "s/^BR2_ARM_EABI(HF)=y/\1/p" $CF | tr '[:upper:]' '[:lower:]')
|
HF=$(sed -rn "s/^BR2_ARM_EABI(HF)=y/\1/p" $CF | tr '[:upper:]' '[:lower:]')
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$ARCH" ]; then
|
if [ -z "$ARCH" ]; then
|
||||||
ARCH=$(sed -rn "s/^BR2_(mips_[a-z]*)=y/\1/p" $CF)
|
ARCH=$(sed -rn "s/^BR2_(mips_[a-z]*)=y/\1/p" $CF)
|
||||||
else
|
else
|
||||||
THUMB=$(sed -rn "s/^BR2_ARM_INSTRUCTIONS_(THUMB2)=y/\1/p" $CF)
|
THUMB=$(sed -rn "s/^BR2_ARM_INSTRUCTIONS_(THUMB2)=y/\1/p" $CF)
|
||||||
if [ -n "$THUMB" ]; then
|
if [ -n "$THUMB" ]; then
|
||||||
ARCH="${ARCH}_${THUMB,,}"
|
ARCH="${ARCH}_${THUMB,,}"
|
||||||
fi
|
fi
|
||||||
if [ -n "$HF" ]; then
|
if [ -n "$HF" ]; then
|
||||||
ARCH="${ARCH}_${HF}"
|
ARCH="${ARCH}_${HF}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LIBC=$(sed -rn "s/^BR2_TOOLCHAIN_BUILDROOT_LIBC=\"(.*)\"/\1/p" $CF)
|
LIBC=$(sed -rn "s/^BR2_TOOLCHAIN_BUILDROOT_LIBC=\"(.*)\"/\1/p" $CF)
|
||||||
|
|
||||||
SOC=$(echo $CF | cut -d _ -f 3)
|
SOC=$(echo $CF | cut -d _ -f 3)
|
||||||
case $FMT in
|
case $FMT in
|
||||||
list)
|
list)
|
||||||
echo $ARCH $GCC_VER $LIBC $KVER $VENDOR $CF
|
echo $ARCH $GCC_VER $LIBC $KVER $VENDOR $CF
|
||||||
;;
|
;;
|
||||||
uniq)
|
uniq)
|
||||||
echo $ARCH $GCC_VER $LIBC $KVER
|
echo $ARCH $GCC_VER $LIBC $KVER
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
if [ -n "$2" ]; then
|
if [ -n "$2" ]; then
|
||||||
BR_DIR=buildroot-$2
|
BR_DIR=buildroot-$2
|
||||||
GCC_VER=$(sed -rn \
|
GCC_VER=$(sed -rn \
|
||||||
"s/^\s+default\s+\"([0-9.]+)\"\s+if BR2_GCC_VERSION_${GCC_VER}_X/\1/p" \
|
"s/^\s+default\s+\"([0-9.]+)\"\s+if BR2_GCC_VERSION_${GCC_VER}_X/\1/p" \
|
||||||
$BR_DIR/package/gcc/Config.in.host)
|
$BR_DIR/package/gcc/Config.in.host)
|
||||||
case $LIBC in
|
case $LIBC in
|
||||||
musl)
|
musl)
|
||||||
VER=$(sed -rn "s/^MUSL_VERSION\s*=\s*([0-9.]+)/\1/p" \
|
VER=$(sed -rn "s/^MUSL_VERSION\s*=\s*([0-9.]+)/\1/p" \
|
||||||
$BR_DIR/package/musl/musl.mk)
|
$BR_DIR/package/musl/musl.mk)
|
||||||
;;
|
;;
|
||||||
uclibc)
|
uclibc)
|
||||||
VER=$(sed -rn "s/^UCLIBC_VERSION\s*=\s*([0-9.]+)/\1/p" \
|
VER=$(sed -rn "s/^UCLIBC_VERSION\s*=\s*([0-9.]+)/\1/p" \
|
||||||
$BR_DIR/package/uclibc/uclibc.mk)
|
$BR_DIR/package/uclibc/uclibc.mk)
|
||||||
;;
|
;;
|
||||||
glibc)
|
glibc)
|
||||||
VER=$(sed -rn "s/^GLIBC_VERSION\s*=\s*([0-9.]+).*/\1/p" \
|
VER=$(sed -rn "s/^GLIBC_VERSION\s*=\s*([0-9.]+).*/\1/p" \
|
||||||
$BR_DIR/package/glibc/glibc.mk | tail -1)
|
$BR_DIR/package/glibc/glibc.mk | tail -1)
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
HASH=$(echo $VER | sha1sum | cut -c 1-8)
|
HASH=$(echo $VER | sha1sum | cut -c 1-8)
|
||||||
echo ${ARCH}-gcc${GCC_VER}-${LIBC}-${KVER}-${HASH}
|
echo ${ARCH}-gcc${GCC_VER}-${LIBC}-${KVER}-${HASH}
|
||||||
else
|
else
|
||||||
echo ${ARCH}-gcc${GCC_VER}-${LIBC}-${KVER}
|
echo ${ARCH}-gcc${GCC_VER}-${LIBC}-${KVER}
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ $# -eq 0 ]; then
|
if [ $# -eq 0 ]; then
|
||||||
$0 list | sort
|
$0 list | sort
|
||||||
else
|
else
|
||||||
if [ "$1" != "list" ] && [ "$1" != "uniq" ]; then
|
if [ "$1" != "list" ] && [ "$1" != "uniq" ]; then
|
||||||
toolchain_by_config $1 $2
|
toolchain_by_config $1 $2
|
||||||
else
|
else
|
||||||
for D in br-ext-chip-*; do
|
for D in br-ext-chip-*; do
|
||||||
for CF in $D/configs/*; do
|
for CF in $D/configs/*; do
|
||||||
toolchain_by_config $CF $1
|
toolchain_by_config $CF $1
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -4,21 +4,21 @@ INDIR=br-ext-chip-hisilicon/board/hi3516ev200/kernel
|
||||||
OUTDIR=br-ext-chip-goke/board/gk7205v200/kernel
|
OUTDIR=br-ext-chip-goke/board/gk7205v200/kernel
|
||||||
|
|
||||||
function map_soc() {
|
function map_soc() {
|
||||||
case $1 in
|
case $1 in
|
||||||
hi3516ev200) NEW_SOC=gk7205v200 ;;
|
hi3516ev200) NEW_SOC=gk7205v200 ;;
|
||||||
hi3516dv200) NEW_SOC=gk7605v100 ;;
|
hi3516dv200) NEW_SOC=gk7605v100 ;;
|
||||||
hi3516ev300) NEW_SOC=gk7205v300 ;;
|
hi3516ev300) NEW_SOC=gk7205v300 ;;
|
||||||
hi3518ev300) NEW_SOC=gk7202v300 ;;
|
hi3518ev300) NEW_SOC=gk7202v300 ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
pushd $(git rev-parse --show-toplevel) > /dev/null
|
pushd $(git rev-parse --show-toplevel) > /dev/null
|
||||||
for FILENAME in ${INDIR}/*.config; do
|
for FILENAME in ${INDIR}/*.config; do
|
||||||
OLD_CONFIG=$(basename $FILENAME)
|
OLD_CONFIG=$(basename $FILENAME)
|
||||||
OLD_SOC=$(echo $OLD_CONFIG | cut -f 1 -d .)
|
OLD_SOC=$(echo $OLD_CONFIG | cut -f 1 -d .)
|
||||||
map_soc $OLD_SOC
|
map_soc $OLD_SOC
|
||||||
NEW_CONFIG=$(echo $OLD_CONFIG | sed "s/$OLD_SOC/$NEW_SOC/")
|
NEW_CONFIG=$(echo $OLD_CONFIG | sed "s/$OLD_SOC/$NEW_SOC/")
|
||||||
general/scripts/clone_hisi2goke.sh $INDIR/$OLD_CONFIG $OUTDIR/$NEW_CONFIG
|
general/scripts/clone_hisi2goke.sh $INDIR/$OLD_CONFIG $OUTDIR/$NEW_CONFIG
|
||||||
git add $OUTDIR/$NEW_CONFIG
|
git add $OUTDIR/$NEW_CONFIG
|
||||||
done
|
done
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
|
|
Loading…
Reference in New Issue