Skip to content

Commit

Permalink
guest: set an /etc/hostname if we don't have one
Browse files Browse the repository at this point in the history
hotfix, see comment.

Signed-off-by: Alyssa Rosenzweig <[email protected]>
  • Loading branch information
alyssarosenzweig committed Oct 7, 2024
1 parent eabdad1 commit 2cbb736
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion crates/muvm/src/guest/mount.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::ffi::CString;
use std::fs::{read_dir, File};
use std::fs::{read_dir, exists, File};
use std::io::Write;
use std::os::fd::AsFd;
use std::path::Path;
Expand Down Expand Up @@ -135,6 +135,22 @@ pub fn mount_filesystems() -> Result<()> {

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

// Due to a FAR integration bug, GNOME installs may not have /etc/hostname. Somehow the system
// mostly works like that? But Steam install depends on this file. If there's no hostname set
// in the host, at least make up a hostname for the guest so the Steam install works in the
// guest.
//
// This is a hot fix but doesn't have any real drawbacks as a bit of robustness against broken
// host installs.
//
// FAR bug: https://pagure.io/fedora-asahi/remix-bugs/issue/11
//
// (Although even after that's closed, we won't be able to drop this for a while because
// existing installs may be affected.)
if !exists("/etc/hostname")? {
place_etc("hostname", Some("placeholder-hostname"))?;
}

mount2(
Some("binfmt_misc"),
"/proc/sys/fs/binfmt_misc",
Expand Down

0 comments on commit 2cbb736

Please sign in to comment.