# Generated by pykickstart v3.47 #version=DEVEL # Use text mode install text # Firewall configuration firewall --enabled --service=mdns # Keyboard layouts keyboard 'us' # System language lang en_US.UTF-8 # Network information network --bootproto=dhcp --device=link --activate # Shutdown after installation shutdown repo --name="koji-f39-build-41699" --baseurl=http://openkoji.iscas.ac.cn/kojifiles/repos/f39-build/41699/riscv64 # Root password rootpw --plaintext riscv # SELinux configuration selinux --enforcing # System services services --disabled="lm_sensors,libvirtd" --enabled="sshd,NetworkManager,chronyd,haveged,initial-setup" # System timezone timezone US/Eastern # System bootloader configuration bootloader --location=mbr --timeout=1 # Clear the Master Boot Record zerombr # Partition clearing information clearpart --all --initlabel --disklabel=gpt # Disk partitioning information part /boot/efi --fstype="vfat" --size=128 --label=EFI part /boot --fstype="ext4" --size=512 --label=boot part / --fstype="ext4" --size=12288 --label=rootfs %post # Find the architecture we are on arch=$(uname -m) #releasever=$(rpm --eval '%{fedora}') #rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-primary echo "Packages within this disk image" rpm -qa --qf '%{size}\t%{name}-%{version}-%{release}.%{arch}\n' |sort -rn # remove random seed, the newly installed instance should make it's own rm -f /var/lib/systemd/random-seed # The enp1s0 interface is a left over from the imagefactory install, clean this up rm -f /etc/NetworkManager/system-connections/*.nmconnection dnf -y remove dracut-config-generic # Remove machine-id on pre generated images rm -f /etc/machine-id touch /etc/machine-id # Note that running rpm recreates the rpm db files which aren't needed or wanted rm -f /var/lib/rpm/__db* %end %post #Disable existed repo files mkdir -p /etc/yum.repos.d/backup mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/backup/ # Create Openfedora RISC-V Koji repo cat << EOF > /etc/yum.repos.d/fedora-riscv-koji.repo [fedora-riscv-koji] name=Fedora RISC-V Koji baseurl=https://openkoji.iscas.ac.cn/kojifiles/repos/f39-build/latest/riscv64/ enabled=1 gpgcheck=0 EOF %end %post # setup login message cat << EOF | tee /etc/issue /etc/issue.net Welcome to the Fedora RISC-V disk image https://openkoji.iscas.ac.cn/koji/ Build date: $(date --utc) Kernel \r on an \m (\l) The root password is 'riscv'. root password logins are disabled in SSH starting Fedora. If DNS isn’t working, try editing ‘/etc/yum.repos.d/fedora-riscv.repo’. For updates and latest information read: https://fedoraproject.org/wiki/Architectures/RISC-V Fedora RISC-V ------------- EOF %end %post # Disable default repositories (not riscv64 in upstream) # dnf config-manager --set-disabled rawhide updates updates-testing fedora fedora-modular fedora-cisco-openh264 updates-modular updates-testing-modular rawhide-modular # remove window managers cannot run correctly at present (May 16 2021) # dnf -y remove i3 i3status i3lock swaybg sway # Re-generating RPM database because the target releasever may use different format of database # rpm --rebuilddb # change kernel to some specific # dnf -y update # dnf -y remove kernel kernel-core kernel-devel kernel-modules kernel-modules-extra # dnf -y install kernel-xxx kernel-xxx-core kernel-xxx-devel kernel-xxx-modules kernel-xxx-modules-extra # KVER=`ls /boot/ | grep -i vmlinuz | grep -i riscv64 | sed -e 's/vmlinuz-//g'` # dracut -f --kver `ls /boot/ | grep -i vmlinuz | grep -i riscv64 | sed -e 's/vmlinuz-//g'` --add-drivers dw_mmc-pltfm # dracut -f --kver "${KVER}" # dracut -f # sed -i \ # -e 's/^ui/# ui/g' \ # -e 's/^menu autoboot/# menu autoboot/g' \ # -e 's/^menu hidden/# menu hidden/g' \ # -e 's/^totaltimeout/# totaltimeout/g' \ # -e 's/rhgb quiet/rhgb console=tty0 console=ttyS0,115200 earlycon=sbi rootwait selinux=0/g' \ # -e 's/ fdtdir/# fdtdir/g' \ # /boot/extlinux/extlinux.conf # grep -A3 -B0 '^label' /boot/extlinux/extlinux.conf >> tmp.save # sed -i '/append/i\\tfdt \/some.dtb' /boot/extlinux/extlinux.conf # cat tmp.save >> /boot/extlinux/extlinux.conf # rm -vf tmp.save /boot/version.txt # link ui background file # ln -sf ./dir/file.png /usr/share/backgrounds/default.png # ln -sf ../dir/file.png /usr/share/backgrounds/images/default.png # ln -sf ../dir/file.png /usr/share/backgrounds/images/default-5_4.png # ln -sf ../dir/file.png /usr/share/backgrounds/images/default-16_9.png # ln -sf ../dir/file.png /usr/share/backgrounds/images/default-16_10.png # pushd /lib/firmware/xxx # ln -sf file link # popd # systemd on no-SMP boots (i.e. single core) sometimes timeout waiting for storage # devices. After entering emergency prompt all disk are mounted. # For more information see: # https://www.suse.com/support/kb/doc/?id=7018491 # https://www.freedesktop.org/software/systemd/man/systemd.mount.html # https://github.com/systemd/systemd/issues/3446 # We modify /etc/fstab to give more time for device detection (the problematic part) # and mounting processes. This should help on systems where boot takes longer. sed -i 's|noatime|noatime,x-systemd.device-timeout=300s,x-systemd.mount-timeout=300s|g' /etc/fstab # systemd starts serial consoles on /dev/ttyS0 and /dev/hvc0. The # only problem is they are the same serial console. Mask one. systemctl mask serial-getty@hvc0.service %end %post # setup systemd to boot to the right runlevel echo -n "Setting default runlevel to multiuser text mode" systemctl set-default multi-user.target echo . %end %post # remove unnecessary entry in /etc/fstab #sed -i '/swap/d' /etc/fstab #sed -i '/efi/d' /etc/fstab %end %post pushd /tmp #making a temp resolv.conf file rm -f /etc/resolv.conf echo 'nameserver 114.114.114.114' >> /etc/resolv.conf /usr/bin/wget -P image-bin-patch "https://openkoji.iscas.ac.cn/pub/dl/riscv/T-Head/th1520_light/kernel-cross/image-bin-patch.tar" #recover to the original resolv.conf rm -f /etc/resolv.conf ln -s ../run/systemd/resolve/stub-resolv.conf /etc/resolv.conf pushd image-bin-patch /usr/bin/tar xpf image-bin-patch.tar rm -f image-bin-patch.tar cp -rvf * / popd rm -rf image-bin-patch popd #ROOT_UUID=`grep ' / ' /etc/fstab | awk '{printf $1}' | sed -e 's/^UUID=//g'` # #sed -i -e "s/@@ROOTUUID@@/${ROOT_UUID}/g" \ # /boot/extlinux/extlinux.conf # #sed -i -e "s/@@DISTRO@@/Fedora/g" \ # /boot/extlinux/extlinux.conf # #sed -i -e "s/@@DISTRO_RELAESE@@/fc36/g" \ # /boot/extlinux/extlinux.conf %end %packages @container-management @core @domain-client @guest-agents @hardware-support @headless-management @networkmanager-submodules @server-hardware-support @server-product @standard chkconfig chrony dracut-config-generic fedora-release-server glibc-all-langpacks grub2-efi-riscv64 initscripts kernel tar uboot-tools wget -dracut-config-rescue -generic-release* -initial-setup-gui -ipw* -iwl* -usb_modeswitch %end