[arch-releng] [PATCH] add cmdline options for DNS settings

Gerardo Exequiel Pozzi vmlinuz386 at gmail.com
Fri Dec 18 12:00:28 UTC 2015


On 12/17/2015 08:01 PM, Thore Boedecker wrote:
> Signed-off-by: Thore Boedecker <me at foxxx0.de>
> ---
>  archiso/initcpio/hooks/archiso_pxe_common | 20 +++++++++++++++++---
>  1 file changed, 17 insertions(+), 3 deletions(-)
> 
> diff --git a/archiso/initcpio/hooks/archiso_pxe_common b/archiso/initcpio/hooks/archiso_pxe_common
> index d3aa46f..edf8cfd 100644
> --- a/archiso/initcpio/hooks/archiso_pxe_common
> +++ b/archiso/initcpio/hooks/archiso_pxe_common
> @@ -36,13 +36,27 @@ run_hook () {
>  
>          pxeserver=${ROOTSERVER}
>  
> -        # setup DNS resolver
> -        if [[ "${IPV4DNS0}" != "0.0.0.0" ]]; then
> +        # read DNS and DOMAIN cmdline arguments (if present), otherwise use
> +        # addresses provided by ipconfig
> +        if [[ -n "${DNS0}" ]]; then
> +            echo "Using DNS Server from cmdline (DNS0): ${DNS0}"
> +            echo "nameserver ${DNS0}" > /etc/resolv.conf
> +        elif [[ "${IPV4DNS0}" != "0.0.0.0" ]]; then
>              echo "nameserver ${IPV4DNS0}" > /etc/resolv.conf
>          fi
> -        if [[ "${IPV4DNS1}" != "0.0.0.0" ]]; then
> +        if [[ -n "${DNS1}" ]]; then
> +            echo "Using DNS Server from cmdline (DNS1): ${DNS1}"
> +            echo "nameserver ${DNS1}" >> /etc/resolv.conf
> +        elif [[ "${IPV4DNS1}" != "0.0.0.0" ]]; then
>              echo "nameserver ${IPV4DNS1}" >> /etc/resolv.conf
>          fi
> +
> +        # setup DNSDOMAIN
> +        if [[ -n "${DOMAIN}" ]]; then
> +            echo "Using DNSDOMAIN from cmdline (DOMAIN): ${DOMAIN}"
> +            echo "domain ${DOMAIN}" >> /etc/resolv.conf
> +        fi
> +
>      fi
>  }
>  
> 

thanks, please add documentation.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://lists.archlinux.org/pipermail/arch-releng/attachments/20151218/e980bec6/attachment.asc>


More information about the arch-releng mailing list