2018-05-08 13:11:05 +00:00
|
|
|
# This is the kickstart for Fedora IoT disk images.
|
|
|
|
|
|
|
|
text # don't use cmdline -- https://github.com/rhinstaller/anaconda/issues/931
|
|
|
|
lang en_US.UTF-8
|
|
|
|
keyboard us
|
|
|
|
timezone --utc Etc/UTC
|
|
|
|
|
|
|
|
selinux --enforcing
|
|
|
|
rootpw --lock --iscrypted locked
|
|
|
|
|
2021-01-08 09:47:43 +00:00
|
|
|
bootloader --timeout=1 --append="modprobe.blacklist=vc4"
|
2018-05-08 13:11:05 +00:00
|
|
|
|
|
|
|
network --bootproto=dhcp --device=link --activate --onboot=on
|
2022-02-16 15:50:58 +00:00
|
|
|
services --enabled=NetworkManager,sshd
|
2018-05-08 13:11:05 +00:00
|
|
|
|
|
|
|
zerombr
|
2018-10-11 16:52:26 +00:00
|
|
|
clearpart --all --initlabel --disklabel=msdos
|
2018-07-10 13:03:57 +00:00
|
|
|
autopart --nohome --noswap --type=plain
|
2018-05-08 13:11:05 +00:00
|
|
|
|
|
|
|
# Equivalent of %include fedora-repo.ks
|
|
|
|
# Pull from the ostree repo that was created during the compose
|
2024-08-11 16:28:27 +00:00
|
|
|
ostreesetup --nogpg --osname=fedora-iot --remote=fedora-iot --url=https://kojipkgs.fedoraproject.org/compose/iot/repo/ --ref=fedora/41/${basearch}/iot
|
2018-05-08 13:11:05 +00:00
|
|
|
|
|
|
|
reboot
|
|
|
|
|
|
|
|
%post --erroronfail
|
2023-03-14 17:22:18 +00:00
|
|
|
|
|
|
|
# Find the architecture we are on
|
|
|
|
arch=$(uname -m)
|
2018-05-08 13:11:05 +00:00
|
|
|
# Setup Raspberry Pi firmware
|
|
|
|
if [[ $arch == "aarch64" ]]; then
|
2021-11-21 19:22:12 +00:00
|
|
|
cp -P /usr/share/uboot/rpi_arm64/u-boot.bin /boot/efi/rpi-u-boot.bin
|
2018-05-08 13:11:05 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Set the origin to the "main ref", distinct from /updates/ which is where bodhi writes.
|
|
|
|
# We want consumers of this image to track the two week releases.
|
2024-08-11 16:28:27 +00:00
|
|
|
ostree admin set-origin --index 0 fedora-iot https://dl.fedoraproject.org/iot/repo/ "fedora/41/${arch}/iot"
|
2018-05-08 13:11:05 +00:00
|
|
|
|
|
|
|
# Make sure the ref we're supposedly sitting on (according
|
|
|
|
# to the updated origin) exists.
|
2024-08-11 16:28:27 +00:00
|
|
|
ostree refs "fedora-iot:fedora/41/${arch}/iot" --create "fedora-iot:fedora/41/${arch}/iot"
|
2018-05-08 13:11:05 +00:00
|
|
|
|
|
|
|
# Remove the old ref so that the commit eventually gets cleaned up.
|
2024-08-11 16:28:27 +00:00
|
|
|
ostree refs "fedora-iot:fedora/41/${arch}/iot" --delete
|
2018-05-08 13:11:05 +00:00
|
|
|
|
|
|
|
# delete/add the remote with new options to enable gpg verification
|
|
|
|
# and to point them at the cdn url
|
|
|
|
ostree remote delete fedora-iot
|
2019-08-30 06:17:56 +00:00
|
|
|
ostree remote add --set=gpg-verify=true --set=gpgkeypath=/etc/pki/rpm-gpg/ --set=contenturl=mirrorlist=https://ostree.fedoraproject.org/iot/mirrorlist fedora-iot 'https://ostree.fedoraproject.org/iot'
|
2018-05-08 13:11:05 +00:00
|
|
|
|
2019-07-02 13:10:00 +00:00
|
|
|
# We're getting a stray console= from somewhere, work around it
|
2018-11-30 17:33:19 +00:00
|
|
|
rpm-ostree kargs --delete=console=tty0
|
|
|
|
|
2018-05-08 13:11:05 +00:00
|
|
|
# older versions of livecd-tools do not follow "rootpw --lock" line above
|
|
|
|
# https://bugzilla.redhat.com/show_bug.cgi?id=964299
|
|
|
|
passwd -l root
|
|
|
|
|
|
|
|
# Work around https://bugzilla.redhat.com/show_bug.cgi?id=1193590
|
|
|
|
cp /etc/skel/.bash* /var/roothome
|
|
|
|
|
|
|
|
# Remove any persistent NIC rules generated by udev
|
|
|
|
rm -vf /etc/udev/rules.d/*persistent-net*.rules
|
|
|
|
|
|
|
|
echo "Removing random-seed so it's not the same in every image."
|
|
|
|
rm -f /var/lib/systemd/random-seed
|
|
|
|
|
|
|
|
echo "Packages within this iot image:"
|
|
|
|
echo "-----------------------------------------------------------------------"
|
2020-06-17 11:14:08 +00:00
|
|
|
rpm -qa --qf '%{size}\t%{name}-%{version}-%{release}.%{arch}\n' |sort -rn
|
2018-05-08 13:11:05 +00:00
|
|
|
echo "-----------------------------------------------------------------------"
|
|
|
|
# Note that running rpm recreates the rpm db files which aren't needed/wanted
|
|
|
|
rm -f /var/lib/rpm/__db*
|
|
|
|
|
|
|
|
echo "Zeroing out empty space."
|
|
|
|
# This forces the filesystem to reclaim space from deleted files
|
|
|
|
dd bs=1M if=/dev/zero of=/var/tmp/zeros || :
|
|
|
|
rm -f /var/tmp/zeros
|
|
|
|
echo "(Don't worry -- that out-of-space error was expected.)"
|
|
|
|
|
2021-03-21 19:14:59 +00:00
|
|
|
rm -f /etc/NetworkManager/system-connections/*.nmconnection
|
2018-05-08 13:11:05 +00:00
|
|
|
|
|
|
|
# Anaconda is writing an /etc/resolv.conf from the install environment.
|
|
|
|
# The system should start out with an empty file, otherwise cloud-init
|
|
|
|
# will try to use this information and may error:
|
|
|
|
# https://bugs.launchpad.net/cloud-init/+bug/1670052
|
|
|
|
truncate -s 0 /etc/resolv.conf
|
|
|
|
|
|
|
|
%end
|