Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No way to specify where to keep the history file #419

Open
TotallyNotSethP opened this issue Aug 30, 2022 · 3 comments
Open

No way to specify where to keep the history file #419

TotallyNotSethP opened this issue Aug 30, 2022 · 3 comments

Comments

@TotallyNotSethP
Copy link

I need to be able to tell the os to always put the history file in ramfs, never in fat storage. This is not an option, it always defaults to fat storage.

@the0ne
Copy link
Collaborator

the0ne commented Aug 30, 2022

Using df I think it's possible to show the used/free space for each mounted file system.
Maybe you can use that to check if the ramfs has been mounted.
If not, you could add an option to the shell.history() call to make sure it's only activated if ramfs is properly mounted.

@TotallyNotSethP
Copy link
Author

Sorry I think you misunderstood... if both ramfs and fat are mounted, i want to be able to choose where the history file is stored. atm, it defaults to fat always

@the0ne
Copy link
Collaborator

the0ne commented Aug 31, 2022

It all comes down to function mount_history_file in components/sys/sys/mount.c
It first checks for fat, then second it checks for ramfs.

    if (mount_is_mounted("fat")) {
        path = mount_get_mount_path("fat");
    } else if (mount_is_mounted("ramfs")) {
        path = mount_get_mount_path("ramfs");
    }

That's clearly because it reflects the idea of a history best: To preserve previous commands.
Which, one has to admit, is better done on a FAT than on a RAMFS 😉

I'd say you could add an optional parameter to function os_history in loslib_adds.inc
That parameter could say whether RAMFS should be preferred over FAT - with the default being the current behaviour.
Then in mount_history_file that parameter could be used to check for RAMFS before FAT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants