Skip to content

Commit

Permalink
dont mount rootfs
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Mar 8, 2022
1 parent 833c33c commit ba56b43
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
7 changes: 0 additions & 7 deletions src/Etterna/Globals/StepMania.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -992,13 +992,6 @@ sm_main(int argc, char* argv[])
FILEMAN = new RageFileManager(argv[0]);
FILEMAN->Mount("dir", Core::Platform::getAppDirectory(), "/");

#ifdef __unix__
/* Mount the root filesystem, so we can read files in /proc, /etc, and so
* on. This is /rootfs, not /root, to avoid confusion with root's home
* directory. */
FILEMAN->Mount("dir", "/", "/rootfs");
#endif

// load preferences and mount any alternative trees.
PREFSMAN = new PrefsManager;

Expand Down
4 changes: 3 additions & 1 deletion src/arch/Sound/ALSA9Dynamic.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "Etterna/Globals/global.h"

#include <dlfcn.h>
#include <sys/stat.h>

#define ALSA_PCM_NEW_HW_PARAMS_API
#define ALSA_PCM_NEW_SW_PARAMS_API
Expand Down Expand Up @@ -31,7 +32,8 @@ LoadALSA()
* know if anyone actually does that, though: they're often configured to
* load snd (the core module) if ALSA devices are accessed, but hardware
* drivers are typically loaded on boot. */
if (!IsADirectory("/rootfs/proc/asound/"))
struct stat st;
if (stat("/proc/asound/", &st) == -1 || !(st.st_mode & S_IFDIR))
return "/proc/asound/ does not exist";

ASSERT(Handle == NULL);
Expand Down
11 changes: 7 additions & 4 deletions src/arch/Sound/ALSA9Helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include "ALSA9Dynamic.h"
#include "Etterna/Singletons/PrefsManager.h"

#include <fstream>
#include <string>
#include <algorithm>

/* int err; must be defined before using this macro */
Expand Down Expand Up @@ -160,10 +162,11 @@ Alsa9Buf::GetSoundCardDebugInfo()
return;
done = true;

if (DoesFileExist("/rootfs/proc/asound/version")) {
std::string sVersion;
GetFileContents("/rootfs/proc/asound/version", sVersion, true);
Locator::getLogger()->info("ALSA: {}", sVersion.c_str());
std::ifstream f("/proc/asound/version");
if (f.good()) {
std::string version;
std::getline(f, version);
Locator::getLogger()->info("ALSA: {}", version.c_str());
}

InitializeErrorHandler();
Expand Down
5 changes: 3 additions & 2 deletions src/arch/Sound/RageSoundDriver_OSS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <sys/ioctl.h>
#include <sys/soundcard.h>
#include <sys/select.h>
#include <sys/stat.h>

REGISTER_SOUND_DRIVER_CLASS(OSS);

Expand Down Expand Up @@ -145,8 +146,8 @@ RageSoundDriver_OSS::CheckOSSVersion(int fd)
*/
#ifndef FORCE_OSS
#define ALSA_SNDRV_OSS_VERSION ((3 << 16) | (8 << 8) | (1 << 4) | (0))
if (version == ALSA_SNDRV_OSS_VERSION &&
IsADirectory("/rootfs/proc/asound"))
struct stat st;
if( version == ALSA_SNDRV_OSS_VERSION && stat("/proc/asound", &st) && (st.st_mode & S_IFDIR) )
return "RageSoundDriver_OSS: ALSA detected. ALSA OSS emulation is "
"buggy; use ALSA natively.";
#endif
Expand Down

0 comments on commit ba56b43

Please sign in to comment.