On 05/19/2012 04:27 PM, Dave Reisner wrote:
On Sat, May 19, 2012 at 04:17:23PM -0300, Gerardo Exequiel Pozzi wrote:
---
  README                           |    3 +++
  archiso/hooks/archiso_pxe_common |    8 ++++++++
  2 files changed, 11 insertions(+)

diff --git a/README b/README
index 07bc019..cfcff39 100644
--- a/README
+++ b/README
@@ -90,6 +90,9 @@ INDEX
                      when option "IPAPPEND" is set to 2 or 3 in config.
                      BOOTIF=<hardware-address-of-boot-interface>
                      Default: (set via PXELINUX)
+* copy_resolvconf=  Copy /etc/resolv.conf from initramfs to live-enviroment.
+                    Set to "n" to skip them.
+                    Default: "y"


  ** hooks/archiso_pxe_nbd
diff --git a/archiso/hooks/archiso_pxe_common b/archiso/hooks/archiso_pxe_common
index febb503..eddc7ea 100644
--- a/archiso/hooks/archiso_pxe_common
+++ b/archiso/hooks/archiso_pxe_common
@@ -40,3 +40,11 @@ run_hook () {
          fi
      fi
  }
+
+run_latehook () {
+    [[ -z "${copy_resolvconf}" ]]&&  copy_resolvconf="y"
busybox won't complain about this, but you should be using single square
braces here for "clarity".

mmm I use double sqaure braces in all places on archiso, since busybox is compiled with bash compatible support (of course does not work in the same way)

Also I like to add/test for all "boot vars" on each hook. To keep more visible.

+
+    if [[ "${copy_resolvconf}" != "n" ]]; then
+        cp /etc/resolv.conf /new_root/etc/resolv.conf
+    fi
Wouldn't this entire hook be better stated as simply:

   if [ "$copy_resolveconf" != 'n' ]; then
     cp /etc/resolv.conf /new_root/etc/resolv.conf
   fi


Its just a "coding style" that I am following on archiso.



+}
--
1.7.9.6


Thanks for the feedback.

--
Gerardo Exequiel Pozzi
\cos^2\alpha + \sin^2\alpha = 1

Reply via email to