From 1356707e9ac58136da12e473bfe90c81542d33c0 Mon Sep 17 00:00:00 2001 From: Luca Weiss Date: Fri, 15 May 2020 19:15:04 +0200 Subject: [PATCH] pmb.install._install: update comments (MR 1933) --- pmb/install/_install.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pmb/install/_install.py b/pmb/install/_install.py index f679aa4d..565168f8 100644 --- a/pmb/install/_install.py +++ b/pmb/install/_install.py @@ -279,10 +279,11 @@ def setup_hostname(args): raise RuntimeError("Hostname '" + hostname + "' is not valid, please" " run 'pmbootstrap init' to configure it.") - # Update /etc/hosts suffix = "rootfs_" + args.device + # Generate /etc/hostname pmb.chroot.root(args, ["sh", "-c", "echo " + shlex.quote(hostname) + " > /etc/hostname"], suffix) + # Update /etc/hosts regex = (r"s/^127\.0\.0\.1.*/127.0.0.1\t" + re.escape(hostname) + " localhost.localdomain localhost/") pmb.chroot.root(args, ["sed", "-i", "-e", regex, "/etc/hosts"], suffix)