Changeset d3b2ffa in mainline for uspace/app


Ignore:
Timestamp:
2018-06-29T15:40:10Z (7 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5e904dd
Parents:
1e472ee (diff), 1a9174e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge volume management improvements (still WIP).

Location:
uspace/app
Files:
2 added
2 edited

Legend:

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

    r1e472ee rd3b2ffa  
    3737#include <cap.h>
    3838#include <errno.h>
     39#include <fdisk.h>
     40#include <io/label.h>
    3941#include <nchoice.h>
    4042#include <stdbool.h>
    4143#include <stdio.h>
    4244#include <stdlib.h>
    43 #include <fdisk.h>
    4445#include <str.h>
     46#include <vol.h>
    4547
    4648#define NO_LABEL_CAPTION "(No name)"
     
    6971} devac_t;
    7072
    71 static errno_t fdsk_pcnt_fs_format(vol_part_cnt_t pcnt, vol_fstype_t fstype,
    72     char **rstr)
    73 {
    74         errno_t rc;
    75         char *s;
    76 
    77         switch (pcnt) {
    78         case vpc_empty:
    79                 s = str_dup("Empty");
    80                 if (s == NULL)
    81                         return ENOMEM;
    82                 break;
    83         case vpc_fs:
    84                 rc = fdisk_fstype_format(fstype, &s);
    85                 if (rc != EOK)
    86                         return ENOMEM;
    87                 break;
    88         case vpc_unknown:
    89                 s = str_dup("Unknown");
    90                 if (s == NULL)
    91                         return ENOMEM;
    92                 break;
    93         }
    94 
    95         *rstr = s;
    96         return EOK;
    97 }
    98 
    9973/** Confirm user selection. */
    10074static errno_t fdsk_confirm(const char *msg, bool *rconfirm)
     
    305279
    306280        for (i = LT_FIRST; i < LT_LIMIT; i++) {
    307                 rc = fdisk_ltype_format(i, &sltype);
     281                rc = label_type_format(i, &sltype);
    308282                if (rc != EOK)
    309283                        goto error;
     
    413387
    414388        for (i = 0; i < VOL_FSTYPE_LIMIT; i++) {
    415                 rc = fdisk_fstype_format(i, &sfstype);
     389                rc = vol_fstype_format(i, &sfstype);
    416390                if (rc != EOK)
    417391                        goto error;
     
    598572                }
    599573
    600                 rc = fdisk_pkind_format(pinfo.pkind, &spkind);
     574                rc = label_pkind_format(pinfo.pkind, &spkind);
    601575                if (rc != EOK) {
    602576                        printf("\nOut of memory.\n");
     
    605579
    606580                if (pinfo.pkind != lpk_extended) {
    607                         rc = fdsk_pcnt_fs_format(pinfo.pcnt, pinfo.fstype, &sfstype);
     581                        rc = vol_pcnt_fs_format(pinfo.pcnt, pinfo.fstype, &sfstype);
    608582                        if (rc != EOK) {
    609583                                printf("Out of memory.\n");
     
    773747                break;
    774748        default:
    775                 rc = fdisk_ltype_format(linfo.ltype, &sltype);
     749                rc = label_type_format(linfo.ltype, &sltype);
    776750                if (rc != EOK) {
    777751                        assert(rc == ENOMEM);
     
    804778                }
    805779
    806                 rc = fdsk_pcnt_fs_format(pinfo.pcnt, pinfo.fstype, &sfstype);
     780                rc = vol_pcnt_fs_format(pinfo.pcnt, pinfo.fstype, &sfstype);
    807781                if (rc != EOK) {
    808782                        printf("Out of memory.\n");
     
    821795
    822796                if ((linfo.flags & lf_ext_supp) != 0) {
    823                         rc = fdisk_pkind_format(pinfo.pkind, &spkind);
     797                        rc = label_pkind_format(pinfo.pkind, &spkind);
    824798                        if (rc != EOK) {
    825799                                printf("\nOut of memory.\n");
  • uspace/app/sysinst/sysinst.c

    r1e472ee rd3b2ffa  
    6969#define MOUNT_POINT "/inst"
    7070
    71 /** Device containing HelenOS live CD */
    72 #define CD_DEV "devices/\\hw\\pci0\\00:01.0\\ata-c2\\d0"
    73 
    74 #define CD_FS_TYPE "cdfs"
    75 #define CD_FS_SRV "/srv/cdfs"
    76 #define CD_MOUNT_POINT "/cdrom"
    77 
    78 #define BOOT_FILES_SRC "/cdrom"
     71/** HelenOS live CD volume label */
     72#define CD_VOL_LABEL "HelenOS-CD"
     73#define CD_MOUNT_POINT "/vol/" CD_VOL_LABEL
     74
     75#define BOOT_FILES_SRC CD_MOUNT_POINT
    7976#define BOOT_BLOCK_IDX 0 /* MBR */
    8077
     
    196193static errno_t sysinst_copy_boot_files(void)
    197194{
    198         task_wait_t twait;
    199         task_exit_t texit;
    200         errno_t rc;
    201         int trc;
    202 
    203         printf("sysinst_copy_boot_files(): start filesystem server\n");
    204         rc = task_spawnl(NULL, &twait, CD_FS_SRV, CD_FS_SRV, NULL);
    205         if (rc != EOK)
    206                 return rc;
    207 
    208         printf("sysinst_copy_boot_files(): wait for filesystem server\n");
    209         rc = task_wait(&twait, &texit, &trc);
    210         if (rc != EOK)
    211                 return rc;
    212 
    213         printf("sysinst_copy_boot_files(): verify filesystem server result\n");
    214         if (texit != TASK_EXIT_NORMAL || trc != 0) {
    215                 printf("sysinst_fs_mount(): not successful, but could be already loaded.\n");
    216         }
    217 
    218         printf("sysinst_copy_boot_files(): create CD mount point\n");
    219         rc = vfs_link_path(CD_MOUNT_POINT, KIND_DIRECTORY, NULL);
    220         if (rc != EOK)
    221                 return rc;
    222 
    223         printf("sysinst_copy_boot_files(): mount CD filesystem\n");
    224         rc = vfs_mount_path(CD_MOUNT_POINT, CD_FS_TYPE, CD_DEV, "", 0, 0);
    225         if (rc != EOK)
    226                 return rc;
     195        errno_t rc;
    227196
    228197        printf("sysinst_copy_boot_files(): copy bootloader files\n");
Note: See TracChangeset for help on using the changeset viewer.