mirror of
https://github.com/rosalinux/image-builder.git
synced 2025-02-23 10:22:50 +00:00
cleanup duplicate ru comments
This commit is contained in:
parent
31682b10c7
commit
92f9afa840
1 changed files with 0 additions and 4 deletions
|
@ -44,10 +44,8 @@ def setup_loop_device(disk_image_path):
|
||||||
|
|
||||||
|
|
||||||
def create_partitions(loop_device, config):
|
def create_partitions(loop_device, config):
|
||||||
# Получаем параметры из конфигурации
|
|
||||||
root_size = config.get("ROOT_SIZE", "1024MB").rstrip("MB")
|
root_size = config.get("ROOT_SIZE", "1024MB").rstrip("MB")
|
||||||
root_fstype = config.get("ROOT_FSTYPE", "ext4")
|
root_fstype = config.get("ROOT_FSTYPE", "ext4")
|
||||||
# Проверка наличия BOOT_SIZE
|
|
||||||
boot_size = config.get("BOOT_SIZE")
|
boot_size = config.get("BOOT_SIZE")
|
||||||
boot_fstype = config.get("BOOT_FSTYPE", "vfat") if boot_size else None
|
boot_fstype = config.get("BOOT_FSTYPE", "vfat") if boot_size else None
|
||||||
|
|
||||||
|
@ -64,11 +62,9 @@ def create_partitions(loop_device, config):
|
||||||
subprocess.run(["sudo", "mkfs.ext4", f"{loop_device}p2"], check=True)
|
subprocess.run(["sudo", "mkfs.ext4", f"{loop_device}p2"], check=True)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# Если BOOT_SIZE не задан, создаем один раздел для всей системы
|
|
||||||
fdisk_commands = f"""o\nn\np\n\n\n+{root_size}M\nw\n"""
|
fdisk_commands = f"""o\nn\np\n\n\n+{root_size}M\nw\n"""
|
||||||
subprocess.run(["sudo", "fdisk", "--wipe", "always", loop_device], input=fdisk_commands, text=True, check=True)
|
subprocess.run(["sudo", "fdisk", "--wipe", "always", loop_device], input=fdisk_commands, text=True, check=True)
|
||||||
|
|
||||||
# Форматируем один раздел как корневой (/) с учетом root_fstype
|
|
||||||
print(f" - Formatting single root (/) partition as {root_fstype} ({root_size} MB)")
|
print(f" - Formatting single root (/) partition as {root_fstype} ({root_size} MB)")
|
||||||
subprocess.run(["sudo", "mkfs.ext4", f"{loop_device}p1"], check=True)
|
subprocess.run(["sudo", "mkfs.ext4", f"{loop_device}p1"], check=True)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue