Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/init/init.c

    r75701004 ra35b458  
    4848#include <config.h>
    4949#include <io/logctl.h>
    50 #include "untar.h"
    5150#include "init.h"
    5251
     
    8483        switch (rc) {
    8584        case EOK:
    86                 if ((dev != NULL) && (str_cmp(dev, "") != 0))
     85                if (dev != NULL)
    8786                        printf("%s: %s mounted on %s (%s at %s)\n", NAME, desc, mntpt,
    8887                            fstype, dev);
     
    108107}
    109108
    110 /** Mount root file system
    111  *
    112  * The operation blocks until the root file system
     109/** Mount root filesystem
     110 *
     111 * The operation blocks until the root filesystem
    113112 * server is ready for mounting.
    114113 *
    115  * @param[in] fstype Root file system type.
     114 * @param[in] fstype Root filesystem type.
    116115 *
    117116 * @return True on success.
     
    121120static bool mount_root(const char *fstype)
    122121{
    123         const char *root_device = "";
    124 
    125         if (str_cmp(fstype, "tmpfs") != 0)
    126                 root_device = ROOT_DEVICE;
    127 
    128         errno_t rc = vfs_mount_path(ROOT_MOUNT_POINT, fstype, root_device, "",
     122        const char *opts = "";
     123
     124        if (str_cmp(fstype, "tmpfs") == 0)
     125                opts = "restore";
     126
     127        errno_t rc = vfs_mount_path(ROOT_MOUNT_POINT, fstype, ROOT_DEVICE, opts,
    129128            IPC_FLAG_BLOCKING, 0);
    130129        if (rc == EOK)
    131130                logctl_set_root();
    132 
    133         bool ret = mount_report("Root file system", ROOT_MOUNT_POINT, fstype,
    134             root_device, rc);
    135 
    136         rc = vfs_cwd_set(ROOT_MOUNT_POINT);
    137         if (rc != EOK) {
    138                 printf("%s: Unable to set current directory to %s (%s)\n",
    139                     NAME, ROOT_MOUNT_POINT, str_error(ret));
    140                 return false;
    141         }
    142 
    143         if ((ret) && (str_cmp(fstype, "tmpfs") == 0)) {
    144                 printf("%s: Extracting root file system archive\n", NAME);
    145                 ret = bd_untar(ROOT_DEVICE);
    146         }
    147 
    148         return ret;
    149 }
    150 
    151 /** Mount locfs file system
    152  *
    153  * The operation blocks until the locfs file system
     131        return mount_report("Root filesystem", ROOT_MOUNT_POINT, fstype,
     132            ROOT_DEVICE, rc);
     133}
     134
     135/** Mount locfs filesystem
     136 *
     137 * The operation blocks until the locfs filesystem
    154138 * server is ready for mounting.
    155139 *
     
    162146        errno_t rc = vfs_mount_path(LOCFS_MOUNT_POINT, LOCFS_FS_TYPE, "", "",
    163147            IPC_FLAG_BLOCKING, 0);
    164         return mount_report("Location service file system", LOCFS_MOUNT_POINT,
     148        return mount_report("Location service filesystem", LOCFS_MOUNT_POINT,
    165149            LOCFS_FS_TYPE, NULL, rc);
    166150}
     
    317301{
    318302        errno_t rc = vfs_mount_path(TMPFS_MOUNT_POINT, TMPFS_FS_TYPE, "", "", 0, 0);
    319         return mount_report("Temporary file system", TMPFS_MOUNT_POINT,
     303        return mount_report("Temporary filesystem", TMPFS_MOUNT_POINT,
    320304            TMPFS_FS_TYPE, NULL, rc);
    321305}
Note: See TracChangeset for help on using the changeset viewer.