From cf7f3da1bf5bf65af2f2ed166eff60bb8aec8eea Mon Sep 17 00:00:00 2001 From: superconvert Date: Mon, 26 Sep 2022 12:56:15 +0000 Subject: [PATCH] add xfce into image --- 01_build_src.sh | 5 ----- 02_build_img.sh | 21 +++++++++++++++++++++ common.sh | 3 --- mk_strip.sh | 4 ++++ 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/01_build_src.sh b/01_build_src.sh index 4291571..ff4542d 100755 --- a/01_build_src.sh +++ b/01_build_src.sh @@ -159,11 +159,6 @@ fi cd .. -# 编译 xorg [ no same time with xfce ] -if [ "${with_xorg}" = true ]; then - ./mk_xorg.sh -fi - # 编译 xfce [ no same time with xorg ] if [ "${with_xfce}" = true ]; then ./mk_xfce.sh diff --git a/02_build_img.sh b/02_build_img.sh index 66d71e7..69a52d9 100755 --- a/02_build_img.sh +++ b/02_build_img.sh @@ -173,6 +173,12 @@ if [ "${with_gcc}" = true ]; then fi rm -rf ${diskfs}/init ${diskfs}/lost+found +# 带有 xfce 编译器 +if [ "${with_xfce}" = true ]; then + echo "${RED}build xfce desktop${NC}" + cp ${xfce_install}/* ${diskfs} -r -n +fi + # 测试用户登陆模式: root/123456 if [ "${with_login}" = true ]; then echo "${RED} with-login --- it's an exciting time ${NC}" @@ -235,6 +241,21 @@ route add default gw 192.168.100.1 # exec 执行 /etc/init.d/rc.local 脚本 EOF chmod +x ${diskfs}/etc/init.d/rcS + + +# 登陆 login shell ,非 non-login shell +if [ "${with_login}" = true ]; then +cat - > ${diskfs}/etc/profile << EOF +export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +export LD_LIBRARY_PATH=/usr/lib:/usr/lib64:/usr/local/lib:/usr/lib/x86_64-linux-gnu +EOF +else +cat - > ${diskfs}/etc/bash.bashrc << EOF +export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +export LD_LIBRARY_PATH=/usr/lib:/usr/lib64:/usr/local/lib:/usr/lib/x86_64-linux-gnu +EOF +fi + echo "${GREEN}+++ build diskfs ok +++${NC}" # 卸载映射 diff --git a/common.sh b/common.sh index c15ff58..f7c12ba 100755 --- a/common.sh +++ b/common.sh @@ -21,9 +21,6 @@ core_num=`nproc` # 是否开启 gcc with_gcc=true -# 是否开启 xorg -with_xorg=false - # 是否开启 xfce with_xfce=false diff --git a/mk_strip.sh b/mk_strip.sh index a1be920..f55075a 100755 --- a/mk_strip.sh +++ b/mk_strip.sh @@ -42,3 +42,7 @@ strip_dir ${gcc_install} #rm -rf work/binutils_install/usr/share strip_dir ${binutils_install} +# strip xfce +if [ "${with_xfce}" = true ]; then + strip_dir ${xfce_install} +fi