public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] Refresh /etc/resolv.conf on partial rebuilds
@ 2018-11-10 17:35 Jan Kiszka
  2018-11-12  9:07 ` Henning Schild
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Kiszka @ 2018-11-10 17:35 UTC (permalink / raw)
  To: isar-users

From: Jan Kiszka <jan.kiszka@siemens.com>

This addresses the scenario "mobile build host" where the resolv.conf as
once generated during bootstrap and then propagated into the
buildchroots as well the image rootfs may have become stale.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta/classes/buildchroot.bbclass           | 6 +++++-
 meta/classes/isar-bootstrap-helper.bbclass | 3 +++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/meta/classes/buildchroot.bbclass b/meta/classes/buildchroot.bbclass
index 870d27c..78e21d9 100644
--- a/meta/classes/buildchroot.bbclass
+++ b/meta/classes/buildchroot.bbclass
@@ -29,5 +29,9 @@ buildchroot_do_mounts() {
             mount --bind ${DL_DIR} ${BUILDCHROOT_DIR}/downloads
             mount -t devtmpfs -o mode=0755,nosuid devtmpfs ${BUILDCHROOT_DIR}/dev
             mount -t proc none ${BUILDCHROOT_DIR}/proc
-        fi'
+        fi
+
+        # Refresh /etc/resolv.conf at this chance
+        cp /etc/resolv.conf ${BUILDCHROOT_DIR}/etc
+        '
 }
diff --git a/meta/classes/isar-bootstrap-helper.bbclass b/meta/classes/isar-bootstrap-helper.bbclass
index 1ac39db..99c1fb7 100644
--- a/meta/classes/isar-bootstrap-helper.bbclass
+++ b/meta/classes/isar-bootstrap-helper.bbclass
@@ -106,6 +106,9 @@ setup_root_file_system() {
     sudo mount -t devtmpfs -o mode=0755,nosuid devtmpfs $ROOTFSDIR/dev
     sudo mount -t proc none $ROOTFSDIR/proc
 
+    # Refresh /etc/resolv.conf
+    sudo cp /etc/resolv.conf ${ROOTFSDIR}/etc
+
     # Install packages:
     E="${@ bb.utils.export_proxies(d)}"
     export DEBIAN_FRONTEND=noninteractive
-- 
2.16.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Refresh /etc/resolv.conf on partial rebuilds
  2018-11-10 17:35 [PATCH] Refresh /etc/resolv.conf on partial rebuilds Jan Kiszka
@ 2018-11-12  9:07 ` Henning Schild
  2018-11-12  9:15   ` [PATCH v2] " Jan Kiszka
  0 siblings, 1 reply; 4+ messages in thread
From: Henning Schild @ 2018-11-12  9:07 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: isar-users

Am Sat, 10 Nov 2018 18:35:47 +0100
schrieb Jan Kiszka <jan.kiszka@web.de>:

> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> This addresses the scenario "mobile build host" where the resolv.conf
> as once generated during bootstrap and then propagated into the
> buildchroots as well the image rootfs may have become stale.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  meta/classes/buildchroot.bbclass           | 6 +++++-
>  meta/classes/isar-bootstrap-helper.bbclass | 3 +++
>  2 files changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/classes/buildchroot.bbclass
> b/meta/classes/buildchroot.bbclass index 870d27c..78e21d9 100644
> --- a/meta/classes/buildchroot.bbclass
> +++ b/meta/classes/buildchroot.bbclass
> @@ -29,5 +29,9 @@ buildchroot_do_mounts() {
>              mount --bind ${DL_DIR} ${BUILDCHROOT_DIR}/downloads
>              mount -t devtmpfs -o mode=0755,nosuid devtmpfs
> ${BUILDCHROOT_DIR}/dev mount -t proc none ${BUILDCHROOT_DIR}/proc
> -        fi'
> +        fi
> +
> +        # Refresh /etc/resolv.conf at this chance
> +        cp /etc/resolv.conf ${BUILDCHROOT_DIR}/etc
> +        '

You probably want to use "cp -L", modern network managing tools often
work with symlinks and there seem to be versions of cp that do not
default to "-L". Not sure whether we can get problems in Isar, but
the gentoo manuals always mention "-L" for that step.

Henning

>  }
> diff --git a/meta/classes/isar-bootstrap-helper.bbclass
> b/meta/classes/isar-bootstrap-helper.bbclass index 1ac39db..99c1fb7
> 100644 --- a/meta/classes/isar-bootstrap-helper.bbclass
> +++ b/meta/classes/isar-bootstrap-helper.bbclass
> @@ -106,6 +106,9 @@ setup_root_file_system() {
>      sudo mount -t devtmpfs -o mode=0755,nosuid devtmpfs
> $ROOTFSDIR/dev sudo mount -t proc none $ROOTFSDIR/proc
>  
> +    # Refresh /etc/resolv.conf
> +    sudo cp /etc/resolv.conf ${ROOTFSDIR}/etc
> +
>      # Install packages:
>      E="${@ bb.utils.export_proxies(d)}"
>      export DEBIAN_FRONTEND=noninteractive


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] Refresh /etc/resolv.conf on partial rebuilds
  2018-11-12  9:07 ` Henning Schild
@ 2018-11-12  9:15   ` Jan Kiszka
  2018-11-14  3:18     ` Maxim Yu. Osipov
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Kiszka @ 2018-11-12  9:15 UTC (permalink / raw)
  To: isar-users; +Cc: [ext] Henning Schild

This addresses the scenario "mobile build host" where the resolv.conf as
once generated during bootstrap and then propagated into the
buildchroots as well the image rootfs may have become stale.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

Changes in v2:
 - use "cp -L"

 meta/classes/buildchroot.bbclass           | 6 +++++-
 meta/classes/isar-bootstrap-helper.bbclass | 3 +++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/meta/classes/buildchroot.bbclass b/meta/classes/buildchroot.bbclass
index 870d27c..34b7f59 100644
--- a/meta/classes/buildchroot.bbclass
+++ b/meta/classes/buildchroot.bbclass
@@ -29,5 +29,9 @@ buildchroot_do_mounts() {
             mount --bind ${DL_DIR} ${BUILDCHROOT_DIR}/downloads
             mount -t devtmpfs -o mode=0755,nosuid devtmpfs ${BUILDCHROOT_DIR}/dev
             mount -t proc none ${BUILDCHROOT_DIR}/proc
-        fi'
+        fi
+
+        # Refresh /etc/resolv.conf at this chance
+        cp -L /etc/resolv.conf ${BUILDCHROOT_DIR}/etc
+        '
 }
diff --git a/meta/classes/isar-bootstrap-helper.bbclass b/meta/classes/isar-bootstrap-helper.bbclass
index 1ac39db..e6a46ce 100644
--- a/meta/classes/isar-bootstrap-helper.bbclass
+++ b/meta/classes/isar-bootstrap-helper.bbclass
@@ -106,6 +106,9 @@ setup_root_file_system() {
     sudo mount -t devtmpfs -o mode=0755,nosuid devtmpfs $ROOTFSDIR/dev
     sudo mount -t proc none $ROOTFSDIR/proc
 
+    # Refresh /etc/resolv.conf
+    sudo cp -L /etc/resolv.conf ${ROOTFSDIR}/etc
+
     # Install packages:
     E="${@ bb.utils.export_proxies(d)}"
     export DEBIAN_FRONTEND=noninteractive
-- 
2.16.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] Refresh /etc/resolv.conf on partial rebuilds
  2018-11-12  9:15   ` [PATCH v2] " Jan Kiszka
@ 2018-11-14  3:18     ` Maxim Yu. Osipov
  0 siblings, 0 replies; 4+ messages in thread
From: Maxim Yu. Osipov @ 2018-11-14  3:18 UTC (permalink / raw)
  To: Jan Kiszka, isar-users; +Cc: [ext] Henning Schild

On 11/12/18 12:15 PM, Jan Kiszka wrote:
> This addresses the scenario "mobile build host" where the resolv.conf as
> once generated during bootstrap and then propagated into the
> buildchroots as well the image rootfs may have become stale.

Applied to the 'next',

Thanks,
Maxim.

> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> 
> Changes in v2:
>   - use "cp -L"
> 
>   meta/classes/buildchroot.bbclass           | 6 +++++-
>   meta/classes/isar-bootstrap-helper.bbclass | 3 +++
>   2 files changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/classes/buildchroot.bbclass b/meta/classes/buildchroot.bbclass
> index 870d27c..34b7f59 100644
> --- a/meta/classes/buildchroot.bbclass
> +++ b/meta/classes/buildchroot.bbclass
> @@ -29,5 +29,9 @@ buildchroot_do_mounts() {
>               mount --bind ${DL_DIR} ${BUILDCHROOT_DIR}/downloads
>               mount -t devtmpfs -o mode=0755,nosuid devtmpfs ${BUILDCHROOT_DIR}/dev
>               mount -t proc none ${BUILDCHROOT_DIR}/proc
> -        fi'
> +        fi
> +
> +        # Refresh /etc/resolv.conf at this chance
> +        cp -L /etc/resolv.conf ${BUILDCHROOT_DIR}/etc
> +        '
>   }
> diff --git a/meta/classes/isar-bootstrap-helper.bbclass b/meta/classes/isar-bootstrap-helper.bbclass
> index 1ac39db..e6a46ce 100644
> --- a/meta/classes/isar-bootstrap-helper.bbclass
> +++ b/meta/classes/isar-bootstrap-helper.bbclass
> @@ -106,6 +106,9 @@ setup_root_file_system() {
>       sudo mount -t devtmpfs -o mode=0755,nosuid devtmpfs $ROOTFSDIR/dev
>       sudo mount -t proc none $ROOTFSDIR/proc
>   
> +    # Refresh /etc/resolv.conf
> +    sudo cp -L /etc/resolv.conf ${ROOTFSDIR}/etc
> +
>       # Install packages:
>       E="${@ bb.utils.export_proxies(d)}"
>       export DEBIAN_FRONTEND=noninteractive
> 


-- 
Maxim Osipov
ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn
Germany
+49 (151) 6517 6917
mosipov@ilbers.de
http://ilbers.de/
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-11-14  3:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-10 17:35 [PATCH] Refresh /etc/resolv.conf on partial rebuilds Jan Kiszka
2018-11-12  9:07 ` Henning Schild
2018-11-12  9:15   ` [PATCH v2] " Jan Kiszka
2018-11-14  3:18     ` Maxim Yu. Osipov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox