<template>
<name>Debian8.7-zxy</name>
<os>
<name>Debian</name>
<version>8</version>
<arch>x86_64</arch>
<install type='iso'>
<iso>file:///data/md0/DVD/debian-8.7.0-amd64-DVD-1.iso</iso>
</install>
<rootpw>123123</rootpw>
</os>
<disk>
<size>20</size>
</disk>
<description>Debian8.7 x86_64</description>
<commands>
<command name='install_qga'>
cd /root
tar xf qga.debian.tar.gz
cd qga
bash -x ./install_qga_local.sh
</command> <command name='console'>
sed -i 's/splash//g' /etc/default/grub
sed -i 's/quiet/console=ttyS0/g' /etc/default/grub
/usr/sbin/update-grub
</command> <command name='packages'>
mv /etc/apt/sources.list /etc/apt/sources.list.old
mv /root/sources.list /etc/apt/
rm -rf /var/lib/apt/lists/*
apt-get clean
apt-get update
apt-get -y install acpid
apt-get -y install curl
apt-get -y install sysv-rc-conf
apt-get -y install network-manager
apt-get -y install cloud-init-*
apt-get -y install cloud-utils
</command> <command name='modify'>
echo -n > /etc/udev/rules.d/70-persistent-net.rules
echo -n > /lib/udev/rules.d/75-persistent-net-generator.rules
sed -i '/exit 0/d' /etc/rc.local
echo "/usr/local/bin/nic_set_mq.sh > /tmp/nic_set_mq.log 2&gt;&amp;1" >> /etc/rc.local
echo "exit 0">>/etc/rc.local
echo 'blacklist intel_rapl' >> /etc/modprobe.d/modprobe.conf
chmod +x /var/lib/cloud/scripts/per-boot/resetroot
chmod +x /usr/local/bin/nic_set_mq.sh
chmod +x /var/lib/cloud/scripts/per-instance/ssh.sh
chmod +x /etc/rc.local
rm -rf /etc/cloud/cloud.cfg
rm -rf /etc/cloud/cloud.cfg.d/90_dpkg.cfg
mv /root/cloud.cfg /etc/cloud/
mv /root/90_dpkg.cfg /etc/cloud/cloud.cfg.d/
rm -rf /etc/apt/sources.list
mv /etc/apt/sources.list.old /etc/apt/sources.list
apt-get clean
apt-get update
cat >> /usr/local/bin/instance_init.sh &lt;&lt; EOF
if [ ! -d /root/.ssh ]; then
mkdir -p /root/.ssh
chmod 700 /root/.ssh
fi
</command> <command name='services'>
systemctl enable acpid
systemctl enable qemu-guest-agent
systemctl enable network-manager
systemctl enable cloud-init
systemctl enable cloud-config
systemctl enable cloud-final
systemctl enable cloud-init-local
</command> <command name='clear-logs'>
rm -rf /root/*
rm -rf /var/log/alternatives.log
rm -rf /var/log/daemon.log
rm -rf /var/log/debug
rm -rf /var/log/dmesg
rm -rf /var/log/faillog
rm -rf /var/log/fontconfig.log
rm -rf /var/log/messages
rm -rf /var/log/user.log
rm -rf /var/log/unattended-upgrades
rm -rf /var/log/auth.log
rm -rf /var/log/dpkg.log
rm -rf /var/log/syslog
rm -rf /var/log/kern.log
rm -rf /var/log/cloud-init.log
rm -rf /var/log/cloud-init-output.log
rm -rf /var/log/btmp
rm -rf /var/log/wtmp
rm -rf /var/log/lastlog
rm -rf /var/log/installer/
rm -rf /var/log/apt/
rm -rf /var/lib/apt/lists/*
rm -rf /var/lib/dhcp/*.leases
</command>
</commands> <files>
<file name="/root/qga.debian.tar.gz" type="url">
file:///data/nvme0n1/oz/qga.debian.tar.gz
</file>
<file name="/var/lib/cloud/scripts/per-boot/resetroot" type="url">
file:///data/nvme0n1/oz/resetroot
</file>
<file name="/root/cloud.cfg" type="url">
file:///data/nvme0n1/oz/cloud.cfg_debian
</file>
<file name="/usr/local/bin/nic_set_mq.sh" type="url">
file:///data/nvme0n1/oz/nic_set_mq.sh
</file>
<file name="/var/lib/cloud/scripts/per-instance/ssh.sh" type="url">
file:///data/nvme0n1/oz/ssh-debian87.sh
</file>
<file name="/root/sources.list" type="url">
file:///data/nvme0n1/oz/sources.aliyun.debian
</file>
<file name="/etc/cloud/cloud.cfg.d/99-disable-network-config.cfg" type="url">
file:///data/nvme0n1/oz/99-disable-network-config.cfg
</file>
<file name="/root/90_dpkg.cfg" type="url">
file:///data/nvme0n1/oz/90_dpkg.cfg_debian87
</file>
<file name="/etc/default/grub" type="url">
file:///data/nvme0n1/oz/grub_debian
</file>
</files>
</template>

debian87.tdl

d-i debian-installer/locale string en_US
d-i keyboard-configuration/xkb-keymap select us d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string localhost
d-i netcfg/get_domain string localdomain
d-i mirror/http/proxy string
d-i netcfg/wireless_wep string d-i clock-setup/utc boolean true
d-i time/zone string Asia/Shanghai d-i partman-auto/disk string /dev/vda
d-i partman-auto/method string regular
d-i partman-auto/expert_recipe string root :: 2048 50 1000000 ext4 \
$primary{ } $bootable{ } method{ format } \
format{ } use_filesystem{ } filesystem{ ext4 } \
mountpoint{ / } \
.
d-i partman-auto/choose_recipe select root
d-i partman-auto/confirm boolean true
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select Finish partitioning and write changes to disk
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman-basicfilesystems/no_swap boolean false
d-i partman-partitioning/default_label select msdos d-i passwd/root-login boolean true
d-i passwd/make-user boolean false
d-i passwd/root-password password Ct@2017Yun!@$%.CN
d-i passwd/root-password-again password Ct@2017Yun!@$%.CN tasksel tasksel/first multiselect standard
d-i pkgsel/include/install-recommends boolean true
d-i pkgsel/include string openssh-server curl d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i grub-installer/bootdev string default d-i apt-setup/security_host string
d-i apt-setup/services-select multiselect d-i finish-install/reboot_in_progress note

debian87.ks

Oz 创建Debian8镜像的更多相关文章

  1. Oz 创建CentOS7镜像

    参考链接: https://github.com/clalancette/oz/wiki/Oz-template-description-language https://github.com/cla ...

  2. Oz 创建CentOS6镜像

    参考 http://linuxblind.blog.51cto.com/7616603/1655550/ http://www.chenshake.com/oz-making-centos-mirro ...

  3. Oz 创建Windows2008R2镜像

    此tdl和auto文件只可定义windows disk bus以ide模式启动,不支持virtio. <template> <name>Windows-gushiren< ...

  4. Oz 创建Ubuntu镜像

    参考链接: http://blog.csdn.net/gcogle/article/details/52767135http://tlinux.blog.51cto.com/7288656/17497 ...

  5. 如何使用win7自带的备份还原以及创建系统镜像------傻瓜式教程

    对于经常鼓捣电脑的童鞋来说,装系统是一件极其平常的事情,不过系统装多了之后,我们会感到比较烦躁,因为每一次装系统意味着驱动的重新安装,程序的重新安装,每次这么鼓捣几次,半天时间就花在这上面了,效率是在 ...

  6. 基于Dockerfile创建docker镜像

    0.先创建一个文件夹img mkdir img 1.Linux上新建3个文件 2.文件内容分别写入 (1)Dockerfile中 # 基于的基础镜像centos FROM centos # 维护该镜像 ...

  7. Mycat 镜像-创建 Docker 镜像

    将 Mycat-server 创建到镜像,使其能够进行容器化部署,我们需要创建 Dockerfile 并在文件中安装其依赖项,使用 centos 做为 base 镜像,并安装 jdk 依赖即可,因此创 ...

  8. 标记,上传并下载自己创建的镜像 image

    1. 首先使用 docker images 查看已有镜像: 2. 获得 docker-whale 的 IMAGE ID,然后为 docker-whale 镜像 image 打上标签 Tag.使用命令: ...

  9. docker创建nginx镜像

    注意:此处不是用的dockerfile创建的镜像,只是用来搞一搞 首先你的系统里面要安装docker,这里就不重复介绍了,可以看之前的文章: 然后再搞一个基础镜像 docker pull regist ...

随机推荐

  1. ceph-文件存储

    文件存储 ceph文件系统提供了任何大小的符合posix标准的分布式文件系统,它使用Ceph RADOS存储数据.要实现ceph文件系统,需要一个正在运行的ceph存储集群和至少一个ceph元数据服务 ...

  2. 121. Best Time to Buy and Sell Stock——Leetcode

    Say you have an array for which the ith element is the price of a given stock on day i. If you were ...

  3. 一个老鸟发的公司内部整理的 Android 学习路线图 Markdown 版本

    jixiaohua发了一篇一个老鸟也发了一份他给公司内部小伙伴整理的路线图.另一份 Android 开发学习路线图.可惜不是MarkDown格式的,所以jixiaohua直接上传的截图,在jixiao ...

  4. Hibernate 提供session的工具类HibernateUtils

    package cn.itcast.utils; import java.sql.Connection; import java.sql.SQLException; import org.hibern ...

  5. 关于var和ES6中的let,const的理解

    var的作用就不多说了,下面说说var的缺点: 1.var可以重复声明 var a = 1; var a = 5; console.log(a); //5 不会报错 在像这些这些严谨的语言来说,一般是 ...

  6. BZOJ1509: [NOI2003]逃学的小孩(树的直径)

    Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 1126  Solved: 567[Submit][Status][Discuss] Description ...

  7. LeetCode961 重复 N 次的元素

    问题: 重复 N 次的元素 在大小为 2N 的数组 A 中有 N+1 个不同的元素,其中有一个元素重复了 N 次. 返回重复了 N 次的那个元素. 示例 1: 输入:[1,2,3,3] 输出:3 示例 ...

  8. 小程序里面使用wxParse解析富文本导致页面空白等

    在部分安卓手机上会出现白屏的情况且有些ios手机上图文混排上,图片显示不出问题 解决:把插件里面的console.dir去掉即可(原因在于安卓手机无法解析console.dir) 有些图片解析出来下面 ...

  9. 线程、进程、协程和GIL(一)

    参考链接:https://www.cnblogs.com/alex3714/articles/5230609.html https://www.cnblogs.com/work115/p/562027 ...

  10. Go实现mqtt服务

    package main import ( "os" "log" "github.com/eclipse/paho.mqtt.golang" ...