PiSCSI / piscsi

PiSCSI allows a Raspberry Pi to function as emulated SCSI devices (hard disk, CD-ROM, and others) for vintage SCSI-based computers and devices. This is a fork of the RaSCSI project by GIMONS.
https://piscsi.org
BSD 3-Clause "New" or "Revised" License
545 stars 82 forks source link

Arbitrary limitation that images dir must be under /home #1172

Closed rdmark closed 1 year ago

rdmark commented 1 year ago

We currently have an arbitrary limitation that forces the default images dir to be a subdir to /home --

cpp/piscsi/piscsi_image.cpp

string PiscsiImage::SetDefaultFolder(const string& f)
{
    if (f.empty()) {
        return "Can't set default image folder: Missing folder name";
    }

    string folder = f;

    // If a relative path is specified, the path is assumed to be relative to the user's home directory
    if (folder[0] != '/') {
        folder = GetHomeDir() + "/" + folder;
    }
    else {
        if (folder.find("/home/") != 0) {
            return "Default image folder must be located in '/home/'";
        }
    }

I think it's time to remove this limitation and allow users to define the default images dir anywhere on the file system. F.e. they may want to mount external storage media under /mnt and use that for images storage. (Although the mount point could certainly be under /home but that is not a good practice IMHO)

rdmark commented 1 year ago

Discarding after discussion in PR