install.x.KT2.KT3.zh.CN.UTF8.sh
Code:
#!/bin/sh
root=/mnt/base-us/root
img=$root.ext3
mkdir -p $root
fsck.ext3 $img
mount -o loop $img $root || exit
cat > $root/root/inst.sh << 'EOF'
apt update
apt install -f -y
apt full-upgrade -y
apt install -y locales
sed -i '/zh_CN.UTF-8/s/^#//' /etc/locale.gen
locale-gen zh_CN.UTF-8
apt install -y xserver-xephyr xfce4 onboard xfce4-terminal fonts-wqy-microhei fcitx-googlepinyin
EOF
#APT::Install-Recommends "0";
#APT::Install-Suggests "0";
cat >> $root/etc/apt/apt.conf << 'EOF'
APT::Sandbox::User root;
EOF
cat > $root/usr/local/bin/start-x-flip << 'EOF'
#!/bin/bash
export DISPLAY=:0
Xephyr :1 -title "L:A_N:application_ID:xephyr_O:R_PC:N" -screen 800x600 -cc 4 -dpi 167 -nocursor &
sleep 3
export DISPLAY=:1
startxfce4
EOF
mkdir -p $root/usr/share/applications/
cat > $root/usr/share/applications/stopx.desktop << 'EOF'
[Desktop Entry]
Categories=Network;InstantMessaging;GTK;GNOME;
Name=Stop X
Version=1.0
Exec=killall Xephyr xfce4-session
Terminal=false
Type=Application
EOF
chmod +x $root/root/inst.sh
chmod +x $root/usr/local/bin/start-x-flip
umount $root
/mnt/us/chroot.sh root/inst.sh
mount -o loop $img $root || exit
rm $root/root/inst.sh
umount $root