Installation Problem with Rocky-8-XFCE-x86_64-latest

The problem is encountered specifically on an old machine which has an
nvidia SATA disk controller and an nvidia-304xx-supported graphics card.
(The Compaq Presario is described in detail in a previous post,
https://forums.rockylinux.org/t/rocky-8-6-won-t-boot-on-pc-with-nvidia
-graphics-card-/6564/29, General category, last updated July 26/22)

Summary Problem Description

-When the DVD containing the .iso is booted up, the end result is a
series of dracut-initque timeout messages and a drop into the dracut
emergency shell.

-When the .iso is loaded to a USB, the live session boots up. After installing
two kmod packages from a flash drive in the following manner,

sudo rpm -ivh kmod-sata_nv-3.5-6.el8_7.elrepo.x86_64.rpm
sudo modprobe sata_nv
sudo rpm -ivh kmod-forcedeth-0.0-8.el8_7.elrepo.x86_64.rpm
sudo modprobe forcedeth

the .iso successfully installs to the hard drive.

-However, when trying to boot from the hard drive, the end result again
is a series of dracut-initque timeout messages and a drop into the dracut
emergency shell, with an error message that the hard drive cannot be
found. The obvious cause for the error message is that the /etc/fstab file
does not exist; instead there is a null file, /etc/fstab.empty, containing
nothing.

Methods for loading the .iso to a USB stick and booting from it.

Two approaches were used:

-Load the USB stick with unetbootinx86_64-702.bin, and boot with
super_grub2_disk_hybrid_2.02s3.iso on a CD.

-Load a USB stick with the command,
sudo dd if=Rocky-8-XFCE-x86_64-latest.iso of=/dev/sdb bs=2K oflag=sync
status=progress, and boot with plopkexec-64-bit.iso on a CD.

The results were the same in the two cases.

Supplementary Tests to confirm the integrity of the machine and
media used.

-Rocky-8.7-minimal was installed from a DVD on the Compaq
Presario, adding 2 inst.dd statements to the boot command line
for the 2 kmod .rpm’s mentioned above.

The install completed normally, and a normal /etc/fstab file
was present on the hard drive.

-Rocky-8-XFCE-x86_64-latest was installed from the DVD onto a
HP Compaq DC5800 which has primarily Intel device controllers.

The install completed normally, and a normal /etc/fstab file
was present on the hard drive.


I’m very hopeful that a solution to this problem can be found.
The ability to use alternative images on any machine certainly
provides huge labour savings in lieu of building up distros from
minimal installs.

Len E.

If I’m understanding correctly, you’re trying to load drivers after the fact in a live environment (that ultimately won’t persist), performing the install, and the system won’t boot.

Have you tried using inst.dd on the boot command line for the live image? I’ve personally not ever tried this on a live image, but it may be worth a try. Anaconda (the installer) might see it despite being in a live environment.

Hi nazunalika:

I did try your suggestion in early testing, but it didn’t help.


Another Supplementary Test just completed:

-Springdale Linux-8.7-x86_64-netinst.iso was downloaded and installed in
the same manner as Rocky-8.7-minimal, with the usual inst.dd statements.

-Under software selection, Springdale offers the option of installing a desktop,
so the result is a standard GUI-environment distro. Unfortunately, the only
option is a full-blown Gnome desktop, which is not desirable on old, under-powered
machines.

Len E.

Another Supplementary Test just completed:

-a Rocky-8.5-XFCE-20211115.iso was loaded to a USB stick with unetbootin-702 and installed with the two version-matched kmod .rpm’s. The result was the same, an
fstab.empty file.

Len E.

Another Supplementary Test just completed:

-an AlmaLinux-8-latest-x86_64-Live-XFCE.iso was loaded to a USB stick with unetbootin-702 and installed with the two latest kmod .rpm’s described earlier. The result was the same, an
fstab.empty file.

Len E.

I’ve recently uncovered some information on the web (of which I was
previously unaware), which suggests that the installation I’m attempting
on the Compaq Presario machine has no chance of success.

-Many live cd’s (including el8-related ones) rely on the OverlayFS file system.
-From some CentOS8 documentation:
“not all file systems that are mountable by Linux have the features
needed for OverlayFS to work”
-Red Hat discontinued the use of the Btfrs files system on RHEL 8.
(Instead, the copy-on-write (COW) functionality has been added
to XFS, starting with xfsprogs package version 4.17.0-2.el8).


From my feeble understanding of OverlayFS in the current installation
situation, the upper layer of files, with read/write access can be modified
by the live OS, which includes additions from inst.dd statements and the
like, but Anaconda live-installer only installs the lower layer of files, with
read-only access, which originated with the installation media.

Consequently, as observed behaviour suggests, the original install proceeds
o.k., but the as-installed-on-the-hard-drive result lacks the necessary driver
additions to work properly.


I invite commentary from anyone with any expertise/knowledge of
OverlayFS to verify/dispute what I’ve described, and if possible, to suggest
a way forward.

Len E.

Hi nazunalika:

Using the rocky-live-xfce-related kickstart files that you have authored,
that are found on https://git.rockylinux.org, would it be possible to use
livecd-creator to create a custom rocky-live-xfce .iso with a localrepo
within it containing the kmod-sata_nv and kmod-forcedeth .rpm’s ???

From my own experience, using livecd-creator can be tricky, but with
explicit, “how to” instructions from you, average users would have
the weaponry to create a custom .iso to overcome this particular problem,
but much-more-importantly, would be able to create custom iso’s containing
their own preferred applications.

For your consideration …

Len E.

You can easily modify the kickstarts to add custom repos using the repo directive and list the packages you need in the %packages section.

The instructions to make a live image with a provided kickstart is in the README of the repo. This uses livemedia-creator instead of livecd-creator. You can use livecd-creator if you wish.[1]

Here is an example. If you take the kickstart, you can add the repo definition and the required packages (using the kmod examples you listed). This is a diff from the kickstart we use and the added lines.

[label@sani kickstarts]$ diff Rocky-8-XFCE.ks /tmp/rocky-8-xfce-elrepo.ks
24a25,27
>
> # elrepo repository - required for kmods
> repo --name="elrepo" --baseurl=http://elrepo.org/linux/elrepo/el8/$basearch/ --cost=200
497a501,505
>
> # elrepo packages
> elrepo-release
> kmod-sata_nv
> kmod-forcedeth

The full kickstart with the modifications:

# Generated by pykickstart v3.32
#version=DEVEL
# X Window System configuration information
xconfig  --startxonboot
# Keyboard layouts
keyboard 'us'
# Root password
rootpw --iscrypted --lock locked
# System language
lang en_US.UTF-8
# Shutdown after installation
shutdown
# Network information
network  --bootproto=dhcp --device=link --activate
# Firewall configuration
firewall --enabled --service=mdns
# Use network installation
url --url https://download.rockylinux.org/stg/rocky/8/BaseOS/$basearch/os/
repo --name="BaseOS" --baseurl=http://dl.rockylinux.org/pub/rocky/8.7/BaseOS/$basearch/os/ --cost=200
repo --name="AppStream" --baseurl=http://dl.rockylinux.org/pub/rocky/8.7/AppStream/$basearch/os/ --cost=200
repo --name="PowerTools" --baseurl=http://dl.rockylinux.org/pub/rocky/8.7/PowerTools/$basearch/os/ --cost=200
repo --name="extras" --baseurl=http://dl.rockylinux.org/pub/rocky/8.7/extras/$basearch/os --cost=200
repo --name="epel" --baseurl=https://dl.fedoraproject.org/pub/epel/8/Everything/$basearch/ --cost=200
repo --name="epel-modular" --baseurl=https://dl.fedoraproject.org/pub/epel/8/Modular/$basearch/ --cost=200

# elrepo repository - required for kmods
repo --name="elrepo" --baseurl=http://elrepo.org/linux/elrepo/el8/$basearch/ --cost=200
# System timezone
timezone US/Eastern
# SELinux configuration
selinux --enforcing
# System services
services --disabled="sshd" --enabled="NetworkManager,ModemManager"
# System bootloader configuration
bootloader --location=none
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all
# Disk partitioning information
part / --fstype="ext4" --size=5120
part / --size=6144

%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

# Enable swap unless requested otherwise
swaps=\`blkid -t TYPE=swap -o device\`
if ! strstr "\`cat /proc/cmdline\`" noswap && [ -n "\$swaps" ] ; then
  for s in \$swaps ; do
    action "Enabling swap partition \$s" swapon \$s
  done
fi
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

# Support for persistent homes
mountPersistentHome() {
  # support label/uuid
  if [ "\${homedev##LABEL=}" != "\${homedev}" -o "\${homedev##UUID=}" != "\${homedev}" ]; then
    homedev=\`/sbin/blkid -o device -t "\$homedev"\`
  fi

  # if we're given a file rather than a blockdev, loopback it
  if [ "\${homedev##mtd}" != "\${homedev}" ]; then
    # mtd devs don't have a block device but get magic-mounted with -t jffs2
    mountopts="-t jffs2"
  elif [ ! -b "\$homedev" ]; then
    loopdev=\`losetup -f\`
    if [ "\${homedev##/run/initramfs/live}" != "\${homedev}" ]; then
      action "Remounting live store r/w" mount -o remount,rw /run/initramfs/live
    fi
    losetup \$loopdev \$homedev
    homedev=\$loopdev
  fi

  # if it's encrypted, we need to unlock it
  if [ "\$(/sbin/blkid -s TYPE -o value \$homedev 2>/dev/null)" = "crypto_LUKS" ]; then
    echo
    echo "Setting up encrypted /home device"
    plymouth ask-for-password --command="cryptsetup luksOpen \$homedev EncHome"
    homedev=/dev/mapper/EncHome
  fi

  # and finally do the mount
  mount \$mountopts \$homedev /home
  # if we have /home under what's passed for persistent home, then
  # we should make that the real /home.  useful for mtd device on olpc
  if [ -d /home/home ]; then mount --bind /home/home /home ; fi
  [ -x /sbin/restorecon ] && /sbin/restorecon /home
  if [ -d /home/liveuser ]; then USERADDARGS="-M" ; fi
}

# Help locate persistent homes
findPersistentHome() {
  for arg in \`cat /proc/cmdline\` ; do
    if [ "\${arg##persistenthome=}" != "\${arg}" ]; then
      homedev=\${arg##persistenthome=}
    fi
  done
}

if strstr "\`cat /proc/cmdline\`" persistenthome= ; then
  findPersistentHome
elif [ -e /run/initramfs/live/\${livedir}/home.img ]; then
  homedev=/run/initramfs/live/\${livedir}/home.img
fi

# Mount the persistent home if it's available
if ! strstr "\`cat /proc/cmdline\`" nopersistenthome && [ -n "\$homedev" ] ; then
  action "Mounting persistent /home" mountPersistentHome
fi

if [ -n "\$configdone" ]; then
  exit 0
fi

# Create the liveuser (no password) so automatic logins and sudo works
action "Adding live user" useradd \$USERADDARGS -c "Live System User" liveuser
passwd -d liveuser > /dev/null
usermod -aG wheel liveuser > /dev/null

# Same for root
passwd -d root > /dev/null

# Turn off firstboot (similar to a DVD/minimal install, where it asks
# for the user to accept the EULA before bringing up a TTY)
systemctl --no-reload disable firstboot-text.service 2> /dev/null || :
systemctl --no-reload disable firstboot-graphical.service 2> /dev/null || :
systemctl stop firstboot-text.service 2> /dev/null || :
systemctl stop firstboot-graphical.service 2> /dev/null || :

# Prelinking damages the images
sed -i 's/PRELINKING=yes/PRELINKING=no/' /etc/sysconfig/prelink &>/dev/null || :

# Turn off mdmonitor by default
systemctl --no-reload disable mdmonitor.service 2> /dev/null || :
systemctl --no-reload disable mdmonitor-takeover.service 2> /dev/null || :
systemctl stop mdmonitor.service 2> /dev/null || :
systemctl stop mdmonitor-takeover.service 2> /dev/null || :

# Even if there isn't gnome, this doesn't hurt.
gsettings set org.gnome.software download-updates 'false' || :

# Disable cron
systemctl --no-reload disable crond.service 2> /dev/null || :
systemctl --no-reload disable atd.service 2> /dev/null || :
systemctl stop crond.service 2> /dev/null || :
systemctl stop atd.service 2> /dev/null || :

# Disable abrt
systemctl --no-reload disable abrtd.service 2> /dev/null || :
systemctl stop abrtd.service 2> /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
echo "localhost-live" > /etc/hostname

EOF

# HAL likes to start 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 stuff out of the kernel 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 installer
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

# Configure X, allowing user to override xdriver
if [ -n "\$xdriver" ]; then
   cat > /etc/X11/xorg.conf.d/00-xdriver.conf <<FOE
Section "Device"
	Identifier	"Videocard0"
	Driver	"\$xdriver"
EndSection
FOE
fi

EOF

chmod 755 /etc/rc.d/init.d/livesys
/sbin/restorecon /etc/rc.d/init.d/livesys
/sbin/chkconfig --add livesys

chmod 755 /etc/rc.d/init.d/livesys-late
/sbin/restorecon /etc/rc.d/init.d/livesys-late
/sbin/chkconfig --add livesys-late

# Enable tmpfs for /tmp - this is a good idea
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

# PackageKit likes to play games. Let's fix that.
rm -f /var/lib/rpm/__db*
releasever=$(rpm -q --qf '%{version}\n' --whatprovides system-release)
basearch=$(uname -i)
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial
echo "Packages within this LiveCD"
rpm -qa
# Note that running rpm recreates the rpm db files which aren't needed or wanted
rm -f /var/lib/rpm/__db*

# go ahead and pre-make the man -k cache (#455968)
/usr/bin/mandb

# make sure there aren't core files lying around
rm -f /core*

# remove random seed, the newly installed instance should make it's own
rm -f /var/lib/systemd/random-seed

# convince readahead not to collect
# FIXME: for systemd

echo 'File created by kickstart. See systemd-update-done.service(8).' \
    | tee /etc/.updated >/var/.updated

# Drop the rescue kernel and initramfs, we don't need them on the live media itself.
# See bug 1317709
rm -f /boot/*-rescue*

# Disable network service here, as doing it in the services line
# fails due to RHBZ #1369794 - the error is expected
/sbin/chkconfig network off

# Remove machine-id on generated images
rm -f /etc/machine-id
touch /etc/machine-id

# xfce configuration

# create /etc/sysconfig/desktop (needed for installation)

cat > /etc/sysconfig/desktop <<EOF
PREFERRED=/usr/bin/startxfce4
DISPLAYMANAGER=/usr/sbin/lightdm
EOF

cat >> /etc/rc.d/init.d/livesys << EOF

mkdir -p /home/liveuser/.config/xfce4
# ugly stuff, this should give us a default background for now
mkdir -p /usr/share/backgrounds/images
ln -s /usr/share/backgrounds/f32/default/f32.png \
  /usr/share/backgrounds/images/default.png

cat > /home/liveuser/.config/xfce4/helpers.rc << FOE
MailReader=sylpheed-claws
FileManager=Thunar
WebBrowser=firefox
FOE

# disable screensaver locking (#674410)
cat >> /home/liveuser/.xscreensaver << FOE
mode:           off
lock:           False
dpmsEnabled:    False
FOE

# deactivate xfconf-migration (#683161)
rm -f /etc/xdg/autostart/xfconf-migration-4.6.desktop || :

# deactivate xfce4-panel first-run dialog (#693569)
mkdir -p /home/liveuser/.config/xfce4/xfconf/xfce-perchannel-xml
cp /etc/xdg/xfce4/panel/default.xml /home/liveuser/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml

# set up lightdm autologin
sed -i 's/^#autologin-user=.*/autologin-user=liveuser/' /etc/lightdm/lightdm.conf
sed -i 's/^#autologin-user-timeout=.*/autologin-user-timeout=0/' /etc/lightdm/lightdm.conf
sed -i 's/^#show-language-selector=.*/show-language-selector=true/' /etc/lightdm/lightdm-gtk-greeter.conf

# set Xfce as default session, otherwise login will fail
sed -i 's/^#user-session=.*/user-session=xfce/' /etc/lightdm/lightdm.conf

# debrand
#sed -i "s/Red Hat Enterprise/Rocky/g" /usr/share/anaconda/gnome/rhel-welcome.desktop
#sed -i "s/RHEL/Rocky Linux/g" /usr/share/anaconda/gnome/rhel-welcome
#sed -i "s/Red Hat Enterprise/Rocky/g" /usr/share/anaconda/gnome/rhel-welcome
#sed -i "s/org.fedoraproject.AnacondaInstaller/fedora-logo-icon/g" /usr/share/anaconda/gnome/rhel-welcome
#sed -i "s/org.fedoraproject.AnacondaInstaller/fedora-logo-icon/g" /usr/share/applications/liveinst.desktop

# Show harddisk install on the desktop
sed -i -e 's/NoDisplay=true/NoDisplay=false/' /usr/share/applications/liveinst.desktop
mkdir /home/liveuser/Desktop
cp /usr/share/applications/liveinst.desktop /home/liveuser/Desktop/

# no updater applet in live environment
rm -f /etc/xdg/autostart/org.mageia.dnfdragora-updater.desktop

if [ -f /usr/share/anaconda/gnome/rhel-welcome.desktop ]; then
  mkdir -p ~liveuser/.config/autostart
  cp /usr/share/anaconda/gnome/rhel-welcome.desktop /usr/share/applications/
  cp /usr/share/anaconda/gnome/rhel-welcome.desktop ~liveuser/.config/autostart/
fi

# and mark it as executable (new Xfce security feature)
chmod +x /home/liveuser/Desktop/liveinst.desktop

# move to anaconda - probably not required for XFCE.
mv /usr/share/applications/liveinst.desktop /usr/share/applications/anaconda.desktop

# this goes at the end after all other changes. 
chown -R liveuser:liveuser /home/liveuser
restorecon -R /home/liveuser

EOF

# this doesn't come up automatically. not sure why.
systemctl enable --force lightdm.service
dnf config-manager --set-enabled powertools

%end

%post --nochroot
cp $INSTALL_ROOT/usr/share/licenses/*-release/* $LIVE_ROOT/

# only works on x86_64
if [ "$(uname -i)" = "i386" -o "$(uname -i)" = "x86_64" ]; then
    # For livecd-creator builds
    if [ ! -d $LIVE_ROOT/LiveOS ]; then mkdir -p $LIVE_ROOT/LiveOS ; fi
    cp /usr/bin/livecd-iso-to-disk $LIVE_ROOT/LiveOS

    # For lorax/livemedia-creator builds
    sed -i '
    /## make boot.iso/ i\
    # Add livecd-iso-to-disk script to .iso filesystem at /LiveOS/\
    <% f = "usr/bin/livecd-iso-to-disk" %>\
    %if exists(f):\
        install ${f} ${LIVEDIR}/${f|basename}\
    %endif\
    ' /usr/share/lorax/templates.d/99-generic/live/x86.tmpl
fi

%end

%packages
@anaconda-tools
@base-x
@core
@dial-up
@fonts
@guest-desktop-agents
@hardware-support
@input-methods
@multimedia
@standard
@xfce-desktop
aajohan-comfortaa-fonts
anaconda
anaconda-install-env-deps
anaconda-live
chkconfig
dracut-live
epel-release
f32-backgrounds-extras-xfce
f32-backgrounds-xfce
firefox
firewall-config
geany
glibc-all-langpacks
gparted
initscripts
kernel
kernel-modules
kernel-modules-extra
memtest86+
mousepad
pavucontrol
pcp-selinux
pidgin
rhythmbox
ristretto
rocky-backgrounds
lightdm
seahorse
syslinux
thunderbird
transmission
wget
xfce4-about
xfce4-appfinder
xfce4-battery-plugin
xfce4-datetime-plugin
xfce4-netload-plugin
xfce4-places-plugin
xfce4-pulseaudio-plugin
xfce4-screenshooter-plugin
xfce4-smartbookmark-plugin
xfce4-systemload-plugin
xfce4-taskmanager
xfce4-time-out-plugin
xfce4-weather-plugin
xfce4-whiskermenu-plugin
xfdashboard
xfdashboard-themes
xdg-user-dirs
xdg-user-dirs-gtk
-acpid
-aspell-*
-autofs
-desktop-backgrounds-basic
-gdm
-gimp-help
-gnome-menus
-gnome-shell
-hplip
-isdn4k-utils
-mpage
-sane-backends
-xfce4-eyes-plugin
-xfce4-sensors-plugin
-xsane
-xsane-gimp

# elrepo packages
elrepo-release
kmod-sata_nv
kmod-forcedeth

%end

Following the instructions to build an image with this kickstart would be the following commands:

# If on enterprise linux, like Rocky Linux
% dnf install epel-release -y

# Commands apply to Fedora and EL below
% dnf install mock -y
% usermod -a -G mock myuser
% mock -r rocky-8-x86_64 --init
% mock -r rocky-8-x86_64 --install lorax-lmc-novirt vim-minimal pykickstart git
# Set selinux to permissive temporarily
% setenforce 0

# Copy my modified kickstart to the mock root
% sudo cp /tmp/rocky-8-xfce-elrepo.ks /var/lib/mock/rocky-8-x86_64/root/builddir/
# Enter the shell
% mock -r rocky-8-x86_64 --shell --isolation=simple --enable-network

# run the media creator
mock% livemedia-creator --ks rocky-8-xfce-elrepo.ks \
  --no-virt \
  --resultdir /var/lmc \
  --project="Rocky Linux" \
  --make-iso \
  --volid Rocky-XFCE-8 \
  --iso-only \
  --iso-name Rocky-XFCE-8-x86_64-kmods.iso \
  --releasever=8 \
  --nomacboot

mock% exit

# Turn selinux back on
% setenforce 1

# Copy the ISO to my home directory
% cp /var/lib/mock/rocky-8-x86_64/var/lmc/Rocky-XFCE-8-x86_64-kmods.iso ~

That is the gist of making a live image using livemedia-creator.

[1] Note that I’ve not had success with it. If it succeeds, I would recommend that you boot it up and ensure rpm -qa returns all the packages on the live image. I’ve had multiple occassions where this part is broken with livecd-creator.

1 Like

Hi nazunalika:

Thank you for providing such comprehensive kickstart instructions
so quickly !!

From your reply above, I copy/pasted your full, modified kickstart
into a text file, and saved it as rocky-8-xfce-elrepo.ks.

With your instructions in hand, I proceeded to try them out on my
HP Compaq DC5800, which has predominantly-intel device drivers
onto which Rocky-8-XFCE-latest was installed without incident.

A small correction to the .ks before proceeding was to alter the
elrepo repository baseurl, changing el9 to el8.


On the initial iteration, after entering the mock shell, the git clone
statement couldn’t find the github.com kickstarts.
I changed the reference to rocky / kickstarts · GitLab,
which seemed to work.
After the cd kickstarts comand, the livemedia-creator command failed,
unable to find the .ks file.
The /var/lib/mock/rocky-8-x86_64/root/builddir directory contained the
.ks file, but because of the cd kickstarts command, it was not found.
I copied it into the kickstarts subdirectory as well.

The livemedia-creator command failed because of an invalid command
in line 1 of the .ks file. The only thing that seemed at-all suspicious to
me was the 2nd line, #version=DEVEL, with no space after the # character.
I put a space in, and had to re-establish to mock shell environment before
trying the livemedia-creator command again.

This time, the invalid command message was only a warning, but the
command failed with the following screen output:

<!-- @page { margin: 2cm } PRE { font-family: "Tinos" } P { margin-bottom: 0.21cm } -->

2023-01-06 22:09:08,948: livemedia-creator v28.14.70-1
2023-01-06 22:09:08,948: selinux is Disabled
The following problem occurred on line 1 of the kickstart file:

Unknown command:

/usr/lib/python3.6/site-packages/pykickstart/commands/partition.py:448: KickstartParseWarning:
 A partition with the mountpoint / has already been defined.
 warnings.warn(_("A partition with the mountpoint %s has already been defined.") % pd.mountpoint, KickstartParseWarning) 

2023-01-06 22:09:09,078: disk_img = /var/lmc/lmc-disk-uljp0fox.img 
2023-01-06 22:09:09,078: Using disk size of 6146MiB 
2023-01-06 22:09:10,370: Running anaconda. 
2023-01-06 22:19:13,841: Starting installer, one moment... 
2023-01-06 22:19:13,841: terminal size detection failed, using default width 
2023-01-06 22:19:13,841: anaconda 33.16.7.12-1.el8.rocky.0.1 for Rocky Linux 8 (pre-release) started. 
2023-01-06 22:19:13,842: 22:19:13 Service org.fedoraproject.Anaconda.Modules.Storage has failed to start: Failed to activate service 'org.fedoraproject.Anaconda.Modules.Storage': timed out (service_start_timeout=600000ms) 
2023-01-06 22:19:24,174: Running anaconda failed: process '['anaconda', '--kickstart', '/builddir/rocky-8-xfce-elrepo.ks', '--cmdline', '--loglevel', 'debug', '--dirinstall', '--remotelog', '127.0.0.1:46163']' exited with status 1 
2023-01-06 22:19:24,315: Install failed: novirt_install failed 
2023-01-06 22:19:24,315: Removing bad disk image 
2023-01-06 22:19:24,316: ERROR: Image creation failed: novirt_install failed 
2023-01-06 22:19:24,317: Image creation failed: novirt_install failed <mock-chroot> sh-4.4# exit

I look forward to your assessment of this !
Len E.

I have no issues making the ISO with the modified kickstart. It is likely you have copied and pasted it with extra text/data on accident. It may be easier if you clone the kickstarts, make the changes yourself, and copy it into the mock chroot.

[nazu@router tmp]$ mock --quiet -r rocky-8-x86_64 --init
[nazu@router tmp]$ mock --quiet -r rocky-8-x86_64 --install lorax-lmc-novirt vim-minimal pykickstart git
[nazu@router tmp]$ egrep 'kmod|elrepo' /tmp/rocky-8-xfce-elrepo.ks
# elrepo repository - required for kmods
repo --name="elrepo" --baseurl=http://elrepo.org/linux/elrepo/el8/$basearch/ --cost=200
# elrepo packages
elrepo-release
kmod-sata_nv
kmod-forcedeth

[nazu@router tmp]$ sudo setenforce 0
[nazu@router tmp]$ sudo cp /tmp/rocky-8-xfce-elrepo.ks /var/lib/mock/rocky-8-x86_64/root/builddir/
[nazu@router tmp]$ mock -r rocky-8-x86_64 --shell --isolation=simple --enable-network
INFO: mock.py version 3.4 starting (python version = 3.6.8, NVR = mock-3.4-1.el8)...
Start(bootstrap): init plugins
INFO: selinux enabled
Finish(bootstrap): init plugins
Start: init plugins
INFO: selinux enabled
Finish: init plugins
INFO: Signal handler active
Start: run
Start(bootstrap): chroot init
INFO: calling preinit hooks
INFO: enabled root cache
INFO: enabled package manager cache
Start(bootstrap): cleaning package manager metadata
Finish(bootstrap): cleaning package manager metadata
INFO: enabled HW Info plugin
Finish(bootstrap): chroot init
Start: chroot init
INFO: calling preinit hooks
INFO: enabled root cache
INFO: enabled package manager cache
Start: cleaning package manager metadata
Finish: cleaning package manager metadata
INFO: enabled HW Info plugin
Finish: chroot init
Start: shell
<mock-chroot> sh-4.4# livemedia-creator --ks rocky-8-xfce-elrepo.ks \
>   --no-virt \
>   --resultdir /var/lmc \
>   --project="Rocky Linux" \
>   --make-iso \
>   --volid Rocky-XFCE-8 \
>   --iso-only \
>   --iso-name Rocky-XFCE-8-x86_64-kmods.iso \
>   --releasever=8 \
>   --nomacboot
2023-01-07 13:26:04,870: livemedia-creator v28.14.70-1
2023-01-07 13:26:04,871: selinux is Disabled
/usr/lib/python3.6/site-packages/pykickstart/commands/partition.py:448: KickstartParseWarning: A partition with the mountpoint / has already been defined.
  warnings.warn(_("A partition with the mountpoint %s has already been defined.") % pd.mountpoint, KickstartParseWarning)
2023-01-07 13:26:04,974: disk_img = /var/lmc/lmc-disk-ckcqocy8.img
2023-01-07 13:26:04,974: Using disk size of 6146MiB
2023-01-07 13:26:05,301: Running anaconda.
2023-01-07 13:26:09,874: Processing logs from ('127.0.0.1', 57990)
2023-01-07 13:26:09,950: Starting installer, one moment...
2023-01-07 13:26:09,950: terminal size detection failed, using default width
2023-01-07 13:26:09,950: anaconda 33.16.7.12-1.el8.rocky.0.1 for Rocky Linux 8 (pre-release) started.
2023-01-07 13:26:09,950:
2023-01-07 13:26:09,950: Some warnings occurred during reading the kickstart file:
2023-01-07 13:26:09,951: A partition with the mountpoint / has already been defined.
2023-01-07 13:26:09,951: 13:26:09 Not asking for VNC because of an automated install
2023-01-07 13:26:09,951: 13:26:09 Not asking for VNC because we don't have Xvnc
2023-01-07 13:29:16,919: Starting automated install......................
2023-01-07 13:29:16,920: ================================================================================
2023-01-07 13:29:16,920: ================================================================================
2023-01-07 13:29:16,920: Installation
2023-01-07 13:29:16,920:
2023-01-07 13:29:16,920: 1) [x] Language settings                 2) [x] Time settings
2023-01-07 13:29:16,920: (English (United States))                (US/Eastern timezone)
2023-01-07 13:29:16,920: 3) [x] Installation source               4) [x] Software selection
2023-01-07 13:29:16,920: (https://download.rockylinux.org         (Custom software selected)
2023-01-07 13:29:16,920: /stg/rocky/8/BaseOS/$basearch/os
2023-01-07 13:29:16,921: /)
2023-01-07 13:29:16,921: 5) [ ] User creation
2023-01-07 13:29:16,921: (No user will be created)
2023-01-07 13:29:16,921:
2023-01-07 13:29:16,921: ================================================================================
2023-01-07 13:29:16,921: ================================================================================
2023-01-07 13:29:16,921: Progress
2023-01-07 13:29:16,921:
2023-01-07 13:29:16,921: Setting up the installation environment
2023-01-07 13:29:16,921: ..
2023-01-07 13:29:16,922: Configuring storage
2023-01-07 13:29:18,921: ...
2023-01-07 13:29:18,921: Running pre-installation scripts
2023-01-07 13:29:18,921: .
2023-01-07 13:29:18,922: Running pre-installation tasks
2023-01-07 13:30:49,166: ..
2023-01-07 13:30:49,166: Installing.
2023-01-07 13:30:49,166: Starting package installation process
2023-01-07 13:30:49,166: Downloading packages
2023-01-07 13:30:49,167: Downloading 1048 RPMs, 16.75 MiB / 1.44 GiB (1%) done.
2023-01-07 13:30:49,167: Downloading 1048 RPMs, 47.48 MiB / 1.44 GiB (3%) done.
2023-01-07 13:30:49,167: Downloading 1048 RPMs, 61.67 MiB / 1.44 GiB (4%) done.
2023-01-07 13:30:49,167: Downloading 1048 RPMs, 69.3 MiB / 1.44 GiB (4%) done.
2023-01-07 13:30:49,167: Downloading 1048 RPMs, 83 MiB / 1.44 GiB (5%) done.
2023-01-07 13:30:49,167: Downloading 1048 RPMs, 131.93 MiB / 1.44 GiB (8%) done.
2023-01-07 13:30:49,167: Downloading 1048 RPMs, 160.18 MiB / 1.44 GiB (10%) done.
2023-01-07 13:30:49,167: Downloading 1048 RPMs, 189.83 MiB / 1.44 GiB (12%) done.
2023-01-07 13:30:49,167: Downloading 1048 RPMs, 229.07 MiB / 1.44 GiB (15%) done.
2023-01-07 13:30:49,167: Downloading 1048 RPMs, 259.18 MiB / 1.44 GiB (17%) done.
2023-01-07 13:30:49,167: Downloading 1048 RPMs, 290.71 MiB / 1.44 GiB (19%) done.
2023-01-07 13:30:49,168: Downloading 1048 RPMs, 308.64 MiB / 1.44 GiB (20%) done.
2023-01-07 13:30:49,168: Downloading 1048 RPMs, 344.61 MiB / 1.44 GiB (23%) done.
2023-01-07 13:30:49,168: Downloading 1048 RPMs, 407.31 MiB / 1.44 GiB (27%) done.
2023-01-07 13:30:49,168: Downloading 1048 RPMs, 469.94 MiB / 1.44 GiB (31%) done.
2023-01-07 13:30:49,168: Downloading 1048 RPMs, 488.68 MiB / 1.44 GiB (33%) done.
2023-01-07 13:30:49,168: Downloading 1048 RPMs, 493.8 MiB / 1.44 GiB (33%) done.
2023-01-07 13:30:49,168: Downloading 1048 RPMs, 512.45 MiB / 1.44 GiB (34%) done.
2023-01-07 13:30:49,168: Downloading 1048 RPMs, 540.13 MiB / 1.44 GiB (36%) done.
2023-01-07 13:30:49,168: Downloading 1048 RPMs, 558.15 MiB / 1.44 GiB (37%) done.
2023-01-07 13:30:49,168: Downloading 1048 RPMs, 577.57 MiB / 1.44 GiB (39%) done.
2023-01-07 13:30:49,168: Downloading 1048 RPMs, 597.14 MiB / 1.44 GiB (40%) done.
2023-01-07 13:30:49,169: Downloading 1048 RPMs, 617.49 MiB / 1.44 GiB (41%) done.
2023-01-07 13:30:49,169: Downloading 1048 RPMs, 652.15 MiB / 1.44 GiB (44%) done.
2023-01-07 13:30:49,169: Downloading 1048 RPMs, 689.67 MiB / 1.44 GiB (46%) done.
2023-01-07 13:30:49,169: Downloading 1048 RPMs, 765.8 MiB / 1.44 GiB (51%) done.
2023-01-07 13:30:49,169: Downloading 1048 RPMs, 795.32 MiB / 1.44 GiB (53%) done.
2023-01-07 13:30:49,169: Downloading 1048 RPMs, 894.47 MiB / 1.44 GiB (60%) done.
2023-01-07 13:30:49,169: Downloading 1048 RPMs, 981.39 MiB / 1.44 GiB (66%) done.
2023-01-07 13:30:49,169: Downloading 1048 RPMs, 1.04 GiB / 1.44 GiB (71%) done.
2023-01-07 13:30:49,169: Downloading 1048 RPMs, 1.06 GiB / 1.44 GiB (73%) done.
2023-01-07 13:30:49,169: Downloading 1048 RPMs, 1.08 GiB / 1.44 GiB (74%) done.
2023-01-07 13:30:49,169: Downloading 1048 RPMs, 1.1 GiB / 1.44 GiB (76%) done.
2023-01-07 13:30:49,169: Downloading 1048 RPMs, 1.15 GiB / 1.44 GiB (79%) done.
2023-01-07 13:30:49,170: Downloading 1048 RPMs, 1.18 GiB / 1.44 GiB (81%) done.
2023-01-07 13:30:49,170: Downloading 1048 RPMs, 1.22 GiB / 1.44 GiB (84%) done.
2023-01-07 13:30:49,170: Downloading 1048 RPMs, 1.25 GiB / 1.44 GiB (86%) done.
2023-01-07 13:30:49,170: Downloading 1048 RPMs, 1.28 GiB / 1.44 GiB (88%) done.
2023-01-07 13:30:49,170: Downloading 1048 RPMs, 1.33 GiB / 1.44 GiB (92%) done.
2023-01-07 13:30:49,170: Downloading 1048 RPMs, 1.36 GiB / 1.44 GiB (94%) done.
2023-01-07 13:30:49,170: Downloading 1048 RPMs, 1.38 GiB / 1.44 GiB (96%) done.
2023-01-07 13:30:49,170: Downloading 1048 RPMs, 1.4 GiB / 1.44 GiB (96%) done.
2023-01-07 13:30:49,170: Downloading 1048 RPMs, 1.42 GiB / 1.44 GiB (98%) done.
2023-01-07 13:32:37,917: Preparing transaction from installation source
2023-01-07 13:32:37,918: Installing libgcc.x86_64 (1/1048)
. . .
2023-01-07 13:41:40,637: Verifying elrepo-release.noarch (1046/1048)
2023-01-07 13:41:40,637: Verifying kmod-forcedeth.x86_64 (1047/1048)
2023-01-07 13:41:40,637: Verifying kmod-sata_nv.x86_64 (1048/1048)
2023-01-07 13:41:40,981: .
2023-01-07 13:41:40,981: Installing boot loader
2023-01-07 13:41:40,983: ..
2023-01-07 13:41:40,983: Performing post-installation setup tasks
2023-01-07 13:41:41,992: .
2023-01-07 13:41:41,992: Configuring installed system
2023-01-07 13:41:48,080: ...................
2023-01-07 13:41:48,080: Creating users
2023-01-07 13:41:48,081: Configuring addons
2023-01-07 13:42:35,892: ..
2023-01-07 13:42:35,892: Generating initramfs
2023-01-07 13:42:35,956: ...
2023-01-07 13:42:35,956: Storing configuration files and kickstarts
2023-01-07 13:42:50,023: .
2023-01-07 13:42:50,023: Running post-installation scripts
2023-01-07 13:42:50,024: .
2023-01-07 13:42:50,024: Installation complete
2023-01-07 13:42:50,025:
2023-01-07 13:42:50,025: Use of this product is subject to the license agreement found at:
2023-01-07 13:42:50,025: /usr/share/rocky-release/EULA
2023-01-07 13:42:50,025:
2023-01-07 13:43:33,625: Shutting down log processing
2023-01-07 13:43:37,329: Disk Image install successful
2023-01-07 13:43:37,329: working dir is /var/tmp/lmc-work-bvu6ps6x
2023-01-07 13:47:41,705: Rebuilding initrds
2023-01-07 13:47:41,705: dracut args = ['--xz', '--add', 'livenet dmsquash-live convertfs pollcdrom qemu qemu-net', '--omit', 'plymouth', '--no-hostonly', '--debug', '--no-early-microcode']
2023-01-07 13:47:41,707: rebuilding boot/initramfs-4.18.0-425.3.1.el8.x86_64.img
2023-01-07 13:48:29,196: Building boot.iso
2023-01-07 13:48:29,265: running x86.tmpl
2023-01-07 13:48:40,171: Disk image erased
2023-01-07 13:48:41,309: SUMMARY
2023-01-07 13:48:41,309: -------
2023-01-07 13:48:41,309: Logs are in /builddir
2023-01-07 13:48:41,309: Results are in /var/lmc

Hi nazunalika:

An interim report – I had a successful build in progress but ran out of
disk space.

I continue to be confused by the mock git clone process, so instead I
accessed Rocky-8-XFCE.ks on the website, copy/pasted the listing
into a text file, inserted the elrepo additions, thus creating
rocky-8-xfce-elrepo.ks

I used the first 2 statements of your revised procedure, and then
went to sudo setenforce 0 and continued from there. Everything
went as illustrated in your sample output until the disk space ran out.

My previous attempt and your sample output indicated that 6146 MiB
was required for the build, gparted indicated that I had 7GB of unused
space in the partition, but I ran out of room anyway.

I’ll regroup by finding a larger partition, and try again.

To be continued …

Len E.

Hi nazunalika:

Big disappointment – same machine, same .ks file, same procedure as last time,
but in a larger partition — and it failed almost immediately ???


2023-01-07 20:48:06,121: livemedia-creator v28.14.70-1
2023-01-07 20:48:06,121: selinux is Disabled
/usr/lib/python3.6/site-packages/pykickstart/commands/partition.py:448: KickstartParseWarning: A partition with the mountpoint / has already been defined.
  warnings.warn(_("A partition with the mountpoint %s has already been defined.") % pd.mountpoint, KickstartParseWarning)
2023-01-07 20:48:06,301: disk_img = /var/lmc/lmc-disk-lao1k6vp.img
2023-01-07 20:48:06,301: Using disk size of 6146MiB
2023-01-07 20:48:07,543: Running anaconda.
2023-01-07 20:58:10,953: Starting installer, one moment...
2023-01-07 20:58:10,954: terminal size detection failed, using default width
2023-01-07 20:58:10,954: anaconda 33.16.7.12-1.el8.rocky.0.1 for Rocky Linux 8 (pre-release) started.
2023-01-07 20:58:10,954: 20:58:10 Service org.fedoraproject.Anaconda.Modules.Storage has failed to start: Failed to activate service 'org.fedoraproject.Anaconda.Modules.Storage': timed out (service_start_timeout=600000ms)
2023-01-07 20:58:21,086: Running anaconda failed: process '['anaconda', '--kickstart', '/builddir/rocky-8-xfce-elrepo.ks', '--cmdline', '--loglevel', 'debug', '--dirinstall', '--remotelog', '127.0.0.1:41309']' exited with status 1
2023-01-07 20:58:21,359: Install failed: novirt_install failed
2023-01-07 20:58:21,360: Removing bad disk image
2023-01-07 20:58:21,361: ERROR: Image creation failed: novirt_install failed
2023-01-07 20:58:21,361: Image creation failed: novirt_install failed
<mock-chroot> sh-4.4# 

Hi nazunalika:

Since my “big disappointment” report yesterday, I’ve had two more
attempts with the kickstart process, unfortunately with similar failures
characterized by the same error message, “Service org.fedoraproject.
Anaconda.Modules.Storage has failed to start”.

For these two tests, I switched from the Rocky-8-XFCE-latest platform to
Rocky-8.7-minimal Server with basic Development Tools installed.
Immediately after installation, I installed the “RPM Development Tools”
group, epel-release, and enabled Rocky powertools also. For the one test, the
Rocky-8.7-minimal was installed on the HP Compaq DC5800; for the
other, Rocky-8.7-minimal was installed on the Compaq Presario with the
aid of the two inst.dd statements.

I’m certain that I’ve been using a clean version of rocky-8-xfce-elrepo.ks.
I found that at Sign in · GitLab
Rocky-8-XFCE.ks, there is a download icon at the far right end of the title
line on the screen, so a direct download of the .ks can be obtained avoiding
any errors that could be caused by a copy/paste of the .ks contents.
Therefore, rocky-8-xfce-elrepo.ks is created by editing Rocky-8-XFCE.ks to
add the elrepo-specific lines.
I’ve read some articles on the web that come up by searching with the
“Service org.fedoraproject …” error message, but none so far pin-pointing
a solution.

To be continued …

Len E.

Hi nazunalika: to me, an ABSOLUTELY ASTOUNDING RESULT

With a single command, the livecd-creator program generated the
livecd .iso from the .ks file which subsequently installed without
incident on my problem Compaq Presario machine, and works
normally as installed.


On Rocky-8.7-minimal on the HP Compaq DC5800, I installed
livecd-tools. I noticed that a correction is needed in the
livecd-creator man page: the fedora sample command shows
the directory as /usr/share/livecd-tools; it should be
/usr/share/doc/livecd-tools.

I loaded the elrepo.ks file into /usr/share/doc/livecd-tools.
I started the command, sudo
livecd-creator --config=/usr/share/doc/livecd-tools/rocky-8-xfce.elrepo.ks

It ran for 43 minutes. The .iso was then burned on a DVD for the
installation on the Compaq Presario


It is very reassuring that a top-quality .ks file developed for livemedia-creator is fully compatible/usable for livecd-creator.


Thank you sir, for your expert mentoring throughout this development
process, without which success would have been unachievable.

Len E.