Skip to content

Commit

Permalink
Fix bug with multiple disks
Browse files Browse the repository at this point in the history
- Stop searching rootfs, kernel on other disks if devices were already found
- Only compare hd51 kernel/rootfs names if they are set
  • Loading branch information
betacentauri committed Dec 30, 2024
1 parent 6237842 commit e45fdd2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions busybox/fdisk_gpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ gpt_list_table(int xtra UNUSED_PARAM)
rootfs_name[0] = '\0';
kernel_name_hd51[0] = '\0';
rootfs_name_hd51[0] = '\0';

// Don't search on other disks if kernel and rootfs are already found
if (found_kernel && found_rootfs)
{
return;
}
if (multiboot_partition != -1 && current_rootfs_sub_dir[0] == '\0')
{
sprintf(kernel_name, "kernel%d", multiboot_partition);
Expand Down Expand Up @@ -176,12 +182,12 @@ gpt_list_table(int xtra UNUSED_PARAM)
found_rootfs = 1;
}
// for hd51, h7, ... search also for special rootfs and kernel names
if (strcmp(partname, kernel_name_hd51) == 0)
if (kernel_name_hd51[0] != '\0' && strcmp(partname, kernel_name_hd51) == 0)
{
ext4_kernel_dev_found(disk_device, i+1);
found_kernel = 1;
}
if (strcmp(partname, rootfs_name_hd51) == 0)
if (rootfs_name_hd51[0] != '\0' && strcmp(partname, rootfs_name_hd51) == 0)
{
ext4_rootfs_dev_found(disk_device, i+1);
found_rootfs = 1;
Expand Down
2 changes: 1 addition & 1 deletion ofgwrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ char *boxname = NULL;
enum RootfsTypeEnum rootfs_type;
int stop_e2_needed = 1;

const char ofgwrite_version[] = "4.6.9";
const char ofgwrite_version[] = "4.7.0";

struct struct_mountlist
{
Expand Down

0 comments on commit e45fdd2

Please sign in to comment.