diff --git a/02_build_img.sh b/02_build_img.sh index d42ef73..66d71e7 100755 --- a/02_build_img.sh +++ b/02_build_img.sh @@ -16,21 +16,12 @@ # #---------------------------------------------- echo "${CYAN}--- build disk --- ${NC}" -# 创建磁盘 64M +# 创建磁盘 128M 或 256M if [ "${with_gcc}" = false ]; then - dd if=/dev/zero of=disk.img bs=1M count=128 + create_disk disk.img 128 else - dd if=/dev/zero of=disk.img bs=1M count=256 + create_disk disk.img 256 fi -# 对磁盘进行分区一个主分区 -fdisk disk.img << EOF -n -p - - - -w -EOF echo "${GREEN}+++ build disk ok +++${NC}" # 磁盘镜像挂载到具体设备 diff --git a/common.sh b/common.sh index c659d0c..1700a96 100755 --- a/common.sh +++ b/common.sh @@ -74,3 +74,21 @@ ls_dir() { done } +# 创建一个磁盘文件并分区 +create_disk() { +# 输入参数磁盘文件和大小 +disk=$1 +size=$2 +# 创建一个磁盘文件 +dd if=/dev/zero of=${disk} bs=1M count=${size} + +# 对磁盘进行分区一个主分区 +fdisk ${disk} << EOF +n +p + + + +w +EOF +} diff --git a/mk_sdb.sh b/mk_sdb.sh index cdb0024..17cacbb 100755 --- a/mk_sdb.sh +++ b/mk_sdb.sh @@ -1,5 +1,8 @@ #!/bin/sh +# 导入公共环境 +. ./common.sh + #---------------------------------------------- # # 制作磁盘 @@ -13,18 +16,7 @@ fi echo "${CYAN}开始制作磁盘...${NC}" # 创建磁盘 64M -dd if=/dev/zero of=extra.img bs=1M count=64 - -# 对磁盘进行分区一个主分区 -fdisk extra.img << EOF -n -p - - - -w -EOF - +create_disk extra.img 64 echo "${GREEN}磁盘制作成功!!!${NC}" echo ".........................................................." diff --git a/mk_xfce.sh b/mk_xfce.sh index b6e86d1..47d57fe 100755 --- a/mk_xfce.sh +++ b/mk_xfce.sh @@ -420,7 +420,7 @@ ms_link="-Wl,-rpath-link=${xfce_loc_lib}" # 编译 pixman if [ ! -f .pixman ]; then - echo "${CYAN}build pixman begin${NC}" && cd ${PIXMAN_SRC_DIR} && ./configure ${CFGOPT} --enable-gtk=no + echo "${CYAN}build pixman begin${NC}" && cd ${PIXMAN_SRC_DIR} && ./configure ${CFGOPT} --enable-libpng=yes make -j8 && make install DESTDIR=${xfce_install} && echo "ok" > ../.pixman || exit cd .. && echo "${GREEN}build pixman end${NC}" fi @@ -742,9 +742,12 @@ if [ "${with_xfce_test}" = true ]; then echo "xfce4-session" > ~/.xsession # xfdesktop 需要库的路径, xfdesktop 不能运行,基本上桌面就是黑屏了,可能有 dock 栏和最上面的状态栏 - echo "/root/test/a/usr/lib" > /etc/ld.so.conf.d/xfce4.conf - echo "/root/test/a/usr/local/lib" >> /etc/ld.so.conf.d/xfce4.conf - echo "/root/test/a/usr/lib/x86_64-linux-gnu" >> /etc/ld.so.conf.d/xfce4.conf + # echo "/root/test/a/usr/lib" > /etc/ld.so.conf.d/xfce4.conf + # echo "/root/test/a/usr/local/lib" >> /etc/ld.so.conf.d/xfce4.conf + # echo "/root/test/a/usr/lib/x86_64-linux-gnu" >> /etc/ld.so.conf.d/xfce4.conf + libdir=`pwd`"/a/usr" + echo "XDG_CONFIG_HOME=\"/usr/local/etc/xdg\"" >> /etc/environment + echo "LD_LIBRARY_PATH=\"${libdir}/lib:${libdir}/local/lib:${libdir}/lib/x86_64-linux-gnu\"" >> /etc/environment # 重启系统,然后可以利用 windows 下 remote desktop 体验最新版本的 xfce4 了, 最新版本的 xfce4 还是很漂亮的 # reboot