Hide curl 404 errors while downloading updates.img/product.img/.treeinfo from repository.
Resolves: rhbz#1182776
From: Vojtech Trefny vtrefny@redhat.com
Resolves: rhbz#1182776
Signed-off-by: Vojtech Trefny vtrefny@redhat.com --- dracut/anaconda-netroot.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/dracut/anaconda-netroot.sh b/dracut/anaconda-netroot.sh index f080b1f..a6d95fc 100755 --- a/dracut/anaconda-netroot.sh +++ b/dracut/anaconda-netroot.sh @@ -65,17 +65,20 @@ case $repo in http*|ftp*) . /lib/url-lib.sh info "anaconda fetching installer from $repo" - treeinfo=$(fetch_url $repo/.treeinfo) && \ + treeinfo=$(fetch_url $repo/.treeinfo 2> /tmp/treeinfo_err) && \ stage2=$(config_get stage2 mainimage < $treeinfo) + [ -z "$treeinfo" ] && info $(cat /tmp/treeinfo_err) if [ -z "$treeinfo" -o -z "$stage2" ]; then warn "can't find installer mainimage path in .treeinfo" stage2="LiveOS/squashfs.img" fi if runtime=$(fetch_url $repo/$stage2); then # NOTE: Should be the same as anaconda_auto_updates() - updates=$(fetch_url $repo/images/updates.img) + updates=$(fetch_url $repo/images/updates.img 2> /tmp/updates_err) + [ -z "$updates" ] && info $(cat /tmp/updates_err) [ -n "$updates" ] && unpack_updates_img $updates /updates - product=$(fetch_url $repo/images/product.img) + product=$(fetch_url $repo/images/product.img 2> /tmp/product_err) + [ -z "$product" ] && info $(cat /tmp/product_err) [ -n "$product" ] && unpack_updates_img $product /updates /sbin/dmsquash-live-root $runtime fi
I think this commit needs a comment in the commit message or in the code that ``info`` is supposed to only print the message with debugging turned on. Otherwise it looks like this commit makes no difference.
Looks good to me other than the minor issue described above.
Added label: ACK.
Nice!
I'm pretty sure info always prints the message.
Actually warn prints the message during "normal" boot and info should print the message only in debug mode (= with rd.debug or rd.info arguments). Or at least I assume this should work this way from the code -- https://git.kernel.org/cgit/boot/dracut/dracut.git/tree/modules.d/99base/dra... -- because in debug mode both info and warn messages are NOT displayed (or added to the log). I need to file a bug against dracut...
anaconda-patches@lists.fedorahosted.org