[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Some of the parameters used in my genisoimage command don't produce a bootable ISO image



Almost,but not fully. Because I've realized that as soon as a new kernel has been installed by the user,logos and images should be added automatically inside the initrd.img* file. For this reason,I've created the bash script below. It works,I've tested it. Now I should understand where to place it and which stage of the linux booting is the better one to invoke it. I would like to read your suggestions. Thanks.

#!/bin/bash

if [ "`id -u`" -ne 0 ]; then
 echo "Switching from `id -un` to root"
 exec sudo "$0"
 exit 99
 fi

# Lets check the kernel version

function kernels-check() {
  CURRENT_KERNEL_VERSION_LIQUORIX=$(uname --kernel-release | cut --delimiter="-" --fields=3)
  if [ "$CURRENT_KERNEL_VERSION_LIQUORIX" = "liquorix" ]; then
        CURRENT_KERNEL_VERSION_GZ='initrd.img-'$(uname --kernel-release | cut --delimiter="-" --fields=1-3)'-amd64.gz'
        CURRENT_KERNEL_VERSION_NO_GZ='initrd.img-'$(uname --kernel-release | cut --delimiter="-" --fields=1-3)'-amd64'
  else
        CURRENT_KERNEL_VERSION_GZ='initrd.img-'$(uname --kernel-release | cut --delimiter="-" --fields=1-2)'-amd64.gz'
        CURRENT_KERNEL_VERSION_NO_GZ='initrd.img-'$(uname --kernel-release | cut --delimiter="-" --fields=1-2)'-amd64'
  fi
        echo $CURRENT_KERNEL_VERSION_GZ
        echo $CURRENT_KERNEL_VERSION_NO_GZ
        cp $CURRENT_KERNEL_VERSION_GZ /boot/old
        gunzip /boot/old/$CURRENT_KERNEL_VERSION_GZ
        echo /usr/share/plymouth/themes/homeworld/debian.png | cpio -H newc -o -A -F /boot/old/$CURRENT_KERNEL_VERSION_NO_GZ
        echo /usr/share/plymouth/themes/homeworld/logo.png | cpio -H newc -o -A -F /boot/old/$CURRENT_KERNEL_VERSION_NO_GZ
        echo /usr/share/plymouth/debian-logo.png | cpio -H newc -o -A -F /boot/old/$CURRENT_KERNEL_VERSION_NO_GZ
        gzip /boot/old/$CURRENT_KERNEL_VERSION_NO_GZ
        cp /boot/old/$CURRENT_KERNEL_VERSION_GZ /boot

}

kernels-check

Il giorno lun 24 ott 2022 alle ore 13:36 Thomas Schmitt <scdbackup@gmx.net> ha scritto:
Hi,

Mario Marietto wrote:
> But the technique below worked :

So your initrd problems are solved now and you managed to modify a Debian
Live ISO by help of Cubic ?


Have a nice day :)

Thomas



--
Mario.

Reply to: