pmb.install._install: update comments (MR 1933)
This commit is contained in:
parent
6bb7f022b1
commit
1356707e9a
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue