Skip to content

Commit 29e77d2

Browse files
alyssarosenzweigslp
authored andcommitted
guest: set an /etc/hostname if we don't have one
hotfix, see comment. Signed-off-by: Alyssa Rosenzweig <[email protected]>
1 parent d0611e4 commit 29e77d2

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

crates/muvm/src/guest/mount.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use std::ffi::CString;
2-
use std::fs::{read_dir, File};
2+
use std::fs::{exists, read_dir, File};
33
use std::io::Write;
44
use std::os::fd::AsFd;
55
use std::path::Path;
@@ -136,6 +136,22 @@ pub fn mount_filesystems() -> Result<()> {
136136

137137
place_etc("resolv.conf", None)?;
138138

139+
// Due to a FAR integration bug, GNOME installs may not have /etc/hostname. Somehow the system
140+
// mostly works like that? But Steam install depends on this file. If there's no hostname set
141+
// in the host, at least make up a hostname for the guest so the Steam install works in the
142+
// guest.
143+
//
144+
// This is a hot fix but doesn't have any real drawbacks as a bit of robustness against broken
145+
// host installs.
146+
//
147+
// FAR bug: https://pagure.io/fedora-asahi/remix-bugs/issue/11
148+
//
149+
// (Although even after that's closed, we won't be able to drop this for a while because
150+
// existing installs may be affected.)
151+
if !exists("/etc/hostname")? {
152+
place_etc("hostname", Some("placeholder-hostname"))?;
153+
}
154+
139155
mount2(
140156
Some("binfmt_misc"),
141157
"/proc/sys/fs/binfmt_misc",

0 commit comments

Comments
 (0)