How to regenerate initramfs in kickstart installation using post scripts.

Solution Verified - Updated -

Issue

  • Regenerate the initramfs file in kickstart %post scripts.
  • Kickstart %post script fails to generate the initramfs with the below errors while --nochroot option enabled.

    localhost program[xxxx]: + dracut -l -f -i /boot/.random_keyfile /boot/.random_keyfile
    localhost program[xxxx]: dracut: Cannot find /usr/lib/dracut/dracut-init.sh.
    localhost program[xxxx]: dracut: Are you running from a git checkout?
    localhost program[xxxx]: dracut: Try passing -l as an argument to /mnt/sysimage/bin/dracut
    localhost anaconda[xxxx]: Error code 1 running the kickstart script at line 132
    

Environment

  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 8

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content