Changeset 0cec807a in mainline for uspace/app/sysinst/sysinst.c


Ignore:
Timestamp:
2025-05-06T16:18:58Z (8 weeks ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
61f28c4
Parents:
21cd0c8
Message:

Unmount destination volume and delete mount point on installation failure.

File:
1 edited

Legend:

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

    r21cd0c8 r0cec807a  
    592592        rc = futil_rcopy_contents(sysinst->futil, CFG_FILES_SRC,
    593593            CFG_FILES_DEST);
    594         if (rc != EOK)
    595                 return rc;
     594        if (rc != EOK) {
     595                sysinst_error(sysinst, "Error copying initial configuration "
     596                    "files.");
     597                return rc;
     598        }
    596599
    597600        return EOK;
     
    613616            "sysinst_copy_boot_files(): copy bootloader files");
    614617        rc = futil_rcopy_contents(sysinst->futil, BOOT_FILES_SRC, MOUNT_POINT);
    615         if (rc != EOK)
    616                 return rc;
     618        if (rc != EOK) {
     619                sysinst_error(sysinst, "Error copying bootloader "
     620                    "files.");
     621                return rc;
     622        }
    617623
    618624        sysinst_debug(sysinst, "sysinst_copy_boot_files(): OK");
     
    983989{
    984990        errno_t rc;
     991        bool clean_dev = false;
    985992
    986993        sysinst_action(sysinst, "Creating device label and file system.");
     
    988995        rc = sysinst_label_dev(sysinst, dev);
    989996        if (rc != EOK)
    990                 return rc;
     997                goto error;
     998
     999        clean_dev = true;
    9911000
    9921001        sysinst_action(sysinst, "Creating system directory structure.");
    9931002        rc = sysinst_setup_sysvol(sysinst);
    9941003        if (rc != EOK)
    995                 return rc;
     1004                goto error;
    9961005
    9971006        sysinst_action(sysinst, "Copying boot files.");
    9981007        rc = sysinst_copy_boot_files(sysinst);
    9991008        if (rc != EOK)
    1000                 return rc;
     1009                goto error;
    10011010
    10021011        sysinst_action(sysinst, "Configuring the system.");
    10031012        rc = sysinst_customize_initrd(sysinst);
    10041013        if (rc != EOK)
    1005                 return rc;
     1014                goto error;
    10061015
    10071016        sysinst_action(sysinst, "Finishing system volume.");
    10081017        rc = sysinst_finish_dev(sysinst);
    10091018        if (rc != EOK)
    1010                 return rc;
     1019                goto error;
     1020
     1021        clean_dev = false;
    10111022
    10121023        sysinst_action(sysinst, "Installing boot blocks.");
     
    10211032
    10221033        return EOK;
     1034error:
     1035        if (clean_dev)
     1036                (void)sysinst_finish_dev(sysinst);
     1037        return rc;
    10231038}
    10241039
Note: See TracChangeset for help on using the changeset viewer.