[netboot] Improvements on boot menu for PXE Boot

-Display "Network" as boot method
-Set the name of the boot volume to 'IP:filename' in case of net boot, "CD-ROM" in case of CD boot method.
-TODO : set a default volume name in TarFS::Volume() ?

Change-Id: Ia44d8f93227be5243af5c210375a635790daf0f7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8523
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
Sylvain78
2025-03-27 17:25:28 +00:00
committed by Adrien Destugues
parent 0aaaf60dec
commit d67db61955
5 changed files with 39 additions and 12 deletions
+10 -9
View File
@@ -11,28 +11,30 @@ SYSTEM_ADD_ONS_DRIVERS_NET = [ FFilterByBuildFeatures
3com
atheros813x
atheros81xx
attansic_l2
broadcom440x
broadcom570x
ipro1000
rtl8139
via_rhine
ipro100
nforce
ipro1000
marvell_yukon
nforce
rtl8139
sis900
syskonnect
attansic_l2
via_rhine
}@ # x86,x86_64
rtl81xx
etherpci
pegasus
rtl81xx
usb_ecm
wb840
] ;
SYSTEM_ADD_ONS_BUS_MANAGERS = [ FFilterByBuildFeatures
pci
<pci>x86@x86,x86_64
isa@x86
usb
ata
scsi
agp_gart
@@ -75,14 +77,12 @@ AddFilesToNetBootArchive system add-ons kernel partitioning_systems :
AddFilesToNetBootArchive system add-ons kernel interrupt_controllers :
openpic@ppc
;
if $(TARGET_ARCH) = x86 {
if $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 {
AddFilesToNetBootArchive system add-ons kernel cpu
:
generic_x86
;
}
# drivers
AddNewDriversToNetBootArchive disk scsi :
scsi_cd
@@ -138,6 +138,7 @@ AddBootModuleSymlinksToNetBootArchive
session
openpic@ppc
generic_x86@x86
# generic_x86@x86_64
# nbd
remote_disk
$(SYSTEM_ADD_ONS_DRIVERS_NET)
@@ -1,5 +1,6 @@
SubDir HAIKU_TOP src system boot loader file_systems tarfs ;
UsePrivateKernelHeaders
UsePrivateHeaders [ FDirName kernel disk_device_manager ] ;
UsePrivateHeaders kernel shared storage ;
@@ -22,6 +22,7 @@
#include <boot/partitions.h>
#include <boot/platform.h>
#include <boot/stage2.h>
#include <util/DoublyLinkedList.h>
@@ -733,6 +734,18 @@ TarFS::Volume::Init(boot::Partition* partition)
return status;
regionDeleter.Detach();
int32 bootMethod = gBootVolume.GetInt32(BOOT_METHOD, BOOT_METHOD_DEFAULT);
switch (bootMethod) {
case BOOT_METHOD_CD:
fName = "CD-ROM";
break;
case BOOT_METHOD_NET:
fName = (char*)malloc(64);
// Same size as in platform_add_boot_device() (file pxe_ia32/devices.cpp).
get_node_from(partition->FD())->GetName((char*)fName, 64);
break;
}
return B_OK;
}
+14 -3
View File
@@ -1294,9 +1294,20 @@ add_boot_volume_menu()
menu->AddItem(item = new(nothrow) MenuItem("Return to main menu"));
item->SetType(MENU_ITEM_NO_CHOICE);
if (gBootVolume.GetBool(BOOT_VOLUME_BOOTED_FROM_IMAGE, false))
menu->SetChoiceText("CD-ROM or hard drive");
if (gBootVolume.GetBool(BOOT_VOLUME_BOOTED_FROM_IMAGE, false)) {
int32 bootMethod = gBootVolume.GetInt32(BOOT_METHOD, BOOT_METHOD_DEFAULT);
switch (bootMethod) {
case BOOT_METHOD_CD:
menu->SetChoiceText("CD-ROM");
break;
case BOOT_METHOD_HARD_DISK:
menu->SetChoiceText("Hard drive");
break;
case BOOT_METHOD_NET:
menu->SetChoiceText("Network");
break;
}
}
return menu;
}
@@ -78,6 +78,7 @@ platform_add_boot_device(struct stage2_args *args, NodeList *devicesList)
}
gBootVolume.SetBool(BOOT_VOLUME_BOOTED_FROM_IMAGE, true);
gBootVolume.SetInt32(BOOT_METHOD, BOOT_METHOD_NET);
devicesList->Add(disk);
return B_OK;
} else {