Ask Your Question
1

Build a bootable DVD that uses kickstart

asked 2014-04-28 10:10:49 -0500

deanhunter gravatar image

updated 2014-09-28 11:07:51 -0500

mether gravatar image

Using the Fedora documentation I have learned how to use livecd-iso-to-disk to create a USB stick from the Fedora ISO that will boot and run Kickstart to build a new installation of Fedora on a physical machine. This works great and simplifies my work. However, I have some computers that will not boot from USB, only from a CD/DVD or disk. I would like to build a DVD that does the same thing that my USB stick does. I am confused by the available choices.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2014-04-29 17:09:40 -0500

marcindulak gravatar image

updated 2014-05-01 08:37:20 -0500

For a clean Fedora 20 installation embed the kickstart file in a DVD. There are several posts available online describing how to achieve that http://docs.oracle.com/cd/E37670_01/E41137/html/ch01s06.html (or just http://bit.ly/1hR3IkT ), but the exact syntax and functionality of ks=cdrom::/ks.cfg (not ks=cdrom:/ks.cfg ) tends to change over time, and there are several bugs open about this problem (e.g.: https://bugzilla.redhat.com/show_bug.cgi?id=963003 https://bugzilla.redhat.com/show_bug.cgi?id=1049237 ). Therefore below you find a solution that currently works for me (Fedora 20 x86_64). As an unprivileged user do:

  1. download iso and checksum (make sure you are in a directory with ~20GB free disk space):

    su -c "yum -y install wget"
    wget https://dl.fedoraproject.org/pub/fedora/linux/releases/20/Fedora/x86_64/iso/Fedora-20-x86_64-DVD.iso
    wget https://dl.fedoraproject.org/pub/fedora/linux/releases/20/Fedora/x86_64/iso/Fedora-20-x86_64-CHECKSUM
    test $(sha256sum Fedora-20-x86_64-DVD.iso | cut -d' ' -f1) == $(cat Fedora-20-x86_64-CHECKSUM | grep DVD | cut -d' ' -f1) || echo incorrect CHECKSUM
    
  2. mount and copy the iso for modifications:

    mkdir fedora.orig
    su -c "mount -o loop Fedora-20-x86_64-DVD.iso fedora.orig"
    /bin/cp -rp fedora.orig fedora
    
  3. modify the default kernel parameters (see https://wiki.archlinux.org/index.php/kernel_parameters ):

    sed -i 's|inst.stage2=hd:LABEL=Fedora.*x86_64 quiet|ks=cdrom::/ks.cfg|' fedora/isolinux/isolinux.cfg
    sed -i 's|inst.stage2=hd:LABEL=Fedora.*x86_64 nomodeset quiet|nomodeset ks=cdrom::/ks.cfg|' fedora/isolinux/isolinux.cfg
    

    After the edits the append lines should contain append initrd=initrd.img ks=cdrom::/ks.cfg.

  4. create ks.cfg in the root of the DVD (no need to create this file in the isolinux directory as some documentations suggest). This is the exact file from https://ask.fedoraproject.org/en/question/43364/kickstart-in-linux-rescue-mode/ :

    cat << 'EOF' > fedora/ks.cfg
    install
    cdrom
    
    # Root password (set to: password)
    # Change that using "openssl passwd -1" to generate MD5 encrypted passwd
    rootpw --iscrypted $1$U/zHbzw7$c4MRlApxFpvmPqrrxNvje/
    # System authorization information
    auth --useshadow --enablemd5
    
    # System locale
    timezone --utc America/New_York
    keyboard --vckeymap=us --xlayouts=us
    lang en_US.UTF-8
    
    # Clear the Master Boot Record
    zerombr
    # Partition clearing information
    clearpart --all --initlabel
    # Disk partitioning information
    # /boot must be outside LVM
    part /boot --fstype ext4 --size=500 --asprimary
    part swap --size 2000 --asprimary
    part pv.01 --fstype ext4 --size=1 --grow --asprimary
    volgroup VolGroup00 pv.01
    logvol / --fstype ext4 --name=lv_root --vgname=VolGroup00 --size=1 --grow
    
    # check repodata/*Fedora*comps.xml online for a list
    %packages
    @Core
    #@Basic Desktop
    #@GNOME
    %end
    EOF
    
  5. create the new iso and burn it:

    su -c "yum -y install dvd+rw-tools genisoimage"
    mkisofs -R --iso-level 4 -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o Fedora-20-x86_64-DVD-my.iso fedora
    growisofs -dvd-compat -speed=1 -Z /dev/cdrom=Fedora-20-x86_64-DVD-my.iso
    

After DVD booting select Install Fedora in order to install.

Note that the installation requires network access in order to perform network configuration. Moreover the DVD will not be ejected after the ... (more)

edit flag offensive delete link more

Comments

Thank you for your thorough and complete response. This is exactly what I have been trying to do.but it is not working for me. I was certain I had missed something important. For testing I am using qemu on the results of step 5. To eliminate sources of error I am skipping steps 3 and 4. qemu opens a new windows and displays the boot menu. I select Install then the window changes sizes, several lines are displayed and after a lengthy delay the Dracut Emergency Shell warns me that /dev/root does not exist.

deanhunter gravatar imagedeanhunter ( 2014-04-30 11:21:19 -0500 )edit

Could it be you did not specify --cdrom=/dev/cdrom? Skipping point 4. means there is no kickstart on the DVD.

marcindulak gravatar imagemarcindulak ( 2014-05-02 04:35:58 -0500 )edit

No, I believe I found the problem to be an incorrect volume label. "inst.stage2=hd:LABEL=Fedora\x2020\x20x86_64" is specified in "isolinux.cfg" on "Fedora-20-x86_64-DVD.iso". Until I added "-volid "Fedora 20 x86_64" to mkisofs the DVD would not mount.

Thank you, again, for your answer. I assured me that I was on the right track. And I am certain it will be most helpful to others to have this process so nicely documented. I know it would have helped me if I had found it before I started.

deanhunter gravatar imagedeanhunter ( 2014-05-03 12:10:49 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-04-28 10:10:49 -0500

Seen: 4,990 times

Last updated: May 01 '14