请选择 进入手机版 | 继续访问电脑版

Linux人社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 1109|回复: 1

Kubuntu定制ISO构建脚本 放出

[复制链接]

533

主题

3617

帖子

180

积分

红旗

Rank: 5Rank: 5

积分
180
 楼主| 发表于 2016-8-24 12:05:11 | 显示全部楼层 |阅读模式
#!/bin/bash  

autoi()
{
cat < resolv
omain localdomain  
search localdomain  
nameserver 223.5.5.5
nameserver 223.6.6.6
nameserver 180.76.76.76
nameserver 114.114.114.114
dnsconf
sudo mv -f resolv ~/qomosys/run/resolvconf/resolv.conf
sudo rsync -a --exclude=kubuntu*.iso /mnt/ok-app ~/qomosys/

CHROOTDIR=~/qomosys  

sudo mount -t proc proc $CHROOTDIR/proc  
sudo umount -f $CHROOTDIR/dev 2>&1 >/den/null
sudo mount -t sysfs sysfs $CHROOTDIR/sys
sudo mount -o bind /dev $CHROOTDIR/dev
chmod +x $CHROOTDIR/ok-app/autoinstall
}
case "$@" in
cs)autoi
sudo chroot $CHROOTDIR/ /bin/bash
sudo umount -f $CHROOTDIR/dev
exit ;;
esac

sudo mkdir -p /mnt/qomoiso
sudo mkdir -p /mnt/qomosys
sudo rm -rf ~/qomosys
sudo mkdir -p ~/qomosys/var/cache/apt/archives/
sudo rm -rf ~/filesystem.*
sudo mkdir -p ~/qomoiso
sudo apt-get install squashfs-tools

sudo mount -o loop /mnt/ok-app/kubuntu*.iso /mnt/qomoiso/
sudo mount -o loop /mnt/qomoiso/casper/filesystem.squashfs /mnt/qomosys/
sudo rsync -a --exclude=casper/filesystem.squashfs /mnt/qomoiso/ ~/qomoiso/
sudo cp -a /mnt/qomosys/* ~/qomosys/

autoi
sudo chroot $CHROOTDIR/ /ok-app/autoinstall

sudo rm -rf ~/qomosys/ok-app
sudo rm -rf ~/qomosys/var/cache/apt/archives/

sudo umount $CHROOTDIR/proc
sudo umount $CHROOTDIR/sys
sudo umount -f $CHROOTDIR/dev

TARGETDIR=~/qomoiso

sudo rm -rf filesystem.squashfs filesystem.manifest filesystem.manifest-desktop
sudo mksquashfs $CHROOTDIR ~/filesystem.squashfs
sudo cp ~/filesystem.squashfs $TARGETDIR/casper
sudo chroot $CHROOTDIR dpkg-query -W --showformat=\'${Package} ${Version}\n\' | grep -v deinstall > ~/filesystem.manifest

cat < /tmp/$$.control

/casper/d
/libdebian-installer4/d
/os-prober/d
/ubiquity/d
/ubuntu-live/d
/user-setup/d

DB

sed -f /tmp/$$.control < ~/filesystem.manifest > ~/filesystem.manifest-desktop
sudo rm -rf /tmp/$$.control
sudo cp ~/filesystem.manifest $TARGETDIR/casper
sudo cp ~/filesystem.manifest-desktop $TARGETDIR/casper

sudo rm -rf ~/md5sum.txt
cd $TARGETDIR && find . -type f -print0 | xargs -0 md5sum > ../md5sum.txt

cd ~
sudo cp ~/md5sum.txt $TARGETDIR

datum=`/bin/date +"_%Y%m%d_%H%M"`
sudo mkisofs -r -V "QomoK-$datum" -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o ~/LiveCD$datum.iso $TARGETDIR



回复

使用道具 举报

533

主题

3617

帖子

180

积分

红旗

Rank: 5Rank: 5

积分
180
 楼主| 发表于 2016-8-24 12:09:06 | 显示全部楼层
#!/bin/bash

deb="
opera*86.deb
aliwangw*.deb
dazhihui*deb
deepin-music*deb
peazip*deb
netease-cloud*deb
wps-office*.deb
WineQQ*.deb
google-chrome*.deb
sogoupinyin*deb
skype*.deb
adobeair*.deb
crossover*.deb
PPSt*.deb
virtualbox*.deb
#Yozo*.deb
"
apt="
kde-l10n-zhcn
language-pack-gnome-zh-*
language-pack-zh-*
firefox
thunderbird
flashplugin-installer
multiget
gcc
fcitx
fcitx-pinyin
qt4-qtconfig
libjpeg62
libcurl3-nss
"

bin="cxcnfont.sh
cx-pro-key.sh
yong-*.bin
#qq-1*86.bin
"

del="libreoffice-avmedia-backend-gstreamer
libreoffice-base
libreoffice-base-core
libreoffice-base-drivers
libreoffice-calc
ii  libreoffice-common
libreoffice-core
libreoffice-draw
libreoffice-impress
libreoffice-java-common
libreoffice-kde
libreoffice-math
libreoffice-pdfimport
libreoffice-sdbc-firebird
libreoffice-sdbc-hsqldb
libreoffice-style-galaxy
libreoffice-style-oxygen
libreoffice-writer
openoffice.org-hyphenation
uno-libs3 ure"
patch="
qomo-kde.tgz
"

export LC_ALL=zh_CN.UTF-8
export GDM_LANG=zh_CN
export LANG=zh_CN.UTF-8
export LC_ADDRESS=zh_CN.UTF-8
export LC_IDENTIFICATION=zh_CN.UTF-8
export LC_MEASUREMENT=zh_CN.UTF-8
export LC_MONETARY=zh_CN.UTF-8
export LC_NAME=zh_CN.UTF-8
export LC_NUMERIC=zh_CN.UTF-8
export LC_PAPER=zh_CN.UTF-8
export LC_TELEPHONE=zh_CN.UTF-8
export LC_TIME=zh_CN.UTF-8

sudo dpkg-preconfigure locale
sudo locale

tee >listdeb
sudo mv -f listdeb /etc/apt/sources.list


cd /ok-app/

sudo apt-get update

for i in $del ;do
sudo apt-get remove $i
done
sudo apt-get autoremove

for i in $apt ;do
sudo apt-get install $i
done
for i in $deb ;do
sudo dpkg -i $i
done
for i in $bin ;do
sudo sh $i
done
for i in $patch ;do
sudo tar xzvf $i -C /
done

sudo apt-get -f install
sudo apt-get upgrade
sudo apt-get autoremove

sudo VBoxManage extpack install ./Oracle_VM_VirtualBox*vbox-extpack

sudo addgroup usbfs
sudo adduser ck usbfs
sudo adduser ck vboxusers
sudo chmod 7777 /proc/bus
sudo chown ck /proc/bus

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋| 欧侃在线社区 ( 沪ICP备19038881号-2 )

GMT+8, 2022-1-24 08:06 , Processed in 0.020246 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表