Ignore:
File:
1 edited

Legend:

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

    r9b95b964 rc24b0dcb  
    11/*
    2  * Copyright (c) 2024 Jiri Svoboda
     2 * Copyright (c) 2018 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    6262 * in Grub notation).
    6363 */
    64 #define DEFAULT_DEV_0 "devices/\\hw\\sys\\00:01.1\\c0d0"
    65 #define DEFAULT_DEV_1 "devices/\\hw\\sys\\00:01.0\\ata1\\c0d0"
     64#define DEFAULT_DEV "devices/\\hw\\sys\\00:01.0\\ata-c1\\d0"
    6665//#define DEFAULT_DEV "devices/\\hw\\pci0\\00:01.2\\uhci_rh\\usb01_a1\\mass-storage0\\l0"
    6766/** Volume label for the new file system */
     
    8079#define BOOT_BLOCK_IDX 0 /* MBR */
    8180
    82 static const char *default_devs[] = {
    83         DEFAULT_DEV_0,
    84         DEFAULT_DEV_1,
    85         NULL
    86 };
    87 
    8881static const char *sys_dirs[] = {
    8982        "/cfg",
    90         "/data",
    91         NULL
     83        "/data"
    9284};
    93 
    94 /** Check the if the destination device exists.
    95  *
    96  * @param dev Disk device
    97  *
    98  * @return EOK on success or an error code
    99  */
    100 static errno_t sysinst_check_dev(const char *dev)
    101 {
    102         service_id_t sid;
    103         errno_t rc;
    104 
    105         rc = loc_service_get_id(dev, &sid, 0);
    106         if (rc != EOK)
    107                 return rc;
    108 
    109         (void)sid;
    110         return EOK;
    111 }
    11285
    11386/** Label the destination device.
     
    388361
    389362        printf("sysinst_copy_boot_blocks: block_init.\n");
    390         rc = block_init(sid);
     363        rc = block_init(sid, 512);
    391364        if (rc != EOK)
    392365                return rc;
     
    517490int main(int argc, char *argv[])
    518491{
    519         unsigned i;
    520         errno_t rc;
    521 
    522         i = 0;
    523         while (default_devs[i] != NULL) {
    524                 rc = sysinst_check_dev(default_devs[i]);
    525                 if (rc == EOK)
    526                         break;
    527         }
    528 
    529         if (default_devs[i] == NULL) {
    530                 printf("Cannot determine installation device.\n");
    531                 return 1;
    532         }
    533 
    534         return sysinst_install(default_devs[i]);
     492        const char *dev = DEFAULT_DEV;
     493        return sysinst_install(dev);
    535494}
    536495
Note: See TracChangeset for help on using the changeset viewer.