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
|
|
|
|
|
|
|
|
auth --useshadow --passalgo=sha512
|
|
|
|
selinux --enforcing
|
|
|
|
rootpw --lock --iscrypted locked
|
|
|
|
|
|
|
|
# Add most common consoles console=ttyAMA0 console=ttyS0 console=ttyS1 as kernel boot parameter
|
2018-07-10 13:03:57 +00:00
|
|
|
bootloader --timeout=1 --append="console=tty1 console=ttyS0,115200n8 console=ttyS1,115200n8 console=ttyAMA0,115200n8 net.ifnames=0 modprobe.blacklist=vc4"
|
2018-05-08 13:11:05 +00:00
|
|
|
|
|
|
|
network --bootproto=dhcp --device=link --activate --onboot=on
|
2018-07-19 10:54:38 +00:00
|
|
|
services --enabled=NetworkManager,sshd,rngd,initial-setup,zram-swap
|
2018-07-10 13:03:57 +00:00
|
|
|
|
|
|
|
# tell Initial Setup to run in the reconfig mode
|
|
|
|
firstboot --reconfig --enable
|
2018-05-08 13:11:05 +00:00
|
|
|
|
|
|
|
zerombr
|
|
|
|
clearpart --all
|
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
|
2018-07-10 13:03:57 +00:00
|
|
|
ostreesetup --nogpg --osname=fedora-iot --remote=fedora-iot --url=https://kojipkgs.fedoraproject.org/compose/iot/repo/ --ref=fedora/29/${basearch}/iot
|
2018-05-08 13:11:05 +00:00
|
|
|
|
|
|
|
reboot
|
|
|
|
|
|
|
|
%post --erroronfail
|
|
|
|
# Find the architecture we are on
|
|
|
|
arch=$(uname -m)
|
|
|
|
|
|
|
|
# Setup Raspberry Pi firmware
|
|
|
|
if [[ $arch == "aarch64" ]] || [[ $arch == "armv7l" ]]; then
|
|
|
|
if [[ $arch == "aarch64" ]]; then
|
|
|
|
cp -P /usr/share/uboot/rpi_3/u-boot.bin /boot/efi/rpi3-u-boot.bin
|
|
|
|
else
|
|
|
|
cp -P /usr/share/uboot/rpi_2/u-boot.bin /boot/fw/rpi2-u-boot.bin
|
|
|
|
cp -P /usr/share/uboot/rpi_3_32b/u-boot.bin /boot/fw/rpi3-u-boot.bin
|
|
|
|
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.
|
|
|
|
ostree admin set-origin --index 0 fedora-iot https://kojipkgs.fedoraproject.org/iot/29/ "fedora/29/${arch}/iot"
|
|
|
|
|
|
|
|
# Make sure the ref we're supposedly sitting on (according
|
|
|
|
# to the updated origin) exists.
|
2018-07-10 13:03:57 +00:00
|
|
|
ostree refs "fedora-iot:fedora/29/${arch}/iot" --create "fedora-iot:fedora/29/${arch}/iot"
|
2018-05-08 13:11:05 +00:00
|
|
|
|
|
|
|
# Remove the old ref so that the commit eventually gets cleaned up.
|
2018-07-10 13:03:57 +00:00
|
|
|
ostree refs "fedora-iot:fedora/29/${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
|
|
|
|
ostree remote add --set=gpg-verify=true --set=gpgkeypath=/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-29-primary fedora-iot 'https://dl.fedoraproject.org/iot/repo/'
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
echo -n "Network fixes"
|
|
|
|
# initscripts don't like this file to be missing.
|
|
|
|
cat > /etc/sysconfig/network << EOF
|
|
|
|
NETWORKING=yes
|
|
|
|
NOZEROCONF=yes
|
|
|
|
EOF
|
|
|
|
|
|
|
|
# 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 "-----------------------------------------------------------------------"
|
|
|
|
rpm -qa
|
|
|
|
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
|
|
|
|
|
|
|
|
echo "Adding Developer Mode GRUB2 menu item."
|
|
|
|
/usr/libexec/atomic-devmode/bootentry add
|
|
|
|
|
|
|
|
# Disable network service here, as doing it in the services line
|
|
|
|
# fails due to RHBZ #1369794
|
|
|
|
/sbin/chkconfig network off
|
|
|
|
|
|
|
|
# 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
|