File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,8 @@ for i in {1000..1005}; do
104104done
105105# No password for sudo
106106/bin/sed -i "s/.*sudo.*ALL=(ALL:ALL) ALL/%sudo ALL=(ALL) NOPASSWD:ALL/" /etc/sudoers
107+ # 移除奇怪的软链接
108+ [ -L /bin/X11 ] && /bin/unlink /bin/X11
107109EOF
108110
109111chroot $ROOT /bin/bash /config.sh
@@ -115,17 +117,18 @@ source `dirname ${BASH_SOURCE[0]}`/xnoshm.sh $1
115117
116118
117119# 卸载不必要组件
118- cat > $ROOT /clean.sh << EOF
120+ if [ ! -f $ROOT /clean.sh ]; then
121+ cat > $ROOT /clean.sh << EOF
119122# Save space
120- [ -L /bin/X11 ] && /bin/unlink /bin/X11
121123/bin/rm -rf /usr/share/doc
122124/bin/rm -rf /usr/share/man
123125/bin/rm -rf /tmp/*
124126
125127# Clean up and exit
126128no_need_pkgs="bsdmainutils compton debconf-i18n \
127129 fonts-noto-core fonts-symbola gdbm-l10n iptables \
128- logrotate menu tasksel tzdata vim-common whiptail xxd
130+ logrotate menu tasksel tzdata vim-common \
131+ whiptail xxd
129132 "
130133for i in \$ no_need_pkgs; do
131134 /bin/echo [ /bin/apt purge \$ i ]
137140EOF
138141
139142chroot $ROOT /bin/bash /clean.sh
140- rm -f $ROOT /clean.sh
143+ fi
141144
142145
143146# 确保宿主机当前用户相关目录或文件存在
You can’t perform that action at this time.
0 commit comments