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
|
|
|
|
|
2018-11-02 16:19:38 +00:00
|
|
|
bootloader --timeout=1 --append="net.ifnames=0 modprobe.blacklist=vc4"
|
2018-05-08 13:11:05 +00:00
|
|
|
|
|
|
|
network --bootproto=dhcp --device=link --activate --onboot=on
|
2020-07-09 01:13:34 +00:00
|
|
|
services --enabled=NetworkManager,sshd,rngd
|
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
|
2019-07-02 13:10:00 +00:00
|
|
|
ostreesetup --nogpg --osname=fedora-iot --remote=fedora-iot --url=https://kojipkgs.fedoraproject.org/compose/iot/repo/ --ref=fedora/rawhide/${basearch}/iot
|
2018-05-08 13:11:05 +00:00
|
|
|
|
|
|
|
reboot
|
|
|
|
|
|
|
|
%post --erroronfail
|
|
|
|
# Find the architecture we are on
|
|
|
|
arch=$(uname -m)
|
2020-10-27 00:15:47 +00:00
|
|
|
if [[ $arch == "armv7l" ]]; then
|
|
|
|
arch="armhfp"
|
|
|
|
fi
|
2018-05-08 13:11:05 +00:00
|
|
|
|
|
|
|
# Setup Raspberry Pi firmware
|
2020-10-27 00:15:47 +00:00
|
|
|
if [[ $arch == "aarch64" ]] || [[ $arch == "armhfp" ]]; then
|
2018-05-08 13:11:05 +00:00
|
|
|
if [[ $arch == "aarch64" ]]; then
|
|
|
|
cp -P /usr/share/uboot/rpi_3/u-boot.bin /boot/efi/rpi3-u-boot.bin
|
2019-12-13 04:34:51 +00:00
|
|
|
cp -P /usr/share/uboot/rpi_4/u-boot.bin /boot/efi/rpi4-u-boot.bin
|
2018-05-08 13:11:05 +00:00
|
|
|
else
|
2019-12-04 09:56:12 +00:00
|
|
|
cp -P /usr/share/uboot/rpi_2/u-boot.bin /boot/efi/rpi2-u-boot.bin
|
|
|
|
cp -P /usr/share/uboot/rpi_3_32b/u-boot.bin /boot/efi/rpi3-u-boot.bin
|
2019-12-13 04:34:51 +00:00
|
|
|
cp -P /usr/share/uboot/rpi_4_32b/u-boot.bin /boot/efi/rpi4-u-boot.bin
|
2018-05-08 13:11:05 +00:00
|
|
|
fi
|
|
|
|
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.
|
2020-10-27 00:15:47 +00:00
|
|
|
ostree admin set-origin --index 0 fedora-iot https://dl.fedoraproject.org/iot/repo/ "fedora/rawhide/${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.
|
2020-10-27 00:15:47 +00:00
|
|
|
ostree refs "fedora-iot:fedora/rawhide/${arch}/iot" --create "fedora-iot:fedora/rawhide/${arch}/iot"
|
2018-05-08 13:11:05 +00:00
|
|
|
|
|
|
|
# Remove the old ref so that the commit eventually gets cleaned up.
|
2020-10-27 00:15:47 +00:00
|
|
|
ostree refs "fedora-iot:fedora/rawhide/${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
|
|
|
|
# And ensure that we will do DHCP on eth0 on startup
|
|
|
|
cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF
|
|
|
|
DEVICE="eth0"
|
|
|
|
BOOTPROTO="dhcp"
|
|
|
|
ONBOOT="yes"
|
|
|
|
TYPE="Ethernet"
|
|
|
|
PERSISTENT_DHCLIENT="yes"
|
|
|
|
EOF
|
|
|
|
|
|
|
|
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.)"
|
|
|
|
|
|
|
|
# For trac ticket https://pagure.io/atomic-wg/issue/128
|
|
|
|
rm -f /etc/sysconfig/network-scripts/ifcfg-ens3
|
|
|
|
|
|
|
|
# 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
|