Changeset 3acb63b5 in mainline for uspace/app/sysinst/rdimg.c


Ignore:
Timestamp:
2025-04-09T20:01:05Z (6 days ago)
Author:
GitHub <noreply@…>
Children:
a92290d
Parents:
9f945464 (diff), a188131 (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.
git-author:
Wayne Thornton <wmthornton-dev@…> (2025-04-09 20:01:05)
git-committer:
GitHub <noreply@…> (2025-04-09 20:01:05)
Message:

Merge pull request #4 from HelenOS/master

Add UI to system installer

File:
1 edited

Legend:

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

    r9f945464 r3acb63b5  
    3535#include <errno.h>
    3636#include <fibril.h>
     37#include <io/log.h>
    3738#include <stdio.h>
    3839#include <stdlib.h>
     
    6061        rc = vol_get_parts(vol, &part_ids, &nparts);
    6162        if (rc != EOK) {
    62                 printf("Error getting list of volumes.\n");
     63                log_msg(LOG_DEFAULT, LVL_ERROR,
     64                    "Error getting list of volumes.");
    6365                goto out;
    6466        }
     
    6769                rc = vol_part_info(vol, part_ids[i], &vinfo);
    6870                if (rc != EOK) {
    69                         printf("Error getting volume information.\n");
     71                        log_msg(LOG_DEFAULT, LVL_ERROR,
     72                            "Error getting volume information.");
    7073                        rc = EIO;
    7174                        goto out;
     
    106109        int cnt;
    107110
    108         printf("rd_img_open: begin\n");
     111        log_msg(LOG_DEFAULT, LVL_NOTE, "rd_img_open: begin");
     112
    109113        rdpath = str_dup("/vol/" RD_LABEL);
    110114        if (rdpath == NULL) {
     
    119123        }
    120124
    121         printf("rd_img_open: spawn file_bd\n");
     125        log_msg(LOG_DEFAULT, LVL_NOTE, "rd_img_open: spawn file_bd");
    122126        rc = task_spawnl(&id, &wait, FILE_BD, FILE_BD, imgpath, RD_SVC, NULL);
    123127        if (rc != EOK) {
     
    126130        }
    127131
    128         printf("rd_img_open: wait for file_bd\n");
     132        log_msg(LOG_DEFAULT, LVL_NOTE, "rd_img_open: wait for file_bd");
    129133        rc = task_wait(&wait, &texit, &retval);
    130134        if (rc != EOK || texit != TASK_EXIT_NORMAL) {
     
    134138
    135139        /* Wait for the RAM disk to become available */
    136         printf("rd_img_open: wait for RAM disk to be mounted\n");
     140        log_msg(LOG_DEFAULT, LVL_NOTE,
     141            "rd_img_open: wait for RAM disk to be mounted");
    137142        cnt = 10;
    138143        while (cnt > 0) {
     
    146151
    147152        if (cnt == 0) {
    148                 printf("rd_img_open: ran out of time\n");
     153                log_msg(LOG_DEFAULT, LVL_ERROR, "rd_img_open: ran out of time");
    149154                rc = EIO;
    150155                goto error;
     
    154159        *rimg = img;
    155160        *rpath = rdpath;
    156         printf("rd_img_open: success\n");
     161        log_msg(LOG_DEFAULT, LVL_NOTE, "rd_img_open: success");
    157162        return EOK;
    158163error:
     
    173178        vol_t *vol = NULL;
    174179
    175         printf("rd_img_close: begin\n");
     180        log_msg(LOG_DEFAULT, LVL_NOTE, "rd_img_close: begin");
    176181
    177182        rc = vol_create(&vol);
    178183        if (rc != EOK) {
    179                 printf("Error opening volume management service.\n");
    180                 rc = EIO;
    181                 goto error;
    182         }
    183 
    184         printf("rd_img_close: Find RAM disk volume.\n");
     184                log_msg(LOG_DEFAULT, LVL_ERROR,
     185                    "Error opening volume management service.");
     186                rc = EIO;
     187                goto error;
     188        }
     189
     190        log_msg(LOG_DEFAULT, LVL_NOTE, "rd_img_close: Find RAM disk volume.");
    185191        rc = rd_img_part_by_label(vol, RD_LABEL, &rd_svcid);
    186192        if (rc != EOK) {
    187                 printf("Error getting RAM disk service ID.\n");
    188                 rc = EIO;
    189                 goto error;
    190         }
    191 
    192         printf("rd_img_close: eject RAM disk volume\n");
     193                log_msg(LOG_DEFAULT, LVL_ERROR,
     194                    "Error getting RAM disk service ID.");
     195                rc = EIO;
     196                goto error;
     197        }
     198
     199        log_msg(LOG_DEFAULT, LVL_NOTE, "rd_img_close: eject RAM disk volume");
    193200        rc = vol_part_eject(vol, rd_svcid, vef_none);
    194201        if (rc != EOK) {
    195                 printf("Error ejecting RAM disk volume.\n");
     202                log_msg(LOG_DEFAULT, LVL_ERROR,
     203                    "Error ejecting RAM disk volume.");
    196204                rc = EIO;
    197205                goto error;
     
    202210        rc = task_kill(img->filebd_tid);
    203211        if (rc != EOK) {
    204                 printf("Error killing file_bd.\n");
     212                log_msg(LOG_DEFAULT, LVL_ERROR, "Error killing file_bd.");
    205213                rc = EIO;
    206214                goto error;
     
    208216
    209217        free(img);
    210         printf("rd_img_close: success\n");
     218        log_msg(LOG_DEFAULT, LVL_NOTE, "rd_img_close: success");
    211219        return EOK;
    212220error:
Note: See TracChangeset for help on using the changeset viewer.