add ROOT_SIZE for ok3568c, minor fixes

This commit is contained in:
alexander stefanov 2024-11-16 01:21:57 +03:00
parent bd5cda66a4
commit e677980e68
2 changed files with 6 additions and 3 deletions

View file

@ -6,3 +6,6 @@ UBOOT_VERSION="next-dev-v2024.03"
UBOOT_CONFIG="ok3568c-rk3568_defconfig" UBOOT_CONFIG="ok3568c-rk3568_defconfig"
DTB="rockchip/rk3568-ok3568c" DTB="rockchip/rk3568-ok3568c"
CMDLINE="earlycon=uart8250,mmio32,0xfeb50000 console=ttyFIQ0 console=tty1 consoleblank=0 irqchip.gicv3_pseudo_nmi=0 switolb=1 coherent_pool=2M cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1" CMDLINE="earlycon=uart8250,mmio32,0xfeb50000 console=ttyFIQ0 console=tty1 consoleblank=0 irqchip.gicv3_pseudo_nmi=0 switolb=1 coherent_pool=2M cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1"
ROOT_SIZE="1024MB"
ROOT_FSTYPE="ext4"

View file

@ -6,8 +6,8 @@ import subprocess
def create_disk_image(tmp_dir, config, vendor, device): def create_disk_image(tmp_dir, config, vendor, device):
boot_size = config.get("BOOT_SIZE").rstrip("MB") boot_size = config.get("BOOT_SIZE", "").rstrip("MB")
root_size = config.get("ROOT_SIZE").rstrip("MB") root_size = config.get("ROOT_SIZE", "0").rstrip("MB")
if not root_size: if not root_size:
print("Error: ROOT_SIZE is not defined in the configuration.") print("Error: ROOT_SIZE is not defined in the configuration.")
@ -72,7 +72,7 @@ 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:
fdisk_commands = f"""o\nn\np\n\n\n+{root_size}M\nw\n""" fdisk_commands = f"""o\nn\np\n\n\n\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)
print(f" - Formatting single root (/) partition as {root_fstype} ({root_size} MB)") print(f" - Formatting single root (/) partition as {root_fstype} ({root_size} MB)")