Bug 817116

Summary: kickstart: %pre section not executed before initqueue?
Product: [Fedora] Fedora Reporter: IBM Bug Proxy <bugproxy>
Component: anacondaAssignee: Will Woods <wwoods>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 17CC: g.kaviyarasu, jkachuck, jonathan, vanmeeuwen+fedora, wgomerin
Target Milestone: ---   
Target Release: ---   
Hardware: ppc64   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-04-30 20:06:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description IBM Bug Proxy 2012-04-27 18:20:17 UTC
Description of problem:

I am using Cobbler for testing FC17-alpha on ppc64. The kickstart (only up to the %end of %pre) I am using is:


# kickstart template for Fedora 8 and later.
# (includes %end blocks)
# do not use with earlier distros

#platform=x86, AMD64, or Intel EM64T
# System authorization information
auth  --useshadow  --enablemd5
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --all --initlabel
# Use text mode install
text
# Firewall configuration
firewall --enabled
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# Use network installation
url --url=http://x.x.191.134/cblr/links/fedora17-alpha-ppc64
# If any cobbler repo definitions were referenced in the kickstart profile, include them here.
# Network information
# Using "new" style networking config, by matching networking information to the physical interface's 
# MAC-address
%include /tmp/pre_install_network_config

# Reboot after installation
reboot

#Root password
rootpw --iscrypted $1$lockbox$1tA3DRTYbslTtCFYXA5if/
# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# System timezone
timezone --utc America/New_York
# Install OS instead of upgrade
install
# Clear the Master Boot Record
zerombr
# Allow anaconda to partition the system as needed
autopart

%pre
set -x -v
exec 1>/tmp/ks-pre.log 2>&1

# Once root's homedir is there, copy over the log.
while : ; do
    sleep 10
    if [ -d /mnt/sysimage/root ]; then
        cp /tmp/ks-pre.log /mnt/sysimage/root/
        logger "Copied %pre section log to system"
        break
    fi
done &






wget "http://x.x.191.134/cblr/svc/op/trig/mode/pre/system/fbird-lp8.austin.ibm.com" -O /dev/null
# Start pre_install_network_config generated code

# Start of code to match cobbler system interfaces to physical interfaces by their mac addresses
#  Start eth0
# Configuring eth0 (56:75:4d:e8:e9:04)
if ifconfig -a | grep -i 56:75:4d:e8:e9:04
then
  IFNAME=
  echo "network --device=$IFNAME --bootproto=static --ip=x.x.191.135 --netmask=255.255.255.0 --gateway=x.x.191.1 --nameserver=x.y.9.1 --hostname=fbird-lp8.x.x.x" >> /tmp/pre_install_network_config
fi
# End pre_install_network_config generated code

# Enable installation monitoring

%end

A very similar ks worked fine in FC16. But in FC17-alpha, I am dropped to a debug shell with:

[   30.244995] dracut: anaconda fetching kickstart from http://x.x.191.134/cblr/svc/op/ks/system/fbird-lp8.x.x.x
http://x.x.191.134/cblr/svc/op/ks/system/fbird-lp8.x.x.x
 ######################################################################## 100.0%
parse-kickstart ERROR: The following problem occurred on line 0 of the kickstart file:
Unable to open input kickstart file: Could not open/read file:///tmp/pre_install_network_config

From that dracut shell, I can see that no /tmp/pre_install_network_config file exists, so the error is real. But I don't see how that could be unless the %pre stage wasn't run yet.

There is also no /tmp/ks-pre.log

dracut:/# ls /tmp
HSFjak-ks.cfg           ks.cfg.done        net.eth0.pid                                                                                                                                                                                                                                                                     
dhclient.eth0.dhcpopts  ks.info            net.eth0.resolv.conf                                                                                                                                                                                                                                                             
dhclient.eth0.lease     net.eth0.dhcpopts  net.eth0.up                                                                                                                                                                                                                                                                      
dhclient.eth0.pid       net.eth0.gw        net.ifaces                                                                                                                                                                                                                                                                       
export.orig             net.eth0.hostname  net.lo.manualup                                                                                                                                                                                                                                                                  
ks.cfg                  net.eth0.lease     net.lo.up                                                                                                                                                                                                                                                                        

kernel command-line:

dracut:/# cat /proc/cmdline                                                                                                                                                                                                                                                                                                 
 ksdevice=eth0 lang=  kssendmac text  ks=http://x.x.191.134/cblr/svc/op/ks/system/fbird-lp8.x.x.x

Comment 1 Will Woods 2012-04-30 20:06:54 UTC
%pre does not get executed in initrd. It gets executed by anaconda proper.

This worked in F16 by coincidence, because the entire anaconda runtime was inside the initrd. It would not have worked in any release prior to F15 and F16.

There's plenty of other ways to accomplish this, however. For example. you should be able to use the MAC address as the '--device' option on your network line, as noted in http://fedoraproject.org/wiki/Anaconda/Kickstart#network

Comment 2 IBM Bug Proxy 2012-05-01 00:20:21 UTC
------- Comment From aravam.com 2012-05-01 00:19 EDT-------
Hi,

Yep, if I force cobbler to use their "old-style" network configuration, things work ok (install fails due to a separate known bug which is fixed in beta, hopefully). I'll work with the Cobbler devs on fixing the kickstart template.

Thanks,
Nish

Comment 3 IBM Bug Proxy 2012-05-01 21:30:34 UTC
------- Comment From aravam.com 2012-05-01 21:21 EDT-------
(In reply to comment #7)
> %pre does not get executed in initrd. It gets executed by anaconda proper.
>
> This worked in F16 by coincidence, because the entire anaconda runtime was
> inside the initrd. It would not have worked in any release prior to F15 and
> F16.

Just to check here -- is this statement ppc64 specific? Or does it apply to all architectures?

Thanks,
Nish