Skip to content

Commit

Permalink
virtme-init: Add guest hostname to /etc/hosts
Browse files Browse the repository at this point in the history
The update of the virtme_ng_init submodule pulls in a larger batch of
changes; while most of them are non-behavioral code cleanups, also
included is commit a1eb25c ("Add guest hostname to /etc/hosts"),
which makes the corresponding change to this one so that the two inits
remain behaviorally in sync with each other.

Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
  • Loading branch information
zevweiss committed Nov 20, 2023
1 parent 4c65839 commit 01bb02e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions virtme/guest/virtme-init
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ fi
touch /tmp/fstab
mount --bind /tmp/fstab /etc/fstab

if [[ -n "$virtme_hostname" ]]; then
cp /etc/hosts /tmp/hosts
printf '\n127.0.0.1 %s\n::1 %s\n' "$virtme_hostname" "$virtme_hostname" >> /tmp/hosts
mount --bind /tmp/hosts /etc/hosts
fi

# Fix dpkg if we are on a Debian-based distro
if [ -d /var/lib/dpkg ]; then
lock_files=(/var/lib/dpkg/lock /var/lib/dpkg/lock-frontend /var/lib/dpkg/triggers/Lock)
Expand Down
2 changes: 1 addition & 1 deletion virtme_ng_init
Submodule virtme_ng_init updated 3 files
+191 −235 src/main.rs
+10 −0 src/test.rs
+50 −38 src/utils.rs

0 comments on commit 01bb02e

Please sign in to comment.