# __ ____ ____ _____ # ____ / /_ __ __/ / /___ ____ ___ ___ / __ \/ ___/ # / __ \/ __ \/ / / / / / __ \/ __ `__ \/ _ \ / / / /\__ \ # / /_/ / / / / /_/ / / / /_/ / / / / / / __/ / /_/ /___/ / # / .___/_/ /_/\__, /_/_/\____/_/ /_/ /_/\___/ \____//____/ # /_/ /____/ # What ? This kickstart file bootstraps a minimal live system based on Fedora 34. It expects a virtual disk. # It requires the Fedora 34 server iso # 'i' for iso-based, 'v' for virtual machine, 'd' for desktop, 'm' for minimal, 'l' for live, 'd' for development only. # USAGE : Press the `tab` or 'e' key during POST and apend that after the 'quiet' string : # inst.ks=https://git.phyllo.me/home/kickstart/raw/branch/master/leaves/ivmld.cfg # ATTENTION : this kickstart file will automatically DESTROY the main virtual disk 'vda' and all of its contents. # Bye bye! ############################## # Add GPL licence somewhere ## ############################## # This file is directly inspired by the GPL-licence work of the maintainers of the official kickstart files for the RPM family of operating systems : # Adam Miller, Bastien Nocera, Bruno Wolff III, Bryan Kearney, Chitlesh Goorah, Christoph Wickert, Colin Walters, Fabian Affolter, Igor Pires Soares, # Jens Petersen, Jeremy Katz, Jeroen van Meeuwen, Jesse Keating, Luya Tshimbalanga, Matthias Clasen, Pedro Silva, Rahul Sundaram, Sebastian Dziallas, # Sebastian Vahl, wart %include https://git.phyllo.me/home/kickstart/raw/branch/master/leaves/ivdmd.cfg # Includes vdmd.cfg, a minimal GNOME-based desktop-oriented virtual machine. %packages # Beginning of the packages section kernel # Apparently necessary to avoid dependency loops which cause yum issues. kernel-modules # # Apparently necessary to avoid dependency loops which cause yum issues. kernel-modules-extra # # Apparently necessary to avoid dependency loops which cause yum issues. @x86-baremetal-tools # Includes memtest86+ and syslinux. Diagnosis tools useful for a Live OS image anaconda # Anaconda is needed anaconda-install-env-deps # Anaconda is needed anaconda-live # Anaconda is needed @anaconda-tools # Anaconda is needed -fcoe-utils # Weak unnecessary Anaconda dependency. See https://fedoraproject.org/wiki/Changes/RemoveDeviceMapperMultipathFromWorkstationLiveCD -device-mapper-multipath # Weak unnecessary Anaconda dependency. dracut-live # Without this, initramfs generation during live image creation fails: #1242586 glibc-all-langpacks # anaconda needs the locales available to run for different locales initscripts # no longer in @core but needed for livesys script chkconfig # no longer in @core but needed for livesys script policycoreutils # needed to create a livemedia selinux-policy-targeted # needed to create a livemedia %end %post # FIXME: it'd be better to get this installed from a package cat > /etc/rc.d/init.d/livesys << EOF #!/bin/bash # # live: Init script for live image # # chkconfig: 345 00 99 # description: Init script for live image. ### BEGIN INIT INFO # X-Start-Before: display-manager chronyd ### END INIT INFO . /etc/init.d/functions if ! strstr "\`cat /proc/cmdline\`" rd.live.image || [ "\$1" != "start" ]; then exit 0 fi if [ -e /.liveimg-configured ] ; then configdone=1 fi exists() { which \$1 >/dev/null 2>&1 || return \$* } livedir="LiveOS" for arg in \`cat /proc/cmdline\` ; do if [ "\${arg##rd.live.dir=}" != "\${arg}" ]; then livedir=\${arg##rd.live.dir=} continue fi if [ "\${arg##live_dir=}" != "\${arg}" ]; then livedir=\${arg##live_dir=} fi done # FIXME: it'd be better to get this installed from a package cat > /etc/rc.d/init.d/livesys << EOF #!/bin/bash # # live: Init script for live image # # chkconfig: 345 00 99 # description: Init script for live image. ### BEGIN INIT INFO # X-Start-Before: display-manager chronyd ### END INIT INFO . /etc/init.d/functions if ! strstr "\`cat /proc/cmdline\`" rd.live.image || [ "\$1" != "start" ]; then exit 0 fi if [ -e /.liveimg-configured ] ; then configdone=1 fi exists() { which \$1 >/dev/null 2>&1 || return \$* } livedir="LiveOS" for arg in \`cat /proc/cmdline\` ; do if [ "\${arg##rd.live.dir=}" != "\${arg}" ]; then livedir=\${arg##rd.live.dir=} continue fi if [ "\${arg##live_dir=}" != "\${arg}" ]; then livedir=\${arg##live_dir=} fi done # enable swapfile if it exists if ! strstr "\`cat /proc/cmdline\`" noswap && [ -f /run/initramfs/live/\${livedir}/swap.img ] ; then action "Enabling swap file" swapon /run/initramfs/live/\${livedir}/swap.img fi # add liveuser user with no passwd action "Adding live user" useradd \$USERADDARGS -c "Live System User" liveuser passwd -d liveuser > /dev/null usermod -aG wheel liveuser > /dev/null # don't use prelink on a running live image sed -i 's/PRELINKING=yes/PRELINKING=no/' /etc/sysconfig/prelink &>/dev/null || : # Don't sync the system clock when running live (RHBZ #1018162) sed -i 's/rtcsync//' /etc/chrony.conf # Mark things as configured touch /.liveimg-configured # add static hostname to work around xauth bug # https://bugzilla.redhat.com/show_bug.cgi?id=679486 # the hostname must be something else than 'localhost' # https://bugzilla.redhat.com/show_bug.cgi?id=1370222 hostnamectl set-hostname "localhost-live" EOF # bah, hal starts way too late cat > /etc/rc.d/init.d/livesys-late << EOF #!/bin/bash # # live: Late init script for live image # # chkconfig: 345 99 01 # description: Late init script for live image. . /etc/init.d/functions if ! strstr "\`cat /proc/cmdline\`" rd.live.image || [ "\$1" != "start" ] || [ -e /.liveimg-late-configured ] ; then exit 0 fi exists() { which \$1 >/dev/null 2>&1 || return \$* } touch /.liveimg-late-configured # read some variables out of /proc/cmdline for o in \`cat /proc/cmdline\` ; do case \$o in ks=*) ks="--kickstart=\${o#ks=}" ;; xdriver=*) xdriver="\${o#xdriver=}" ;; esac done # if liveinst or textinst is given, start anaconda if strstr "\`cat /proc/cmdline\`" liveinst ; then plymouth --quit /usr/sbin/liveinst \$ks fi if strstr "\`cat /proc/cmdline\`" textinst ; then plymouth --quit /usr/sbin/liveinst --text \$ks fi # enable tmpfs for /tmp systemctl enable tmp.mount # make it so that we don't do writing to the overlay for things which # are just tmpdirs/caches # note https://bugzilla.redhat.com/show_bug.cgi?id=1135475 cat >> /etc/fstab << EOF vartmp /var/tmp tmpfs defaults 0 0 EOF # work around for poor key import UI in PackageKit rm -f /var/lib/rpm/__db* echo "Packages within this LiveCD" rpm -qa --qf '%{size}\t%{name}-%{version}-%{release}.%{arch}\n' |sort -rn # Note that running rpm recreates the rpm db files which aren't needed or wanted rm -f /var/lib/rpm/__db* %end %post --nochroot # For livecd-creator builds only (lorax/livemedia-creator handles this directly) if [ -n "$LIVE_ROOT" ]; then cp "$INSTALL_ROOT"/usr/share/licenses/*-release-common/* "$LIVE_ROOT/" # only installed on x86, x86_64 if [ -f /usr/bin/livecd-iso-to-disk ]; then mkdir -p "$LIVE_ROOT/LiveOS" cp /usr/bin/livecd-iso-to-disk "$LIVE_ROOT/LiveOS" fi fi %end