Skip to content

Commit

Permalink
Add support for h17
Browse files Browse the repository at this point in the history
h17 has similar multiboot mechanism like hd51 but no seperate
rootfs1 partition
  • Loading branch information
betacentauri authored and atvcaptain committed Sep 29, 2024
1 parent 1ec9027 commit 6237842
Showing 1 changed file with 42 additions and 4 deletions.
46 changes: 42 additions & 4 deletions busybox/fdisk_gpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,14 @@ gpt_list_table(int xtra UNUSED_PARAM)
char partname[19];
char kernel_name[19];
char rootfs_name[19];
char kernel_name_hd51[19];
char rootfs_name_hd51[19];
int found_kernel = 0;
int found_rootfs = 0;
kernel_name[0] = '\0';
rootfs_name[0] = '\0';
kernel_name_hd51[0] = '\0';
rootfs_name_hd51[0] = '\0';
if (multiboot_partition != -1 && current_rootfs_sub_dir[0] == '\0')
{
sprintf(kernel_name, "kernel%d", multiboot_partition);
Expand All @@ -123,8 +129,12 @@ gpt_list_table(int xtra UNUSED_PARAM)
{
if (multiboot_partition == 1)
{
strcpy(kernel_name, "linuxkernel");
strcpy(rootfs_name, "linuxrootfs");
// hd51, h7,... have seperate partition for rootfs1
strcpy(kernel_name_hd51, "linuxkernel");
strcpy(rootfs_name_hd51, "linuxrootfs");
// h17 don't have this -> so also set kernel_name, rootfs_name
sprintf(kernel_name, "linuxkernel%d", multiboot_partition);
strcpy(rootfs_name, "userdata");
}
else
{
Expand Down Expand Up @@ -165,6 +175,17 @@ gpt_list_table(int xtra UNUSED_PARAM)
ext4_rootfs_dev_found(disk_device, i+1);
found_rootfs = 1;
}
// for hd51, h7, ... search also for special rootfs and kernel names
if (strcmp(partname, kernel_name_hd51) == 0)
{
ext4_kernel_dev_found(disk_device, i+1);
found_kernel = 1;
}
if (strcmp(partname, rootfs_name_hd51) == 0)
{
ext4_rootfs_dev_found(disk_device, i+1);
found_rootfs = 1;
}
if ((user_kernel || user_rootfs) && (strcmp(partname, "bp30") == 0 || strcmp(partname, "bp31") == 0))
{
char dummy_device[1000];
Expand All @@ -176,6 +197,10 @@ gpt_list_table(int xtra UNUSED_PARAM)
exit(EXIT_FAILURE);
}
}
if (found_kernel && found_rootfs)
{
return;
}
}
}

Expand Down Expand Up @@ -241,8 +266,12 @@ gpt_list_table(int xtra UNUSED_PARAM)
{
if (multiboot_partition == 1)
{
strcpy(kernel_name, "linuxkernel");
strcpy(rootfs_name, "linuxrootfs");
// hd51, h7,... have seperate partition for rootfs1
strcpy(kernel_name_hd51, "linuxkernel");
strcpy(rootfs_name_hd51, "linuxrootfs");
// h17 don't have this -> so also set kernel_name, rootfs_name
strcpy(kernel_name, current_kernel_device);
strcpy(rootfs_name, "userdata");
}
else
{
Expand All @@ -269,6 +298,15 @@ gpt_list_table(int xtra UNUSED_PARAM)
{
ext4_rootfs_dev_found(disk_device, i+1);
}
// h17 don't have this -> so also set kernel_name, rootfs_name
if (strcmp(partname, kernel_name_hd51) == 0)
{
ext4_kernel_dev_found(disk_device, i+1);
}
if (strcmp(partname, rootfs_name_hd51) == 0)
{
ext4_rootfs_dev_found(disk_device, i+1);
}
}
}
}
Expand Down

0 comments on commit 6237842

Please sign in to comment.