├── .gitignore ├── README.md ├── cloudimg ├── CentOS-6-x86_64-hvm.ks ├── CentOS-7-x86_64-Azure.ks ├── CentOS-7-x86_64-hvm.ks └── CentOS-8-x86_64-Azure.ks ├── docker ├── .cico.pipeline ├── README.md ├── centos-5.11.ks ├── centos-5.ks ├── centos-6.ks ├── centos-6i386.ks ├── centos-7-aarch64.ks ├── centos-7-armhfp.ks ├── centos-7-i386.ks ├── centos-7-ppc64le.ks ├── centos-7-x86_64.ks ├── centos-8.ks ├── containerbuild.sh └── deprecated │ ├── centos-6.6.ks │ ├── centos-7.0.1406.ks │ ├── centos-7.1.1503.ks │ ├── img2docker.sh │ └── img2tar.sh ├── openstack ├── openstack-64-growroot.cfg ├── openstack-64-growroot.json └── openstack-65-x86_64.ks ├── openvz ├── README.md ├── centos6.exclude ├── centos6.include ├── centos7.baseurl ├── centos7.exclude ├── centos7.include ├── create-yum-openvz.sh ├── openvz-7.ks └── openvz-genKS.sh ├── ovirt ├── CentOS-7-x86_64-oVirt-r1.ks └── README.md └── vagrant ├── README.md ├── centos6.ks ├── centos7.ks ├── centos8.ks ├── do_vagrant_cbs.sh └── tests ├── README.md ├── _test.sh └── run_tests.sh /.gitignore: -------------------------------------------------------------------------------- 1 | .project 2 | *~ 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Build-Instance 2 | 3 | This git repo contains kickstart files that define how the various CentOS Cloud Instances are built. These kickstarts are parsed with `virt-install`. Every kickstart must be named in the following convention: 4 | 5 | ``` 6 | CentOS----.ks 7 | ``` 8 | 9 | eg: 10 | 11 | ``` 12 | CentOS-6-x86_64-OpenStack-6.5_20140119.ks 13 | ``` 14 | 15 | Along with every kickstart is a metadata file, with the same name as the kickstart, except ending with .json ( because they are json files ) 16 | 17 | # Git Tags: 18 | 19 | As a part of the instance release process, the content used to build that instance MUST be tag'd away 20 | 21 | # Notes: 22 | 23 | * ReleaseVer must always only be 5 or 6 or 7, never the point release ( but you can overload the TAG component in the name with anything, I like using the point release there, along with the datestamp ). 24 | 25 | # ToDo: 26 | 27 | * Provide some example kickstarts 28 | * Provide some example metadata json's 29 | * Import the virt-install wrapper bash script 30 | -------------------------------------------------------------------------------- /cloudimg/CentOS-6-x86_64-hvm.ks: -------------------------------------------------------------------------------- 1 | # Build a basic CentOS 6.5 x86_64 2 | lang en_US.UTF-8 3 | keyboard us 4 | timezone --utc UTC 5 | auth --useshadow --enablemd5 6 | rootpw --iscrypted nothing 7 | selinux --enforcing 8 | firewall --service=ssh 9 | bootloader --timeout=1 10 | network --bootproto=dhcp --device=eth0 --onboot=on 11 | services --enabled=network 12 | zerombr 13 | clearpart --all --initlabel 14 | part / --size 4096 --grow --fstype ext4 15 | reboot 16 | 17 | # Repositories 18 | repo --name=CentOS6-Base --baseurl=http://mirrorsnap.centos.org/DATESTAMP/centos/6/os/x86_64 19 | repo --name=CentOS6-Updates --baseurl=http://mirrorsnap.centos.org/DATESTAMP/centos/6/updates/x86_64 20 | repo --name=CentOS6-Extras --baseurl=http://mirrorsnap.centos.org/DATESTAMP/centos/6/extras/x86_64 21 | 22 | # 23 | # 24 | # Add all the packages after the base packages 25 | # 26 | %packages --nobase --instLangs=en 27 | @core 28 | system-config-securitylevel-tui 29 | newt-python 30 | system-config-firewall-base 31 | audit 32 | pciutils 33 | bash 34 | coreutils 35 | kernel 36 | grub 37 | e2fsprogs 38 | passwd 39 | policycoreutils 40 | chkconfig 41 | rootfiles 42 | yum 43 | yum-presto 44 | vim-minimal 45 | acpid 46 | openssh-clients 47 | openssh-server 48 | curl 49 | man 50 | rsync 51 | #Allow for dhcp access 52 | dhclient 53 | iputils 54 | 55 | # cloud stuff 56 | cloud-init 57 | 58 | #stuff we really done want 59 | -kernel-firmware 60 | -xorg-x11-drv-ati-firmware 61 | -iwl6000g2a-firmware 62 | -aic94xx-firmware 63 | -iwl6000-firmware 64 | -iwl100-firmware 65 | -ql2200-firmware 66 | -libertas-usb8388-firmware 67 | -ipw2100-firmware 68 | -atmel-firmware 69 | -iwl3945-firmware 70 | -ql2500-firmware 71 | -rt61pci-firmware 72 | -ipw2200-firmware 73 | -iwl6050-firmware 74 | -iwl1000-firmware 75 | -bfa-firmware 76 | -iwl5150-firmware 77 | -iwl5000-firmware 78 | -ql2400-firmware 79 | -rt73usb-firmware 80 | -ql23xx-firmware 81 | -iwl4965-firmware 82 | -ql2100-firmware 83 | -ivtv-firmware 84 | -zd1211-firmware 85 | 86 | %end 87 | 88 | # 89 | # Add custom post scripts after the base post. 90 | # 91 | %post 92 | %end 93 | 94 | # more ec2-ify 95 | %post --erroronfail 96 | # disable root password based login 97 | cat >> /etc/ssh/sshd_config << EOF 98 | PermitRootLogin without-password 99 | UseDNS no 100 | EOF 101 | 102 | sed -i 's|PasswordAuthentication yes|PasswordAuthentication no|' /etc/ssh/sshd_config 103 | 104 | # set the firstrun flag 105 | touch /root/firstrun 106 | 107 | # lock the root pass 108 | passwd -l root 109 | 110 | # chance dhcp client retry/timeouts to resolve #6866 111 | cat >> /etc/dhcp/dhclient.conf << EOF 112 | 113 | timeout 300 114 | retry 60 115 | EOF 116 | # set up ssh key fetching and set a random root passwd if needed 117 | cat >> /etc/rc.local << EOF 118 | 119 | # set a random pass on first boot 120 | if [ -f /root/firstrun ]; then 121 | dd if=/dev/urandom count=50|md5sum|passwd --stdin root 122 | passwd -l root 123 | rm /root/firstrun 124 | fi 125 | 126 | if [ ! -d /root/.ssh ]; then 127 | mkdir -m 0700 -p /root/.ssh 128 | restorecon /root/.ssh 129 | fi 130 | EOF 131 | 132 | # Do some basic cleanup 133 | sed -i -e 's/^ACTIVE_CONSOLES=\/dev\/tty\[1-6\]/ACTIVE_CONSOLES=\/dev\/tty1/' /etc/sysconfig/init 134 | 135 | # make sure the kernel can be updated 136 | rm /boot/grub/menu.lst 137 | rm /etc/grub.conf 138 | ln -s /boot/grub/grub.conf /boot/grub/menu.lst 139 | ln -s /boot/grub/grub.conf /etc/grub.conf 140 | cat >> /etc/sysconfig/kernel << EOF 141 | UPDATEDEFAULT=yes 142 | DEFAULTKERNEL=kernel 143 | EOF 144 | 145 | # clear out some network stuff 146 | sed -i "/HWADDR/d" /etc/sysconfig/network-scripts/ifcfg-eth* 147 | rm -f /etc/udev/rules.d/*-persistent-net.rules 148 | touch /etc/udev/rules.d/75-persistent-net-generator.rules 149 | echo NOZEROCONF=yes >> /etc/sysconfig/network 150 | 151 | 152 | #echo "Zeroing out empty space." 153 | # This forces the filesystem to reclaim space from deleted files 154 | dd bs=1M if=/dev/zero of=/var/tmp/zeros || : 155 | rm -f /var/tmp/zeros 156 | echo "(Don't worry -- that out-of-space error was expected.)" 157 | 158 | %end 159 | 160 | -------------------------------------------------------------------------------- /cloudimg/CentOS-7-x86_64-Azure.ks: -------------------------------------------------------------------------------- 1 | # Kickstart for creating a CentOS 7 Azure VM 2 | 3 | # System authorization information 4 | auth --enableshadow --passalgo=sha512 5 | 6 | # Use text install 7 | text 8 | 9 | # Do not run the Setup Agent on first boot 10 | firstboot --disable 11 | 12 | # Keyboard layouts 13 | keyboard --vckeymap=us --xlayouts='us' 14 | 15 | # System language 16 | lang en_US.UTF-8 17 | 18 | # Network information 19 | network --bootproto=dhcp 20 | network --hostname=localhost.localdomain 21 | firewall --enabled --service=ssh 22 | 23 | # Use network installation 24 | url --url="mirrorsnap.centos.org/DATESTAMP/centos/7/os/x86_64" 25 | repo --name "os" --baseurl="http://mirrorsnap.centos.org/DATESTAMP/centos/7/os/x86_64/" --cost=100 26 | repo --name "updates" --baseurl="http://mirrorsnap.centos.org/DATESTAMP/centos/7/updates/x86_64/" --cost=100 27 | repo --name "extras" --baseurl="http://mirrorsnap.centos.org/DATESTAMP/centos/7/extras/x86_64/" --cost=100 28 | # Root password 29 | rootpw --iscrypted nothing 30 | selinux --enforcing 31 | 32 | # System services 33 | services --disabled="kdump,abrtd" --enabled="network,sshd,rsyslog,chronyd,waagent,dnsmasq,NetworkManager" 34 | %addon com_redhat_kdump --disable 35 | %end 36 | 37 | # System timezone 38 | timezone UTC --isUtc 39 | 40 | # Disk partitioning information 41 | zerombr 42 | clearpart --all --initlabel 43 | part /boot --fstype="xfs" --size=500 44 | part / --fstype="xfs" --size=1 --grow --asprimary 45 | 46 | # System bootloader configuration 47 | bootloader --append="console=tty0" --location=mbr --timeout=1 48 | 49 | # Don't configure X 50 | skipx 51 | 52 | # Power down the machine after install 53 | poweroff 54 | 55 | 56 | %packages 57 | @base 58 | @console-internet 59 | chrony 60 | cifs-utils 61 | sudo 62 | python-pyasn1 63 | parted 64 | WALinuxAgent 65 | hypervkvpd 66 | -dracut-config-rescue 67 | %end 68 | 69 | 70 | %post --erroronfail 71 | #!/bin/bash 72 | 73 | passwd -d root 74 | passwd -l root 75 | 76 | # setup systemd to boot to the right runlevel 77 | rm -f /etc/systemd/system/default.target 78 | ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target 79 | 80 | # Set the kernel cmdline 81 | sed -i 's/^\(GRUB_CMDLINE_LINUX\)=".*"$/\1="console=tty1 console=ttyS0,115200n8 earlyprintk=ttyS0,115200 rootdelay=300 net.ifnames=0 scsi_mod.use_blk_mq=y"/g' /etc/default/grub 82 | 83 | 84 | # Enable grub serial console 85 | echo 'GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"' >> /etc/default/grub 86 | sed -i 's/^GRUB_TERMINAL_OUTPUT=".*"$/GRUB_TERMINAL="serial console"/g' /etc/default/grub 87 | 88 | # Set default kernel 89 | cat < /etc/sysconfig/kernel 90 | # UPDATEDEFAULT specifies if new-kernel-pkg should make 91 | # new kernels the default 92 | UPDATEDEFAULT=yes 93 | 94 | # DEFAULTKERNEL specifies the default kernel package type 95 | DEFAULTKERNEL=kernel 96 | EOL 97 | 98 | # Rebuild grub.cfg 99 | grub2-mkconfig -o /boot/grub2/grub.cfg 100 | 101 | # Ensure Hyper-V drivers are built into initramfs 102 | echo -e "\nadd_drivers+=\"hv_vmbus hv_netvsc hv_storvsc\"" >> /etc/dracut.conf 103 | kversion=$( rpm -q kernel | sed 's/kernel\-//' ) 104 | dracut -v -f "/boot/initramfs-${kversion}.img" "$kversion" 105 | 106 | # Import CentOS public key 107 | rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 108 | 109 | # Configure network 110 | cat << EOF > /etc/sysconfig/network-scripts/ifcfg-eth0 111 | DEVICE=eth0 112 | ONBOOT=yes 113 | BOOTPROTO=dhcp 114 | TYPE=Ethernet 115 | USERCTL=no 116 | PEERDNS=yes 117 | IPV6INIT=no 118 | NM_CONTROLLED=no 119 | PERSISTENT_DHCLIENT="1" 120 | EOF 121 | 122 | cat << EOF > /etc/sysconfig/network 123 | NETWORKING=yes 124 | NOZEROCONF=yes 125 | HOSTNAME=localhost.localdomain 126 | EOF 127 | 128 | 129 | # Disable persistent net rules 130 | rm -f /etc/udev/rules.d/70* 2>/dev/null 131 | ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules 132 | 133 | # Disable NetworkManager handling of the SRIOV interfaces 134 | cat < /etc/udev/rules.d/68-azure-sriov-nm-unmanaged.rules 135 | # Accelerated Networking on Azure exposes a new SRIOV interface to the VM. 136 | # This interface is transparently bonded to the synthetic interface, 137 | # so NetworkManager should just ignore any SRIOV interfaces. 138 | SUBSYSTEM=="net", DRIVERS=="hv_pci", ACTION=="add", ENV{NM_UNMANAGED}="1" 139 | 140 | EOF 141 | 142 | # Change dhcp client retry/timeouts to resolve #6866 143 | cat >> /etc/dhcp/dhclient.conf << EOF 144 | timeout 300 145 | retry 60 146 | EOF 147 | 148 | # Blacklist the nouveau driver as it is incompatible 149 | # with Azure GPU instances. 150 | cat << EOF > /etc/modprobe.d/blacklist-nouveau.conf 151 | blacklist nouveau 152 | options nouveau modeset=0 153 | EOF 154 | 155 | echo "Fixing SELinux contexts." 156 | touch /var/log/cron 157 | touch /var/log/boot.log 158 | mkdir -p /var/cache/yum 159 | /usr/sbin/fixfiles -R -a restore 160 | 161 | # Modify yum, clean cache 162 | echo "http_caching=packages" >> /etc/yum.conf 163 | yum clean all 164 | 165 | # XXX instance type markers - MUST match CentOS Infra expectation 166 | echo 'azure' > /etc/yum/vars/infra 167 | 168 | # Set tuned profile 169 | echo "virtual-guest" > /etc/tuned/active_profile 170 | 171 | %end 172 | -------------------------------------------------------------------------------- /cloudimg/CentOS-7-x86_64-hvm.ks: -------------------------------------------------------------------------------- 1 | # System authorization information 2 | auth --enableshadow --passalgo=sha512 3 | # Reboot after installation 4 | reboot 5 | # Use network installation 6 | url --url="mirrorsnap.centos.org/DATESTAMP/centos/7/os/x86_64" 7 | # Firewall configuration 8 | firewall --enabled --service=ssh 9 | firstboot --disable 10 | ignoredisk --only-use=vda 11 | # Keyboard layouts 12 | # old format: keyboard us 13 | # new format: 14 | keyboard --vckeymap=us --xlayouts='us' 15 | # System language 16 | lang en_US.UTF-8 17 | repo --name "os" --baseurl="http://mirrorsnap.centos.org/DATESTAMP/centos/7/os/x86_64/" --cost=100 18 | repo --name "updates" --baseurl="http://mirrorsnap.centos.org/DATESTAMP/centos/7/updates/x86_64/" --cost=100 19 | repo --name "extras" --baseurl="http://mirrorsnap.centos.org/DATESTAMP/centos/7/extras/x86_64/" --cost=100 20 | # Network information 21 | network --bootproto=dhcp 22 | network --hostname=localhost.localdomain 23 | # Root password 24 | rootpw --iscrypted nothing 25 | selinux --enforcing 26 | services --disabled="kdump" --enabled="network,sshd,rsyslog,chronyd" 27 | timezone UTC --isUtc 28 | # Disk 29 | bootloader --append="console=tty0" --location=mbr --timeout=1 --boot-drive=vda 30 | zerombr 31 | clearpart --all --initlabel 32 | part / --fstype="xfs" --ondisk=vda --size=4096 --grow 33 | 34 | %post --erroronfail 35 | 36 | # workaround anaconda requirements 37 | passwd -d root 38 | passwd -l root 39 | 40 | # Create grub.conf for EC2. This used to be done by appliance creator but 41 | # anaconda doesn't do it. And, in case appliance-creator is used, we're 42 | # overriding it here so that both cases get the exact same file. 43 | # Note that the console line is different -- that's because EC2 provides 44 | # different virtual hardware, and this is a convenient way to act differently 45 | echo -n "Creating grub.conf for pvgrub" 46 | rootuuid=$( awk '$2=="/" { print $1 };' /etc/fstab ) 47 | mkdir /boot/grub 48 | echo -e 'default=0\ntimeout=0\n\n' > /boot/grub/grub.conf 49 | for kv in $( ls -1v /boot/vmlinuz* |grep -v rescue |sed s/.*vmlinuz-// ); do 50 | echo "title CentOS Linux 7 ($kv)" >> /boot/grub/grub.conf 51 | echo -e "\troot (hd0)" >> /boot/grub/grub.conf 52 | echo -e "\tkernel /boot/vmlinuz-$kv ro root=$rootuuid console=hvc0 LANG=en_US.UTF-8" >> /boot/grub/grub.conf 53 | echo -e "\tinitrd /boot/initramfs-$kv.img" >> /boot/grub/grub.conf 54 | echo 55 | done 56 | 57 | #link grub.conf to menu.lst for ec2 to work 58 | echo -n "Linking menu.lst to old-style grub.conf for pv-grub" 59 | ln -sf grub.conf /boot/grub/menu.lst 60 | ln -sf /boot/grub/grub.conf /etc/grub.conf 61 | 62 | # setup systemd to boot to the right runlevel 63 | echo -n "Setting default runlevel to multiuser text mode" 64 | rm -f /etc/systemd/system/default.target 65 | ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target 66 | echo . 67 | 68 | # this is installed by default but we don't need it in virt 69 | echo "Removing linux-firmware package." 70 | yum -C -y remove linux-firmware 71 | 72 | # Remove firewalld; it is required to be present for install/image building. 73 | echo "Removing firewalld." 74 | yum -C -y remove firewalld --setopt="clean_requirements_on_remove=1" 75 | 76 | # remove avahi and networkmanager 77 | echo "Removing avahi/zeroconf and NetworkManager" 78 | yum -C -y remove avahi\* Network\* 79 | 80 | echo -n "Getty fixes" 81 | # although we want console output going to the serial console, we don't 82 | # actually have the opportunity to login there. FIX. 83 | # we don't really need to auto-spawn _any_ gettys. 84 | sed -i '/^#NAutoVTs=.*/ a\ 85 | NAutoVTs=0' /etc/systemd/logind.conf 86 | 87 | echo -n "Network fixes" 88 | # initscripts don't like this file to be missing. 89 | cat > /etc/sysconfig/network << EOF 90 | NETWORKING=yes 91 | NOZEROCONF=yes 92 | EOF 93 | 94 | # For cloud images, 'eth0' _is_ the predictable device name, since 95 | # we don't want to be tied to specific virtual (!) hardware 96 | rm -f /etc/udev/rules.d/70* 97 | ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules 98 | 99 | # simple eth0 config, again not hard-coded to the build hardware 100 | cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF 101 | DEVICE="eth0" 102 | BOOTPROTO="dhcp" 103 | ONBOOT="yes" 104 | TYPE="Ethernet" 105 | USERCTL="yes" 106 | PEERDNS="yes" 107 | IPV6INIT="no" 108 | PERSISTENT_DHCLIENT="1" 109 | EOF 110 | 111 | # set virtual-guest as default profile for tuned 112 | echo "virtual-guest" > /etc/tuned/active_profile 113 | 114 | # generic localhost names 115 | cat > /etc/hosts << EOF 116 | 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 117 | ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 118 | 119 | EOF 120 | echo . 121 | 122 | # Because memory is scarce resource in most cloud/virt environments, 123 | # and because this impedes forensics, we are differing from the Fedora 124 | # default of having /tmp on tmpfs. 125 | echo "Disabling tmpfs for /tmp." 126 | systemctl mask tmp.mount 127 | 128 | cat < /etc/sysconfig/kernel 129 | # UPDATEDEFAULT specifies if new-kernel-pkg should make 130 | # new kernels the default 131 | UPDATEDEFAULT=yes 132 | 133 | # DEFAULTKERNEL specifies the default kernel package type 134 | DEFAULTKERNEL=kernel 135 | EOL 136 | 137 | # make sure firstboot doesn't start 138 | echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot 139 | 140 | # workaround https://bugzilla.redhat.com/show_bug.cgi?id=966888 141 | #if ! grep -q growpart /etc/cloud/cloud.cfg; then 142 | # sed -i 's/ - resizefs/ - growpart\n - resizefs/' /etc/cloud/cloud.cfg 143 | #fi 144 | 145 | 146 | #echo -e 'cloud-user\tALL=(ALL)\tNOPASSWD: ALL' >> /etc/sudoers 147 | 148 | echo "Cleaning old yum repodata." 149 | yum clean all 150 | 151 | echo "set instance type markers" 152 | echo 'genclo' > /etc/yum/vars/infra 153 | 154 | # chance dhcp client retry/timeouts to resolve #6866 155 | cat >> /etc/dhcp/dhclient.conf << EOF 156 | 157 | timeout 300; 158 | retry 60; 159 | EOF 160 | 161 | # clean up installation logs" 162 | rm -rf /var/log/yum.log 163 | rm -rf /var/lib/yum/* 164 | rm -rf /root/install.log 165 | rm -rf /root/install.log.syslog 166 | rm -rf /root/anaconda-ks.cfg 167 | rm -rf /var/log/anaconda* 168 | rm -rf /root/anac* 169 | 170 | echo "Fixing SELinux contexts." 171 | touch /var/log/cron 172 | touch /var/log/boot.log 173 | mkdir -p /var/cache/yum 174 | /usr/sbin/fixfiles -R -a restore 175 | 176 | # reorder console entries 177 | sed -i 's/console=tty0/console=tty0 console=ttyS0,115200n8/' /boot/grub2/grub.cfg 178 | 179 | #echo "Zeroing out empty space." 180 | # This forces the filesystem to reclaim space from deleted files 181 | dd bs=1M if=/dev/zero of=/var/tmp/zeros || : 182 | rm -f /var/tmp/zeros 183 | echo "(Don't worry -- that out-of-space error was expected.)" 184 | 185 | %end 186 | 187 | %packages 188 | @core 189 | chrony 190 | cloud-init 191 | cloud-utils-growpart 192 | dracut-config-generic 193 | dracut-norescue 194 | firewalld 195 | grub2 196 | kernel 197 | nfs-utils 198 | rsync 199 | tar 200 | yum-utils 201 | -NetworkManager 202 | -aic94xx-firmware 203 | -alsa-firmware 204 | -alsa-lib 205 | -alsa-tools-firmware 206 | -biosdevname 207 | -iprutils 208 | -ivtv-firmware 209 | -iwl100-firmware 210 | -iwl1000-firmware 211 | -iwl105-firmware 212 | -iwl135-firmware 213 | -iwl2000-firmware 214 | -iwl2030-firmware 215 | -iwl3160-firmware 216 | -iwl3945-firmware 217 | -iwl4965-firmware 218 | -iwl5000-firmware 219 | -iwl5150-firmware 220 | -iwl6000-firmware 221 | -iwl6000g2a-firmware 222 | -iwl6000g2b-firmware 223 | -iwl6050-firmware 224 | -iwl7260-firmware 225 | -libertas-sd8686-firmware 226 | -libertas-sd8787-firmware 227 | -libertas-usb8388-firmware 228 | -plymouth 229 | 230 | %end 231 | 232 | -------------------------------------------------------------------------------- /cloudimg/CentOS-8-x86_64-Azure.ks: -------------------------------------------------------------------------------- 1 | # Kickstart for creating a CentOS 8 Azure VM 2 | # Note: Support for generation-1 and generation-2 VMs Azure - 3 | # This kickstart assumes the installation occurs on a UEFI-enabled VM, and 4 | # will produce a VM image that supports both UEFI and legacy BIOS boot. 5 | # More: https://docs.microsoft.com/en-us/azure/virtual-machines/linux/generation-2 6 | 7 | # System authorization information 8 | auth --enableshadow --passalgo=sha512 9 | 10 | # Use text install 11 | text 12 | 13 | # Do not run the Setup Agent on first boot 14 | firstboot --disable 15 | 16 | # Keyboard layouts 17 | keyboard --vckeymap=us --xlayouts='us' 18 | 19 | # System language 20 | lang en_US.UTF-8 21 | 22 | # Network information 23 | network --bootproto=dhcp 24 | network --hostname=localhost.localdomain 25 | firewall --enabled --service=ssh 26 | 27 | # Use network installation 28 | url --url="mirror.centos.org/centos/8/BaseOS/x86_64/os/" 29 | repo --name "BaseOS" --baseurl="http://mirror.centos.org/centos/8/BaseOS/x86_64/os/" --cost=100 30 | repo --name "AppStream" --baseurl="http://mirror.centos.org/centos/8/AppStream/x86_64/os/" --cost=100 31 | repo --name "extras" --baseurl="http://mirror.centos.org/centos/8/extras/x86_64/os/" --cost=100 32 | 33 | # Root password 34 | rootpw --iscrypted nothing 35 | 36 | # Enable SELinux 37 | selinux --enforcing 38 | 39 | # System services 40 | services --enabled="sshd,waagent,NetworkManager,systemd-resolved" 41 | 42 | # System timezone 43 | timezone Etc/UTC --isUtc 44 | 45 | # Don't configure X 46 | skipx 47 | 48 | # Power down the machine after install 49 | poweroff 50 | 51 | 52 | # Partitioning and bootloader configuration 53 | # Note: biosboot and efi partitions are pre-created in %pre. 54 | zerombr 55 | bootloader --location=mbr --timeout=1 56 | # part biosboot --onpart=sda14 --size=4 57 | part /boot/efi --onpart=sda15 --fstype=vfat 58 | part /boot --fstype="xfs" --size=500 59 | part / --fstype="xfs" --size=1 --grow --asprimary 60 | 61 | %pre --log=/var/log/anaconda/pre-install.log --erroronfail 62 | #!/bin/bash 63 | 64 | # Pre-create the biosboot and EFI partitions 65 | # - Ensure that efi and biosboot are created at the start of the disk to 66 | # allow resizing of the OS disk. 67 | # - Label biosboot and efi as sda14/sda15 for better compat - some tools 68 | # may assume that sda1/sda2 are '/boot' and '/' respectively. 69 | sgdisk --clear /dev/sda 70 | sgdisk --new=14:2048:10239 /dev/sda 71 | sgdisk --new=15:10240:500M /dev/sda 72 | sgdisk --typecode=14:EF02 /dev/sda 73 | sgdisk --typecode=15:EF00 /dev/sda 74 | 75 | %end 76 | 77 | 78 | # Disable kdump 79 | %addon com_redhat_kdump --disable 80 | 81 | %end 82 | 83 | %packages 84 | @^minimal-environment 85 | @standard 86 | #@container-tools 87 | WALinuxAgent 88 | chrony 89 | sudo 90 | parted 91 | -dracut-config-rescue 92 | -postfix 93 | -NetworkManager-config-server 94 | openssh-server 95 | kernel 96 | dnf-utils 97 | rng-tools 98 | cracklib 99 | cracklib-dicts 100 | centos-release 101 | 102 | # pull firmware packages out 103 | -aic94xx-firmware 104 | -alsa-firmware 105 | -alsa-lib 106 | -alsa-tools-firmware 107 | -ivtv-firmware 108 | -iwl1000-firmware 109 | -iwl100-firmware 110 | -iwl105-firmware 111 | -iwl135-firmware 112 | -iwl2000-firmware 113 | -iwl2030-firmware 114 | -iwl3160-firmware 115 | -iwl3945-firmware 116 | -iwl4965-firmware 117 | -iwl5000-firmware 118 | -iwl5150-firmware 119 | -iwl6000-firmware 120 | -iwl6000g2a-firmware 121 | -iwl6000g2b-firmware 122 | -iwl6050-firmware 123 | -iwl7260-firmware 124 | -libertas-sd8686-firmware 125 | -libertas-sd8787-firmware 126 | -libertas-usb8388-firmware 127 | 128 | # Some things from @core we can do without in a minimal install 129 | -biosdevname 130 | -plymouth 131 | -iprutils 132 | 133 | # enable rootfs resize on boot 134 | cloud-utils-growpart 135 | gdisk 136 | 137 | %end 138 | 139 | %post --log=/var/log/anaconda/post-install.log --erroronfail 140 | 141 | #!/bin/bash 142 | 143 | passwd -d root 144 | passwd -l root 145 | 146 | # Import CentOS public key 147 | rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial 148 | 149 | # Set the kernel cmdline 150 | sed -i 's/^\(GRUB_CMDLINE_LINUX\)=".*"$/\1="console=tty1 console=ttyS0,115200n8 earlyprintk=ttyS0,115200 rootdelay=300 net.ifnames=0 scsi_mod.use_blk_mq=y"/g' /etc/default/grub 151 | 152 | # Enable grub serial console 153 | echo 'GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"' >> /etc/default/grub 154 | sed -i 's/^GRUB_TERMINAL_OUTPUT=".*"$/GRUB_TERMINAL="serial console"/g' /etc/default/grub 155 | 156 | # Enable BIOS bootloader 157 | grub2-mkconfig --output /etc/grub2-efi.cfg 158 | grub2-install --target=i386-pc --directory=/usr/lib/grub/i386-pc/ /dev/sda 159 | grub2-mkconfig --output=/boot/grub2/grub.cfg 160 | 161 | # Fix grub.cfg to remove EFI entries, otherwise "boot=" is not set correctly and blscfg fails 162 | EFI_ID=`blkid --match-tag UUID --output value /dev/sda15` 163 | BOOT_ID=`blkid --match-tag UUID --output value /dev/sda1` 164 | sed -i 's/gpt15/gpt1/' /boot/grub2/grub.cfg 165 | sed -i "s/${EFI_ID}/${BOOT_ID}/" /boot/grub2/grub.cfg 166 | sed -i 's|${config_directory}/grubenv|(hd0,gpt15)/efi/centos/grubenv|' /boot/grub2/grub.cfg 167 | sed -i '/^### BEGIN \/etc\/grub.d\/30_uefi/,/^### END \/etc\/grub.d\/30_uefi/{/^### BEGIN \/etc\/grub.d\/30_uefi/!{/^### END \/etc\/grub.d\/30_uefi/!d}}' /boot/grub2/grub.cfg 168 | 169 | # Blacklist the nouveau driver 170 | cat << EOF > /etc/modprobe.d/blacklist-nouveau.conf 171 | blacklist nouveau 172 | options nouveau modeset=0 173 | EOF 174 | 175 | # Ensure Hyper-V drivers are built into initramfs 176 | echo '# Ensure Hyper-V drivers are built into initramfs' >> /etc/dracut.conf.d/azure.conf 177 | echo -e "\nadd_drivers+=\"hv_vmbus hv_netvsc hv_storvsc\"" >> /etc/dracut.conf.d/azure.conf 178 | kversion=$( rpm -q kernel | sed 's/kernel\-//' ) 179 | dracut -v -f "/boot/initramfs-${kversion}.img" "$kversion" 180 | 181 | # Enable SSH keepalive / Disable root SSH login 182 | sed -i 's/^#\(ClientAliveInterval\).*$/\1 180/g' /etc/ssh/sshd_config 183 | sed -i 's/^PermitRootLogin.*/#PermitRootLogin no/g' /etc/ssh/sshd_config 184 | 185 | # Configure network 186 | cat << EOF > /etc/sysconfig/network-scripts/ifcfg-eth0 187 | DEVICE=eth0 188 | ONBOOT=yes 189 | BOOTPROTO=dhcp 190 | TYPE=Ethernet 191 | USERCTL=no 192 | PEERDNS=yes 193 | IPV6INIT=no 194 | NM_CONTROLLED=yes 195 | PERSISTENT_DHCLIENT=yes 196 | EOF 197 | 198 | cat << EOF > /etc/sysconfig/network 199 | NETWORKING=yes 200 | NOZEROCONF=yes 201 | HOSTNAME=localhost.localdomain 202 | EOF 203 | 204 | # Disable NetworkManager handling of the SRIOV interfaces 205 | cat < /etc/udev/rules.d/68-azure-sriov-nm-unmanaged.rules 206 | 207 | # Accelerated Networking on Azure exposes a new SRIOV interface to the VM. 208 | # This interface is transparently bonded to the synthetic interface, 209 | # so NetworkManager should just ignore any SRIOV interfaces. 210 | SUBSYSTEM=="net", DRIVERS=="hv_pci", ACTION=="add", ENV{NM_UNMANAGED}="1" 211 | 212 | EOF 213 | 214 | # Enable DNS cache 215 | # Comment this by default due to "DNSSEC validation failed" issues 216 | #sed -i 's/hosts:\s*files dns myhostname/hosts: files resolve dns myhostname/' /etc/nsswitch.conf 217 | 218 | # Update dnf configuration 219 | echo "http_caching=packages" >> /etc/dnf/dnf.conf 220 | dnf clean all 221 | 222 | # XXX instance type markers - MUST match CentOS Infra expectation 223 | echo 'azure' > /etc/yum/vars/infra 224 | 225 | # Set tuned profile 226 | echo "virtual-guest" > /etc/tuned/active_profile 227 | 228 | # Deprovision and prepare for Azure 229 | /usr/sbin/waagent -force -deprovision 230 | 231 | %end 232 | -------------------------------------------------------------------------------- /docker/.cico.pipeline: -------------------------------------------------------------------------------- 1 | def c7arches = ["ppc64le", "x86_64", "aarch64"] 2 | 3 | 4 | def onmyduffynode(script){ 5 | ansiColor('xterm'){ 6 | timestamps{ 7 | sh 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -l root ${DUFFY_NODE}.ci.centos.org -t \"export REPO=${REPO}; export BRANCH=${BRANCH};\" "' + script + '"' 8 | } 9 | } 10 | } 11 | 12 | 13 | def syncfromduffynode(rsyncpath){ 14 | sh 'rsync -e "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -l root " -Ha --include=' + rsyncpath + " ${DUFFY_NODE}.ci.centos.org:~/ ./" 15 | } 16 | 17 | 18 | def synctoduffynode(source){ 19 | sh 'scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -r ' + source + " " + "root@" + "${DUFFY_NODE}.ci.centos.org:~/" 20 | } 21 | 22 | 23 | node('sig-cloudinstance'){ 24 | stage('make placeholder'){ 25 | env.time_stamp = sh( 26 | script: "date +%y%m%d", 27 | returnStdout: true 28 | ).trim() 29 | 30 | env.rsync_key = sh( 31 | script: "head -c 13 ~/duffy.key", 32 | returnStdout: true 33 | ) 34 | 35 | sh 'mkdir -p /tmp/centos-7-${time_stamp}' 36 | sh "RSYNC_PASSWORD='${rsync_key}' rsync -av /tmp/centos-7-${time_stamp} sig-cloudinstance@artifacts.ci.centos.org::sig-cloudinstance/" 37 | 38 | } 39 | 40 | stage('Checkout'){ 41 | checkout scm 42 | } 43 | 44 | c7arches.each { arch -> 45 | stage("c7-$arch") { 46 | try{ 47 | stage ("Allocate node"){ 48 | env.CICO_API_KEY = readFile("${env.HOME}/duffy.key").trim() 49 | duffy_rtn=sh( 50 | script: "cico --debug node get --arch ${arch} -f value -c hostname -c comment", 51 | returnStdout: true 52 | ).trim().tokenize(' ') 53 | env.DUFFY_NODE = duffy_rtn[0] 54 | env.DUFFY_SSID = duffy_rtn[1] 55 | } 56 | stage ("setup"){ 57 | onmyduffynode "yum -y install rsync docker lorax anaconda-tui yum-langpacks virt-install libvirt-python" 58 | synctoduffynode "docker/centos-7-${arch}.ks" 59 | synctoduffynode "docker/containerbuild.sh" 60 | } 61 | 62 | stage("build boot.iso"){ 63 | onmyduffynode "./containerbuild.sh centos-7-${arch}.ks" 64 | } 65 | 66 | stage("tag the container"){ 67 | env.time_stamp = sh( 68 | script: "date +%Y%m%d", 69 | returnStdout: true 70 | ) 71 | onmyduffynode 'systemctl start docker' 72 | onmyduffynode "cat /var/tmp/containers/*/centos-7-${arch}/docker/centos-7-${arch}-docker.tar.xz | docker import - centos:7" 73 | onmyduffynode "docker tag centos:7 centos:centos7" 74 | onmyduffynode "docker tag centos:7 centos:centos7.6.${time_stamp}" 75 | onmyduffynode "docker tag centos:7 centos:7.6.${time_stamp}" 76 | onmyduffynode "docker tag centos:7 centos:latest" 77 | } 78 | 79 | stage("push to artifacts"){ 80 | 81 | env.time_stamp = sh( 82 | script: "date +%y%m%d", 83 | returnStdout: true 84 | ).trim() 85 | 86 | env.rsync_key = sh( 87 | script: "head -c 13 ~/duffy.key", 88 | returnStdout: true 89 | ) 90 | 91 | 92 | onmyduffynode "mkdir -p /tmp/centos-7-${time_stamp}/${arch}" 93 | 94 | onmyduffynode "cp -r /var/tmp/containers/*/centos-7-${arch}/docker/* /tmp/centos-7-${time_stamp}/${arch}" 95 | 96 | onmyduffynode "RSYNC_PASSWORD='${rsync_key}' rsync -av /tmp/centos-7-${time_stamp}/${arch}/ sig-cloudinstance@artifacts.ci.centos.org::sig-cloudinstance/centos-7-${time_stamp}/${arch}/" 97 | } 98 | } 99 | 100 | catch (e){ 101 | currentBuild.result = "FAILURE" 102 | throw e 103 | } 104 | finally{ 105 | stage("Cleanup"){ 106 | sh 'cico node done ${DUFFY_SSID}' 107 | } 108 | } 109 | } 110 | } 111 | } 112 | 113 | -------------------------------------------------------------------------------- /docker/README.md: -------------------------------------------------------------------------------- 1 | CentOS Docker build scripts 2 | =========================== 3 | 4 | This repository contains the kickstart files needed to build a CentOS Docker container from scratch 5 | 6 | ## Necessary tools 7 | 8 | The Docker base containers for 6 and 7 are now created with tools included in CentOS itself. This means we're no longer dependent on the 3rd party [ami-creator](https://github.com/katzj/ami-creator). 9 | This method does NOT work for CentOS-5 base containers. 10 | 11 | The following packages and dependencies are needed: 12 | 13 | * lorax 14 | * anaconda-tui 15 | 16 | 17 | ## Build 18 | 19 | In order to build the container, a rootfs tarball and Dockerfile are required. 20 | We use lorax's livemedia-creator to create the rootfs tarball, but you'll need 21 | a boot.iso start the process. Below you can find a set of example commands 22 | that will produce a suitable rootfs tarball. Additionally you can also run the 23 | containerbuild.sh script, which will fetch the iso, create the rootfs, and 24 | generate a Dockerfile for you. 25 | 26 | ### The hard way 27 | -- 28 | ```bash 29 | # curl http://mirror.centos.org/centos/7/os/x86_64/images/boot.iso -o /tmp/boot7.iso 30 | # sudo livemedia-creator --make-tar --iso=/tmp/boot7.iso --ks=/path/to/centos-7.ks --image-name=centos-7-docker.tar.xz 31 | ``` 32 | -- 33 | 34 | Once livemedia-creator has finished, you can use the Dockerfile-TEMPLATE to 35 | create a suitable Dockerfile. 36 | 37 | ### The easy way 38 | 39 | After you've run this command, your rootfs tarball and Dockerfile will be 40 | waiting for you in `/var/tmp/containers//` 41 | 42 | -- 43 | ```bash 44 | # sudo ./containerbuild.sh centos-7.ks 45 | ``` 46 | -- 47 | 48 | Once this is done, you can delete the `boot.iso` files in /tmp if you wish. 49 | 50 | 51 | ## Usage 52 | 53 | From here, you can either import the docker container via 54 | 55 | ``` 56 | cat centos-version-docker.tar.xz | docker import - container-name 57 | ``` 58 | 59 | Or you can create a Dockerfile to build the image directly in docker. 60 | 61 | ``` 62 | FROM scratch 63 | MAINTAINER you - ami_creator 64 | ADD centos-version-docker.tar.xz / 65 | ``` 66 | -------------------------------------------------------------------------------- /docker/centos-5.11.ks: -------------------------------------------------------------------------------- 1 | install 2 | url --url=http://mirror.centos.org/centos/5/os/x86_64/ 3 | lang en_US.UTF-8 4 | keyboard uk 5 | network --device eth0 --bootproto dhcp 6 | rootpw --iscrypted $1$UKLtvLuY$kka6S665oCFmU7ivSDZzU. 7 | authconfig --enableshadow --passalgo=sha512 8 | selinux --enforcing 9 | timezone --utc UTC 10 | repo --name="CentOS" --baseurl=http://mirror.centos.org/centos/5.11/os/x86_64/ --cost=100 11 | repo --name="selinux" --baseurl=http://mirror.centos.org/centos/5.11/centosplus/x86_64/ --cost=100 12 | 13 | clearpart --all --initlabel 14 | part / --fstype ext4 --size=1024 --grow 15 | reboot 16 | %packages --nobase 17 | vim-minimal 18 | yum 19 | bash 20 | bind-utils 21 | centos-release 22 | shadow-utils 23 | findutils 24 | iputils 25 | iproute 26 | grub 27 | -*-firmware 28 | passwd 29 | libselinux-utils 30 | -kernel 31 | rootfiles 32 | 33 | %end 34 | 35 | %post --nochroot --erroronfail 36 | # We need to convert the rpmdb, because rpm in c5 gets confused 37 | if file "$INSTALL_ROOT"/var/lib/rpm/Packages | grep -q "version 9"; then 38 | pushd "$INSTALL_ROOT"/var/lib/rpm 2>/dev/null || exit 1 39 | rm -f __db* 40 | for f in * ; do 41 | db_dump "$f" | db43_load "$f".43 || exit 1 42 | mv "$f".43 "$f" 43 | done 44 | popd 2>/dev/null 45 | fi 46 | %end 47 | 48 | %post 49 | # randomize root password and lock root account 50 | dd if=/dev/urandom count=50 | md5sum | passwd --stdin root 51 | passwd -l root 52 | 53 | # create necessary devices 54 | /sbin/MAKEDEV /dev/console 55 | 56 | # cleanup unwanted stuff 57 | 58 | # ami-creator requires grub during the install, so we remove it (and 59 | # its dependencies) in %post 60 | rpm -e grub redhat-logos 61 | rm -rf /boot 62 | 63 | # some packages get installed even though we ask for them not to be, 64 | # and they don't have any external dependencies that should make 65 | # anaconda install them 66 | rpm -e policycoreutils passwd openldap libuser iscsi-initiator-utils \ 67 | mkinitrd 68 | 69 | 70 | # Can't remove docs on c5 due to a bug similar to 71 | # https://bugzilla.redhat.com/show_bug.cgi?id=515911 72 | # Keep yum from installing documentation. It takes up too much space. 73 | #sed -i '/distroverpkg=centos-release/a tsflags=nodocs' /etc/yum.conf 74 | 75 | #Generate installtime file record 76 | /bin/date +%Y%m%d_%H%M > /etc/BUILDTIME 77 | 78 | 79 | 80 | # nuking the locales breaks things. Lets not do that anymore strip 81 | # most of the languages from the archive. stolen from 82 | # https://bugzilla.redhat.com/show_bug.cgi?id=156477#c28 83 | localedef --delete-from-archive $(localedef --list-archive | \ 84 | grep -v -i ^en | xargs ) 85 | # prep the archive template 86 | mv /usr/lib/locale/locale-archive /usr/lib/locale/locale-archive.tmpl 87 | # rebuild archive 88 | /usr/sbin/build-locale-archive 89 | #empty the template 90 | :>/usr/lib/locale/locale-archive.tmpl 91 | 92 | # man pages and documentation 93 | find /usr/share/{man,doc,info,gnome/help} -type f -delete 94 | 95 | # sln 96 | rm -f /sbin/sln 97 | 98 | # ldconfig 99 | rm -rf /etc/ld.so.cache 100 | rm -rf /var/cache/ldconfig/* 101 | 102 | # Add centosplus repo enabled by default, with includepkg for 103 | # libselinux updates until this patch lands in upstream. 104 | 105 | 106 | cat >/etc/yum.repos.d/libselinux.repo </dev/null || exit 1 40 | rm -f __db* 41 | for f in * ; do 42 | db_dump "$f" | db43_load "$f".43 || exit 1 43 | mv "$f".43 "$f" 44 | done 45 | popd 2>/dev/null 46 | fi 47 | %end 48 | 49 | %post 50 | # randomize root password and lock root account 51 | dd if=/dev/urandom count=50 | md5sum | passwd --stdin root 52 | passwd -l root 53 | 54 | # create necessary devices 55 | /sbin/MAKEDEV /dev/console 56 | 57 | # cleanup unwanted stuff 58 | 59 | # ami-creator requires grub during the install, so we remove it (and 60 | # its dependencies) in %post 61 | rpm -e grub redhat-logos 62 | rm -rf /boot 63 | 64 | # some packages get installed even though we ask for them not to be, 65 | # and they don't have any external dependencies that should make 66 | # anaconda install them 67 | rpm -e policycoreutils passwd openldap libuser iscsi-initiator-utils \ 68 | mkinitrd 69 | 70 | 71 | # Can't remove docs on c5 due to a bug similar to 72 | # https://bugzilla.redhat.com/show_bug.cgi?id=515911 73 | # Keep yum from installing documentation. It takes up too much space. 74 | #sed -i '/distroverpkg=centos-release/a tsflags=nodocs' /etc/yum.conf 75 | 76 | #Generate installtime file record 77 | /bin/date +%Y%m%d_%H%M > /etc/BUILDTIME 78 | 79 | 80 | 81 | # nuking the locales breaks things. Lets not do that anymore strip 82 | # most of the languages from the archive. stolen from 83 | # https://bugzilla.redhat.com/show_bug.cgi?id=156477#c28 84 | localedef --delete-from-archive $(localedef --list-archive | \ 85 | grep -v -i ^en | xargs ) 86 | # prep the archive template 87 | mv /usr/lib/locale/locale-archive /usr/lib/locale/locale-archive.tmpl 88 | # rebuild archive 89 | /usr/sbin/build-locale-archive 90 | #empty the template 91 | :>/usr/lib/locale/locale-archive.tmpl 92 | 93 | # man pages and documentation 94 | find /usr/share/{man,doc,info,gnome/help} -type f -delete 95 | 96 | # sln 97 | rm -f /sbin/sln 98 | 99 | # ldconfig 100 | rm -rf /etc/ld.so.cache 101 | rm -rf /var/cache/ldconfig/* 102 | 103 | # Add centosplus repo enabled by default, with includepkg for 104 | # libselinux updates until this patch lands in upstream. 105 | 106 | 107 | cat >/etc/yum.repos.d/libselinux.repo < /etc/rpm/macros.image-language-conf 79 | 80 | awk '(NF==0&&!done){print "override_install_langs='$LANG'\ntsflags=nodocs";done=1}{print}' \ 81 | < /etc/yum.conf > /etc/yum.conf.new 82 | mv /etc/yum.conf.new /etc/yum.conf 83 | echo 'container' > /etc/yum/vars/infra 84 | 85 | rm -f /usr/lib/locale/locale-archive 86 | 87 | #Setup locale properly 88 | localedef -v -c -i en_US -f UTF-8 en_US.UTF-8 89 | 90 | #disable services 91 | for serv in `/sbin/chkconfig|cut -f1`; do /sbin/chkconfig "$serv" off; done; 92 | mv /etc/rc1.d/S26udev-post /etc/rc1.d/K26udev-post 93 | 94 | 95 | rm -rf /var/cache/yum/* 96 | rm -f /tmp/ks-script* 97 | rm -rf /etc/sysconfig/network-scripts/ifcfg-* 98 | 99 | #Generate installtime file record 100 | /bin/date +%Y%m%d_%H%M > /etc/BUILDTIME 101 | 102 | %end 103 | -------------------------------------------------------------------------------- /docker/centos-6i386.ks: -------------------------------------------------------------------------------- 1 | # This is a minimal CentOS kickstart designed for docker. 2 | # It will not produce a bootable system 3 | # To use this kickstart, run the following command 4 | # livemedia-creator --make-tar \ 5 | # --iso=/path/to/boot.iso \ 6 | # --ks=centos-6i386.ks \ 7 | # --image-name=centos-root.tar.xz 8 | # 9 | # Once the image has been generated, it can be imported into docker 10 | # by using: cat centos-root.tar.xz | docker import -i imagename 11 | 12 | # Basic setup information 13 | url --url="http://mirrors.kernel.org/centos/6/os/i386/" 14 | install 15 | keyboard us 16 | lang en_US.UTF-8 17 | rootpw --lock --iscrypted locked 18 | authconfig --enableshadow --passalgo=sha512 19 | timezone --isUtc Etc/UTC 20 | selinux --enforcing 21 | firewall --disabled 22 | network --bootproto=dhcp --device=eth0 --activate --onboot=on 23 | reboot 24 | bootloader --location=none 25 | 26 | # Repositories to use 27 | repo --name="CentOS" --baseurl=http://mirror.centos.org/centos/6/os/i386/ --cost=100 28 | repo --name="Updates" --baseurl=http://mirror.centos.org/centos/6/updates/i386/ --cost=100 29 | 30 | # Disk setup 31 | zerombr 32 | clearpart --all 33 | part / --size 3000 --fstype ext4 34 | 35 | %packages --excludedocs --nobase --nocore 36 | vim-minimal 37 | yum 38 | bash 39 | bind-utils 40 | centos-release 41 | shadow-utils 42 | findutils 43 | iputils 44 | iproute 45 | grub 46 | -*-firmware 47 | passwd 48 | rootfiles 49 | util-linux-ng 50 | yum-plugin-ovl 51 | 52 | %end 53 | 54 | %post --log=/tmp/anaconda-post.log 55 | # Post configure tasks for Docker 56 | 57 | # remove stuff we don't need that anaconda insists on 58 | # kernel needs to be removed by rpm, because of grubby 59 | rpm -e kernel 60 | 61 | yum -y remove dhclient dhcp-libs dracut grubby kmod grub2 centos-logos \ 62 | hwdata os-prober gettext* bind-license freetype kmod-libs dracut 63 | 64 | yum -y remove firewalld dbus-glib dbus-python ebtables \ 65 | gobject-introspection libselinux-python pygobject3-base \ 66 | python-decorator python-slip python-slip-dbus kpartx kernel-firmware \ 67 | device-mapper* e2fsprogs-libs sysvinit-tools kbd-misc libss upstart 68 | 69 | #clean up unused directories 70 | rm -rf /boot 71 | rm -rf /etc/firewalld 72 | 73 | # Randomize root's password and lock 74 | dd if=/dev/urandom count=50 | md5sum | passwd --stdin root 75 | passwd -l root 76 | 77 | #LANG="en_US" 78 | #echo "%_install_lang $LANG" > /etc/rpm/macros.image-language-conf 79 | 80 | awk '(NF==0&&!done){print "override_install_langs='$LANG'\ntsflags=nodocs";done=1}{print}' \ 81 | < /etc/yum.conf > /etc/yum.conf.new 82 | mv /etc/yum.conf.new /etc/yum.conf 83 | echo 'container' > /etc/yum/vars/infra 84 | echo 'i386' > /etc/yum/vars/basearch 85 | 86 | rm -f /usr/lib/locale/locale-archive 87 | 88 | #Setup locale properly 89 | localedef -v -c -i en_US -f UTF-8 en_US.UTF-8 90 | 91 | #disable services 92 | for serv in `/sbin/chkconfig|cut -f1`; do /sbin/chkconfig "$serv" off; done; 93 | mv /etc/rc1.d/S26udev-post /etc/rc1.d/K26udev-post 94 | 95 | 96 | rm -rf /var/cache/yum/* 97 | rm -f /tmp/ks-script* 98 | rm -rf /etc/sysconfig/network-scripts/ifcfg-* 99 | 100 | #Generate installtime file record 101 | /bin/date +%Y%m%d_%H%M > /etc/BUILDTIME 102 | 103 | %end 104 | 105 | -------------------------------------------------------------------------------- /docker/centos-7-aarch64.ks: -------------------------------------------------------------------------------- 1 | # This is a minimal CentOS kickstart designed for docker. 2 | # It will not produce a bootable system 3 | # To use this kickstart, run the following command 4 | # livemedia-creator --make-tar \ 5 | # --iso=/path/to/boot.iso \ 6 | # --ks=centos-7.ks \ 7 | # --image-name=centos-root.tar.xz 8 | # 9 | # Once the image has been generated, it can be imported into docker 10 | # by using: cat centos-root.tar.xz | docker import -i imagename 11 | 12 | # Basic setup information 13 | url --url="http://mirror.centos.org/altarch/7/os/aarch64/" 14 | install 15 | keyboard us --xlayouts=us --vckeymap=us 16 | rootpw --lock --iscrypted locked 17 | timezone --isUtc --nontp UTC 18 | selinux --enforcing 19 | firewall --disabled 20 | network --bootproto=dhcp --device=link --activate --onboot=on 21 | shutdown 22 | bootloader --location=mbr 23 | lang en_US.UTF-8 24 | 25 | # Repositories to use 26 | repo --name="instCentOS" --baseurl=http://mirror.centos.org/altarch/7/os/aarch64/ --cost=100 27 | ## Uncomment for rolling builds 28 | repo --name="instUpdates" --baseurl=http://mirror.centos.org/altarch/7/updates/aarch64/ --cost=100 29 | 30 | # Disk setup 31 | clearpart --initlabel --all 32 | part /boot/efi --size=100 33 | part /boot --size=400 --label=boot 34 | part swap --size=2000 --label=swap --asprimary 35 | part / --size=8192 --label=rootfs 36 | 37 | # Package setup 38 | %packages --excludedocs --instLangs=en --nocore 39 | bind-utils 40 | bash 41 | yum 42 | vim-minimal 43 | centos-release 44 | less 45 | -kernel* 46 | -*firmware 47 | -os-prober 48 | -gettext* 49 | -bind-license 50 | -freetype 51 | iputils 52 | iproute 53 | systemd 54 | rootfiles 55 | -libteam 56 | -teamd 57 | tar 58 | passwd 59 | yum-utils 60 | yum-plugin-ovl 61 | -GeoIP 62 | -firewalld-filesystem 63 | -libss 64 | -qemu-guest-agent 65 | 66 | 67 | %end 68 | 69 | %post --log=/anaconda-post.log 70 | # Post configure tasks for Docker 71 | 72 | # remove stuff we don't need that anaconda insists on 73 | # kernel needs to be removed by rpm, because of grubby 74 | rpm -e kernel 75 | 76 | yum -y remove bind-libs bind-libs-lite dhclient dhcp-common dhcp-libs \ 77 | dracut-network e2fsprogs e2fsprogs-libs ebtables ethtool file \ 78 | firewalld freetype gettext gettext-libs groff-base grub2-efi grub2-tools \ 79 | grubby initscripts iproute iptables kexec-tools libcroco libgomp \ 80 | libmnl libnetfilter_conntrack libnfnetlink libselinux-python lzo \ 81 | libunistring os-prober python-decorator python-slip python-slip-dbus \ 82 | snappy sysvinit-tools which linux-firmware centos-logos shim \ 83 | mokutil pciutils-libs xfsprogs dosfstools efibootmgr efivar-libs \ 84 | GeoIP firewalld-filesystem 85 | yum clean all 86 | 87 | #clean up unused directories 88 | rm -rf /boot 89 | rm -rf /etc/firewalld 90 | 91 | # Lock roots account, keep roots account password-less. 92 | passwd -l root 93 | 94 | #LANG="en_US" 95 | #echo "%_install_lang $LANG" > /etc/rpm/macros.image-language-conf 96 | 97 | awk '(NF==0&&!done){print "override_install_langs='$LANG'\ntsflags=nodocs";done=1}{print}' \ 98 | < /etc/yum.conf > /etc/yum.conf.new 99 | mv /etc/yum.conf.new /etc/yum.conf 100 | echo 'container' > /etc/yum/vars/infra 101 | 102 | 103 | 104 | #Setup locale properly 105 | #localedef -v -c -i en_US -f UTF-8 en_US.UTF-8 106 | 107 | rm -rf /var/cache/yum/aarch64 108 | rm -f /tmp/ks-script* 109 | rm -rf /var/log/anaconda* 110 | rm -rf /tmp/ks-script* 111 | rm -rf /etc/sysconfig/network-scripts/ifcfg-* 112 | # do we really need a hardware database in a container? 113 | rm -rf /etc/udev/hwdb.bin 114 | rm -rf /usr/lib/udev/hwdb.d/* 115 | 116 | 117 | ## Systemd fixes 118 | # no machine-id by default. 119 | :> /etc/machine-id 120 | # Fix /run/lock breakage since it's not tmpfs in docker 121 | umount /run 122 | systemd-tmpfiles --create --boot 123 | # Make sure login works 124 | rm /var/run/nologin 125 | 126 | 127 | #Generate installtime file record 128 | /bin/date +%Y%m%d_%H%M > /etc/BUILDTIME 129 | 130 | %end 131 | -------------------------------------------------------------------------------- /docker/centos-7-armhfp.ks: -------------------------------------------------------------------------------- 1 | # This is a minimal CentOS kickstart designed for docker. 2 | # It will not produce a bootable system 3 | # To use this kickstart, run the following command 4 | # livemedia-creator --make-tar \ 5 | # --iso=/path/to/boot.iso \ 6 | # --ks=centos-7.ks \ 7 | # --image-name=centos-root.tar.xz 8 | # 9 | # Once the image has been generated, it can be imported into docker 10 | # by using: cat centos-root.tar.xz | docker import -i imagename 11 | 12 | # Basic setup information 13 | url --url="http://mirror.centos.org/altarch/7/os/armhfp/" 14 | install 15 | keyboard us --xlayouts=us --vckeymap=us 16 | rootpw --lock --iscrypted locked 17 | timezone --isUtc --nontp UTC 18 | selinux --enforcing 19 | firewall --disabled 20 | network --bootproto=dhcp --device=link --activate --onboot=on 21 | shutdown 22 | bootloader --disable 23 | lang en_US.UTF-8 24 | 25 | # Repositories to use 26 | repo --name="CentOS" --baseurl=http://mirror.centos.org/altarch/7/os/armhfp/ --cost=100 27 | ## Uncomment for rolling builds 28 | repo --name="Updates" --baseurl=http://mirror.centos.org/altarch/7/updates/armhfp/ --cost=100 29 | 30 | 31 | # Disk setup 32 | zerombr 33 | clearpart --initlabel --all 34 | part / --size=3000 --label=rootfs 35 | 36 | # Package setup 37 | %packages --excludedocs --instLangs=en --nocore 38 | bind-utils 39 | bash 40 | yum 41 | vim-minimal 42 | centos-userland-release 43 | less 44 | -kernel* 45 | -*firmware 46 | -os-prober 47 | -gettext* 48 | -bind-license 49 | -freetype 50 | iputils 51 | iproute 52 | systemd 53 | rootfiles 54 | -libteam 55 | -teamd 56 | tar 57 | passwd 58 | yum-utils 59 | yum-plugin-ovl 60 | -GeoIP 61 | -firewalld-filesystem 62 | -libss 63 | -qemu-guest-agent 64 | 65 | 66 | %end 67 | 68 | %post --log=/anaconda-post.log 69 | # Post configure tasks for Docker 70 | 71 | # remove stuff we don't need that anaconda insists on 72 | # kernel needs to be removed by rpm, because of grubby 73 | rpm -e kernel 74 | 75 | yum -y remove bind-libs bind-libs-lite dhclient dhcp-common dhcp-libs \ 76 | dracut-network e2fsprogs e2fsprogs-libs ebtables ethtool file \ 77 | firewalld freetype gettext gettext-libs groff-base grub2-efi grub2-tools \ 78 | grubby initscripts iproute iptables kexec-tools libcroco libgomp \ 79 | libmnl libnetfilter_conntrack libnfnetlink libselinux-python lzo \ 80 | libunistring os-prober python-decorator python-slip python-slip-dbus \ 81 | snappy sysvinit-tools which linux-firmware centos-logos shim \ 82 | mokutil pciutils-libs xfsprogs dosfstools efibootmgr efivar-libs \ 83 | GeoIP firewalld-filesystem 84 | yum clean all 85 | 86 | #clean up unused directories 87 | rm -rf /boot 88 | rm -rf /etc/firewalld 89 | 90 | # Lock roots account, keep roots account password-less. 91 | passwd -l root 92 | 93 | #LANG="en_US" 94 | #echo "%_install_lang $LANG" > /etc/rpm/macros.image-language-conf 95 | 96 | awk '(NF==0&&!done){print "override_install_langs='$LANG'\ntsflags=nodocs";done=1}{print}' \ 97 | < /etc/yum.conf > /etc/yum.conf.new 98 | mv /etc/yum.conf.new /etc/yum.conf 99 | echo 'container' > /etc/yum/vars/infra 100 | echo 'generic' > /etc/yum/vars/kvariant 101 | 102 | 103 | #Setup locale properly 104 | #localedef -v -c -i en_US -f UTF-8 en_US.UTF-8 105 | 106 | rm -rf /var/cache/yum/aarch64 107 | rm -f /tmp/ks-script* 108 | rm -rf /var/log/anaconda* 109 | rm -rf /tmp/ks-script* 110 | rm -rf /etc/sysconfig/network-scripts/ifcfg-* 111 | # do we really need a hardware database in a container? 112 | rm -rf /etc/udev/hwdb.bin 113 | rm -rf /usr/lib/udev/hwdb.d/* 114 | 115 | 116 | ## Systemd fixes 117 | # no machine-id by default. 118 | :> /etc/machine-id 119 | # Fix /run/lock breakage since it's not tmpfs in docker 120 | umount /run 121 | systemd-tmpfiles --create --boot 122 | # Make sure login works 123 | rm /var/run/nologin 124 | 125 | 126 | #Generate installtime file record 127 | /bin/date +%Y%m%d_%H%M > /etc/BUILDTIME 128 | 129 | %end 130 | -------------------------------------------------------------------------------- /docker/centos-7-i386.ks: -------------------------------------------------------------------------------- 1 | # This is a minimal CentOS kickstart designed for docker. 2 | # It will not produce a bootable system 3 | # To use this kickstart, run the following command 4 | # livemedia-creator --make-tar \ 5 | # --iso=/path/to/boot.iso \ 6 | # --ks=centos-7.ks \ 7 | # --image-name=centos-root.tar.xz 8 | # 9 | # Once the image has been generated, it can be imported into docker 10 | # by using: cat centos-root.tar.xz | docker import -i imagename 11 | 12 | # Basic setup information 13 | url --url="http://mirror.centos.org/altarch/7/os/i386/" 14 | install 15 | keyboard us 16 | rootpw --lock --iscrypted locked 17 | timezone --isUtc --nontp UTC 18 | selinux --enforcing 19 | firewall --disabled 20 | network --bootproto=dhcp --device=link --activate --onboot=on 21 | shutdown 22 | bootloader --disable 23 | lang en_US 24 | 25 | # Repositories to use 26 | repo --name="CentOS" --baseurl=http://mirror.centos.org/altarch/7/os/i386/ --cost=100 27 | ## Uncomment for rolling builds 28 | repo --name="Updates" --baseurl=http://mirror.centos.org/altarch/7/updates/i386/ --cost=100 29 | 30 | # Disk setup 31 | zerombr 32 | clearpart --all --initlabel 33 | part / --size 3000 --fstype ext4 34 | 35 | # Package setup 36 | %packages --excludedocs --instLangs=en --nocore 37 | bind-utils 38 | bash 39 | yum 40 | vim-minimal 41 | centos-release 42 | less 43 | -kernel* 44 | -*firmware 45 | -firewalld-filesystem 46 | -os-prober 47 | -gettext* 48 | -GeoIP 49 | -bind-license 50 | -freetype 51 | iputils 52 | iproute 53 | systemd 54 | rootfiles 55 | -libteam 56 | -teamd 57 | tar 58 | passwd 59 | yum-utils 60 | yum-plugin-ovl 61 | 62 | 63 | %end 64 | 65 | %post --log=/anaconda-post.log 66 | # Post configure tasks for Docker 67 | 68 | # remove stuff we don't need that anaconda insists on 69 | # kernel needs to be removed by rpm, because of grubby 70 | rpm -e kernel 71 | 72 | yum -y remove bind-libs bind-libs-lite dhclient dhcp-common dhcp-libs \ 73 | dracut-network e2fsprogs e2fsprogs-libs ebtables ethtool file \ 74 | firewalld freetype gettext gettext-libs groff-base grub2 grub2-tools \ 75 | grubby initscripts iproute iptables kexec-tools libcroco libgomp \ 76 | libmnl libnetfilter_conntrack libnfnetlink libselinux-python lzo \ 77 | libunistring os-prober python-decorator python-slip python-slip-dbus \ 78 | snappy sysvinit-tools which linux-firmware GeoIP firewalld-filesystem 79 | 80 | yum clean all 81 | 82 | #clean up unused directories 83 | rm -rf /boot 84 | rm -rf /etc/firewalld 85 | 86 | # Lock roots account, keep roots account password-less. 87 | passwd -l root 88 | 89 | #LANG="en_US" 90 | #echo "%_install_lang $LANG" > /etc/rpm/macros.image-language-conf 91 | 92 | awk '(NF==0&&!done){print "override_install_langs=en_US.utf8\ntsflags=nodocs";done=1}{print}' \ 93 | < /etc/yum.conf > /etc/yum.conf.new 94 | mv /etc/yum.conf.new /etc/yum.conf 95 | echo 'container' > /etc/yum/vars/infra 96 | echo -e 'i386\n' > /etc/yum/vars/basearch 97 | 98 | 99 | ##Setup locale properly 100 | # Commenting out, as this seems to no longer be needed 101 | #rm -f /usr/lib/locale/locale-archive 102 | #localedef -v -c -i en_US -f UTF-8 en_US.UTF-8 103 | 104 | ## Remove some things we don't need 105 | rm -rf /var/cache/yum/x86_64 106 | rm -f /tmp/ks-script* 107 | rm -rf /var/log/anaconda 108 | rm -rf /tmp/ks-script* 109 | rm -rf /etc/sysconfig/network-scripts/ifcfg-* 110 | # do we really need a hardware database in a container? 111 | rm -rf /etc/udev/hwdb.bin 112 | rm -rf /usr/lib/udev/hwdb.d/* 113 | 114 | ## Systemd fixes 115 | # no machine-id by default. 116 | :> /etc/machine-id 117 | # Fix /run/lock breakage since it's not tmpfs in docker 118 | umount /run 119 | systemd-tmpfiles --create --boot 120 | # Make sure login works 121 | rm /var/run/nologin 122 | 123 | 124 | #Generate installtime file record 125 | /bin/date +%Y%m%d_%H%M > /etc/BUILDTIME 126 | 127 | 128 | %end 129 | -------------------------------------------------------------------------------- /docker/centos-7-ppc64le.ks: -------------------------------------------------------------------------------- 1 | # This is a minimal CentOS kickstart designed for docker. 2 | # It will not produce a bootable system 3 | # To use this kickstart, run the following command 4 | # livemedia-creator --make-tar \ 5 | # --iso=/path/to/boot.iso \ 6 | # --ks=centos-7.ks \ 7 | # --image-name=centos-root.tar.xz 8 | # 9 | # Once the image has been generated, it can be imported into docker 10 | # by using: cat centos-root.tar.xz | docker import -i imagename 11 | 12 | # Basic setup information 13 | url --url="http://mirror.centos.org/altarch/7/os/ppc64le/" 14 | install 15 | keyboard us 16 | rootpw --lock --iscrypted locked 17 | timezone --isUtc --nontp UTC 18 | selinux --enforcing 19 | firewall --disabled 20 | network --bootproto=dhcp --device=link --activate --onboot=on 21 | shutdown 22 | bootloader --disable 23 | lang en_US 24 | 25 | # Repositories to use 26 | repo --name="CentOS" --baseurl=http://mirror.centos.org/altarch/7/os/ppc64le/ --cost=100 27 | ## Uncomment for rolling builds 28 | repo --name="Updates" --baseurl=http://mirror.centos.org/altarch/7/updates/ppc64le/ --cost=100 29 | 30 | # Disk setup 31 | zerombr 32 | clearpart --all --initlabel 33 | part / --fstype ext4 --size=3000 34 | part prepboot --fstype "PPC PReP Boot" --size=10 35 | 36 | # Package setup 37 | %packages --excludedocs --instLangs=en --nocore 38 | bind-utils 39 | bash 40 | yum 41 | vim-minimal 42 | centos-release 43 | less 44 | -kernel* 45 | -*firmware 46 | -firewalld-filesystem 47 | -os-prober 48 | -gettext* 49 | -GeoIP 50 | -bind-license 51 | -freetype 52 | iputils 53 | iproute 54 | systemd 55 | rootfiles 56 | -libteam 57 | -teamd 58 | tar 59 | passwd 60 | yum-utils 61 | yum-plugin-ovl 62 | 63 | 64 | %end 65 | 66 | %post --log=/anaconda-post.log 67 | # Post configure tasks for Docker 68 | 69 | # remove stuff we don't need that anaconda insists on 70 | # kernel needs to be removed by rpm, because of grubby 71 | rpm -e kernel 72 | 73 | yum -y remove bind-libs bind-libs-lite dhclient dhcp-common dhcp-libs \ 74 | dracut-network e2fsprogs e2fsprogs-libs ebtables ethtool file \ 75 | firewalld freetype gettext gettext-libs groff-base grub2 grub2-tools \ 76 | grubby initscripts iproute iptables kexec-tools libcroco libgomp \ 77 | libmnl libnetfilter_conntrack libnfnetlink libselinux-python lzo \ 78 | libunistring os-prober python-decorator python-slip python-slip-dbus \ 79 | snappy sysvinit-tools which linux-firmware GeoIP firewalld-filesystem 80 | 81 | yum clean all 82 | 83 | #clean up unused directories 84 | rm -rf /boot 85 | rm -rf /etc/firewalld 86 | 87 | # Lock roots account, keep roots account password-less. 88 | passwd -l root 89 | 90 | awk '(NF==0&&!done){print "override_install_langs=en_US.utf8\ntsflags=nodocs";done=1}{print}' \ 91 | < /etc/yum.conf > /etc/yum.conf.new 92 | mv /etc/yum.conf.new /etc/yum.conf 93 | echo 'container' > /etc/yum/vars/infra 94 | 95 | ## Remove some things we don't need 96 | rm -rf /var/cache/yum/* 97 | rm -rf /var/log/* 98 | rm -rf /tmp/* 99 | rm -rf /etc/sysconfig/network-scripts/ifcfg-* 100 | # do we really need a hardware database in a container? 101 | rm -rf /etc/udev/hwdb.bin 102 | rm -rf /usr/lib/udev/hwdb.d/* 103 | 104 | ## Systemd fixes 105 | # no machine-id by default. 106 | :> /etc/machine-id 107 | # Fix /run/lock breakage since it's not tmpfs in docker 108 | umount /run 109 | systemd-tmpfiles --create --boot 110 | # Make sure login works 111 | rm /var/run/nologin 112 | 113 | #Generate installtime file record 114 | /bin/date +%Y%m%d_%H%M > /etc/BUILDTIME 115 | 116 | 117 | %end 118 | -------------------------------------------------------------------------------- /docker/centos-7-x86_64.ks: -------------------------------------------------------------------------------- 1 | # This is a minimal CentOS kickstart designed for docker. 2 | # It will not produce a bootable system 3 | # To use this kickstart, run the following command 4 | # livemedia-creator --make-tar \ 5 | # --iso=/path/to/boot.iso \ 6 | # --ks=centos-7.ks \ 7 | # --image-name=centos-root.tar.xz 8 | # 9 | # Once the image has been generated, it can be imported into docker 10 | # by using: cat centos-root.tar.xz | docker import -i imagename 11 | 12 | # Basic setup information 13 | url --url="http://mirrors.kernel.org/centos/7/os/x86_64/" 14 | install 15 | keyboard us 16 | rootpw --lock --iscrypted locked 17 | timezone --isUtc --nontp UTC 18 | selinux --enforcing 19 | firewall --disabled 20 | network --bootproto=dhcp --device=link --activate --onboot=on 21 | shutdown 22 | bootloader --disable 23 | lang en_US 24 | 25 | # Repositories to use 26 | repo --name="CentOS" --baseurl=http://mirror.centos.org/centos/7/os/x86_64/ --cost=100 27 | ## Uncomment for rolling builds 28 | repo --name="Updates" --baseurl=http://mirror.centos.org/centos/7/updates/x86_64/ --cost=100 29 | 30 | # Disk setup 31 | zerombr 32 | clearpart --all --initlabel 33 | part / --size 3000 --fstype ext4 34 | 35 | # Package setup 36 | %packages --excludedocs --instLangs=en --nocore 37 | bind-utils 38 | bash 39 | yum 40 | vim-minimal 41 | centos-release 42 | less 43 | -kernel* 44 | -*firmware 45 | -firewalld-filesystem 46 | -os-prober 47 | -gettext* 48 | -GeoIP 49 | -bind-license 50 | -freetype 51 | iputils 52 | iproute 53 | systemd 54 | rootfiles 55 | -libteam 56 | -teamd 57 | tar 58 | passwd 59 | yum-utils 60 | yum-plugin-ovl 61 | 62 | %end 63 | 64 | %pre 65 | # Pre configure tasks for Docker 66 | 67 | # Don't add the anaconda build logs to the image 68 | # see /usr/share/anaconda/post-scripts/99-copy-logs.ks 69 | touch /tmp/NOSAVE_LOGS 70 | %end 71 | 72 | %post --log=/anaconda-post.log 73 | # Post configure tasks for Docker 74 | 75 | # remove stuff we don't need that anaconda insists on 76 | # kernel needs to be removed by rpm, because of grubby 77 | rpm -e kernel 78 | 79 | yum -y remove bind-libs bind-libs-lite dhclient dhcp-common dhcp-libs \ 80 | dracut-network e2fsprogs e2fsprogs-libs ebtables ethtool file \ 81 | firewalld freetype gettext gettext-libs groff-base grub2 grub2-tools \ 82 | grubby initscripts iproute iptables kexec-tools libcroco libgomp \ 83 | libmnl libnetfilter_conntrack libnfnetlink libselinux-python lzo \ 84 | libunistring os-prober python-decorator python-slip python-slip-dbus \ 85 | snappy sysvinit-tools which linux-firmware GeoIP firewalld-filesystem \ 86 | qemu-guest-agent 87 | 88 | yum clean all 89 | 90 | #clean up unused directories 91 | rm -rf /boot 92 | rm -rf /etc/firewalld 93 | 94 | # Lock roots account, keep roots account password-less. 95 | passwd -l root 96 | 97 | #LANG="en_US" 98 | #echo "%_install_lang $LANG" > /etc/rpm/macros.image-language-conf 99 | 100 | awk '(NF==0&&!done){print "override_install_langs=en_US.utf8\ntsflags=nodocs";done=1}{print}' \ 101 | < /etc/yum.conf > /etc/yum.conf.new 102 | mv /etc/yum.conf.new /etc/yum.conf 103 | echo 'container' > /etc/yum/vars/infra 104 | 105 | 106 | ##Setup locale properly 107 | # Commenting out, as this seems to no longer be needed 108 | #rm -f /usr/lib/locale/locale-archive 109 | #localedef -v -c -i en_US -f UTF-8 en_US.UTF-8 110 | 111 | ## Remove some things we don't need 112 | rm -rf /var/cache/yum/x86_64 113 | rm -f /tmp/ks-script* 114 | rm -rf /etc/sysconfig/network-scripts/ifcfg-* 115 | # do we really need a hardware database in a container? 116 | rm -rf /etc/udev/hwdb.bin 117 | rm -rf /usr/lib/udev/hwdb.d/* 118 | 119 | ## Systemd fixes 120 | # no machine-id by default. 121 | :> /etc/machine-id 122 | # Fix /run/lock breakage since it's not tmpfs in docker 123 | umount /run 124 | systemd-tmpfiles --create --boot 125 | # Make sure login works 126 | rm /var/run/nologin 127 | 128 | 129 | #Generate installtime file record 130 | /bin/date +%Y%m%d_%H%M > /etc/BUILDTIME 131 | 132 | 133 | %end 134 | -------------------------------------------------------------------------------- /docker/centos-8.ks: -------------------------------------------------------------------------------- 1 | # This is a minimal CentOS kickstart designed for docker. 2 | # It will not produce a bootable system 3 | # To use this kickstart, run the following command 4 | # livemedia-creator --make-tar \ 5 | # --iso=/path/to/boot.iso \ 6 | # --ks=centos-8.ks \ 7 | # --image-name=centos-root.tar.xz 8 | # 9 | 10 | # Basic setup information 11 | install 12 | keyboard us 13 | rootpw --lock --iscrypted locked 14 | timezone --isUtc --nontp UTC 15 | selinux --enforcing 16 | firewall --disabled 17 | network --bootproto=dhcp --device=link --activate --onboot=on 18 | shutdown 19 | bootloader --disable 20 | lang en_US 21 | 22 | 23 | # Disk setup 24 | zerombr 25 | clearpart --all --initlabel 26 | autopart --noboot --nohome --noswap --nolvm --fstype=ext4 27 | 28 | # Package setup 29 | %packages --excludedocs --instLangs=en --nocore 30 | centos-release 31 | binutils 32 | -brotli 33 | bash 34 | hostname 35 | rootfiles 36 | coreutils-single 37 | glibc-minimal-langpack 38 | vim-minimal 39 | less 40 | -gettext* 41 | -firewalld 42 | -os-prober* 43 | tar 44 | -iptables 45 | iputils 46 | -kernel 47 | -dosfstools 48 | -e2fsprogs 49 | -fuse-libs 50 | -gnupg2-smime 51 | -libss 52 | -pinentry 53 | -shared-mime-info 54 | -trousers 55 | -xkeyboard-config 56 | -xfsprogs 57 | -qemu-guest-agent 58 | yum 59 | -grub\* 60 | 61 | %end 62 | 63 | %post --erroronfail --log=/root/anaconda-post.log 64 | # container customizations inside the chroot 65 | 66 | echo 'container' > /etc/dnf/vars/infra 67 | 68 | #Generate installtime file record 69 | /bin/date +%Y%m%d_%H%M > /etc/BUILDTIME 70 | 71 | # Limit languages to help reduce size. 72 | LANG="en_US" 73 | echo "%_install_langs $LANG" > /etc/rpm/macros.image-language-conf 74 | 75 | 76 | # systemd fixes 77 | :> /etc/machine-id 78 | umount /run 79 | systemd-tmpfiles --create --boot 80 | # mask mounts and login bits 81 | systemctl mask systemd-logind.service getty.target console-getty.service sys-fs-fuse-connections.mount systemd-remount-fs.service dev-hugepages.mount 82 | 83 | # Remove things we don't need 84 | rm -f /etc/udev/hwdb.bin 85 | rm -rf /usr/lib/udev/hwdb.d/ 86 | rm -rf /boot 87 | rm -rf /var/lib/dnf/history.* 88 | 89 | 90 | %end 91 | 92 | 93 | -------------------------------------------------------------------------------- /docker/containerbuild.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #-------------------------------------------------------------------- 3 | # Author: Jim Perrin 4 | # Script: containerbuild.sh 5 | # Desc: This script generates a rootfs tarball, and base Dockerfile 6 | # Run this script from the directory where the kickstarts are 7 | # located. 8 | # Modified: Carl Thompson 9 | # Update: Updated to use local boot.iso instead of downloading 10 | # require preperation but is faster in building the image 11 | # Requires: anaconda lorax 12 | #-------------------------------------------------------------------- 13 | #### Basic VAR definitions 14 | USAGE="USAGE: $(basename "$0") kickstart" 15 | KICKSTART="$1" 16 | KSNAME=${KICKSTART%.*} 17 | BUILDDATE=$(date +%Y%m%d) 18 | BUILDROOT=/var/tmp/containers/$BUILDDATE/$KSNAME 19 | CONT_ARCH=$(uname -m) 20 | 21 | #### Test for script requirements 22 | # Did we get passed a kickstart 23 | if [ "$#" -ne 1 ]; then 24 | echo "$USAGE" 25 | exit 1 26 | fi 27 | 28 | # Test for package requirements 29 | PACKAGES=( anaconda-tui lorax yum-langpacks) 30 | for Element in "${PACKAGES[@]}" 31 | do 32 | TEST=`rpm -q --whatprovides $Element` 33 | if [ "$?" -gt 0 ] 34 | then echo "RPM $Element missing" 35 | exit 1 36 | fi 37 | done 38 | 39 | # Is the buildroot already present 40 | if [ -d "$BUILDROOT" ]; then 41 | echo "The Build root, $BUILDROOT, already exists. Would you like to remove it? [y/N] " 42 | read REMOVE 43 | if [ "$REMOVE" == "Y" ] || [ "$REMOVE" == "y" ] 44 | then 45 | if [ ! "$BUILDROOT" == "/" ] 46 | then 47 | rm -rf $BUILDROOT 48 | fi 49 | else 50 | exit 1 51 | fi 52 | fi 53 | 54 | # Build the rootfs 55 | time livemedia-creator --logfile=/tmp/"$KSNAME"-"$BUILDDATE".log \ 56 | --no-virt --make-tar --ks "$KICKSTART" \ 57 | --image-name="$KSNAME"-docker.tar.xz --project "CentOS 7 Docker" \ 58 | --releasever "7" 59 | 60 | # Put the rootfs someplace 61 | mkdir -p $BUILDROOT/docker 62 | mv /var/tmp/"$KSNAME"-docker.tar.xz $BUILDROOT/docker/ 63 | 64 | # Create a Dockerfile to go along with the rootfs. 65 | 66 | BUILDDATE_RFC3339="$(date -d $BUILDDATE --rfc-3339=seconds)" 67 | cat << EOF > $BUILDROOT/docker/Dockerfile 68 | FROM scratch 69 | ADD $KSNAME-docker.tar.xz / 70 | 71 | LABEL \\ 72 | org.label-schema.schema-version="1.0" \\ 73 | org.label-schema.name="CentOS Base Image" \\ 74 | org.label-schema.vendor="CentOS" \\ 75 | org.label-schema.license="GPLv2" \\ 76 | org.label-schema.build-date="$BUILDDATE" \\ 77 | org.opencontainers.image.title="CentOS Base Image" \\ 78 | org.opencontainers.image.vendor="CentOS" \\ 79 | org.opencontainers.image.licenses="GPL-2.0-only" \\ 80 | org.opencontainers.image.created="$BUILDDATE_RFC3339" 81 | 82 | CMD ["/bin/bash"] 83 | EOF 84 | 85 | # Create cccp.yaml for testing 86 | cat << EOF > $BUILDROOT/docker/cccp.yaml 87 | job-id: centos-base 88 | test-skip: true 89 | EOF 90 | -------------------------------------------------------------------------------- /docker/deprecated/centos-6.6.ks: -------------------------------------------------------------------------------- 1 | install 2 | url --url=http://mirror.centos.org/centos/6/os/x86_64/ 3 | lang en_US.UTF-8 4 | keyboard uk 5 | network --device eth0 --bootproto dhcp 6 | rootpw --iscrypted $1$UKLtvLuY$kka6S665oCFmU7ivSDZzU. 7 | authconfig --enableshadow --passalgo=sha512 --enablefingerprint 8 | selinux --enforcing 9 | timezone --utc UTC 10 | repo --name="CentOS" --baseurl=http://mirror.centos.org/centos/6.6/os/x86_64/ --cost=100 11 | 12 | clearpart --all --initlabel 13 | part / --fstype ext4 --size=1024 --grow 14 | reboot 15 | %packages --excludedocs --nobase 16 | vim-minimal 17 | yum 18 | bash 19 | bind-utils 20 | centos-release 21 | shadow-utils 22 | findutils 23 | iputils 24 | iproute 25 | grub 26 | -*-firmware 27 | passwd 28 | rootfiles 29 | 30 | %end 31 | 32 | %post 33 | # randomize root password and lock root account 34 | dd if=/dev/urandom count=50 | md5sum | passwd --stdin root 35 | passwd -l root 36 | 37 | # create necessary devices 38 | /sbin/MAKEDEV /dev/console 39 | 40 | # cleanup unwanted stuff 41 | 42 | # ami-creator requires grub during the install, so we remove it (and 43 | # its dependencies) in %post 44 | rpm -e grub redhat-logos 45 | rm -rf /boot 46 | 47 | # some packages get installed even though we ask for them not to be, 48 | # and they don't have any external dependencies that should make 49 | # anaconda install them 50 | rpm -e policycoreutils passwd 51 | 52 | 53 | # Keep yum from installing documentation. It takes up too much space. 54 | sed -i '/distroverpkg=centos-release/a tsflags=nodocs' /etc/yum.conf 55 | 56 | # Remove files that are known to take up lots of space but leave 57 | # directories intact since those may be required by new rpms. 58 | 59 | #Generate installtime file record 60 | /bin/date +%Y%m%d_%H%M > /etc/BUILDTIME 61 | 62 | # locales 63 | #rm -f /usr/lib/locale/locale-archive 64 | 65 | # nuking the locales breaks things. Lets not do that anymore 66 | # strip most of the languages from the archive. 67 | localedef --delete-from-archive $(localedef --list-archive | \ 68 | grep -v -i ^en | xargs ) 69 | # prep the archive template 70 | mv /usr/lib/locale/locale-archive /usr/lib/locale/locale-archive.tmpl 71 | # rebuild archive 72 | /usr/sbin/build-locale-archive 73 | #empty the template 74 | :>/usr/lib/locale/locale-archive.tmpl 75 | 76 | # man pages and documentation 77 | find /usr/share/{man,doc,info,gnome/help} \ 78 | -type f | xargs /bin/rm 79 | 80 | # sln 81 | rm -f /sbin/sln 82 | 83 | # ldconfig 84 | rm -rf /etc/ld.so.cache 85 | rm -rf /var/cache/ldconfig/* 86 | 87 | 88 | # Add centosplus repo enabled by default, with includepkg for 89 | # libselinux updates until this patch lands in upstream. 90 | 91 | 92 | #cat >/etc/yum.repos.d/libselinux.repo </usr/lib/locale/locale-archive.tmpl 92 | 93 | 94 | #Generate installtime file record 95 | /bin/date +%Y%m%d_%H%M > /etc/BUILDTIME 96 | 97 | 98 | 99 | # man pages and documentation 100 | find /usr/share/{man,doc,info,gnome/help} \ 101 | -type f | xargs /bin/rm 102 | 103 | # cracklib 104 | #find /usr/share/cracklib \ 105 | # -type f | xargs /bin/rm 106 | 107 | # sln 108 | rm -f /sbin/sln 109 | 110 | # ldconfig 111 | rm -rf /etc/ld.so.cache 112 | rm -rf /var/cache/ldconfig/* 113 | 114 | 115 | # Clean up after the installer. 116 | rm -f /etc/rpm/macros.imgcreate 117 | 118 | # temp fix for systemd /run/lock 119 | mkdir /run/lock 120 | chmod 755 /run/lock 121 | 122 | 123 | %end 124 | -------------------------------------------------------------------------------- /docker/deprecated/centos-7.1.1503.ks: -------------------------------------------------------------------------------- 1 | install 2 | keyboard us 3 | network --bootproto=dhcp --device=eth0 --onboot=on 4 | rootpw --iscrypted $1$UKLtvLuY$kka6S665oCFmU7ivSDZzU. 5 | timezone UTC --isUtc 6 | selinux --enforcing 7 | firewall --disabled 8 | repo --name="CentOS" --baseurl=http://mirror.centos.org/centos/7/os/x86_64/ --cost=100 9 | repo --name="systemdcontainer" --baseurl=http://dev.centos.org/centos/7/systemd-container/ --cost=100 10 | 11 | 12 | clearpart --all --initlabel 13 | part / --fstype ext4 --size=1024 --grow 14 | reboot 15 | 16 | %packages --excludedocs --nobase 17 | bind-utils 18 | bash 19 | yum 20 | vim-minimal 21 | centos-release 22 | shadow-utils 23 | less 24 | -kernel* 25 | -*firmware 26 | grub2 27 | -os-prober 28 | -gettext* 29 | -bind-license 30 | -freetype 31 | iputils 32 | iproute 33 | -systemd 34 | systemd-container 35 | firewalld 36 | rootfiles 37 | 38 | %end 39 | 40 | %post 41 | # randomize root password and lock root account 42 | dd if=/dev/urandom count=50 | md5sum | passwd --stdin root 43 | passwd -l root 44 | 45 | # create necessary devices 46 | /sbin/MAKEDEV /dev/console 47 | 48 | # cleanup unwanted stuff 49 | 50 | # ami-creator requires grub during the install, so we remove it (and 51 | # its dependencies) in %post 52 | 53 | # some packages get installed even though we ask for them not to be, 54 | # and they don't have any external dependencies that should make 55 | # anaconda install them 56 | 57 | 58 | yum -y remove grub2 centos-logos hwdata os-prober gettext* \ 59 | bind-license freetype kmod dracut 60 | 61 | 62 | # firewalld is necessary for building on centos7 but it is not 63 | # necessary in the image. remove it and its requirements. 64 | 65 | yum -y remove firewalld dbus-glib dbus-python ebtables \ 66 | gobject-introspection libselinux-python pygobject3-base \ 67 | python-decorator python-slip python-slip-dbus 68 | rm -rf /etc/firewalld 69 | 70 | 71 | rm -rf /boot 72 | 73 | #delete a few systemd things 74 | rm -rf /etc/machine-id 75 | rm -rf /usr/lib/systemd/system/multi-user.target.wants/getty.target 76 | rm -rf /usr/lib/systemd/system/multi-user.target.wants/systemd-logind.service 77 | 78 | # Add tsflags to keep yum from installing docs 79 | 80 | sed -i '/distroverpkg=centos-release/a tsflags=nodocs' /etc/yum.conf 81 | 82 | # Remove files that are known to take up lots of space but leave 83 | # directories intact since those may be required by new rpms. 84 | 85 | # locales 86 | # nuking the locales breaks things. Lets not do that anymore 87 | # strip most of the languages from the archive. 88 | localedef --delete-from-archive $(localedef --list-archive | \ 89 | grep -v -i ^en | xargs ) 90 | # prep the archive template 91 | mv /usr/lib/locale/locale-archive /usr/lib/locale/locale-archive.tmpl 92 | # rebuild archive 93 | /usr/sbin/build-locale-archive 94 | #empty the template 95 | :>/usr/lib/locale/locale-archive.tmpl 96 | 97 | 98 | #Generate installtime file record 99 | /bin/date +%Y%m%d_%H%M > /etc/BUILDTIME 100 | 101 | 102 | 103 | # man pages and documentation 104 | find /usr/share/{man,doc,info,gnome/help} \ 105 | -type f | xargs /bin/rm 106 | 107 | # cracklib 108 | #find /usr/share/cracklib \ 109 | # -type f | xargs /bin/rm 110 | 111 | # sln 112 | rm -f /sbin/sln 113 | 114 | # ldconfig 115 | rm -rf /etc/ld.so.cache 116 | rm -rf /var/cache/ldconfig/* 117 | rm -rf /var/cache/yum/* 118 | 119 | # Clean up after the installer. 120 | rm -f /etc/rpm/macros.imgcreate 121 | 122 | # temp fix for systemd /run/lock 123 | 124 | 125 | %end 126 | -------------------------------------------------------------------------------- /docker/deprecated/img2docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # This script imports a raw image into Docker. It takes two 4 | # arguments: the name of the image file, and the tag to assign to the 5 | # Docker image that it creates. 6 | 7 | usage() { 8 | echo "usage: $(basename $0) " 9 | exit 1 10 | } 11 | 12 | image="$1" 13 | tag="$2" 14 | 15 | if [[ -z $1 || -z $2 ]]; then 16 | usage 17 | fi 18 | 19 | mount="$(mktemp -d --tmpdir)" 20 | mount -o loop "$image" "$mount" 21 | 22 | cd "$mount" 23 | 24 | #this tar seems to cause issues such as rpmdb corruption 25 | #tar -cpSf - --acls --selinux --xattrs * | docker import - "$tag" 26 | 27 | tar --numeric-owner -c . | docker import - "$tag" 28 | 29 | cd - >& /dev/null 30 | umount "$mount" 31 | rmdir "$mount" 32 | -------------------------------------------------------------------------------- /docker/deprecated/img2tar.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # This script imports a raw image into Docker consumeable tarball. It takes one 4 | # arguments: the name of the image file 5 | 6 | usage() { 7 | echo "usage: $(basename $0) " 8 | exit 1 9 | } 10 | 11 | image="$1" 12 | 13 | if [[ -z $1 ]]; then 14 | usage 15 | fi 16 | 17 | mount="$(mktemp -d --tmpdir)" 18 | mount -o loop "$image" "$mount" 19 | 20 | cd "$mount" 21 | #this tar seems to cause issues such as rpmdb corruption 22 | #tar -cpSf - --acls --selinux --xattrs * | bzip2 > ${image}.tar.bz2 23 | 24 | # This one appears to work fine for docker creation 25 | # hacked by jefby,change the output file to /tmp/xxx.tar.bz2 26 | tar --numeric-owner -c . | bzip2 > /tmp/${image}.tar.bz2 27 | cd - >& /dev/null 28 | umount "$mount" 29 | rmdir "$mount" 30 | -------------------------------------------------------------------------------- /openstack/openstack-64-growroot.cfg: -------------------------------------------------------------------------------- 1 | install 2 | url --url=http://mirror.centos.org/centos/6/os/x86_64/ 3 | lang en_US.UTF-8 4 | keyboard uk 5 | network --device eth0 --bootproto dhcp --onboot=on 6 | rootpw --iscrypted --lock $1$UKLtvLuY$kka6S665oCFmU7ivSDZzU. 7 | firewall --service=ssh 8 | authconfig --enableshadow --passalgo=sha512 --enablefingerprint 9 | selinux --enforcing 10 | timezone --utc UTC 11 | bootloader --location=mbr --driveorder=sda 12 | repo --name="CentOS" --baseurl=http://mirrors.karan.org/centos/6/os/x86_64/ --cost=100 13 | repo --name="repo3" --baseurl=http://repos.fedorapeople.org/repos/openstack/cloud-init/epel-6 --cost=200 14 | zerombr yes 15 | clearpart --all --initlabel 16 | part / --fstype ext4 --size=400 --grow 17 | reboot 18 | %packages --excludedocs 19 | @Base 20 | @Core 21 | -bfa-firmware-3.0.3.1-1.el6.noarch 22 | -iwl1000-firmware-39.31.5.1-1.el6.noarch 23 | -ql2400-firmware-5.08.00-1.el6.noarch 24 | -libertas-usb8388-firmware-5.110.22.p23-3.1.el6.noarch 25 | -zd1211-firmware-1.4-4.el6.noarch 26 | -ql2200-firmware-2.02.08-3.1.el6.noarch 27 | -ipw2200-firmware-3.1-4.el6.noarch 28 | -iwl5150-firmware-8.24.2.2-1.el6.noarch 29 | -iwl6050-firmware-41.28.5.1-2.el6.noarch 30 | -iwl6000g2a-firmware-17.168.5.3-1.el6.noarch 31 | -iwl6000-firmware-9.221.4.1-1.el6.noarch 32 | -iwl5000-firmware-8.83.5.1_1-1.el6_1.1.noarch 33 | -ivtv-firmware-20080701-20.2.noarch 34 | -xorg-x11-drv-ati-firmware-6.99.99-1.el6.noarch 35 | -atmel-firmware-1.3-7.el6.noarch 36 | -iwl4965-firmware-228.61.2.24-2.1.el6.noarch 37 | -iwl3945-firmware-15.32.2.9-4.el6.noarch 38 | -rt73usb-firmware-1.8-7.el6.noarch 39 | -ql23xx-firmware-3.03.27-3.1.el6.noarch 40 | -iwl100-firmware-39.31.5.1-1.el6.noarch 41 | -aic94xx-firmware-30-2.el6.noarch 42 | -ql2100-firmware-1.19.38-3.1.el6.noarch 43 | -ql2500-firmware-5.08.00-1.el6.noarch 44 | -rt61pci-firmware-1.2-7.el6.noarch 45 | -ipw2100-firmware-1.3-11.el6.noarch 46 | -b43-fwcutter 47 | -b43-openfwwf 48 | -perl 49 | -perl-Module-Pluggable 50 | -perl-Pod-Escapes 51 | -perl-Pod-Simple 52 | -perl-libs 53 | -perl-version 54 | -vim-enhanced 55 | -abrt 56 | -abrt-addon-ccpp 57 | -abrt-addon-kerneloops 58 | -abrt-addon-python 59 | -abrt-cli 60 | -abrt-libs 61 | -abrt-tui 62 | -libreport 63 | -libreport-cli 64 | -libreport-compat 65 | -libreport-plugin-kerneloops 66 | -libreport-plugin-logger 67 | -libreport-plugin-mailx 68 | -libreport-plugin-reportuploader 69 | -libreport-plugin-rhtsupport 70 | -libreport-python 71 | -cups-libs 72 | -fprintd 73 | -fprintd-pam 74 | -gtk2 75 | -libfprint 76 | -mysql-libs 77 | -cronie 78 | -cronie-anacron 79 | -crontabs 80 | -postfix 81 | -sysstat 82 | -alsa-lib 83 | -alsa-utils 84 | -man 85 | -man-pages 86 | -man-pages-overrides 87 | -yum-utils 88 | -system-config-firewall-base 89 | -system-config-firewall-tui 90 | -system-config-network-tui 91 | -systemtap-runtime 92 | -at 93 | -atk 94 | -avahi-libs 95 | -bc 96 | -bind-libs 97 | -bind-utils 98 | -biosdevname 99 | -blktrace 100 | -busybox 101 | -cairo 102 | -centos-indexhtml 103 | -ConsoleKit 104 | -ConsoleKit-libs 105 | -cpuspeed 106 | -crda 107 | -cyrus-sasl-plain 108 | -dbus 109 | -dbus-python 110 | -desktop-file-utils 111 | -dmidecode 112 | -dmraid 113 | -dmraid-events 114 | -dosfstools 115 | -ed 116 | -eggdbus 117 | -eject 118 | -elfutils-libs 119 | -fontconfig 120 | -freetype 121 | -gnutls 122 | -hal 123 | -hal-info 124 | -hal-libs 125 | -hdparm 126 | -hicolor-icon-theme 127 | -hunspell 128 | -hunspell-en 129 | -irqbalance 130 | -iw 131 | -jasper-libs 132 | -kexec-tools 133 | -ledmon 134 | -libjpeg-turbo 135 | -libnl 136 | -libpcap 137 | -libpng 138 | -libtasn1 139 | -libthai 140 | -libtiff 141 | -libusb1 142 | -libX11 143 | -libX11-common 144 | -libXau 145 | -libxcb 146 | -libXcomposite 147 | -libXcursor 148 | -libXdamage 149 | -libXext 150 | -libXfixes 151 | -libXft 152 | -libXi 153 | -libXinerama 154 | -libxml2-python 155 | -libXrandr 156 | -libXrender 157 | -lsof 158 | -mailx 159 | -microcode_ctl 160 | -mlocate 161 | -mtr 162 | -nano 163 | -ntp 164 | -ntpdate 165 | -ntsysv 166 | -numactl 167 | -pam_passwdqc 168 | -pango 169 | -parted 170 | -pciutils 171 | -pcmciautils 172 | -pinfo 173 | -pixman 174 | -pkgconfig 175 | -pm-utils 176 | -polkit 177 | -prelink 178 | -psacct 179 | -python-ethtool 180 | -python-iwlib 181 | -quota 182 | -rdate 183 | -readahead 184 | -rfkill 185 | -rng-tools 186 | -rsync 187 | -scl-utils 188 | -setserial 189 | -setuptool 190 | -sg3_utils-libs 191 | -sgpio 192 | -smartmontools 193 | -sos 194 | -strace 195 | -tcpdump 196 | -tcp_wrappers 197 | -tcsh 198 | -time 199 | -tmpwatch 200 | -traceroute 201 | -unzip 202 | -usbutils 203 | -usermode 204 | -vconfig 205 | -wget 206 | -wireless-tools 207 | -words 208 | -xdg-utils 209 | -xz 210 | -xz-lzma-compat 211 | -yum-plugin-security 212 | -yum-utils 213 | -zip 214 | 215 | # Stuff from EPEL 216 | cloud-init 217 | dracut-modules-growroot 218 | 219 | %end 220 | 221 | %post --log=/root/post.log --nochroot 222 | sed -i "s/^ACTIVE_CONSOLES=\/dev\/tty\[1-6\]/ACTIVE_CONSOLES=\/dev\/tty1/" /mnt/sysimage/etc/sysconfig/init 223 | 224 | sed -i "/HWADDR/d" /mnt/sysimage/etc/sysconfig/network-scripts/ifcfg-eth* 225 | 226 | rm -f /mnt/sysimage//etc/udev/rules.d/*-persistent-net.rules 227 | touch /mnt/sysimage/etc/udev/rules.d/75-persistent-net-generator.rules 228 | echo NOZEROCONF=yes >> /mnt/sysimage/etc/sysconfig/network 229 | 230 | sed -i 's/rhgb quiet/quiet console=tty0 console=ttyS0,115200n8/g' /boot/grub/grub.conf 231 | sed -i 's/^hiddenmenu$/hiddenmenu\nserial\ --unit=0\ --speed=115200\ --word=8\ --parity=no\ --stop=1\nterminal\ --timeout=5\ console\ serial/g' /boot/grub/grub.conf 232 | 233 | #handle the cloud-init stuff 234 | echo 'disable_root: 0' > /etc/cloud/cloud.cfg.d/01_centos.cfg 235 | echo 'user: root' > /etc/cloud/cloud.cfg.d/01_centos.cfg 236 | 237 | rm -f /mnt/sysimage/root/* 238 | %end 239 | -------------------------------------------------------------------------------- /openstack/openstack-64-growroot.json: -------------------------------------------------------------------------------- 1 | { 2 | "script": "", 3 | "distro": "centos", 4 | "release": "6", 5 | "schedule": "0", 6 | "update": "yes", 7 | "notify_u": "", 8 | "image_tag": "testing", 9 | "type": "kvm", 10 | "notify_e": "", 11 | "extra": { 12 | "vendor": "CentOS", 13 | "disk_type": "qcow2", 14 | "disk_size": "10", 15 | "compression": "bzip2", 16 | "deliver": "pickup", 17 | "xtra_opts": "noipv6", 18 | "networks": { 19 | "net_0": "dhcp" 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /openstack/openstack-65-x86_64.ks: -------------------------------------------------------------------------------- 1 | install 2 | url --url=http://mirrors.karan.org/centos/6/os/x86_64/ 3 | lang en_US.UTF-8 4 | keyboard uk 5 | network --device eth0 --bootproto dhcp 6 | rootpw --iscrypted $1$UKLtvLuY$kka6S665oCFmU7ivSDZzU. 7 | firewall --service=ssh 8 | authconfig --enableshadow --passalgo=sha512 --enablefingerprint 9 | selinux --enforcing 10 | timezone --utc Europe/London 11 | bootloader --location=mbr --driveorder=sda 12 | repo --name="CentOS" --baseurl=http://mirrors.karan.org/centos/6/os/x86_64/ --cost=100 13 | repo --name="cloudinit" --baseurl=https://nazar.karan.org/results/misc/ --cost=100 14 | zerombr yes 15 | clearpart --all --initlabel 16 | part /boot --fstype ext3 --size=400 17 | part pv.2 --size=5000 --grow 18 | volgroup VolGroup00 --pesize=32768 pv.2 19 | logvol / --fstype ext4 --name=LogVol00 --vgname=VolGroup00 --size=1024 --grow 20 | logvol swap --fstype swap --name=LogVol01 --vgname=VolGroup00 --size=256 --grow --maxsize=512 21 | reboot 22 | %packages --excludedocs 23 | @Base 24 | @Core 25 | -bfa-firmware-3.0.3.1-1.el6.noarch 26 | -iwl1000-firmware-39.31.5.1-1.el6.noarch 27 | -ql2400-firmware-5.08.00-1.el6.noarch 28 | -libertas-usb8388-firmware-5.110.22.p23-3.1.el6.noarch 29 | -zd1211-firmware-1.4-4.el6.noarch 30 | -ql2200-firmware-2.02.08-3.1.el6.noarch 31 | -ipw2200-firmware-3.1-4.el6.noarch 32 | -iwl5150-firmware-8.24.2.2-1.el6.noarch 33 | -iwl6050-firmware-41.28.5.1-2.el6.noarch 34 | -iwl6000g2a-firmware-17.168.5.3-1.el6.noarch 35 | -iwl6000-firmware-9.221.4.1-1.el6.noarch 36 | -iwl5000-firmware-8.83.5.1_1-1.el6_1.1.noarch 37 | -ivtv-firmware-20080701-20.2.noarch 38 | -xorg-x11-drv-ati-firmware-6.99.99-1.el6.noarch 39 | -atmel-firmware-1.3-7.el6.noarch 40 | -iwl4965-firmware-228.61.2.24-2.1.el6.noarch 41 | -iwl3945-firmware-15.32.2.9-4.el6.noarch 42 | -rt73usb-firmware-1.8-7.el6.noarch 43 | -ql23xx-firmware-3.03.27-3.1.el6.noarch 44 | -iwl100-firmware-39.31.5.1-1.el6.noarch 45 | -aic94xx-firmware-30-2.el6.noarch 46 | -ql2100-firmware-1.19.38-3.1.el6.noarch 47 | -ql2500-firmware-5.08.00-1.el6.noarch 48 | -rt61pci-firmware-1.2-7.el6.noarch 49 | -ipw2100-firmware-1.3-11.el6.noarch 50 | -b43-fwcutter 51 | -b43-openfwwf 52 | -perl 53 | -perl-Module-Pluggable 54 | -perl-Pod-Escapes 55 | -perl-Pod-Simple 56 | -perl-libs 57 | -perl-version 58 | -vim-enhanced 59 | -abrt 60 | -abrt-addon-ccpp 61 | -abrt-addon-kerneloops 62 | -abrt-addon-python 63 | -abrt-cli 64 | -abrt-libs 65 | -abrt-tui 66 | -libreport 67 | -libreport-cli 68 | -libreport-compat 69 | -libreport-plugin-kerneloops 70 | -libreport-plugin-logger 71 | -libreport-plugin-mailx 72 | -libreport-plugin-reportuploader 73 | -libreport-plugin-rhtsupport 74 | -libreport-python 75 | -cups-libs 76 | -fprintd 77 | -fprintd-pam 78 | -gtk2 79 | -libfprint 80 | -mysql-libs 81 | -cronie 82 | -cronie-anacron 83 | -crontabs 84 | -postfix 85 | -sysstat 86 | -alsa-lib 87 | -alsa-utils 88 | -man 89 | -man-pages 90 | -man-pages-overrides 91 | -yum-utils 92 | -system-config-firewall-base 93 | -system-config-firewall-tui 94 | -system-config-network-tui 95 | -systemtap-runtime 96 | -at 97 | -atk 98 | -avahi-libs 99 | -bc 100 | -bind-libs 101 | -bind-utils 102 | -biosdevname 103 | -blktrace 104 | -busybox 105 | -cairo 106 | -centos-indexhtml 107 | -ConsoleKit 108 | -ConsoleKit-libs 109 | -cpuspeed 110 | -crda 111 | -cyrus-sasl-plain 112 | -dbus 113 | -dbus-python 114 | -desktop-file-utils 115 | -dmidecode 116 | -dmraid 117 | -dmraid-events 118 | -dosfstools 119 | -ed 120 | -eggdbus 121 | -eject 122 | -elfutils-libs 123 | -fontconfig 124 | -freetype 125 | -gnutls 126 | -hal 127 | -hal-info 128 | -hal-libs 129 | -hdparm 130 | -hicolor-icon-theme 131 | -hunspell 132 | -hunspell-en 133 | -irqbalance 134 | -iw 135 | -jasper-libs 136 | -kexec-tools 137 | -ledmon 138 | -libjpeg-turbo 139 | -libnl 140 | -libpcap 141 | -libpng 142 | -libtasn1 143 | -libthai 144 | -libtiff 145 | -libusb1 146 | -libX11 147 | -libX11-common 148 | -libXau 149 | -libxcb 150 | -libXcomposite 151 | -libXcursor 152 | -libXdamage 153 | -libXext 154 | -libXfixes 155 | -libXft 156 | -libXi 157 | -libXinerama 158 | -libxml2-python 159 | -libXrandr 160 | -libXrender 161 | -lsof 162 | -mailx 163 | -microcode_ctl 164 | -mlocate 165 | -mtr 166 | -nano 167 | -ntp 168 | -ntpdate 169 | -ntsysv 170 | -numactl 171 | -pam_passwdqc 172 | -pango 173 | -parted 174 | -pciutils 175 | -pcmciautils 176 | -pinfo 177 | -pixman 178 | -pkgconfig 179 | -pm-utils 180 | -polkit 181 | -prelink 182 | -psacct 183 | -python-ethtool 184 | -python-iwlib 185 | -quota 186 | -rdate 187 | -readahead 188 | -rfkill 189 | -rng-tools 190 | -rsync 191 | -scl-utils 192 | -setserial 193 | -setuptool 194 | -sg3_utils-libs 195 | -sgpio 196 | -smartmontools 197 | -sos 198 | -strace 199 | -tcpdump 200 | -tcp_wrappers 201 | -tcsh 202 | -time 203 | -tmpwatch 204 | -traceroute 205 | -unzip 206 | -usbutils 207 | -usermode 208 | -vconfig 209 | -wget 210 | -wireless-tools 211 | -words 212 | -xdg-utils 213 | -xz 214 | -xz-lzma-compat 215 | -yum-plugin-security 216 | -yum-utils 217 | -zip 218 | cloud-init 219 | 220 | %end 221 | 222 | %post --log=/root/post.log --nochroot 223 | sed -i "s/^ACTIVE_CONSOLES=\/dev\/tty\[1-6\]/ACTIVE_CONSOLES=\/dev\/tty1/" /mnt/sysimage/etc/sysconfig/init 224 | 225 | sed -i "/HWADDR/d" /mnt/sysimage/etc/sysconfig/network-scripts/ifcfg-eth* 226 | rm -f /mnt/sysimage//etc/udev/rules.d/*-persistent-net.rules 227 | touch /mnt/sysimage/etc/udev/rules.d/75-persistent-net-generator.rules 228 | echo NOZEROCONF=yes >> /mnt/sysimage/etc/sysconfig/network 229 | 230 | sed -i 's/rhgb quiet/quiet console=tty0 console=ttyS0,115200n8/g' /boot/grub/grub.conf 231 | sed -i 's/^hiddenmenu$/hiddenmenu\nserial\ --unit=0\ --speed=115200\ --word=8\ --parity=no\ --stop=1\nterminal\ --timeout=5\ console\ serial/g' /boot/grub/grub.conf 232 | 233 | #handle the cloud-init stuff 234 | echo 'disable_root: 0' > /etc/cloud/cloud.cfg.d/01_centos.cfg 235 | echo 'user: root' >> /etc/cloud/cloud.cfg.d/01_centos.cfg 236 | 237 | rm -f /mnt/sysimage/root/* 238 | %end 239 | -------------------------------------------------------------------------------- /openvz/README.md: -------------------------------------------------------------------------------- 1 | # OpenVZ Image 2 | 3 | This folder has several files 4 | 5 | * openvz-genKS.sh -- A script that generated the kickstart file 6 | * img2vz.sh -- will convert the an VM img to a VZ distributable tar file 7 | * create-yum-openvz.sh -- Script that allows you to create an image from yum 8 | * centos*.include -- packages that need to be installed for the relevant repo 9 | * centos*.exclude -- packages that need to bre removed 10 | 11 | ## Kickstart file 12 | 13 | In order to generate a kickstart file, you need to run the following 14 | 15 | ```bash 16 | ./openvz-genKS.sh -v -u 17 | ``` 18 | 19 | where 20 | 21 | 1. `-v` is the version of centos that we want to build the kickstart for 22 | 1. `-u` is the baseurl from where the root of the yum repository is 23 | 24 | If the -b is not specified then it will do 2 things 25 | 26 | 1. Check for a file `centos.baseurl` and use that for the baseurl 27 | 1. If the above URL is not found, then it will use 28 | 29 | ``` 30 | http://www.mirrorservice.org/sites/mirror.centos.org/$centosver/os/x86_64/ 31 | ``` 32 | 33 | The script will automatically append the `centos.include` file to be installed, and `centos.exclude` to be removed. 34 | 35 | The resulting file will be `centos.ks` 36 | 37 | ## Create image using YUM 38 | 39 | The script in question here is the `create-yum-openvz.sh`, This again takes 2 arguments as per the above example. 40 | 41 | The script will only work on a version of centos that is the same as you are creating the image for, or one version lower. So the one that has been tested is 7 on 7, and 6 on 7 42 | 43 | The resulting file will be in `centos-7-x86_64-viayum-20140620.tar.gz` for a centos 7 build in `/root` 44 | -------------------------------------------------------------------------------- /openvz/centos6.exclude: -------------------------------------------------------------------------------- 1 | ModemManager-glib 2 | NetworkManager* 3 | alsa-lib 4 | centos-logos 5 | dracut-network 6 | efibootmgr 7 | grub* 8 | gsettings-desktop-schemas 9 | kbd* 10 | kernel* 11 | libteam 12 | mozjs17 13 | parted 14 | pciutils-libs 15 | plymouth 16 | plymouth-scripts 17 | ppp 18 | selinux-policy 19 | selinux-policy-targeted 20 | sudo 21 | teamd 22 | wpa_supplicant 23 | *-firmware 24 | -------------------------------------------------------------------------------- /openvz/centos6.include: -------------------------------------------------------------------------------- 1 | yum-utils 2 | wget 3 | -------------------------------------------------------------------------------- /openvz/centos7.baseurl: -------------------------------------------------------------------------------- 1 | http://buildlogs.centos.org/centos/7/os/x86_64-latest/ 2 | -------------------------------------------------------------------------------- /openvz/centos7.exclude: -------------------------------------------------------------------------------- 1 | ModemManager-glib 2 | NetworkManager* 3 | alsa-lib 4 | centos-logos 5 | dracut-network 6 | ethtool 7 | grub* 8 | gsettings-desktop-schemas 9 | kbd* 10 | kernel* 11 | libteam 12 | mozjs17 13 | parted 14 | pciutils-libs 15 | plymouth 16 | plymouth-scripts 17 | postfix 18 | policycoreutils 19 | ppp 20 | selinux-policy 21 | selinux-policy-targeted 22 | sudo 23 | teamd 24 | wpa_supplicant 25 | *-firmware 26 | -------------------------------------------------------------------------------- /openvz/centos7.include: -------------------------------------------------------------------------------- 1 | yum-utils 2 | wget 3 | -------------------------------------------------------------------------------- /openvz/create-yum-openvz.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | usage() { echo "$0 -v [-u ]" 1>&2; exit 1; } 4 | 5 | while getopts u:v:? flag; do 6 | case $flag in 7 | v) 8 | centosver=$OPTARG 9 | reponame=centos${centosver} 10 | ;; 11 | u) 12 | repourl=$OPTARG 13 | ;; 14 | ?) 15 | usage 16 | ;; 17 | esac 18 | done 19 | 20 | [[ -z $centosver ]] && usage 21 | if [[ -z $repourl ]] ; then 22 | if [[ -e ${reponame}.baseurl ]] ; then 23 | repourl=$(cat ${reponame}.baseurl) 24 | else 25 | repourl=http://www.mirrorservice.org/sites/mirror.centos.org/$centosver/os/x86_64/ 26 | fi 27 | fi 28 | 29 | # Variables 30 | mount="$(mktemp -d --tmpdir)" 31 | installroot="$mount/installroot" 32 | tmpyumconf=$mount/yum.conf 33 | 34 | # Create the installroot 35 | mkdir -p $installroot 36 | 37 | # Yum conf to use for the installation 38 | cat > $tmpyumconf << __YUMCONF__ 39 | [$reponame] 40 | name=centos $centosver x86_64 41 | baseurl=$repourl 42 | enabled=1 43 | gpgcheck=0 44 | __YUMCONF__ 45 | 46 | # Install the Core group 47 | yum \ 48 | --installroot $installroot \ 49 | --disablerepo "*" \ 50 | --enablerepo $reponame \ 51 | -c $tmpyumconf \ 52 | -y groupinstall \ 53 | Core 54 | 55 | # Install the necessary rpms 56 | yum \ 57 | --installroot $installroot \ 58 | --disablerepo "*" \ 59 | --enablerepo $reponame \ 60 | -c $tmpyumconf \ 61 | -y install \ 62 | $(cat ${reponame}.include | xargs) 63 | 64 | # Remove firmware files if installed 65 | yum \ 66 | --installroot $installroot \ 67 | --disablerepo "*" \ 68 | --enablerepo $reponame \ 69 | -c $tmpyumconf \ 70 | -y remove \ 71 | $(cat ${reponame}.exclude | xargs) 72 | 73 | # Clean the yum configuration 74 | yum --installroot $installroot -c $tmpyumconf clean all 75 | 76 | # Remove /boot, as that is not required 77 | chroot $installroot rm -rf /boot 78 | 79 | # Remove files that are known to take up lots of space but leave 80 | # directories intact since those may be required by new rpms. 81 | 82 | # locales 83 | find $installroot/usr/{{lib,share}/{i18n,locale},{lib,lib64}/gconv,bin/localedef,sbin/build-locale-archive} \ 84 | -type f \( ! -iname "*utf*" ! -name "en_US" \) | xargs /bin/rm 85 | 86 | # cracklib 87 | find $installroot/usr/share/cracklib \ 88 | -type f | xargs /bin/rm 89 | 90 | # sln 91 | rm -f $installroot/sbin/sln 92 | 93 | # ldconfig 94 | rm -rf $installroot/etc/ld.so.cache 95 | rm -rf $installroot/var/cache/ldconfig/* 96 | 97 | # Create fstab file, which is required for VZ installations 98 | cat > $installroot/etc/fstab << __FSTAB__ 99 | none /dev/pts devpts rw,gid=5,mode=620 0 0 100 | none /dev/shm tmpfs defaults 0 0 101 | __FSTAB__ 102 | 103 | # GMT to be default, but change for requirement 104 | chroot $installroot cp /usr/share/zoneinfo/GMT /etc/localtime 105 | 106 | # Misc post stuff for VZ 107 | ln -s /proc/mounts $installroot/etc/mtab 108 | rm -f $installroot/dev/null 109 | mknod -m 600 $installroot/dev/console c 5 1 110 | 111 | # Copy the yum config to the system 112 | cp $tmpyumconf $installroot/etc/yum.repos.d/centos.repo 113 | 114 | # Now compress the image 115 | tar -C $installroot -cpzf /root/centos-${centosver}-x86_64-viayum-$(date '+%Y%m%d').tar.gz . 116 | 117 | # Cleanup temporary directory 118 | rm -rf $mount 119 | -------------------------------------------------------------------------------- /openvz/openvz-7.ks: -------------------------------------------------------------------------------- 1 | install 2 | url --url=http://buildlogs.centos.org/centos/7/os/x86_64-latest/ 3 | lang en_GB.UTF-8 4 | keyboard uk 5 | network --device eth0 --bootproto dhcp 6 | rootpw --iscrypted $1$UKLtvLuY$kka6S665oCFmU7ivSDZzU. 7 | authconfig --enableshadow --passalgo=sha512 --enablefingerprint 8 | selinux --enforcing 9 | timezone --utc Europe/London 10 | skipx 11 | 12 | clearpart --all --initlabel 13 | part / --fstype ext4 --size=1024 --grow 14 | reboot 15 | %packages --excludedocs --nobase 16 | @Core 17 | yum-utils 18 | wget 19 | -ModemManager-glib 20 | -NetworkManager* 21 | -alsa-lib 22 | -centos-logos 23 | -dracut-network 24 | -efibootmgr 25 | -ethtool 26 | -grub* 27 | -gsettings-desktop-schemas 28 | -kbd* 29 | -kernel* 30 | -libteam 31 | -mozjs17 32 | -parted 33 | -pciutils-libs 34 | -plymouth 35 | -plymouth-scripts 36 | -postfix 37 | -policycoreutils 38 | -ppp 39 | -selinux-policy 40 | -selinux-policy-targeted 41 | -sudo 42 | -teamd 43 | -upstart 44 | -wpa_supplicant 45 | -*-firmware 46 | %end 47 | 48 | %post 49 | # cleanup unwanted stuff, that might still get installed 50 | yum -y remove grub* centos-logos plymouth* kernel* 51 | 52 | # Remove /boot, as that is not required 53 | rm -rf /boot 54 | 55 | # Remove files that are known to take up lots of space but leave 56 | # directories intact since those may be required by new rpms. 57 | 58 | # locales 59 | find $installroot/usr/{{lib,share}/{i18n,locale},{lib,lib64}/gconv,bin/localedef,sbin/build-locale-archive} \ 60 | -type f \( ! -iname "*utf*" ! -name "en_US" \) | xargs /bin/rm 61 | 62 | # cracklib 63 | find $installroot/usr/share/cracklib \ 64 | -type f | xargs /bin/rm 65 | 66 | # sln 67 | rm -f $installroot/sbin/sln 68 | 69 | # ldconfig 70 | rm -rf $installroot/etc/ld.so.cache 71 | rm -rf $installroot/var/cache/ldconfig/* 72 | 73 | # Create fstab file, which is required for VZ installtions 74 | cat > /etc/fstab << __FSTAB__ 75 | none /dev/pts devpts rw,gid=5,mode=620 0 0 76 | none /dev/shm tmpfs defaults 0 0 77 | __FSTAB__ 78 | 79 | # GMT to be default, but change for requirement 80 | cp /usr/share/zoneinfo/GMT /etc/localtime 81 | 82 | # Misc post stuff for VZ 83 | ln -s /proc/mounts /etc/mtab 84 | rm -f /dev/null 85 | mknod -m 600 /dev/console c 5 1 86 | 87 | # Add a temporary yum repository to the config 88 | cat > /etc/yum.repo.d/centos.repo << __YUMCONF__ 89 | [centos7] 90 | name=centos 7 x86_64 91 | baseurl=http://buildlogs.centos.org/centos/7/os/x86_64-latest/ 92 | enabled=1 93 | gpgcheck=0 94 | __YUMCONF__ 95 | 96 | %end 97 | -------------------------------------------------------------------------------- /openvz/openvz-genKS.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | usage() { echo "$0 -v [-u ]" 1>&2; exit 1; } 4 | 5 | while getopts u:v:? flag; do 6 | case $flag in 7 | v) 8 | centosver=$OPTARG 9 | reponame=centos${centosver} 10 | ;; 11 | u) 12 | repourl=$OPTARG 13 | ;; 14 | ?) 15 | usage 16 | ;; 17 | esac 18 | done 19 | 20 | [[ -z $centosver ]] && usage 21 | if [[ -z $repourl ]] ; then 22 | if [[ -e ${reponame}.baseurl ]] ; then 23 | repourl=$(cat ${reponame}.baseurl) 24 | else 25 | repourl=http://www.mirrorservice.org/sites/mirror.centos.org/$centosver/os/x86_64/ 26 | fi 27 | fi 28 | 29 | cat > $reponame.ks << __KSFILE__ 30 | install 31 | url --url=$repourl 32 | lang en_GB.UTF-8 33 | keyboard uk 34 | network --device eth0 --bootproto dhcp 35 | rootpw --iscrypted \$1\$UKLtvLuY\$kka6S665oCFmU7ivSDZzU. 36 | authconfig --enableshadow --passalgo=sha512 --enablefingerprint 37 | selinux --enforcing 38 | timezone --utc Europe/London 39 | skipx 40 | 41 | clearpart --all --initlabel 42 | part / --fstype ext4 --size=1024 --grow 43 | reboot 44 | %packages --excludedocs --nobase 45 | @Core 46 | $(cat ${reponame}.include) 47 | $(cat ${reponame}.exclude | awk '{print "-"$1}') 48 | %end 49 | 50 | %post 51 | # cleanup unwanted stuff, that might still get installed 52 | yum -y remove grub* centos-logos plymouth* kernel* 53 | 54 | # Remove /boot, as that is not required 55 | rm -rf /boot 56 | 57 | # Remove files that are known to take up lots of space but leave 58 | # directories intact since those may be required by new rpms. 59 | 60 | # locales 61 | find /usr/{{lib,share}/{i18n,locale},{lib,lib64}/gconv,bin/localedef,sbin/build-locale-archive} \\ 62 | -type f \( ! -iname "*utf*" ! -name "en_US" \) | xargs /bin/rm 63 | 64 | # cracklib 65 | find /usr/share/cracklib \\ 66 | -type f | xargs /bin/rm 67 | 68 | # sln 69 | rm -f /sbin/sln 70 | 71 | # ldconfig 72 | rm -rf /etc/ld.so.cache 73 | rm -rf /var/cache/ldconfig/* 74 | 75 | # Create fstab file, which is required for VZ installtions 76 | cat > /etc/fstab << __FSTAB__ 77 | none /dev/pts devpts rw,gid=5,mode=620 0 0 78 | none /dev/shm tmpfs defaults 0 0 79 | __FSTAB__ 80 | 81 | # GMT to be default, but change for requirement 82 | cp /usr/share/zoneinfo/GMT /etc/localtime 83 | 84 | # Misc post stuff for VZ 85 | ln -s /proc/mounts /etc/mtab 86 | rm -f /dev/null 87 | mknod -m 600 /dev/console c 5 1 88 | 89 | # Add a temporary yum repository to the config 90 | cat > /etc/yum.repo.d/centos.repo << __YUMCONF__ 91 | [${reponame}] 92 | name=centos ${centosver} x86_64 93 | baseurl=${repourl} 94 | enabled=1 95 | gpgcheck=0 96 | __YUMCONF__ 97 | 98 | %end 99 | __KSFILE__ 100 | -------------------------------------------------------------------------------- /ovirt/CentOS-7-x86_64-oVirt-r1.ks: -------------------------------------------------------------------------------- 1 | auth --enableshadow --passalgo=sha512 2 | reboot 3 | url --url="mirror.centos.org/centos/7/os/x86_64" 4 | firewall --enabled --service=ssh 5 | firstboot --disable 6 | ignoredisk --only-use=vda 7 | keyboard --vckeymap=us --xlayouts='us' 8 | # System language 9 | lang en_US.UTF-8 10 | repo --name "os" --baseurl="http://mirror.centos.org/centos/7/os/x86_64/" --cost=100 11 | repo --name "updates" --baseurl="http://mirror.centos.org/centos/7/updates/x86_64/" --cost=100 12 | repo --name "extras" --baseurl="http://mirror.centos.org/centos/7/extras/x86_64/" --cost=100 13 | 14 | # oVirt specific repos 15 | repo --name "centos-ovirt43" --baseurl="http://mirror.centos.org/centos/7/virt/x86_64/ovirt-4.3/" --cost=100 16 | 17 | # Network information 18 | network --bootproto=dhcp 19 | network --hostname=localhost.localdomain 20 | # Root password 21 | rootpw --iscrypted thereisnopasswordanditslocked 22 | selinux --enforcing 23 | services --disabled="kdump" --enabled="network,sshd,rsyslog,chronyd" 24 | timezone UTC --isUtc 25 | # Disk 26 | bootloader --append="console=tty0" --location=mbr --timeout=1 --boot-drive=vda 27 | zerombr 28 | clearpart --all --initlabel 29 | part / --fstype="xfs" --ondisk=vda --size=4096 --grow 30 | 31 | %post --erroronfail 32 | passwd -d root 33 | passwd -l root 34 | 35 | # pvgrub support 36 | echo -n "Creating grub.conf for pvgrub" 37 | rootuuid=$( awk '$2=="/" { print $1 };' /etc/fstab ) 38 | mkdir /boot/grub 39 | echo -e 'default=0\ntimeout=0\n\n' > /boot/grub/grub.conf 40 | for kv in $( ls -1v /boot/vmlinuz* |grep -v rescue |sed s/.*vmlinuz-// ); do 41 | echo "title CentOS Linux 7 ($kv)" >> /boot/grub/grub.conf 42 | echo -e "\troot (hd0)" >> /boot/grub/grub.conf 43 | echo -e "\tkernel /boot/vmlinuz-$kv ro root=$rootuuid console=hvc0 LANG=en_US.UTF-8" >> /boot/grub/grub.conf 44 | echo -e "\tinitrd /boot/initramfs-$kv.img" >> /boot/grub/grub.conf 45 | echo 46 | done 47 | ln -sf grub.conf /boot/grub/menu.lst 48 | ln -sf /boot/grub/grub.conf /etc/grub.conf 49 | 50 | # setup systemd to boot to the right runlevel 51 | rm -f /etc/systemd/system/default.target 52 | ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target 53 | echo . 54 | 55 | yum -C -y remove linux-firmware 56 | 57 | # Remove firewalld; it is required to be present for install/image building. 58 | # but we dont ship it in cloud 59 | yum -C -y remove firewalld --setopt="clean_requirements_on_remove=1" 60 | yum -C -y remove avahi\* Network\* 61 | sed -i '/^#NAutoVTs=.*/ a\ 62 | NAutoVTs=0' /etc/systemd/logind.conf 63 | 64 | cat > /etc/sysconfig/network << EOF 65 | NETWORKING=yes 66 | NOZEROCONF=yes 67 | EOF 68 | 69 | # For cloud images, 'eth0' _is_ the predictable device name, since 70 | # we don't want to be tied to specific virtual (!) hardware 71 | rm -f /etc/udev/rules.d/70* 72 | ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules 73 | 74 | # simple eth0 config, again not hard-coded to the build hardware 75 | cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF 76 | DEVICE="eth0" 77 | BOOTPROTO="dhcp" 78 | ONBOOT="yes" 79 | TYPE="Ethernet" 80 | USERCTL="yes" 81 | PEERDNS="yes" 82 | IPV6INIT="no" 83 | PERSISTENT_DHCLIENT="1" 84 | EOF 85 | 86 | echo "virtual-guest" > /etc/tuned/active_profile 87 | 88 | # generic localhost names 89 | cat > /etc/hosts << EOF 90 | 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 91 | ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 92 | 93 | EOF 94 | echo . 95 | 96 | systemctl mask tmp.mount 97 | 98 | cat < /etc/sysconfig/kernel 99 | # UPDATEDEFAULT specifies if new-kernel-pkg should make 100 | # new kernels the default 101 | UPDATEDEFAULT=yes 102 | 103 | # DEFAULTKERNEL specifies the default kernel package type 104 | DEFAULTKERNEL=kernel 105 | EOL 106 | 107 | # make sure firstboot doesn't start 108 | echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot 109 | 110 | yum clean all 111 | 112 | # XXX instance type markers - MUST match CentOS Infra expectation 113 | echo 'ovirt' > /etc/yum/vars/infra 114 | 115 | # chance dhcp client retry/timeouts to resolve #6866 116 | cat >> /etc/dhcp/dhclient.conf << EOF 117 | 118 | timeout 300; 119 | retry 60; 120 | EOF 121 | 122 | echo "Fixing SELinux contexts." 123 | touch /var/log/cron 124 | touch /var/log/boot.log 125 | mkdir -p /var/cache/yum 126 | /usr/sbin/fixfiles -R -a restore 127 | 128 | # reorder console entries 129 | sed -i 's/console=tty0/console=tty0 console=ttyS0,115200n8/' /boot/grub2/grub.cfg 130 | 131 | # oVirt specific service 132 | systemctl enable ovirt-guest-agent.service 133 | %end 134 | 135 | %packages 136 | @core 137 | chrony 138 | cloud-init 139 | cloud-utils-growpart 140 | dracut-config-generic 141 | dracut-norescue 142 | firewalld 143 | grub2 144 | kernel 145 | nfs-utils 146 | rsync 147 | tar 148 | yum-utils 149 | -NetworkManager 150 | -aic94xx-firmware 151 | -alsa-firmware 152 | -alsa-lib 153 | -alsa-tools-firmware 154 | -biosdevname 155 | -iprutils 156 | -ivtv-firmware 157 | -iwl100-firmware 158 | -iwl1000-firmware 159 | -iwl105-firmware 160 | -iwl135-firmware 161 | -iwl2000-firmware 162 | -iwl2030-firmware 163 | -iwl3160-firmware 164 | -iwl3945-firmware 165 | -iwl4965-firmware 166 | -iwl5000-firmware 167 | -iwl5150-firmware 168 | -iwl6000-firmware 169 | -iwl6000g2a-firmware 170 | -iwl6000g2b-firmware 171 | -iwl6050-firmware 172 | -iwl7260-firmware 173 | -libertas-sd8686-firmware 174 | -libertas-sd8787-firmware 175 | -libertas-usb8388-firmware 176 | -plymouth 177 | 178 | # oVirt specific packages 179 | ovirt-guest-agent-common 180 | 181 | %end 182 | 183 | -------------------------------------------------------------------------------- /ovirt/README.md: -------------------------------------------------------------------------------- 1 | # ovirt specific image build scripts including kickstarts 2 | 3 | -------------------------------------------------------------------------------- /vagrant/README.md: -------------------------------------------------------------------------------- 1 | Notes 2 | ----- 3 | 4 | To disable the default Vagrant synced folder (`/vagrant`), you need to add the 5 | following snippet to your `Vagrantfile`: 6 | 7 | ~~~ruby 8 | config.vm.synced_folder ".", "/vagrant", disabled: true 9 | ~~~ 10 | 11 | -------------------------------------------------------------------------------- /vagrant/centos6.ks: -------------------------------------------------------------------------------- 1 | #repo http://mirror.centos.org/centos/6/os/x86_64/ 2 | install 3 | text 4 | keyboard us 5 | lang en_US.UTF-8 6 | skipx 7 | network --device eth0 --bootproto dhcp 8 | rootpw vagrant 9 | firewall --disabled 10 | authconfig --enableshadow --enablemd5 11 | selinux --enforcing 12 | timezone --utc UTC 13 | services --enabled ntpd,tuned 14 | # The biosdevname and ifnames options ensure we get "eth0" as our interface 15 | # even in environments like virtualbox that emulate a real NW card 16 | bootloader --timeout=1 --append="no_timer_check console=tty0 console=ttyS0,115200n8 net.ifnames=0 biosdevname=0 elevator=noop" 17 | zerombr 18 | clearpart --all --drives=vda 19 | part / --fstype=ext4 --asprimary --size=1024 --grow --ondisk=vda 20 | 21 | user --name=vagrant --password=vagrant 22 | 23 | reboot 24 | 25 | %packages 26 | deltarpm 27 | man-pages 28 | bzip2 29 | @core 30 | rsync 31 | screen 32 | nfs-utils 33 | cifs-utils 34 | tuned 35 | hyperv-daemons 36 | # Microcode updates cannot work in a VM 37 | -microcode_ctl 38 | # Firmware packages are not needed in a VM 39 | -aic94xx-firmware 40 | -atmel-firmware 41 | -bfa-firmware 42 | -ipw2100-firmware 43 | -ipw2200-firmware 44 | -ivtv-firmware 45 | -iwl100-firmware 46 | -iwl1000-firmware 47 | -iwl3945-firmware 48 | -iwl4965-firmware 49 | -iwl5000-firmware 50 | -iwl5150-firmware 51 | -iwl6000-firmware 52 | -iwl6000g2a-firmware 53 | -iwl6050-firmware 54 | -libertas-usb8388-firmware 55 | -ql2100-firmware 56 | -ql2200-firmware 57 | -ql23xx-firmware 58 | -ql2400-firmware 59 | -ql2500-firmware 60 | -rt61pci-firmware 61 | -rt73usb-firmware 62 | -xorg-x11-drv-ati-firmware 63 | -zd1211-firmware 64 | # Disable kdump 65 | -kexec-tools 66 | 67 | %end 68 | 69 | %post 70 | 71 | # configure swap to a file 72 | fallocate -l 2G /swapfile 73 | chmod 600 /swapfile 74 | mkswap /swapfile 75 | echo "/swapfile none swap defaults 0 0" >> /etc/fstab 76 | 77 | # sudo 78 | echo "%vagrant ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/vagrant 79 | chmod 0440 /etc/sudoers.d/vagrant 80 | 81 | # Fix for https://github.com/CentOS/sig-cloud-instance-build/issues/38 82 | cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF 83 | DEVICE="eth0" 84 | BOOTPROTO="dhcp" 85 | ONBOOT="yes" 86 | TYPE="Ethernet" 87 | PERSISTENT_DHCLIENT="yes" 88 | EOF 89 | 90 | # sshd: disable password authentication and DNS checks 91 | ex -s /etc/ssh/sshd_config <>/etc/sysconfig/sshd <> /home/vagrant/.ssh/authorized_keys 108 | chmod 600 /home/vagrant/.ssh/authorized_keys 109 | chown -R vagrant:vagrant /home/vagrant/.ssh 110 | # Workaround for SSH pubkey auth not working, due to .ssh having the 111 | # wrong SELinux context (see "Known Issues" in the CentOS 6 release notes) 112 | restorecon -vR /home/vagrant/.ssh 113 | 114 | # Fix for issue #76, regular users can gain admin privileges via su 115 | ex -s /etc/pam.d/su <<'EOF' 116 | /^account\s\+sufficient\s\+pam_succeed_if.so uid = 0 use_uid quiet$/ 117 | :append 118 | # allow vagrant to use su, but prevent others from becoming root or vagrant 119 | account [success=1 default=ignore] \\ 120 | pam_succeed_if.so user = vagrant use_uid quiet 121 | account required pam_succeed_if.so user notin root:vagrant 122 | . 123 | :update 124 | :quit 125 | EOF 126 | 127 | # Indicate that vagrant6 infra is being used 128 | echo 'vag' > /etc/yum/vars/infra 129 | 130 | # Configure tuned 131 | tuned-adm profile virtual-guest 132 | 133 | # Enable VMware PVSCSI support for VMware Fusion guests. This produces 134 | # a tiny increase in the image and is harmless for other environments. 135 | pushd /etc/dracut.conf.d 136 | echo 'add_drivers+=" vmw_pvscsi "' > vmware-fusion-drivers.conf 137 | echo 'add_drivers+=" hv_netvsc hv_storvsc hv_utils hv_vmbus hid-hyperv "' > hyperv-drivers.conf 138 | popd 139 | 140 | # Fix for issue 156, CentOS 6 not booting on HyperV 141 | echo blacklist hyperv_fb > /etc/modprobe.d/hyperv_fb.conf 142 | 143 | # Fix the SELinux context of the new files 144 | restorecon -f - <> /etc/fstab 82 | 83 | # sudo 84 | echo "%vagrant ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/vagrant 85 | chmod 0440 /etc/sudoers.d/vagrant 86 | 87 | # Fix for https://github.com/CentOS/sig-cloud-instance-build/issues/38 88 | cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF 89 | DEVICE="eth0" 90 | BOOTPROTO="dhcp" 91 | ONBOOT="yes" 92 | TYPE="Ethernet" 93 | PERSISTENT_DHCLIENT="yes" 94 | EOF 95 | 96 | # sshd: disable password authentication and DNS checks 97 | ex -s /etc/ssh/sshd_config <>/etc/sysconfig/sshd <> /home/vagrant/.ssh/authorized_keys 114 | chmod 600 /home/vagrant/.ssh/authorized_keys 115 | chown -R vagrant:vagrant /home/vagrant/.ssh 116 | 117 | # Fix for issue #76, regular users can gain admin privileges via su 118 | ex -s /etc/pam.d/su <<'EOF' 119 | # allow vagrant to use su, but prevent others from becoming root or vagrant 120 | /^account\s\+sufficient\s\+pam_succeed_if.so uid = 0 use_uid quiet$/ 121 | :append 122 | account [success=1 default=ignore] \\ 123 | pam_succeed_if.so user = vagrant use_uid quiet 124 | account required pam_succeed_if.so user notin root:vagrant 125 | . 126 | :update 127 | :quit 128 | EOF 129 | 130 | # systemd should generate a new machine id during the first boot, to 131 | # avoid having multiple Vagrant instances with the same id in the local 132 | # network. /etc/machine-id should be empty, but it must exist to prevent 133 | # boot errors (e.g. systemd-journald failing to start). 134 | :>/etc/machine-id 135 | 136 | echo 'vag' > /etc/yum/vars/infra 137 | 138 | # Blacklist the floppy module to avoid probing timeouts 139 | echo blacklist floppy > /etc/modprobe.d/nofloppy.conf 140 | chcon -u system_u -r object_r -t modules_conf_t /etc/modprobe.d/nofloppy.conf 141 | 142 | # Customize the initramfs 143 | pushd /etc/dracut.conf.d 144 | # Enable VMware PVSCSI support for VMware Fusion guests. 145 | echo 'add_drivers+=" vmw_pvscsi "' > vmware-fusion-drivers.conf 146 | echo 'add_drivers+=" hv_netvsc hv_storvsc hv_utils hv_vmbus hid-hyperv "' > hyperv-drivers.conf 147 | # There's no floppy controller, but probing for it generates timeouts 148 | echo 'omit_drivers+=" floppy "' > nofloppy.conf 149 | popd 150 | # Fix the SELinux context of the new files 151 | restorecon -f - <> /etc/fstab 70 | 71 | # sudo 72 | echo "%vagrant ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/vagrant 73 | chmod 0440 /etc/sudoers.d/vagrant 74 | 75 | # Fix for https://github.com/CentOS/sig-cloud-instance-build/issues/38 76 | cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF 77 | DEVICE="eth0" 78 | BOOTPROTO="dhcp" 79 | ONBOOT="yes" 80 | TYPE="Ethernet" 81 | PERSISTENT_DHCLIENT="yes" 82 | EOF 83 | 84 | # sshd: disable password authentication and DNS checks 85 | ex -s /etc/ssh/sshd_config <>/etc/sysconfig/sshd <> /home/vagrant/.ssh/authorized_keys 102 | chmod 600 /home/vagrant/.ssh/authorized_keys 103 | chown -R vagrant:vagrant /home/vagrant/.ssh 104 | 105 | # Fix for issue #76, regular users can gain admin privileges via su 106 | ex -s /etc/pam.d/su <<'EOF' 107 | # allow vagrant to use su, but prevent others from becoming root or vagrant 108 | /^account\s\+sufficient\s\+pam_succeed_if.so uid = 0 use_uid quiet$/ 109 | :append 110 | account [success=1 default=ignore] \\ 111 | pam_succeed_if.so user = vagrant use_uid quiet 112 | account required pam_succeed_if.so user notin root:vagrant 113 | . 114 | :update 115 | :quit 116 | EOF 117 | 118 | # systemd should generate a new machine id during the first boot, to 119 | # avoid having multiple Vagrant instances with the same id in the local 120 | # network. /etc/machine-id should be empty, but it must exist to prevent 121 | # boot errors (e.g. systemd-journald failing to start). 122 | :>/etc/machine-id 123 | 124 | echo 'vag' > /etc/yum/vars/infra 125 | 126 | # Blacklist the floppy module to avoid probing timeouts 127 | echo blacklist floppy > /etc/modprobe.d/nofloppy.conf 128 | chcon -u system_u -r object_r -t modules_conf_t /etc/modprobe.d/nofloppy.conf 129 | 130 | # Customize the initramfs 131 | pushd /etc/dracut.conf.d 132 | # Enable VMware PVSCSI support for VMware Fusion guests. 133 | echo 'add_drivers+=" vmw_pvscsi "' > vmware-fusion-drivers.conf 134 | echo 'add_drivers+=" hv_netvsc hv_storvsc hv_utils hv_vmbus hid-hyperv "' > hyperv-drivers.conf 135 | # There's no floppy controller, but probing for it generates timeouts 136 | echo 'omit_drivers+=" floppy "' > nofloppy.conf 137 | popd 138 | # Fix the SELinux context of the new files 139 | restorecon -f - < 9 | where is one of: 10 | 6 -- build Vagrant images for CentOS 6 11 | 7 -- build Vagrant images for CentOS 7 12 | all -- build Vagrant images for both CentOS 6 and 7 13 | EOF 14 | exit 1 15 | } 16 | 17 | 18 | build_vagrant_image() 19 | { 20 | # The kickstart files are in the same directory as this script 21 | KS_DIR=$(dirname $0) 22 | 23 | # Always wait if stdout is not a tty (needed by ci.centos.org) 24 | if [ ! -t 1 ]; then WAIT="--wait"; fi 25 | 26 | EL_MAJOR=$1 27 | koji -p cbs image-build \ 28 | centos-${EL_MAJOR} 1 cloudinstance${EL_MAJOR}-common-el${EL_MAJOR} \ 29 | http://mirror.centos.org/centos/${EL_MAJOR}/os/x86_64/ x86_64 \ 30 | --release=1 \ 31 | --distro RHEL-${EL_MAJOR}.0 \ 32 | --ksver RHEL${EL_MAJOR} \ 33 | --kickstart=${KS_DIR}/centos${EL_MAJOR}.ks \ 34 | --format=vagrant-libvirt \ 35 | --format=vagrant-virtualbox \ 36 | --format=vagrant-vmware-fusion \ 37 | --format=vagrant-hyperv \ 38 | --factory-parameter fusion_scsi_controller_type pvscsi \ 39 | --ova-option vagrant_sync_directory=/vagrant \ 40 | --repo http://mirror.centos.org/centos/${EL_MAJOR}/extras/x86_64/\ 41 | --repo http://mirror.centos.org/centos/${EL_MAJOR}/updates/x86_64/\ 42 | --scratch \ 43 | ${WAIT:-"--nowait"} \ 44 | --disk-size=40 45 | } 46 | 47 | 48 | if [ $# -ne 1 ]; then 49 | usage 50 | fi 51 | 52 | case $1 in 53 | 6) 54 | build_vagrant_image 6 55 | ;; 56 | 7) 57 | build_vagrant_image 7 58 | ;; 59 | all) 60 | build_vagrant_image 6 61 | build_vagrant_image 7 62 | ;; 63 | *) 64 | usage 65 | ;; 66 | esac 67 | 68 | # vim: set sw=2: 69 | -------------------------------------------------------------------------------- /vagrant/tests/README.md: -------------------------------------------------------------------------------- 1 | Tests 2 | ----- 3 | 4 | Placeholder for Vagrantfiles and scripts we want to test the 5 | CentOS Vagrant Box builds against, pre release 6 | 7 | -------------------------------------------------------------------------------- /vagrant/tests/_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | basedir=$(pwd) 3 | for x in 6 7;do 4 | echo testing $x 5 | mkdir ${basedir}/${x} && cd ${basedir}/${x} 6 | vagrant init centos/${x} 7 | vagrant up --provider libvirt 8 | vagrant ssh --command "rpm -qa --last | head -n1 && uname -a" 9 | vagrant destroy --force 10 | done 11 | -------------------------------------------------------------------------------- /vagrant/tests/run_tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This should work on any CentOS Linux 7 machine 4 | # assuming it is either a baremetal box or has nested virt 5 | # capability 6 | 7 | yum -y install rsync libvirt qemu-kvm centos-release-scl 8 | service libvirtd start 9 | yum -y install sclo-vagrant1 10 | scl enable sclo-vagrant1 _test.sh 11 | 12 | --------------------------------------------------------------------------------