# Generated by pykickstart v3.47 #version=DEVEL # Use text mode install text # Firewall configuration firewall --enabled --service=ssh # Keyboard layouts keyboard 'us' # System language lang en_US.UTF-8 # Network information network --bootproto=dhcp --device=link --hostname=fedora-riscv # Shutdown after installation shutdown repo --name="koji-f39-build-50934" --baseurl=http://openkoji.iscas.ac.cn/kojifiles/repos/f39-build/50934/riscv64 # Root password rootpw --plaintext riscv # SELinux configuration selinux --enforcing # System services services --disabled="lm_sensors,libvirtd,lightdm" --enabled="sshd,dbus-broker,NetworkManager,chronyd,haveged,gdm" # System timezone timezone America/New_York --utc # System bootloader configuration bootloader --location=none --timeout=1 --extlinux # 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 --asprimary --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 # Explicitly set graphical.target as default as this is how initial-setup detects which version to run echo -n "Setting default runlevel to graphical mode[5]" #rm -f /etc/systemd/system/default.target #ln -s /lib/systemd/system/graphical.target /etc/systemd/system/default.target systemctl set-default graphical.target echo . %end %post # remove unnecessary entry in /etc/fstab sed -i '/swap/d' /etc/fstab sed -i '/efi/d' /etc/fstab sed -i '/boot/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 "http://openkoji.iscas.ac.cn/pub/dl/riscv/Sophgo/SG2042_EVB/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 dracut -f --regenerate-all %end %post #/usr/sbin/sfdisk -l /dev/loop0 #echo 'Deleting the first partition of Image...' #/usr/sbin/sfdisk --delete /dev/loop0 1 #/usr/sbin/sfdisk -l /dev/loop0 #echo 'Reorder the partitions of Image...' #/usr/sbin/sfdisk -r /dev/loop0 #/usr/sbin/sfdisk -l /dev/loop0 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 boot "http://openkoji.iscas.ac.cn/pub/dl/riscv/Sophgo/SG2042_EVB/FW/EFI.tar" #recover to the original resolv.conf rm -f /etc/resolv.conf ln -s ../run/systemd/resolve/stub-resolv.conf /etc/resolv.conf pushd boot /usr/bin/tar xpf EFI.tar rm -f EFI.tar cp -rvf * /boot/efi/ popd rm -rf boot 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@@/fc38/g" \ /boot/extlinux/extlinux.conf sed -i -e "s/@@KERNEL_RELAESE@@/6.1.55/g" \ /boot/extlinux/extlinux.conf sed -i -e "s/@@STORAGE@@/Installer Image/g" \ /boot/extlinux/extlinux.conf %end %post # Create Install app shortcut cat << EOF > /usr/share/applications/Fedora-on-sophgo-inst.desktop [Desktop Entry] Name=Install Fedora to Hard Drive GenericName=Install Fedora Comment=Install the Fedora to your hard disk Categories=System;Utility;X-Red-Hat-Base;X-Fedora;GNOME;GTK; Exec=sudo /usr/sbin/anaconda --graphical --kickstart /root/anaconda-ks.cfg Terminal=true Type=Application # TRANSLATORS: Icon name, probably should not be translated Icon=org.fedoraproject.AnacondaInstaller StartupNotify=true NoDisplay=false X-Desktop-File-Install-Version=0.26 EOF cat << EOF > /root/Fedora_install.sh #!/bin/sh anaconda --graphical --kickstart /root/anaconda-ks.cfg EOF cat << EOF > /etc/dconf/db/local.d/00-favorite-apps # Snippet sets gedit, terminal and nautilus as default favorites for all users [org/gnome/shell] favorite-apps = ['Fedora-on-sophgo-inst.desktop', 'org.gnome.Nautilus.desktop', 'org.gnome.Terminal.desktop', 'org.fedoraproject.MediaWriter.desktop', 'gparted.desktop'] EOF /usr/bin/dconf update %end %packages @base-x @buildsys-build @c-development @core @development-tools @dial-up @fedora-packager @gnome-desktop @hardware-support @input-methods @rpm-development-tools @standard @workstation-product @xfce-apps @xfce-desktop @xfce-extra-plugins @xfce-media @xfce-office NetworkManager-bluetooth ack anaconda anaconda-install-env-deps anaconda-live appliance-tools aria2 autoconf-archive avahi axel binwalk bloaty bpftool chkconfig chrony ckermit cmake colordiff cowsay dracut-config-generic dracut-live dracut-network dtc elinks entr evemu execstack extlinux-bootloader f2fs-tools fedora-release-xfce gcc-gdb-plugin gcc-gfortran gcc-plugin-devel glibc-all-langpacks glibc-langpack-en glibc-static haveged hdparm hexedit htop i2c-tools i2c-tools-perl incron initscripts inxi iproute-tc iptables-services isomd5sum jfsutils kernel kernel-tools koji-builder koji-builder-plugin-rpmautospec koji-builder-plugins lftp libatomic-static libgfortran libgfortran-static libgpiod libgpiod-c++ libgpiod-devel libgpiod-utils libi2c libi2c-devel libstdc++-static livecd-tools mailx mandoc mc moreutils mtd-utils mutt nbd nbdkit ncdu neofetch ninja-build nnn nvme-cli openrdate openssl-devel pax-utils pcmanfm perl-devel perl-generators pesign prettyping pv pycdio pykickstart python-imgcreate-sysdeps python3-asn1crypto python3-bluez python3-crypto python3-entrypoints python3-evdev python3-i2c-tools python3-imgcreate python3-iso8601 python3-isomd5sum python3-jmespath python3-ordered-set python3-pyelftools python3-pyserial python3-sh python3-wheel qemu-guest-agent qemu-img selinux-policy setools-console setroubleshoot-server spi-tools stress-ng tar tcsh texinfo the_silver_searcher tig tldr tmux trousers uboot-tools udftools wget zsh -dnfdragora-updater -dracut-config-rescue -generic-release* -grubby -ipw* -iwl* -libguestfs-tools-c -usb_modeswitch %end