Ultimate goal: Create an automated installation disk for CentOS, using a kickstart config file stored on an internal website.
What I've done: Created a script that
- downloads an ISO
- unpacks it
- updates the
isolinux.cfg
file with my own menu option - recreates the ISO using
genisoimage
All of this works, and the ISO is recreated without any errors. However, when I try to use the ISO, to start an installation, the sistem always dies at:
"new value non-existent xfs filesystem is not valid as a default fs type"
Pane is dead
Unlike this question here, my error happens pre-installation, and I'm already using lang = en_US.UTF-8
. I even tried en_US
, but it did not make a difference.
Lines I added to the isolinux.cfg
file:
label install
menu label ^Kickstart Installation
menu default
kernel vmlinuz
append initrd=initrd.img text ramdisk=100000 lang=en_US.UTF-8 keymap=us ipv6.disable=1 ip=dhcp install inst.ks=cdrom:/kickstart.cfg
I searched online for the error, and a lot of comments seem to be related to mismatching versions for init and the kernel, or corrupted files. I am not replacing any files, and the only change I make is to the configuration file isolinux.cfg
. There is no mixing of files from different versions/DVDs/images.
Has anyone had/seen the above, and have any ideas on what I should try next? I've tried playing around with the options I am putting into the file, but it doesn't seem to make a difference.
Other Info
Original image: CentOS 7.2 - DVD ISO
State of the system:
EDIT
Script that I am writing, as requested:
#!/bin/bash
#############################################################
function prepare {
rm -rf ${ISO_EXTRACTION_DIR}
if [ -d ${ISO_MOUNT_DIR} ]
then
umount ${ISO_MOUNT_DIR} 2>&1 || true
rm -rf ${ISO_MOUNT_DIR}
fi
mkdir -p ${ISO_MOUNT_DIR} ${ISO_EXTRACTION_DIR}
}
function extract_iso {
echo "Extracting ISO"
cd $(dirname ${ISO_MOUNT_DIR})
cp -pRf ${ISO_MOUNT_DIR}/* ${ISO_EXTRACTION_DIR}
echo "Extracted $(ls ${ISO_EXTRACTION_DIR} | wc -l) files and directories from ISO"
}
function update_config {
echo "Updating configuration"
cd ${ISO_EXTRACTION_DIR}
if [ -d "isolinux" ]
then
isolinux_cfg_file="${ISO_EXTRACTION_DIR}/isolinux/isolinux.cfg"
else
isolinux_cfg_file="${ISO_EXTRACTION_DIR}/isolinux.cfg"
fi
sed -i 's/timeout 600/timeout 50/' ${isolinux_cfg_file} # Shorten timeout
sed -i '/menu default/d' ${isolinux_cfg_file} # Delete existing menu default
echo "label linux" >> ${isolinux_cfg_file}
echo " menu default" >> ${isolinux_cfg_file}
echo " kernel vmlinuz" >> ${isolinux_cfg_file}
echo " append initrd=initrd.img text ramdisk=100000 lang=en_US.UTF-8 keymap=us ipv6.disable=1 ip=dhcp install inst.ks=cdrom:/kickstart.cfg" >> ${isolinux_cfg_file}
}
function repackage_iso {
echo "Repackaging ISO"
cd ${ISO_EXTRACTION_DIR}
volume_id="${LINUX_DISTRO}-${LINUX_VERSION}-bootable"
if [ -d "isolinux" ]
then
boot_cat_file="isolinux/boot.cat"
isolinux_bin_file="isolinux/isolinux.bin"
else
boot_cat_file="boot.cat"
isolinux_bin_file="isolinux.bin"
fi
iso_file_name="$(echo $(basename ${IMAGE_FILENAME}) | cut -d '.' -f 1)-bootable.iso"
genisoimage \
-U -r -v -T -J -joliet-long \
-V 'CentOS 7 x86_64' \
-volset "${LINUX_DISTRO}-${LINUX_VERSION}" \
-A "${LINUX_DISTRO}-${LINUX_VERSION}" \
-b ${isolinux_bin_file} \
-c ${boot_cat_file} \
-no-emul-boot \
-boot-load-size 4 \
-boot-info-table \
-eltorito-alt-boot \
-e images/efiboot.img \
-no-emul-boot \
-o "${IMAGE_DIR}/${iso_file_name}" .
}
prepare
check_input
mount_iso
extract_iso
unmount_iso
update_config
repackage_iso
I was having the exact same problem until I realized that I hadn't updated my pxe tftpboot environment to agree with my up-to-date Centos 7.5 media, by copying Centos-7.5-version files from centos/7/os/x86_64/isolinux/.
I got it working a few days ago, but forgot to post here (sorry!). Answering my own question, in case it helps anyone else.
Instead of replacing the entire menu option, I had to use
sed
to modify parts of it to what I wanted. It wasn't as clean, but it did what I wanted, so I let it be:I think part of it was the missing
stage2
option on theappend
line.I won't "Accept" this answer, in case someone else has a better explanation for why this worked vs creating a new menu option.