Changeset 63c1dd5 in mainline for uspace/app/sysinst/sysinst.c
- Timestamp:
- 2018-10-09T08:40:53Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 63a045c
- Parents:
- ee9c703
- git-author:
- Jiri Svoboda <jiri@…> (2018-10-08 18:38:16)
- git-committer:
- Jiri Svoboda <jiri@…> (2018-10-09 08:40:53)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/sysinst/sysinst.c
ree9c703 r63c1dd5 79 79 #define BOOT_BLOCK_IDX 0 /* MBR */ 80 80 81 static const char *sys_dirs[] = { 82 "/cfg", 83 "/data" 84 }; 85 81 86 /** Label the destination device. 82 87 * … … 160 165 *psvc_id = pinfo.svc_id; 161 166 return EOK; 167 } 168 169 /** Set up system volume structure. 170 * 171 * @return EOK on success or an error code 172 */ 173 static errno_t sysinst_setup_sysvol(void) 174 { 175 errno_t rc; 176 char *path = NULL; 177 const char **cp; 178 int rv; 179 180 cp = sys_dirs; 181 while (*cp != NULL) { 182 rv = asprintf(&path, "%s%s", MOUNT_POINT, *cp); 183 if (rv < 0) { 184 rc = ENOMEM; 185 goto error; 186 } 187 188 rc = vfs_link_path(path, KIND_DIRECTORY, NULL); 189 if (rc != EOK) { 190 printf("Error creating directory '%s'.\n", path); 191 goto error; 192 } 193 194 free(path); 195 path = NULL; 196 ++cp; 197 } 198 199 free(path); 200 path = NULL; 201 202 return EOK; 203 error: 204 if (path != NULL) 205 free(path); 206 return rc; 162 207 } 163 208 … … 415 460 return rc; 416 461 417 printf("FS created and mounted. Copying boot files.\n"); 462 printf("FS created and mounted. Creating system directory structure.\n"); 463 rc = sysinst_setup_sysvol(); 464 if (rc != EOK) 465 return rc; 466 467 printf("Directories created. Copying boot files.\n"); 418 468 rc = sysinst_copy_boot_files(); 419 469 if (rc != EOK)
Note:
See TracChangeset
for help on using the changeset viewer.