2022-08-06 00:17:23 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
red='\e[0;41m' # 红色
|
|
|
|
RED='\e[1;31m'
|
|
|
|
green='\e[0;32m' # 绿色
|
|
|
|
GREEN='\e[1;32m'
|
|
|
|
yellow='\e[5;43m' # 黄色
|
|
|
|
YELLOW='\e[1;33m'
|
|
|
|
blue='\e[0;34m' # 蓝色
|
|
|
|
BLUE='\e[1;34m'
|
|
|
|
purple='\e[0;35m' # 紫色
|
|
|
|
PURPLE='\e[1;35m'
|
|
|
|
cyan='\e[4;36m' # 蓝绿色
|
|
|
|
CYAN='\e[1;36m'
|
|
|
|
WHITE='\e[1;37m' # 白色
|
|
|
|
NC='\e[0m' # 没有颜色
|
|
|
|
|
2022-07-31 18:36:44 +08:00
|
|
|
# 处理器
|
|
|
|
core_num=`nproc`
|
|
|
|
|
|
|
|
# 是否开启 gcc
|
2022-08-12 06:36:59 +08:00
|
|
|
with_gcc=true
|
2022-07-31 18:36:44 +08:00
|
|
|
|
2022-08-03 22:19:42 +08:00
|
|
|
# 是否开启 xorg
|
2022-08-06 04:53:40 +08:00
|
|
|
with_xorg=false
|
2022-08-03 22:19:42 +08:00
|
|
|
|
2022-08-08 06:36:26 +08:00
|
|
|
# 是否开启 xfce
|
|
|
|
with_xfce=false
|
|
|
|
|
2022-08-16 22:47:33 +08:00
|
|
|
# 开启编译后 xfce 本地测试
|
|
|
|
with_xfce_test=true
|
|
|
|
|
2022-08-01 22:57:30 +08:00
|
|
|
# 是否挂载第二块硬盘
|
|
|
|
with_sdb=false
|
|
|
|
|
|
|
|
# 是否登陆模式
|
|
|
|
with_login=false
|
|
|
|
|
2022-07-31 18:36:44 +08:00
|
|
|
# 编译工程目录
|
|
|
|
build_dir=`pwd`"/build"
|
|
|
|
|
|
|
|
# 公共目录
|
|
|
|
linux_install=${build_dir}"/linux_install"
|
|
|
|
glibc_install=${build_dir}"/glibc_install"
|
|
|
|
busybox_install=${build_dir}"/busybox_install"
|
|
|
|
gcc_install=${build_dir}"/gcc_install"
|
|
|
|
binutils_install=${build_dir}"/binutils_install"
|
2022-08-03 22:19:42 +08:00
|
|
|
xorg_install=${build_dir}"/xorg_install"
|
2022-07-31 18:36:44 +08:00
|
|
|
|
|
|
|
# 从完整路径获取文件名
|
|
|
|
file_name() {
|
|
|
|
filename=$(echo $1 | rev | awk -v FS='/' '{print $1}' | rev)
|
|
|
|
echo ${filename}
|
|
|
|
}
|
|
|
|
|
|
|
|
# 获取去掉扩展名的文件名
|
|
|
|
file_dirname() {
|
|
|
|
filename=$(file_name $1)
|
|
|
|
filedir=`echo $filename | sed "s/$2//g"`
|
|
|
|
echo $filedir
|
|
|
|
}
|
|
|
|
|
2022-08-16 22:47:33 +08:00
|
|
|
# 获取一个目录下所有的文件,包括子目录
|
|
|
|
ls_dir() {
|
|
|
|
for file in `ls $1`
|
|
|
|
do
|
|
|
|
if [ -d $1"/"$file ]
|
|
|
|
then
|
|
|
|
ls_dir $1"/"$file $2
|
|
|
|
else
|
|
|
|
file=$1"/"$file
|
|
|
|
echo ${file#$2} >> tmpfile.txt
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
2022-07-31 18:36:44 +08:00
|
|
|
|