Make cleaner mount info

This commit is contained in:
topjohnwu
2020-04-18 18:50:25 -07:00
parent 69a9d7485b
commit d959c35723
4 changed files with 17 additions and 12 deletions

View File

@ -153,11 +153,13 @@ static void switch_root(const string &path) {
static void mount_persist(const char *dev_base, const char *mnt_base) {
string mnt_point = mnt_base + "/persist"s;
strcpy(partname, "persist");
sprintf(block_dev, "%s/persist", dev_base);
xrealpath(dev_base, block_dev);
char *s = block_dev + strlen(block_dev);
strcpy(s, "/persist");
if (setup_block(false) < 0) {
// Fallback to cache
strcpy(partname, "cache");
sprintf(block_dev, "%s/cache", dev_base);
strcpy(s, "/cache");
if (setup_block(false) < 0) {
// Try NVIDIA's BS
strcpy(partname, "CAC");