1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef UPDATER_FS_MANAGER_PARTITION_CONST_H 17 #define UPDATER_FS_MANAGER_PARTITION_CONST_H 18 namespace Updater { 19 constexpr int SCSI_CDROM_MAJOR = 11; 20 constexpr int SCSI_DISK0_MAJOR = 8; 21 constexpr int SDMMC_MAJOR = 179; 22 constexpr int BUFFER_SIZE = 256; 23 constexpr int SMALL_BUFFER_SIZE = 64; 24 constexpr int DEVPATH_SIZE = 128; 25 constexpr int DEFAULT_PARTSUM = 16; 26 constexpr size_t SECTOR_SIZE_DEFAULT = 512; 27 constexpr size_t DEFAULT_SIZE_1MB = 1048576; 28 29 constexpr const char *SDA_PATH = "/dev/sda"; 30 constexpr const char *SDA_DEV = "sda"; 31 constexpr const char *SDB_PATH = "/dev/sdb"; 32 constexpr const char *SDB_DEV = "sdb"; 33 constexpr const char *MMC_PATH = "/dev/block/mmcblk0"; 34 constexpr const char *MMC_DEV = "mmcblk0"; 35 36 const std::string P_TYPE[] = { 37 "GPT", 38 "MBR", 39 }; 40 41 #define SCSI_BLK_MAJOR(M) ((M) == SCSI_DISK0_MAJOR || (M) == SCSI_CDROM_MAJOR) 42 } // namespace Updater 43 #endif // UPDATER_FS_MANAGER_PARTITION_CONST_H