Skip to content

Commit

Permalink
Rebase with upstream/windows
Browse files Browse the repository at this point in the history
  • Loading branch information
alanbach committed Nov 30, 2023
2 parents d8fd5c3 + 2ab1383 commit de46b89
Show file tree
Hide file tree
Showing 14 changed files with 185 additions and 18 deletions.
14 changes: 12 additions & 2 deletions centos7/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions centos7/http/centos7.ks.in
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion centos8-stream/http/centos8-stream.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions centos8/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions centos8/http/centos8.ks.in
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion rhel7/http/rhel7.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion rhel8/http/rhel8.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion rhel9/http/rhel9.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion windows/curtin/curtin-hooks
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#!/bin/bash
#!/bin/bash
1 change: 1 addition & 0 deletions windows/curtin/finalize
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ then
fi

$PYTHON $FINALIZE

1 change: 1 addition & 0 deletions windows/curtin/finalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,4 @@ def curthooks():


curthooks()

11 changes: 11 additions & 0 deletions windows/curtin/python_wrapper
Original file line number Diff line number Diff line change
@@ -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
144 changes: 144 additions & 0 deletions windows/http/Autounattend.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE">
<component name="Microsoft-Windows-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">
<DiskConfiguration>
<WillShowUI>OnError</WillShowUI>

<Disk wcm:action="add">
<CreatePartitions>
<CreatePartition wcm:action="add">
<Order>1</Order>
<Size>100</Size>
<Type>EFI</Type>
</CreatePartition>
<CreatePartition wcm:action="add">
<Order>2</Order>
<Size>128</Size>
<Type>MSR</Type>
</CreatePartition>
<CreatePartition wcm:action="add">
<Extend>true</Extend>
<Order>3</Order>
<Type>Primary</Type>
</CreatePartition>
</CreatePartitions>
<ModifyPartitions>
<ModifyPartition wcm:action="add">
<Label>EFI</Label>
<Format>FAT32</Format>
<Order>1</Order>
<PartitionID>1</PartitionID>
</ModifyPartition>
<ModifyPartition wcm:action="add">
<Format>NTFS</Format>
<Order>2</Order>
<PartitionID>3</PartitionID>
<Label>System</Label>
</ModifyPartition>
</ModifyPartitions>
<DiskID>0</DiskID>
<WillWipeDisk>true</WillWipeDisk>
</Disk>

</DiskConfiguration>
<ImageInstall>
<OSImage>
<InstallTo>

<PartitionID>3</PartitionID>
<DiskID>0</DiskID>

</InstallTo>
<InstallToAvailablePartition>false</InstallToAvailablePartition>
<WillShowUI>OnError</WillShowUI>
<InstallFrom>
<MetaData wcm:action="add">
<Key>/IMAGE/NAME</Key>
<Value>Windows Server 2016 SERVERSTANDARD</Value>
</MetaData>
</InstallFrom>
</OSImage>
</ImageInstall>
<UserData>
<AcceptEula>true</AcceptEula>

</UserData>
</component>
<component name="Microsoft-Windows-International-Core-WinPE" 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">
<SetupUILanguage>
<UILanguage>en-US</UILanguage>
</SetupUILanguage>
<InputLocale>en-US</InputLocale>
<UILanguage>en-US</UILanguage>
<SystemLocale>en-US</SystemLocale>
<UserLocale>en-US</UserLocale>
</component>
</settings>
<settings pass="oobeSystem">
<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">
<VisualEffects>
<FontSmoothing>ClearType</FontSmoothing>
</VisualEffects>
<OOBE>
<HideEULAPage>true</HideEULAPage>
<ProtectYourPC>3</ProtectYourPC>
<NetworkLocation>Work</NetworkLocation>
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
<!-- Comment the following two options on Windows Vista / 7 and Windows Server 2008 / 2008 R2 -->
<!--
<HideOnlineAccountScreens>true</HideOnlineAccountScreens>
<HideLocalAccountScreen>true</HideLocalAccountScreen>
-->
</OOBE>

<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<CommandLine>%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell -NoLogo -NonInteractive -ExecutionPolicy RemoteSigned -Command A:\logon.ps1 </CommandLine>
<Order>1</Order>
</SynchronousCommand>
</FirstLogonCommands>

<UserAccounts>
<AdministratorPassword>
<Value>Passw0rd</Value>
<PlainText>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>
Binary file added windows/http/cloudbase-init/cloudbase_init.zip
Binary file not shown.

0 comments on commit de46b89

Please sign in to comment.