diff --git a/centos7/Makefile b/centos7/Makefile index 0449e1a2..436a1e31 100644 --- a/centos7/Makefile +++ b/centos7/Makefile @@ -5,7 +5,17 @@ include ../scripts/check.mk PACKER ?= packer PACKER_LOG ?= 0 -export PACKER_LOG KS_PROXY +ifneq (${KS_MIRROR},) +KS_OS_REPOS := --url="${KS_MIRROR}/os/x86_64" +KS_UPDATES_REPOS := --baseurl="${KS_MIRROR}/updates/x86_64" +KS_EXTRA_REPOS := --baseurl="${KS_MIRROR}/extras/x86_64" +else +KS_OS_REPOS := --mirrorlist="http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os" +KS_UPDATES_REPOS := --mirrorlist="http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=updates" +KS_EXTRA_REPOS := --mirrorlist="http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=extras" +endif + +export PACKER_LOG KS_PROXY KS_OS_REPOS KS_UPDATES_REPOS KS_EXTRA_REPOS .PHONY: all clean check-deps @@ -17,7 +27,7 @@ centos7.tar.gz: clean check-deps http/centos7.ks ${PACKER} init centos7.pkr.hcl && ${PACKER} build centos7.pkr.hcl http/centos7.ks: http/centos7.ks.in - envsubst '$${KS_PROXY}' < $< | tee $@ + envsubst '$${KS_PROXY} $${KS_OS_REPOS} $${KS_UPDATES_REPOS} $${KS_EXTRA_REPOS}' < $< | tee $@ clean: ${RM} -rf output-centos7 centos7.tar.gz http/centos7.ks diff --git a/centos7/http/centos7.ks.in b/centos7/http/centos7.ks.in index 6a1f324b..47083a36 100644 --- a/centos7/http/centos7.ks.in +++ b/centos7/http/centos7.ks.in @@ -1,4 +1,4 @@ -url --mirrorlist="http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os" ${KS_PROXY} +url ${KS_OS_REPOS} ${KS_PROXY} poweroff firewall --enabled --service=ssh firstboot --disable @@ -12,8 +12,8 @@ timezone UTC --isUtc bootloader --location=mbr --driveorder="vda" --timeout=1 rootpw --plaintext password -repo --name="Updates" --mirrorlist="http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=updates" ${KS_PROXY} -repo --name="Extras" --mirrorlist="http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=extras" ${KS_PROXY} +repo --name="Updates" ${KS_UPDATES_REPOS} ${KS_PROXY} +repo --name="Extras" ${KS_EXTRA_REPOS} ${KS_PROXY} zerombr clearpart --all --initlabel @@ -40,7 +40,7 @@ rm -f /etc/sysconfig/network-scripts/ifcfg-[^lo]* sed -i 's/^GRUB_TERMINAL=.*/GRUB_TERMINAL_OUTPUT="console"/g' /etc/default/grub sed -i '/GRUB_SERIAL_COMMAND="serial"/d' /etc/default/grub sed -ri 's/(GRUB_CMDLINE_LINUX=".*)\s+console=ttyS0(.*")/\1\2/' /etc/default/grub -sed -i 's/"GRUB_ENABLE_BLSCFG=.*"/"GRUB_ENABLE_BLSCFG=false"/g' /etc/default/grub +sed -i 's/GRUB_ENABLE_BLSCFG=.*/GRUB_ENABLE_BLSCFG=false/g' /etc/default/grub yum clean all %end diff --git a/centos8-stream/http/centos8-stream.ks.in b/centos8-stream/http/centos8-stream.ks.in index 42990f6f..823e78b0 100644 --- a/centos8-stream/http/centos8-stream.ks.in +++ b/centos8-stream/http/centos8-stream.ks.in @@ -40,7 +40,7 @@ rm -f /etc/sysconfig/network-scripts/ifcfg-[^lo]* sed -i 's/^GRUB_TERMINAL=.*/GRUB_TERMINAL_OUTPUT="console"/g' /etc/default/grub sed -i '/GRUB_SERIAL_COMMAND="serial"/d' /etc/default/grub sed -ri 's/(GRUB_CMDLINE_LINUX=".*)\s+console=ttyS0(.*")/\1\2/' /etc/default/grub -sed -i 's/"GRUB_ENABLE_BLSCFG=.*"/"GRUB_ENABLE_BLSCFG=false"/g' /etc/default/grub +sed -i 's/GRUB_ENABLE_BLSCFG=.*/GRUB_ENABLE_BLSCFG=false/g' /etc/default/grub dnf clean all %end diff --git a/centos8/Makefile b/centos8/Makefile index 976d7c83..c1595a0c 100644 --- a/centos8/Makefile +++ b/centos8/Makefile @@ -4,8 +4,8 @@ include ../scripts/check.mk PACKER ?= packer PACKER_LOG ?= 0 - -export PACKER_LOG KS_PROXY +KS_MIRROR ?= http://mirrorlist.centos.org +export PACKER_LOG KS_PROXY KS_MIRROR .PHONY: all clean @@ -17,7 +17,7 @@ centos8.tar.gz: check-deps clean http/centos8.ks ${PACKER} init centos8.pkr.hcl && ${PACKER} build centos8.pkr.hcl http/centos8.ks: http/centos8.ks.in - envsubst '$${KS_PROXY}' < $< | tee $@ + envsubst '$${KS_PROXY} $${KS_MIRROR}' < $< | tee $@ clean: ${RM} -rf output-centos8 centos8.tar.gz http/centos8.ks diff --git a/centos8/http/centos8.ks.in b/centos8/http/centos8.ks.in index 3bdf72b4..80800618 100644 --- a/centos8/http/centos8.ks.in +++ b/centos8/http/centos8.ks.in @@ -1,4 +1,4 @@ -url --mirrorlist="http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=BaseOS" ${KS_PROXY} +url --mirrorlist="${KS_MIRROR}/?release=8&arch=x86_64&repo=BaseOS" ${KS_PROXY} poweroff firewall --enabled --service=ssh firstboot --disable @@ -12,8 +12,8 @@ timezone UTC --isUtc bootloader --location=mbr --driveorder="vda" --timeout=1 rootpw --plaintext password -repo --name="AppStream" --mirrorlist="http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=AppStream" ${KS_PROXY} -repo --name="Extras" --mirrorlist="http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=extras" ${KS_PROXY} +repo --name="AppStream" --mirrorlist="${KS_MIRROR}/?release=8&arch=x86_64&repo=AppStream" ${KS_PROXY} +repo --name="Extras" --mirrorlist="${KS_MIRROR}/?release=8&arch=x86_64&repo=extras" ${KS_PROXY} zerombr clearpart --all --initlabel @@ -40,7 +40,7 @@ rm -f /etc/sysconfig/network-scripts/ifcfg-[^lo]* sed -i 's/^GRUB_TERMINAL=.*/GRUB_TERMINAL_OUTPUT="console"/g' /etc/default/grub sed -i '/GRUB_SERIAL_COMMAND="serial"/d' /etc/default/grub sed -ri 's/(GRUB_CMDLINE_LINUX=".*)\s+console=ttyS0(.*")/\1\2/' /etc/default/grub -sed -i 's/"GRUB_ENABLE_BLSCFG=.*"/"GRUB_ENABLE_BLSCFG=false"/g' /etc/default/grub +sed -i 's/GRUB_ENABLE_BLSCFG=.*/GRUB_ENABLE_BLSCFG=false/g' /etc/default/grub dnf clean all %end diff --git a/rhel7/http/rhel7.ks.in b/rhel7/http/rhel7.ks.in index 695fe263..f0114967 100644 --- a/rhel7/http/rhel7.ks.in +++ b/rhel7/http/rhel7.ks.in @@ -40,7 +40,7 @@ rm -f /etc/sysconfig/network-scripts/ifcfg-[^lo]* sed -i 's/^GRUB_TERMINAL=.*/GRUB_TERMINAL_OUTPUT="console"/g' /etc/default/grub sed -i '/GRUB_SERIAL_COMMAND="serial"/d' /etc/default/grub sed -ri 's/(GRUB_CMDLINE_LINUX=".*)\s+console=ttyS0(.*")/\1\2/' /etc/default/grub -sed -i 's/"GRUB_ENABLE_BLSCFG=.*"/"GRUB_ENABLE_BLSCFG=false"/g' /etc/default/grub +sed -i 's/GRUB_ENABLE_BLSCFG=.*/GRUB_ENABLE_BLSCFG=false/g' /etc/default/grub yum clean all %end diff --git a/rhel8/http/rhel8.ks.in b/rhel8/http/rhel8.ks.in index 9ee3846d..caa543df 100644 --- a/rhel8/http/rhel8.ks.in +++ b/rhel8/http/rhel8.ks.in @@ -39,7 +39,7 @@ rm -f /etc/sysconfig/network-scripts/ifcfg-[^lo]* sed -i 's/^GRUB_TERMINAL=.*/GRUB_TERMINAL_OUTPUT="console"/g' /etc/default/grub sed -i '/GRUB_SERIAL_COMMAND="serial"/d' /etc/default/grub sed -ri 's/(GRUB_CMDLINE_LINUX=".*)\s+console=ttyS0(.*")/\1\2/' /etc/default/grub -sed -i 's/"GRUB_ENABLE_BLSCFG=.*"/"GRUB_ENABLE_BLSCFG=false"/g' /etc/default/grub +sed -i 's/GRUB_ENABLE_BLSCFG=.*/GRUB_ENABLE_BLSCFG=false/g' /etc/default/grub dnf clean all %end diff --git a/rhel9/http/rhel9.ks.in b/rhel9/http/rhel9.ks.in index 9ee3846d..caa543df 100644 --- a/rhel9/http/rhel9.ks.in +++ b/rhel9/http/rhel9.ks.in @@ -39,7 +39,7 @@ rm -f /etc/sysconfig/network-scripts/ifcfg-[^lo]* sed -i 's/^GRUB_TERMINAL=.*/GRUB_TERMINAL_OUTPUT="console"/g' /etc/default/grub sed -i '/GRUB_SERIAL_COMMAND="serial"/d' /etc/default/grub sed -ri 's/(GRUB_CMDLINE_LINUX=".*)\s+console=ttyS0(.*")/\1\2/' /etc/default/grub -sed -i 's/"GRUB_ENABLE_BLSCFG=.*"/"GRUB_ENABLE_BLSCFG=false"/g' /etc/default/grub +sed -i 's/GRUB_ENABLE_BLSCFG=.*/GRUB_ENABLE_BLSCFG=false/g' /etc/default/grub dnf clean all %end diff --git a/windows/curtin/curtin-hooks b/windows/curtin/curtin-hooks index cc1f786e..a9bf588e 100644 --- a/windows/curtin/curtin-hooks +++ b/windows/curtin/curtin-hooks @@ -1 +1 @@ -#!/bin/bash \ No newline at end of file +#!/bin/bash diff --git a/windows/curtin/finalize b/windows/curtin/finalize index 716da835..246f1b9d 100644 --- a/windows/curtin/finalize +++ b/windows/curtin/finalize @@ -23,3 +23,4 @@ then fi $PYTHON $FINALIZE + diff --git a/windows/curtin/finalize.py b/windows/curtin/finalize.py index 92ad1c9e..a7a991f1 100644 --- a/windows/curtin/finalize.py +++ b/windows/curtin/finalize.py @@ -142,3 +142,4 @@ def curthooks(): curthooks() + diff --git a/windows/curtin/python_wrapper b/windows/curtin/python_wrapper new file mode 100644 index 00000000..22d7e168 --- /dev/null +++ b/windows/curtin/python_wrapper @@ -0,0 +1,11 @@ +#!/bin/bash + +export PYTHONPATH='/curtin' + +# Ubuntu 16.04 only ships with Python 3 while previous versions only ship +# with Python 2. +if type -p python > /dev/null; then + exec python "$0.py" "$@" +else + exec python3 "$0.py" "$@" +fi diff --git a/windows/http/Autounattend.xml b/windows/http/Autounattend.xml new file mode 100644 index 00000000..e992a299 --- /dev/null +++ b/windows/http/Autounattend.xml @@ -0,0 +1,144 @@ + + + + + + OnError + + + + + 1 + 100 + EFI + + + 2 + 128 + MSR + + + true + 3 + Primary + + + + + + FAT32 + 1 + 1 + + + NTFS + 2 + 3 + + + + 0 + true + + + + + + + + 3 + 0 + + + false + OnError + + + /IMAGE/NAME + Windows Server 2016 SERVERSTANDARD + + + + + + true + + + + + + en-US + + en-US + en-US + en-US + en-US + + + + + + ClearType + + + true + 3 + Work + true + + + + + + + %SystemRoot%\System32\WindowsPowerShell\v1.0\powershell -NoLogo -NonInteractive -ExecutionPolicy RemoteSigned -Command A:\logon.ps1 + 1 + + + + + + Passw0rd + true</PlainText> + </AdministratorPassword> + </UserAccounts> + <AutoLogon> + <Password> + <Value>Passw0rd</Value> + <PlainText>true</PlainText> + </Password> + <Enabled>true</Enabled> + <LogonCount>50</LogonCount> + <Username>Administrator</Username> + </AutoLogon> + <ComputerName>*</ComputerName> + </component> + </settings> + <settings pass="specialize"> + <component name="Microsoft-Windows-TerminalServices-LocalSessionManager" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <fDenyTSConnections>false</fDenyTSConnections> + </component> + <component name="Microsoft-Windows-TerminalServices-RDP-WinStationExtensions" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <UserAuthentication>0</UserAuthentication> + </component> + <component name="Networking-MPSSVC-Svc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <FirewallGroups> + <FirewallGroup wcm:action="add" wcm:keyValue="RemoteDesktop"> + <Active>true</Active> + <Profile>all</Profile> + <Group>@FirewallAPI.dll,-28752</Group> + </FirewallGroup> + </FirewallGroups> + </component> + <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="NonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <TimeZone>UTC</TimeZone> + <ComputerName>*</ComputerName> + </component> + <component name="Microsoft-Windows-SQMApi" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="NonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <CEIPEnabled>0</CEIPEnabled> + </component> + </settings> +</unattend> diff --git a/windows/http/cloudbase-init/cloudbase_init.zip b/windows/http/cloudbase-init/cloudbase_init.zip new file mode 100644 index 00000000..58623fb9 Binary files /dev/null and b/windows/http/cloudbase-init/cloudbase_init.zip differ