The loader-era behavior for ks=nfs:...:/path/ was to append
"<ip>-kickstart" as a filename.
In the loader rewrite, the behavior was accidentally changed so this
only happened when you did the magical automatic kickstart detection via
plain "ks". And this is how it was documented.
Bug #910550 pointed out that this doesn't match the F16 (i.e. RHEL6)
behavior. I read the old code and we concluded that we should add that
for *any* URL ending in a /, and so commit c85dd38 "fixed" the problem.
Turns out I was wrong, though! Testing confirms that RHEL6 behavior is
to add "<ip>-kickstart" to NFS URLs (and *only* NFS urls) ending in
'/'.
This patch fixes that behavior, and corrects the documentation.
---
docs/boot-options.txt | 4 +++-
dracut/fetch-kickstart-net.sh | 8 ++++----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/docs/boot-options.txt b/docs/boot-options.txt
index c98c93c..905b423 100644
--- a/docs/boot-options.txt
+++ b/docs/boot-options.txt
@@ -107,12 +107,14 @@ Locations may be specified using any of the formats allowed for
For any format the `<path>` component defaults to `/ks.cfg` if it is omitted.
+For NFS kickstarts, if the `<path>` ends in `/`, `<ip>-kickstart` is added.
+
If `inst.ks` is used without a value, the installer will look for
`nfs:<next_server>:/<filename>`:
* `<next_server>` is the DHCP "next-server" option, or the IP of the DHCP
server itself,
* `<filename>` is the DHCP "filename" option, or `/kickstart/`, and
-* if the filename given ends in `/`, `<ip>-kickstart` is added
+* if the filename given ends in `/`, `<ip>-kickstart` is added (as above)
* example:
** DHCP server: `192.168.122.1`
** client address: `192.168.122.100`
diff --git a/dracut/fetch-kickstart-net.sh b/dracut/fetch-kickstart-net.sh
index 018f0f7..4ec073b 100755
--- a/dracut/fetch-kickstart-net.sh
+++ b/dracut/fetch-kickstart-net.sh
@@ -36,10 +36,10 @@ if [ "$kickstart" = "nfs:auto" ]; then
kickstart="nfs:$server:$filename"
fi
-# kickstart is appended with '$IP_ADDR-kickstart' if ending in '/'
-if [ "${kickstart%/}" != "$kickstart" ]; then
- kickstart="${kickstart}${new_ip_address}-kickstart"
-fi
+# NFS kickstart URLs that end in '/' get '$IP_ADDR-kickstart' appended
+case "$kickstart" in
+ nfs*/) kickstart="${kickstart}${new_ip_address}-kickstart" ;;
+esac
info "anaconda fetching kickstart from $kickstart"
if fetch_url "$kickstart" /tmp/ks.cfg; then
--
1.9.0