<commit_before># rocky-linux-8-optimized-gcp-options.cfg

### Anaconda installer configuration.
# Install in text mode.
text --non-interactive
url --url="https://dl.rockylinux.org/pub/rocky/8/BaseOS/$basearch/os"
repo --name=AppStream --baseurl="https://dl.rockylinux.org/pub/rocky/8/AppStream/$basearch/os"
repo --name=PowerTools --baseurl="https://dl.rockylinux.org/pub/rocky/8/PowerTools/$basearch/os"
repo --name=CloudSig --baseurl="https://dl.rockylinux.org/pub/sig/8/cloud/$basearch"
poweroff

# Network configuration
network --bootproto=dhcp --hostname=localhost --device=link

### Disk configuration.
# The bootloader must be set to sdb since sda is the installer.
bootloader --boot-drive=sdb --timeout=0 --append="net.ifnames=0 biosdevname=0 scsi_mod.use_blk_mq=Y"
# EFI partitioning, creates a GPT partitioned disk.
clearpart --drives=sdb --all
part /boot/efi --size=200 --fstype=efi --ondrive=sdb
part / --size=100 --grow --ondrive=sdb --label=root --fstype=xfs

### Installed system configuration.
firewall --enabled
services --enabled=sshd,rngd --disabled=sshd-keygen@
skipx
timezone --utc UTC --ntpservers=metadata.google.internal
rootpw --iscrypted --lock *
firstboot --disabled
user --name=gce --lock

# packages.cfg
# Contains a list of packages to be installed, or not, on all flavors.
# The %package command begins the package selection section of kickstart.
# Packages can be specified by group, or package name. @Base and @Core are
# always selected by default so they do not need to be specified.

%packages
acpid
dhcp-client
dnf-automatic
net-tools
openssh-server
python3
rng-tools
tar
vim
-subscription-manager
-alsa-utils
-b43-fwcutter
-dmraid
-eject
-gpm
-irqbalance
-microcode_ctl
-smartmontools
-aic94xx-firmware
-atmel-firmware
-b43-openfwwf
-bfa-firmware
-ipw2100-firmware
-ipw2200-firmware
-ivtv-firmware
-iwl100-firmware
-iwl1000-firmware
-iwl3945-firmware
-iwl4965-firmware
-iwl5000-firmware
-iwl5150-firmware
-iwl6000-firmware
-iwl6000g2a-firmware
-iwl6050-firmware
-kernel-firmware
-libertas-usb8388-firmware
-ql2100-firmware
-ql2200-firmware
-ql23xx-firmware
-ql2400-firmware
-ql2500-firmware
-rt61pci-firmware
-rt73usb-firmware
-xorg-x11-drv-ati-firmware
-zd1211-firmware
%end

%post
tee -a /etc/yum.repos.d/google-cloud.repo << EOM
[google-compute-engine]
name=Google Compute Engine
baseurl=https://packages.cloud.google.com/yum/repos/google-compute-engine-el8-x86_64-stable
enabled=1
gpgcheck=1
repo_gpgcheck=0
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
       https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOM
tee -a /etc/yum.repos.d/google-cloud.repo << EOM
[google-cloud-sdk]
name=Google Cloud SDK
baseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el8-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=0
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
       https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOM
# Rocky Linux Cloud SIG repo.
tee -a /etc/yum.repos.d/Rocky-CloudSig.repo << EOM
[cloud-sig]
name=Rocky Linux \$releasever - Cloud SIG
baseurl=https://dl.rockylinux.org/pub/sig/\$releasever/cloud/\$basearch
enabled=1
gpgcheck=1
gpgkey=https://dl.rockylinux.org/pub/sig/\$releasever/cloud/\$basearch/RPM-GPG-KEY-Rocky-8-SIG-Cloud
EOM
%end
# Google Compute Engine kickstart config for Enterprise Linux 8.
%onerror
echo "Build Failed!" > /dev/ttyS0
shutdown -h now
%end

%post --erroronfail
set -x
exec &> /dev/ttyS0
# Delete the dummy user account.
userdel -r gce

# Import all RPM GPG keys.
curl -o /etc/pki/rpm-gpg/google-rpm-package-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
curl -o /etc/pki/rpm-gpg/google-key.gpg https://packages.cloud.google.com/yum/doc/yum-key.gpg
curl -o /etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-8-SIG-Cloud https://dl.rockylinux.org/pub/sig/8/cloud/x86_64/RPM-GPG-KEY-Rocky-8-SIG-Cloud
rpm --import /etc/pki/rpm-gpg/*

# Configure the network for GCE.
# Given that GCE users typically control the firewall at the network API level,
# we want to leave the standard Linux firewall setup enabled but all-open.
firewall-offline-cmd --set-default-zone=trusted

cat >>/etc/dhcp/dhclient.conf <<EOL<commit_msg>Change Rocky Cloud Kernel repos. (#1963)<commit_after># rocky-linux-8-optimized-gcp-options.cfg

### Anaconda installer configuration.
# Install in text mode.
text --non-interactive
url --url="https://dl.rockylinux.org/pub/rocky/8/BaseOS/$basearch/os"
repo --name=AppStream --baseurl="https://dl.rockylinux.org/pub/rocky/8/AppStream/$basearch/os"
repo --name=PowerTools --baseurl="https://dl.rockylinux.org/pub/rocky/8/PowerTools/$basearch/os"
repo --name=CloudKernel --baseurl="https://dl.rockylinux.org/pub/sig/8/cloud/$basearch/cloud-kernel"
poweroff

# Network configuration
network --bootproto=dhcp --hostname=localhost --device=link

### Disk configuration.
# The bootloader must be set to sdb since sda is the installer.
bootloader --boot-drive=sdb --timeout=0 --append="net.ifnames=0 biosdevname=0 scsi_mod.use_blk_mq=Y"
# EFI partitioning, creates a GPT partitioned disk.
clearpart --drives=sdb --all
part /boot/efi --size=200 --fstype=efi --ondrive=sdb
part / --size=100 --grow --ondrive=sdb --label=root --fstype=xfs

### Installed system configuration.
firewall --enabled
services --enabled=sshd,rngd --disabled=sshd-keygen@
skipx
timezone --utc UTC --ntpservers=metadata.google.internal
rootpw --iscrypted --lock *
firstboot --disabled
user --name=gce --lock

# packages.cfg
# Contains a list of packages to be installed, or not, on all flavors.
# The %package command begins the package selection section of kickstart.
# Packages can be specified by group, or package name. @Base and @Core are
# always selected by default so they do not need to be specified.

%packages
acpid
dhcp-client
dnf-automatic
net-tools
openssh-server
python3
rng-tools
tar
vim
-subscription-manager
-alsa-utils
-b43-fwcutter
-dmraid
-eject
-gpm
-irqbalance
-microcode_ctl
-smartmontools
-aic94xx-firmware
-atmel-firmware
-b43-openfwwf
-bfa-firmware
-ipw2100-firmware
-ipw2200-firmware
-ivtv-firmware
-iwl100-firmware
-iwl1000-firmware
-iwl3945-firmware
-iwl4965-firmware
-iwl5000-firmware
-iwl5150-firmware
-iwl6000-firmware
-iwl6000g2a-firmware
-iwl6050-firmware
-kernel-firmware
-libertas-usb8388-firmware
-ql2100-firmware
-ql2200-firmware
-ql23xx-firmware
-ql2400-firmware
-ql2500-firmware
-rt61pci-firmware
-rt73usb-firmware
-xorg-x11-drv-ati-firmware
-zd1211-firmware
%end

%post
tee -a /etc/yum.repos.d/google-cloud.repo << EOM
[google-compute-engine]
name=Google Compute Engine
baseurl=https://packages.cloud.google.com/yum/repos/google-compute-engine-el8-x86_64-stable
enabled=1
gpgcheck=1
repo_gpgcheck=0
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
       https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOM
tee -a /etc/yum.repos.d/google-cloud.repo << EOM
[google-cloud-sdk]
name=Google Cloud SDK
baseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el8-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=0
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
       https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOM
# Rocky Linux Cloud Kernel repo.
tee -a /etc/yum.repos.d/Rocky-CloudKernel.repo << EOM
[cloud-sig]
name=Rocky Linux \$releasever - Cloud Kernel
baseurl=https://dl.rockylinux.org/pub/sig/\$releasever/cloud/\$basearch/cloud-kernel
enabled=1
gpgcheck=1
gpgkey=https://dl.rockylinux.org/pub/sig/\$releasever/cloud/\$basearch/cloud-kernel/RPM-GPG-KEY-Rocky-SIG-Cloud
EOM
%end
# Google Compute Engine kickstart config for Enterprise Linux 8.
%onerror
echo "Build Failed!" > /dev/ttyS0
shutdown -h now
%end

%post --erroronfail
set -x
exec &> /dev/ttyS0
# Delete the dummy user account.
userdel -r gce

# Import all RPM GPG keys.
curl -o /etc/pki/rpm-gpg/google-rpm-package-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
curl -o /etc/pki/rpm-gpg/google-key.gpg https://packages.cloud.google.com/yum/doc/yum-key.gpg
curl -o /etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-8-SIG-Cloud https://dl.rockylinux.org/pub/sig/8/cloud/x86_64/cloud-kernel/RPM-GPG-KEY-Rocky-SIG-Cloud
rpm --import /etc/pki/rpm-gpg/*

# Configure the network for GCE.
# Given that GCE users typically control the firewall at the network API level,
# we want to leave the standard Linux firewall setup enabled but all-open.
firewall-offline-cmd --set-default-zone=trusted

cat >>/etc/dhcp/dhclient.conf <<EOL
{'fraction_non_alphanumeric': 0.14012587578672367, 'fraction_numerical': 0.03016268851680323, 'mean_word_length': 4.144777031154551, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 11, 'https://': 30, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6747817', 'n_tokens_mistral': 3442, 'n_tokens_neox': 3180, 'n_words': 656}