diff options
Diffstat (limited to 'emulators')
195 files changed, 10967 insertions, 289 deletions
diff --git a/emulators/86Box/Makefile b/emulators/86Box/Makefile index 001776a75946..35d2c1c01cf0 100644 --- a/emulators/86Box/Makefile +++ b/emulators/86Box/Makefile @@ -1,6 +1,6 @@ PORTNAME= 86Box DISTVERSIONPREFIX= v -DISTVERSION= 4.2.1 +DISTVERSION= 5.0 CATEGORIES= emulators MAINTAINER= tiago.gasiba@gmail.com @@ -72,8 +72,6 @@ ICON_RESOLUTIONS= 128x128 192x192 256x256 48x48 512x512 64x64 72x72 96x96 do-install: ${INSTALL_PROGRAM} ${WRKDIR}/.build/src/86Box ${STAGEDIR}${PREFIX}/bin ${INSTALL_SCRIPT} ${WRKDIR}/86Box-install-roms.sh ${STAGEDIR}${PREFIX}/bin - ${REINPLACE_CMD} -e 's|Exec=86Box|Exec=/bin/sh -c "${PREFIX}/bin/86Box -C $${HOME}/.config/86Box.cfg"|' \ - ${WRKSRC}/src/unix/assets/net.86box.86Box.desktop ${INSTALL_DATA} ${WRKSRC}/src/unix/assets/net.86box.86Box.desktop \ ${STAGEDIR}${DESKTOPDIR} .for F in ${ICON_RESOLUTIONS} diff --git a/emulators/86Box/distinfo b/emulators/86Box/distinfo index 4c04656dbfcc..a08ab5ac5399 100644 --- a/emulators/86Box/distinfo +++ b/emulators/86Box/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1728389339 -SHA256 (86Box-86Box-v4.2.1_GH0.tar.gz) = 9d5627ef96feb815e66b87f167a1b26f4615fccd730334053293eb038f5ec3a9 -SIZE (86Box-86Box-v4.2.1_GH0.tar.gz) = 5320110 +TIMESTAMP = 1756060000 +SHA256 (86Box-86Box-v5.0_GH0.tar.gz) = 00899cb06eb5591df57756d13929a470e50d5d87bc219d1d1d36ae7bbe83a4bf +SIZE (86Box-86Box-v5.0_GH0.tar.gz) = 13880473 diff --git a/emulators/86Box/files/86Box-install-roms.sh.in b/emulators/86Box/files/86Box-install-roms.sh.in index 0c0cf18f342b..6b899380545a 100644 --- a/emulators/86Box/files/86Box-install-roms.sh.in +++ b/emulators/86Box/files/86Box-install-roms.sh.in @@ -5,7 +5,7 @@ DEFAULT_TARGET_DIR="$HOME/.local/share/86Box/" TARGET_DIR=${TARGET_DIR:-$DEFAULT_TARGET_DIR} install_roms() { - if [ -d "$TARGET_DIR" ] && [ "$(ls -A $TARGET_DIR)" ]; then + if [ -d "$TARGET_DIR/roms" ] && [ "$(ls -A $TARGET_DIR/roms)" ]; then echo "ROMs already installed in $TARGET_DIR" echo "To (re)install, please first remove ROMs with -r parameter" exit 1 diff --git a/emulators/86Box/files/patch-src_cdrom_CMakeLists.txt b/emulators/86Box/files/patch-src_cdrom_CMakeLists.txt new file mode 100644 index 000000000000..c02dd2399e58 --- /dev/null +++ b/emulators/86Box/files/patch-src_cdrom_CMakeLists.txt @@ -0,0 +1,10 @@ +--- src/cdrom/CMakeLists.txt.orig 2025-08-24 18:40:59 UTC ++++ src/cdrom/CMakeLists.txt +@@ -26,6 +26,7 @@ target_link_libraries(86Box PkgConfig::SNDFILE) + cdrom_mke.c + ) + target_link_libraries(86Box PkgConfig::SNDFILE) ++target_include_directories(cdrom PRIVATE /usr/local/include) + + if(CDROM_MITSUMI) + target_compile_definitions(cdrom PRIVATE USE_CDROM_MITSUMI) diff --git a/emulators/86Box/files/patch-src_network_CMakeLists.txt b/emulators/86Box/files/patch-src_network_CMakeLists.txt new file mode 100644 index 000000000000..6009eef2e7cb --- /dev/null +++ b/emulators/86Box/files/patch-src_network_CMakeLists.txt @@ -0,0 +1,10 @@ +--- src/network/CMakeLists.txt.orig 2025-08-24 18:50:29 UTC ++++ src/network/CMakeLists.txt +@@ -71,6 +71,7 @@ if (UNIX) + endif() + + if (UNIX) ++ set_source_files_properties(net_slirp.c PROPERTIES COMPILE_FLAGS "-I/usr/local/include") + find_path(HAS_VDE "libvdeplug.h" PATHS ${VDE_INCLUDE_DIR} "/usr/include /usr/local/include" "/opt/homebrew/include" ) + if(HAS_VDE) + find_library(VDE_LIB vdeplug) diff --git a/emulators/86Box/files/patch-src_printer_CMakeLists.txt b/emulators/86Box/files/patch-src_printer_CMakeLists.txt index a6da4a25f91e..a07e28d70427 100644 --- a/emulators/86Box/files/patch-src_printer_CMakeLists.txt +++ b/emulators/86Box/files/patch-src_printer_CMakeLists.txt @@ -1,6 +1,6 @@ ---- src/printer/CMakeLists.txt.orig 2024-08-02 00:15:09 UTC +--- src/printer/CMakeLists.txt.orig 2025-08-24 12:26:31 UTC +++ src/printer/CMakeLists.txt -@@ -29,6 +29,7 @@ target_link_libraries(86Box PkgConfig::FREETYPE) +@@ -37,6 +37,7 @@ target_link_libraries(86Box PkgConfig::FREETYPE) find_package(PkgConfig REQUIRED) pkg_check_modules(FREETYPE REQUIRED IMPORTED_TARGET freetype2) target_link_libraries(86Box PkgConfig::FREETYPE) diff --git a/emulators/86Box/files/patch-src_qt_qt__mainwindow.cpp b/emulators/86Box/files/patch-src_qt_qt__mainwindow.cpp index e6bbf8c52860..89635e4db214 100644 --- a/emulators/86Box/files/patch-src_qt_qt__mainwindow.cpp +++ b/emulators/86Box/files/patch-src_qt_qt__mainwindow.cpp @@ -1,6 +1,6 @@ ---- src/qt/qt_mainwindow.cpp.orig 2024-08-02 00:15:09 UTC +--- src/qt/qt_mainwindow.cpp.orig 2025-08-24 12:26:31 UTC +++ src/qt/qt_mainwindow.cpp -@@ -378,6 +378,7 @@ MainWindow::MainWindow(QWidget *parent) +@@ -469,6 +469,7 @@ MainWindow::MainWindow(QWidget *parent) #if QT_CONFIG(vulkan) bool vulkanAvailable = false; diff --git a/emulators/86Box/files/patch-src_qt_qt__vmmanager__details.cpp b/emulators/86Box/files/patch-src_qt_qt__vmmanager__details.cpp new file mode 100644 index 000000000000..6386154d5c15 --- /dev/null +++ b/emulators/86Box/files/patch-src_qt_qt__vmmanager__details.cpp @@ -0,0 +1,79 @@ +--- src/qt/qt_vmmanager_details.cpp.orig 2025-08-24 19:07:21 UTC ++++ src/qt/qt_vmmanager_details.cpp +@@ -248,52 +248,52 @@ VMManagerDetails::updateConfig(VMManagerSystem *passed + + // System + systemSection->clear(); +- systemSection->addSection("Machine", passed_sysconfig->getDisplayValue(Display::Name::Machine)); +- systemSection->addSection("CPU", passed_sysconfig->getDisplayValue(Display::Name::CPU)); +- systemSection->addSection("Memory", passed_sysconfig->getDisplayValue(Display::Name::Memory)); ++ systemSection->addSection("Machine", passed_sysconfig->getDisplayValue(VMManager::Display::Name::Machine)); ++ systemSection->addSection("CPU", passed_sysconfig->getDisplayValue(VMManager::Display::Name::CPU)); ++ systemSection->addSection("Memory", passed_sysconfig->getDisplayValue(VMManager::Display::Name::Memory)); + + // Video + videoSection->clear(); +- videoSection->addSection("Video", passed_sysconfig->getDisplayValue(Display::Name::Video)); +- if(!passed_sysconfig->getDisplayValue(Display::Name::Voodoo).isEmpty()) { +- videoSection->addSection("Voodoo", passed_sysconfig->getDisplayValue(Display::Name::Voodoo)); ++ videoSection->addSection("Video", passed_sysconfig->getDisplayValue(VMManager::Display::Name::Video)); ++ if(!passed_sysconfig->getDisplayValue(VMManager::Display::Name::Voodoo).isEmpty()) { ++ videoSection->addSection("Voodoo", passed_sysconfig->getDisplayValue(VMManager::Display::Name::Voodoo)); + } + + // Disks + storageSection->clear(); +- storageSection->addSection("Disks", passed_sysconfig->getDisplayValue(Display::Name::Disks)); +- storageSection->addSection("Floppy", passed_sysconfig->getDisplayValue(Display::Name::Floppy)); +- storageSection->addSection("CD-ROM", passed_sysconfig->getDisplayValue(Display::Name::CD)); +- storageSection->addSection("Removable disks", passed_sysconfig->getDisplayValue(Display::Name::RDisk)); +- storageSection->addSection("MO", passed_sysconfig->getDisplayValue(Display::Name::MO)); +- storageSection->addSection("SCSI", passed_sysconfig->getDisplayValue(Display::Name::SCSIController)); +- storageSection->addSection("Controllers", passed_sysconfig->getDisplayValue(Display::Name::StorageController)); ++ storageSection->addSection("Disks", passed_sysconfig->getDisplayValue(VMManager::Display::Name::Disks)); ++ storageSection->addSection("Floppy", passed_sysconfig->getDisplayValue(VMManager::Display::Name::Floppy)); ++ storageSection->addSection("CD-ROM", passed_sysconfig->getDisplayValue(VMManager::Display::Name::CD)); ++ storageSection->addSection("Removable disks", passed_sysconfig->getDisplayValue(VMManager::Display::Name::RDisk)); ++ storageSection->addSection("MO", passed_sysconfig->getDisplayValue(VMManager::Display::Name::MO)); ++ storageSection->addSection("SCSI", passed_sysconfig->getDisplayValue(VMManager::Display::Name::SCSIController)); ++ storageSection->addSection("Controllers", passed_sysconfig->getDisplayValue(VMManager::Display::Name::StorageController)); + + // Audio + audioSection->clear(); +- audioSection->addSection("Audio", passed_sysconfig->getDisplayValue(Display::Name::Audio)); +- audioSection->addSection("MIDI Out", passed_sysconfig->getDisplayValue(Display::Name::MidiOut)); ++ audioSection->addSection("Audio", passed_sysconfig->getDisplayValue(VMManager::Display::Name::Audio)); ++ audioSection->addSection("MIDI Out", passed_sysconfig->getDisplayValue(VMManager::Display::Name::MidiOut)); + + // Network + networkSection->clear(); +- networkSection->addSection("NIC", passed_sysconfig->getDisplayValue(Display::Name::NIC)); ++ networkSection->addSection("NIC", passed_sysconfig->getDisplayValue(VMManager::Display::Name::NIC)); + + // Input + inputSection->clear(); +- inputSection->addSection("Keyboard", passed_sysconfig->getDisplayValue(Display::Name::Keyboard)); +- inputSection->addSection("Mouse", passed_sysconfig->getDisplayValue(Display::Name::Mouse)); +- inputSection->addSection("Joystick", passed_sysconfig->getDisplayValue(Display::Name::Joystick)); ++ inputSection->addSection("Keyboard", passed_sysconfig->getDisplayValue(VMManager::Display::Name::Keyboard)); ++ inputSection->addSection("Mouse", passed_sysconfig->getDisplayValue(VMManager::Display::Name::Mouse)); ++ inputSection->addSection("Joystick", passed_sysconfig->getDisplayValue(VMManager::Display::Name::Joystick)); + + // Ports + portsSection->clear(); +- portsSection->addSection("Serial ports", passed_sysconfig->getDisplayValue(Display::Name::Serial)); +- portsSection->addSection("Parallel ports", passed_sysconfig->getDisplayValue(Display::Name::Parallel)); ++ portsSection->addSection("Serial ports", passed_sysconfig->getDisplayValue(VMManager::Display::Name::Serial)); ++ portsSection->addSection("Parallel ports", passed_sysconfig->getDisplayValue(VMManager::Display::Name::Parallel)); + + // Other devices + otherSection->clear(); +- otherSection->addSection("ISA RTC", passed_sysconfig->getDisplayValue(Display::Name::IsaRtc)); +- otherSection->addSection("ISA RAM", passed_sysconfig->getDisplayValue(Display::Name::IsaMem)); +- otherSection->addSection("ISA ROM", passed_sysconfig->getDisplayValue(Display::Name::IsaRom)); ++ otherSection->addSection("ISA RTC", passed_sysconfig->getDisplayValue(VMManager::Display::Name::IsaRtc)); ++ otherSection->addSection("ISA RAM", passed_sysconfig->getDisplayValue(VMManager::Display::Name::IsaMem)); ++ otherSection->addSection("ISA ROM", passed_sysconfig->getDisplayValue(VMManager::Display::Name::IsaRom)); + + systemSection->setSections(); + videoSection->setSections(); diff --git a/emulators/86Box/files/patch-src_qt_qt__vmmanager__detailsection.cpp b/emulators/86Box/files/patch-src_qt_qt__vmmanager__detailsection.cpp new file mode 100644 index 000000000000..4b35ec0aa35b --- /dev/null +++ b/emulators/86Box/files/patch-src_qt_qt__vmmanager__detailsection.cpp @@ -0,0 +1,11 @@ +--- src/qt/qt_vmmanager_detailsection.cpp.orig 2025-08-24 19:05:30 UTC ++++ src/qt/qt_vmmanager_detailsection.cpp +@@ -145,7 +145,7 @@ void + } + + void +-VMManagerDetailSection::addSection(const QString &name, const QString &value, Display::Name displayField) ++VMManagerDetailSection::addSection(const QString &name, const QString &value, VMManager::Display::Name displayField) + { + const auto new_section = DetailSection { name, value}; + sections.push_back(new_section); diff --git a/emulators/86Box/files/patch-src_qt_qt__vmmanager__system.cpp b/emulators/86Box/files/patch-src_qt_qt__vmmanager__system.cpp new file mode 100644 index 000000000000..aa94a21eab29 --- /dev/null +++ b/emulators/86Box/files/patch-src_qt_qt__vmmanager__system.cpp @@ -0,0 +1,219 @@ +--- src/qt/qt_vmmanager_system.cpp.orig 2025-08-24 19:09:53 UTC ++++ src/qt/qt_vmmanager_system.cpp +@@ -557,7 +557,7 @@ VMManagerSystem::setupVars() { + } + } + } +- display_table[Display::Name::Machine] = machine_name; ++ display_table[VMManager::Display::Name::Machine] = machine_name; + + // CPU: Combine name with speed and FPU + QString cpu_name = "Unknown"; +@@ -592,34 +592,34 @@ VMManagerSystem::setupVars() { + // int speed_display = machine_config["cpu_speed"].toInt() / 1000000; + // cpu_name.append(QString::number(speed_display).prepend(" / ")); + // cpu_name.append(QCoreApplication::translate("", "MHz").prepend(' ')); +- display_table[Display::Name::CPU] = cpu_name; ++ display_table[VMManager::Display::Name::CPU] = cpu_name; + + // Memory + int divisor = (ram_granularity < 1024) ? 1 : 1024; + QString display_unit = (divisor == 1) ? "KB" : "MB"; + auto mem_display = QString::number(machine_config["mem_size"].toInt() / divisor); + mem_display.append(QCoreApplication::translate("", display_unit.toUtf8().constData()).prepend(' ')); +- display_table[Display::Name::Memory] = mem_display; ++ display_table[VMManager::Display::Name::Memory] = mem_display; + + // Video card + int video_int = video_get_video_from_internal_name(video_config["gfxcard"].toUtf8().data()); + const device_t* video_dev = video_card_getdevice(video_int); +- display_table[Display::Name::Video] = DeviceConfig::DeviceName(video_dev, video_get_internal_name(video_int), 1); ++ display_table[VMManager::Display::Name::Video] = DeviceConfig::DeviceName(video_dev, video_get_internal_name(video_int), 1); + + // Secondary video + if (video_config.contains("gfxcard_2")) { + int video2_int = video_get_video_from_internal_name(video_config["gfxcard_2"].toUtf8().data()); + const device_t* video2_dev = video_card_getdevice(video2_int); +- display_table[Display::Name::Video].append(DeviceConfig::DeviceName(video2_dev, video_get_internal_name(video2_int), 1).prepend(VMManagerDetailSection::sectionSeparator)); ++ display_table[VMManager::Display::Name::Video].append(DeviceConfig::DeviceName(video2_dev, video_get_internal_name(video2_int), 1).prepend(VMManagerDetailSection::sectionSeparator)); + } + + // Add-on video that's not Voodoo + if (video_config.contains("8514a") && (video_config["8514a"].toInt() != 0)) +- display_table[Display::Name::Video].append(tr("IBM 8514/A Graphics").prepend(VMManagerDetailSection::sectionSeparator)); ++ display_table[VMManager::Display::Name::Video].append(tr("IBM 8514/A Graphics").prepend(VMManagerDetailSection::sectionSeparator)); + if (video_config.contains("xga") && (video_config["xga"].toInt() != 0)) +- display_table[Display::Name::Video].append(tr("XGA Graphics").prepend(VMManagerDetailSection::sectionSeparator)); ++ display_table[VMManager::Display::Name::Video].append(tr("XGA Graphics").prepend(VMManagerDetailSection::sectionSeparator)); + if (video_config.contains("da2") && (video_config["da2"].toInt() != 0)) +- display_table[Display::Name::Video].append(tr("IBM PS/55 Display Adapter Graphics").prepend(VMManagerDetailSection::sectionSeparator)); ++ display_table[VMManager::Display::Name::Video].append(tr("IBM PS/55 Display Adapter Graphics").prepend(VMManagerDetailSection::sectionSeparator)); + + // Voodoo + QString voodoo_name = ""; +@@ -641,7 +641,7 @@ VMManagerSystem::setupVars() { + break; + } + } +- display_table[Display::Name::Voodoo] = voodoo_name; ++ display_table[VMManager::Display::Name::Voodoo] = voodoo_name; + + // Drives + // First the number of disks +@@ -666,7 +666,7 @@ VMManagerSystem::setupVars() { + if (disks.count()) { + disks_display.append(" / ").append(bus_types.keys().join(", ").toUpper()); + } +-// display_table[Display::Name::Disks] = disks_display; ++// display_table[VMManager::Display::Name::Disks] = disks_display; + + // Drives + QString new_disk_display; +@@ -699,7 +699,7 @@ VMManagerSystem::setupVars() { + if(new_disk_display.isEmpty()) { + new_disk_display = tr("No disks"); + } +- display_table[Display::Name::Disks] = new_disk_display; ++ display_table[VMManager::Display::Name::Disks] = new_disk_display; + + // Floppy & CD-ROM + QStringList floppyDevices; +@@ -748,8 +748,8 @@ VMManagerSystem::setupVars() { + } + } + +- display_table[Display::Name::Floppy] = floppyDevices.join(VMManagerDetailSection::sectionSeparator); +- display_table[Display::Name::CD] = cdromDevices.join(VMManagerDetailSection::sectionSeparator); ++ display_table[VMManager::Display::Name::Floppy] = floppyDevices.join(VMManagerDetailSection::sectionSeparator); ++ display_table[VMManager::Display::Name::CD] = cdromDevices.join(VMManagerDetailSection::sectionSeparator); + + // Removable disks & MO + QStringList rdiskDevices; +@@ -786,8 +786,8 @@ VMManagerSystem::setupVars() { + } + } + +- display_table[Display::Name::RDisk] = rdiskDevices.join(VMManagerDetailSection::sectionSeparator); +- display_table[Display::Name::MO] = moDevices.join(VMManagerDetailSection::sectionSeparator); ++ display_table[VMManager::Display::Name::RDisk] = rdiskDevices.join(VMManagerDetailSection::sectionSeparator); ++ display_table[VMManager::Display::Name::MO] = moDevices.join(VMManagerDetailSection::sectionSeparator); + + + // SCSI controllers +@@ -805,7 +805,7 @@ VMManagerSystem::setupVars() { + } + } + } +- display_table[Display::Name::SCSIController] = scsiControllers.join(VMManagerDetailSection::sectionSeparator); ++ display_table[VMManager::Display::Name::SCSIController] = scsiControllers.join(VMManagerDetailSection::sectionSeparator); + + // Hard and floppy disk controllers + QStringList storageControllers; +@@ -864,7 +864,7 @@ VMManagerSystem::setupVars() { + if (storage_config.contains(ide_qua_internal_name) && (storage_config[ide_qua_internal_name].toInt() != 0)) + storageControllers.append(DeviceConfig::DeviceName(hdc_get_device(hdc_get_from_internal_name(ide_qua_internal_name.toUtf8().data())), ide_qua_internal_name.toUtf8().constData(), 1)); + +- display_table[Display::Name::StorageController] = storageControllers.join(VMManagerDetailSection::sectionSeparator); ++ display_table[VMManager::Display::Name::StorageController] = storageControllers.join(VMManagerDetailSection::sectionSeparator); + + // Audio + QStringList sndCards; +@@ -889,7 +889,7 @@ VMManagerSystem::setupVars() { + if(sndCards.isEmpty()) { + sndCards.append(tr("None")); + } +- display_table[Display::Name::Audio] = sndCards.join(VMManagerDetailSection::sectionSeparator); ++ display_table[VMManager::Display::Name::Audio] = sndCards.join(VMManagerDetailSection::sectionSeparator); + + // MIDI + QString midiOutDev; +@@ -901,7 +901,7 @@ VMManagerSystem::setupVars() { + midiOutDev = midiDevName; + } + } +- display_table[Display::Name::MidiOut] = midiOutDev; ++ display_table[VMManager::Display::Name::MidiOut] = midiOutDev; + + // midi_device = mt32 (output) + // mpu401_standalone = 1 +@@ -940,21 +940,21 @@ VMManagerSystem::setupVars() { + if(nicList.isEmpty()) { + nicList.append(tr("None")); + } +- display_table[Display::Name::NIC] = nicList.join(VMManagerDetailSection::sectionSeparator); ++ display_table[VMManager::Display::Name::NIC] = nicList.join(VMManagerDetailSection::sectionSeparator); + + // Input (Keyboard) + if (input_config.contains("keyboard_type")) { + auto keyboard_internal_name = input_config["keyboard_type"]; + auto keyboard_dev = keyboard_get_from_internal_name(keyboard_internal_name.toUtf8().data()); + auto keyboard_dev_name = DeviceConfig::DeviceName(keyboard_get_device(keyboard_dev), keyboard_get_internal_name(keyboard_dev), 0); +- display_table[Display::Name::Keyboard] = keyboard_dev_name; ++ display_table[VMManager::Display::Name::Keyboard] = keyboard_dev_name; + } + + // Input (Mouse) + auto mouse_internal_name = input_config["mouse_type"]; + auto mouse_dev = mouse_get_from_internal_name(mouse_internal_name.toUtf8().data()); + auto mouse_dev_name = DeviceConfig::DeviceName(mouse_get_device(mouse_dev), mouse_get_internal_name(mouse_dev), 0); +- display_table[Display::Name::Mouse] = mouse_dev_name; ++ display_table[VMManager::Display::Name::Mouse] = mouse_dev_name; + + // Input (joystick) + QString joystickDevice; +@@ -965,7 +965,7 @@ VMManagerSystem::setupVars() { + joystickDevice = joystickName; + } + } +- display_table[Display::Name::Joystick] = joystickDevice; ++ display_table[VMManager::Display::Name::Joystick] = joystickDevice; + + // # Ports + // Serial +@@ -1026,8 +1026,8 @@ VMManagerSystem::setupVars() { + if (portIndex == PARALLEL_MAX) + break; + } +- display_table[Display::Name::Serial] = (serialFinal.empty() ? tr("None") : serialFinal.join(", ")); +- display_table[Display::Name::Parallel] = (lptFinal.empty() ? tr("None") : lptFinal.join((hasLptDevices ? VMManagerDetailSection::sectionSeparator : ", "))); ++ display_table[VMManager::Display::Name::Serial] = (serialFinal.empty() ? tr("None") : serialFinal.join(", ")); ++ display_table[VMManager::Display::Name::Parallel] = (lptFinal.empty() ? tr("None") : lptFinal.join((hasLptDevices ? VMManagerDetailSection::sectionSeparator : ", "))); + + // ISA RTC + QString isartc_dev_name = ""; +@@ -1036,7 +1036,7 @@ VMManagerSystem::setupVars() { + auto isartc_dev = isartc_get_from_internal_name(isartc_internal_name.toUtf8().data()); + isartc_dev_name = DeviceConfig::DeviceName(isartc_get_device(isartc_dev), isartc_get_internal_name(isartc_dev), 0); + } +- display_table[Display::Name::IsaRtc] = isartc_dev_name; ++ display_table[VMManager::Display::Name::IsaRtc] = isartc_dev_name; + + // ISA RAM + QStringList IsaMemCards; +@@ -1053,7 +1053,7 @@ VMManagerSystem::setupVars() { + } + } + } +- display_table[Display::Name::IsaMem] = IsaMemCards.join(VMManagerDetailSection::sectionSeparator); ++ display_table[VMManager::Display::Name::IsaMem] = IsaMemCards.join(VMManagerDetailSection::sectionSeparator); + + // ISA ROM + QStringList IsaRomCards; +@@ -1070,7 +1070,7 @@ VMManagerSystem::setupVars() { + } + } + } +- display_table[Display::Name::IsaRom] = IsaRomCards.join(VMManagerDetailSection::sectionSeparator); ++ display_table[VMManager::Display::Name::IsaRom] = IsaRomCards.join(VMManagerDetailSection::sectionSeparator); + } + + bool +@@ -1119,7 +1119,7 @@ QString + processStatusChanged(); + } + QString +-VMManagerSystem::getDisplayValue(Display::Name key) ++VMManagerSystem::getDisplayValue(VMManager::Display::Name key) + { + return (display_table.contains(key)) ? display_table[key] : ""; + } diff --git a/emulators/86Box/files/patch-src_video_CMakeLists.txt b/emulators/86Box/files/patch-src_video_CMakeLists.txt new file mode 100644 index 000000000000..36e929c16c4b --- /dev/null +++ b/emulators/86Box/files/patch-src_video_CMakeLists.txt @@ -0,0 +1,11 @@ +--- src/video/CMakeLists.txt.orig 2025-08-24 18:56:26 UTC ++++ src/video/CMakeLists.txt +@@ -143,6 +143,8 @@ add_library(vid OBJECT + + ) + ++target_include_directories(vid PRIVATE /usr/local/include) ++ + if(G100) + target_compile_definitions(vid PRIVATE USE_G100) + endif() diff --git a/emulators/Makefile b/emulators/Makefile index 266c35f64e87..bdd2eb0d4009 100644 --- a/emulators/Makefile +++ b/emulators/Makefile @@ -1,6 +1,7 @@ COMMENT = Emulators for other operating systems SUBDIR += 86Box + SUBDIR += Ymir SUBDIR += adamem SUBDIR += almostti SUBDIR += anese @@ -157,6 +158,7 @@ SUBDIR += virtualbox-ose SUBDIR += virtualbox-ose-70 SUBDIR += virtualbox-ose-71 + SUBDIR += virtualbox-ose-72 SUBDIR += virtualbox-ose-additions SUBDIR += virtualbox-ose-additions-legacy SUBDIR += virtualbox-ose-additions-nox11 @@ -164,11 +166,13 @@ SUBDIR += virtualbox-ose-kmod SUBDIR += virtualbox-ose-kmod-70 SUBDIR += virtualbox-ose-kmod-71 + SUBDIR += virtualbox-ose-kmod-72 SUBDIR += virtualbox-ose-kmod-legacy SUBDIR += virtualbox-ose-legacy SUBDIR += virtualbox-ose-nox11 SUBDIR += virtualbox-ose-nox11-70 SUBDIR += virtualbox-ose-nox11-71 + SUBDIR += virtualbox-ose-nox11-72 SUBDIR += virtualbox-ose-nox11-legacy SUBDIR += visualboyadvance-m SUBDIR += vmips diff --git a/emulators/Ymir/Makefile b/emulators/Ymir/Makefile new file mode 100644 index 000000000000..b6cfa0301e45 --- /dev/null +++ b/emulators/Ymir/Makefile @@ -0,0 +1,93 @@ +PORTNAME= Ymir +DISTVERSIONPREFIX= v +DISTVERSION= 0.1.7 +CATEGORIES= emulators + +MAINTAINER= bsdcode@disroot.org +COMMENT= Sega Saturn emulator +WWW= https://github.com/StrikerX3/Ymir/ + +LICENSE= GPLv3 +LICENSE_FILE= ${WRKSRC}/LICENSE + +ONLY_FOR_ARCHS= aarch64 amd64 +ONLY_FOR_ARCHS_REASON= upstream only supports aarch64 and amd64 + +BUILD_DEPENDS= cereal>0:devel/cereal \ + concurrentqueue>0:devel/concurrentqueue \ + cxxopts>0:devel/cxxopts \ + glslangValidator:graphics/glslang \ + glslc:graphics/shaderc \ + stb>0:devel/stb \ + tomlplusplus>0:devel/tomlplusplus \ + vulkan-headers>0:graphics/vulkan-headers +LIB_DEPENDS= libchdr.so:devel/libchdr \ + libfmt.so:devel/libfmt \ + libglfw.so:graphics/glfw \ + libimgui.so:x11-toolkits/imgui \ + liblz4.so:archivers/liblz4 \ + librtmidi.so:audio/rtmidi \ + libvulkan.so:graphics/vulkan-loader \ + libxxhash.so:devel/xxhash + +FLAVORS= gtk3 gtk4 +FLAVOR?= ${FLAVORS:[1]} +gtk4_PKGNAMESUFFIX= -gtk4 +_gtk3_BR_DEPENDS= zenity:x11/zenity +_gtk4_BR_DEPENDS= zenity:x11/zenity4 +${FLAVOR}_BUILD_DEPENDS= ${_${FLAVOR}_BR_DEPENDS} +${FLAVOR}_RUN_DEPENDS= ${_${FLAVOR}_BR_DEPENDS} + +USES= cmake compiler:c++20-lang desktop-file-utils gl \ + llvm${_LLVM_${ARCH}} pkgconfig sdl xorg +_LLVM_aarch64= :min=21 +USE_GITHUB= yes +GH_ACCOUNT= StrikerX3 +GH_TUPLE= StrikerX3:mio:c9dbe3a6f74b2c2c4a6c9621005c3df213a33eaa:mio/vendor/mio +USE_GL= glut +USE_SDL= sdl3 +USE_XORG= xi xmu + +CMAKE_OFF= Ymir_DEV_BUILD \ + Ymir_ENABLE_IMGUI_DEMO \ + Ymir_ENABLE_SANDBOX \ + Ymir_ENABLE_TESTS \ + Ymir_INCLUDE_PACKAGING \ + Ymir_SHARED_LIBS + +CFLAGS+= -I${LOCALBASE}/include/concurrentqueue/moodycamel \ + -I${LOCALBASE}/include/stb \ + -I${WRKSRC}/vendor/imgui/ymir + +PLIST_FILES= bin/ymir-sdl3 \ + share/applications/io.github.strikerx3.ymir.desktop \ + share/icons/hicolor/256x256/apps/ymir.png \ + share/metainfo/io.github.strikerx3.ymir.xml + +OPTIONS_DEFINE= LTO YMDASM +OPTIONS_DEFAULT= LTO + +YMDASM_DESC= Include Ymir disassembly tool + +LTO_CMAKE_BOOL= Ymir_ENABLE_IPO + +YMDASM_CMAKE_BOOL= Ymir_ENABLE_YMDASM +YMDASM_PLIST_FILES= bin/ymdasm + +post-install: + ${INSTALL_PROGRAM} ${INSTALL_WRKSRC}/apps/ymir-sdl3/ymir-sdl3-${DISTVERSION} \ + ${STAGEDIR}${PREFIX}/bin/ymir-sdl3 + ${INSTALL_DATA} ${WRKSRC}/apps/ymir-sdl3/res/io.github.strikerx3.ymir.desktop \ + ${STAGEDIR}${DESKTOPDIR} + ${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/256x256/apps \ + ${STAGEDIR}${PREFIX}/share/metainfo + ${INSTALL_DATA} ${WRKSRC}/apps/ymir-sdl3/res/ymir.png \ + ${STAGEDIR}${PREFIX}/share/icons/hicolor/256x256/apps + ${INSTALL_DATA} ${WRKSRC}/apps/ymir-sdl3/res/io.github.strikerx3.ymir.xml \ + ${STAGEDIR}${PREFIX}/share/metainfo + +post-install-YMDASM-on: + ${INSTALL_PROGRAM} ${INSTALL_WRKSRC}/apps/ymdasm/ymdasm-${DISTVERSION} \ + ${STAGEDIR}${PREFIX}/bin/ymdasm + +.include <bsd.port.mk> diff --git a/emulators/Ymir/distinfo b/emulators/Ymir/distinfo new file mode 100644 index 000000000000..78b5b3eb2cee --- /dev/null +++ b/emulators/Ymir/distinfo @@ -0,0 +1,5 @@ +TIMESTAMP = 1754870707 +SHA256 (StrikerX3-Ymir-v0.1.7_GH0.tar.gz) = 8453407de50a4abef05c985f4eabf32b5185bf5a651583d250f820ff60bae93a +SIZE (StrikerX3-Ymir-v0.1.7_GH0.tar.gz) = 5431708 +SHA256 (StrikerX3-mio-c9dbe3a6f74b2c2c4a6c9621005c3df213a33eaa_GH0.tar.gz) = 384d3a3ee249ebda0766fa5dc9f8bc5a871c8b2e3d3eedf46f330e6350058738 +SIZE (StrikerX3-mio-c9dbe3a6f74b2c2c4a6c9621005c3df213a33eaa_GH0.tar.gz) = 34871 diff --git a/emulators/Ymir/files/patch-apps_ymir-sdl3_CMakeLists.txt b/emulators/Ymir/files/patch-apps_ymir-sdl3_CMakeLists.txt new file mode 100644 index 000000000000..e18e7f768ee3 --- /dev/null +++ b/emulators/Ymir/files/patch-apps_ymir-sdl3_CMakeLists.txt @@ -0,0 +1,11 @@ +--- apps/ymir-sdl3/CMakeLists.txt.orig 2025-07-20 22:35:27 UTC ++++ apps/ymir-sdl3/CMakeLists.txt +@@ -256,7 +256,7 @@ target_link_libraries(ymir-sdl3 PRIVATE + fmt + cxxopts + imgui::imgui +- tomlplusplus::tomlplusplus ++# tomlplusplus::tomlplusplus + cereal::cereal + lz4::lz4 + stb::stb diff --git a/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_app.cpp b/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_app.cpp new file mode 100644 index 000000000000..fc08ed1ec905 --- /dev/null +++ b/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_app.cpp @@ -0,0 +1,13 @@ +--- apps/ymir-sdl3/src/app/app.cpp.orig 2025-08-11 00:12:19 UTC ++++ apps/ymir-sdl3/src/app/app.cpp +@@ -114,8 +114,8 @@ + #include <SDL3/SDL_messagebox.h> + #include <SDL3/SDL_misc.h> + +-#include <backends/imgui_impl_sdl3.h> +-#include <backends/imgui_impl_sdlrenderer3.h> ++#include <imgui_impl_sdl3.h> ++#include <imgui_impl_sdlrenderer3.h> + + #include <imgui.h> + diff --git a/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_ui_views_settings_cartridge__settings__view.cpp b/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_ui_views_settings_cartridge__settings__view.cpp new file mode 100644 index 000000000000..1111d91b86b1 --- /dev/null +++ b/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_ui_views_settings_cartridge__settings__view.cpp @@ -0,0 +1,11 @@ +--- apps/ymir-sdl3/src/app/ui/views/settings/cartridge_settings_view.cpp.orig 2025-07-20 22:35:27 UTC ++++ apps/ymir-sdl3/src/app/ui/views/settings/cartridge_settings_view.cpp +@@ -13,7 +13,7 @@ + #include <util/file_loader.hpp> + #include <util/sdl_file_dialog.hpp> + +-#include <misc/cpp/imgui_stdlib.h> ++#include <imgui_stdlib.h> + + #include <fmt/std.h> + diff --git a/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_ui_views_settings_general__settings__view.cpp b/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_ui_views_settings_general__settings__view.cpp new file mode 100644 index 000000000000..1c363ec3b61f --- /dev/null +++ b/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_ui_views_settings_general__settings__view.cpp @@ -0,0 +1,11 @@ +--- apps/ymir-sdl3/src/app/ui/views/settings/general_settings_view.cpp.orig 2025-07-20 22:35:27 UTC ++++ apps/ymir-sdl3/src/app/ui/views/settings/general_settings_view.cpp +@@ -5,7 +5,7 @@ + + #include <app/ui/widgets/common_widgets.hpp> + +-#include <misc/cpp/imgui_stdlib.h> ++#include <imgui_stdlib.h> + + #include <util/math.hpp> + #include <util/sdl_file_dialog.hpp> diff --git a/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_ui_views_settings_ipl__settings__view.cpp b/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_ui_views_settings_ipl__settings__view.cpp new file mode 100644 index 000000000000..b54026493c5c --- /dev/null +++ b/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_ui_views_settings_ipl__settings__view.cpp @@ -0,0 +1,11 @@ +--- apps/ymir-sdl3/src/app/ui/views/settings/ipl_settings_view.cpp.orig 2025-07-20 22:35:27 UTC ++++ apps/ymir-sdl3/src/app/ui/views/settings/ipl_settings_view.cpp +@@ -4,7 +4,7 @@ + + #include <util/sdl_file_dialog.hpp> + +-#include <misc/cpp/imgui_stdlib.h> ++#include <imgui_stdlib.h> + + #include <SDL3/SDL_misc.h> + diff --git a/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_ui_views_settings_system__settings__view.cpp b/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_ui_views_settings_system__settings__view.cpp new file mode 100644 index 000000000000..dfde2460d6de --- /dev/null +++ b/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_ui_views_settings_system__settings__view.cpp @@ -0,0 +1,11 @@ +--- apps/ymir-sdl3/src/app/ui/views/settings/system_settings_view.cpp.orig 2025-07-20 22:35:27 UTC ++++ apps/ymir-sdl3/src/app/ui/views/settings/system_settings_view.cpp +@@ -11,7 +11,7 @@ + #include <util/regions.hpp> + #include <util/sdl_file_dialog.hpp> + +-#include <misc/cpp/imgui_stdlib.h> ++#include <imgui_stdlib.h> + + #include <ymir/util/size_ops.hpp> + diff --git a/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_ui_views_settings_tweaks__settings__view.cpp b/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_ui_views_settings_tweaks__settings__view.cpp new file mode 100644 index 000000000000..65fa660f361e --- /dev/null +++ b/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_ui_views_settings_tweaks__settings__view.cpp @@ -0,0 +1,11 @@ +--- apps/ymir-sdl3/src/app/ui/views/settings/tweaks_settings_view.cpp.orig 2025-07-20 22:35:27 UTC ++++ apps/ymir-sdl3/src/app/ui/views/settings/tweaks_settings_view.cpp +@@ -4,7 +4,7 @@ + + #include <app/events/emu_event_factory.hpp> + +-#include <misc/cpp/imgui_stdlib.h> ++#include <imgui_stdlib.h> + + #include <SDL3/SDL_clipboard.h> + diff --git a/emulators/Ymir/files/patch-libs_ymir-core_CMakeLists.txt b/emulators/Ymir/files/patch-libs_ymir-core_CMakeLists.txt new file mode 100644 index 000000000000..2c971a407b7a --- /dev/null +++ b/emulators/Ymir/files/patch-libs_ymir-core_CMakeLists.txt @@ -0,0 +1,13 @@ +--- libs/ymir-core/CMakeLists.txt.orig 2025-07-20 22:35:27 UTC ++++ libs/ymir-core/CMakeLists.txt +@@ -239,7 +239,10 @@ target_compile_features(ymir-core PUBLIC cxx_std_20) + target_compile_features(ymir-core PUBLIC cxx_std_20) + + ## Add dependencies ++find_package(Threads REQUIRED) ++ + target_link_libraries(ymir-core PUBLIC ++ Threads::Threads + fmt + mio + concurrentqueue diff --git a/emulators/Ymir/files/patch-vendor_CMakeLists.txt b/emulators/Ymir/files/patch-vendor_CMakeLists.txt new file mode 100644 index 000000000000..c6c095066435 --- /dev/null +++ b/emulators/Ymir/files/patch-vendor_CMakeLists.txt @@ -0,0 +1,100 @@ +--- vendor/CMakeLists.txt.orig 2025-07-20 22:35:27 UTC ++++ vendor/CMakeLists.txt +@@ -22,9 +22,12 @@ message(STATUS "Adding vendored libraries") + + message(STATUS "Adding vendored libraries") + ++find_package(PkgConfig REQUIRED) ++ + # {fmt} - https://github.com/fmtlib/fmt + message(STATUS "==> {fmt}") +-add_subdirectory(fmt EXCLUDE_FROM_ALL) ++pkg_check_modules(fmt REQUIRED IMPORTED_TARGET GLOBAL fmt) ++add_library(fmt ALIAS PkgConfig::fmt) + + # mio - https://github.com/vimpunk/mio + # Notes: +@@ -36,65 +39,55 @@ message(STATUS "==> SDL") + + # SDL - https://github.com/libsdl-org/SDL + message(STATUS "==> SDL") +-set(SDL_DISABLE_UNINSTALL ON) +-set(SDL_TEST_LIBRARY OFF) +-set(SDL_TESTS OFF) +-set(SDL_EXAMPLES OFF) +-if (BUILD_SHARED_LIBS) +- set(SDL_SHARED ON) +- set(SDL_STATIC OFF) +-else () +- set(SDL_SHARED OFF) +- set(SDL_STATIC ON) +-endif () +-add_subdirectory_quiet(SDL EXCLUDE_FROM_ALL) ++find_package(SDL3 REQUIRED GLOBAL) + + # cxxopts - https://github.com/jarro2783/cxxopts + message(STATUS "==> cxxopts") +-add_subdirectory(cxxopts EXCLUDE_FROM_ALL) ++find_package(cxxopts REQUIRED GLOBAL) ++add_library(cxxopts ALIAS cxxopts::cxxopts) + + # concurrentqueue - https://github.com/cameron314/concurrentqueue + message(STATUS "==> concurrentqueue") +-add_subdirectory(concurrentqueue EXCLUDE_FROM_ALL) ++find_package(concurrentqueue REQUIRED GLOBAL) ++add_library(concurrentqueue ALIAS concurrentqueue::concurrentqueue) + + # dear ImGui - https://github.com/ocornut/imgui + # docking branch + message(STATUS "==> dear ImGui") +-add_subdirectory(imgui EXCLUDE_FROM_ALL) ++find_package(imgui REQUIRED GLOBAL) + + # toml++ - https://github.com/marzer/tomlplusplus + message(STATUS "==> toml++") +-add_subdirectory(tomlplusplus EXCLUDE_FROM_ALL) ++find_package(tomlplusplus REQUIRED GLOBAL) + + # xxHash - https://github.com/Cyan4973/xxHash + message(STATUS "==> xxHash") +-add_subdirectory(xxHash EXCLUDE_FROM_ALL) ++pkg_check_modules(libxxhash REQUIRED IMPORTED_TARGET GLOBAL libxxhash) ++add_library(xxHash::xxHash ALIAS PkgConfig::libxxhash) + + # lz4 - https://github.com/lz4/lz4 + message(STATUS "==> lz4") +-add_subdirectory(lz4 EXCLUDE_FROM_ALL) ++pkg_check_modules(liblz4 REQUIRED IMPORTED_TARGET GLOBAL liblz4) ++add_library(lz4::lz4 ALIAS PkgConfig::liblz4) + + # cereal - https://github.com/USCiLab/cereal + message(STATUS "==> cereal") +-set(BUILD_DOC OFF) +-set(BUILD_SANDBOX OFF) +-set(JUST_INSTALL_CEREAL ON) +-add_subdirectory(cereal EXCLUDE_FROM_ALL) ++find_package(cereal REQUIRED GLOBAL) + + # stb - https://github.com/nothings/stb + message(STATUS "==> stb") +-add_subdirectory(stb) ++add_library(stb INTERFACE) ++add_library(stb::stb ALIAS stb) + + # libchdr - https://github.com/rtissera/libchdr + message(STATUS "==> libchdr") +-set(BUILD_FUZZER OFF) +-add_subdirectory(libchdr) ++pkg_check_modules(libchdr REQUIRED IMPORTED_TARGET GLOBAL libchdr) ++add_library(chdr-static ALIAS PkgConfig::libchdr) + + # rtmidi - https://github.com/thestk/rtmidi + message(STATUS "==> rtmidi") +-set(RTMIDI_BUILD_STATIC_LIBS ON) +-set(RTMIDI_BUILD_TESTING OFF) +-add_subdirectory(rtmidi) ++pkg_check_modules(rtmidi REQUIRED IMPORTED_TARGET GLOBAL rtmidi) ++add_library(rtmidi ALIAS PkgConfig::rtmidi) + + # -------------------------------------------------------------------------------------------------- + # Test dependencies diff --git a/emulators/Ymir/files/patch-vendor_mio_include_mio_detail_mmap.ipp b/emulators/Ymir/files/patch-vendor_mio_include_mio_detail_mmap.ipp new file mode 100644 index 000000000000..cf610729c0d1 --- /dev/null +++ b/emulators/Ymir/files/patch-vendor_mio_include_mio_detail_mmap.ipp @@ -0,0 +1,13 @@ +https://github.com/vimpunk/mio/issues/110 + +--- vendor/mio/include/mio/detail/mmap.ipp.orig 2025-02-12 00:14:41 UTC ++++ vendor/mio/include/mio/detail/mmap.ipp +@@ -208,7 +208,7 @@ inline mmap_context memory_map(const file_handle_type + char* mapping_start = static_cast<char*>(::mmap( + 0, // Don't give hint as to where to map. + length_to_map, +- mode == access_mode::read ? PROT_READ : PROT_WRITE, ++ mode == access_mode::read ? PROT_READ : PROT_READ | PROT_WRITE, + mode == access_mode::copy_on_write ? MAP_PRIVATE : MAP_SHARED, + file_handle, + aligned_offset)); diff --git a/emulators/Ymir/pkg-descr b/emulators/Ymir/pkg-descr new file mode 100644 index 000000000000..2eae362fc391 --- /dev/null +++ b/emulators/Ymir/pkg-descr @@ -0,0 +1,16 @@ +Ymir is a Sega Saturn emulator with the following features: + +- Load games from MAME CHD, BIN+CUE, IMG+CCD, MDF+MDS or ISO files +- Automatic IPL (BIOS) ROM detection +- Automatic region switching +- Up to two players with standard Control Pads or 3D Control Pads on both ports +- Fully customizable keybindings +- Backup RAM, DRAM and ROM cartridges +- Integrated backup memory manager to import and export saves, and transfer + between internal and cartridge RAM +- Save states +- Rewinding (up to one minute at 60 fps), turbo speed, frame step (forwards and + backwards) +- Full screen mode with VRR support and low input lag +- Optional deinterlaced/progressive rendering of high resolution modes +- A feature-rich debugger diff --git a/emulators/ares/Makefile b/emulators/ares/Makefile index 6ec6dc0301ee..0ce6c3aaf5c9 100644 --- a/emulators/ares/Makefile +++ b/emulators/ares/Makefile @@ -1,8 +1,10 @@ PORTNAME= ares DISTVERSIONPREFIX= v -DISTVERSION= 144 -PORTREVISION= 1 +DISTVERSION= 146 CATEGORIES= emulators +MASTER_SITES= https://github.com/${PORTNAME}-emulator/${PORTNAME}/releases/download/${DISTVERSIONFULL}/ +DISTNAME= ${PORTNAME}-source +DIST_SUBDIR= ${PORTNAME}-${DISTVERSION} MAINTAINER= bsdcode@disroot.org COMMENT= Multi-system emulator @@ -14,24 +16,29 @@ LICENSE_FILE= ${WRKSRC}/LICENSE BUILD_DEPENDS= librashader>0:devel/librashader USES= cmake compiler:c++17-lang gl gnome pkgconfig xorg -USE_GITHUB= yes -GH_ACCOUNT= ares-emulator USE_GL= opengl USE_GNOME= gtk30 USE_XORG= x11 xext xrandr xrender CMAKE_ARGS= -DARES_CORES="${_CORES:S/ /;/gW}" \ - -DARES_VERSION_OVERRIDE=${DISTVERSIONFULL} \ -DENABLE_CCACHE=${CCACHE_ENABLED} -CMAKE_ON= ARES_SKIP_DEPS \ +CMAKE_ON= ARES_BUILD_OFFICIAL \ + ARES_SKIP_DEPS \ ARES_UNITY_CORES CMAKE_OFF= ARES_BUILD_LOCAL \ ARES_BUNDLE_SHADERS \ ARES_ENABLE_MINIMUM_CPU -EXTRACT_AFTER_ARGS= --exclude thirdparty/librashader \ +EXTRACT_AFTER_ARGS= --exclude thirdparty/GL \ + --exclude thirdparty/KHR \ + --exclude thirdparty/libchdr \ + --exclude thirdparty/librashader \ + --exclude thirdparty/sse2neon.h \ + --exclude thirdparty/xxhash.h \ --no-same-owner --no-same-permissions +NO_WRKSUBDIR= yes + OPTIONS_DEFINE= CHD SDL TOOLS OPTIONS_DEFAULT= A26 ALSA AO CHD CV FC GB GBA LIBRASHADER \ LIBRETRO LTO MD MS MSX MYVISION N64 NG NGP \ @@ -62,7 +69,7 @@ GBA_DESC= Game Boy Advance GB_DESC= Game Boy / Game Boy Color HOTKEYS_DESC= Inofficial hotkeys locking patch LIBRASHADER_DESC= Slang-shader support via librashader -LIBRETRO_DESC= Install slang-shaders from libretro +LIBRETRO_DESC= Install slang-shaders from libretro (implies ${LIBRETRO_IMPLIES}) MD_DESC= Sega Mega Drive / Genesis MSX_DESC= Microsoft MSX MS_DESC= Sega Master System / Mark III @@ -90,8 +97,9 @@ ALSA_CMAKE_BOOL= ARES_ENABLE_ALSA AO_LIB_DEPENDS= libao.so:audio/libao AO_CMAKE_BOOL= ARES_ENABLE_AO -CHD_CMAKE_BOOL= ARES_ENABLE_CHD \ - WITH_SYSTEM_ZLIB +CHD_LIB_DEPENDS= libchdr.so:devel/libchdr +CHD_USES= localbase +CHD_CMAKE_BOOL= ARES_ENABLE_CHD CV_VARS= _CORES+=cv @@ -113,6 +121,8 @@ LIBRETRO_RUN_DEPENDS= ${_LIBRETRO_BR_DEPENDS} LTO_CMAKE_BOOL= ENABLE_IPO +MD_BUILD_DEPENDS= xxhash>0:devel/xxhash +MD_USES= localbase MD_VARS= _CORES+=md MSX_VARS= _CORES+=msx @@ -122,8 +132,12 @@ MS_VARS= _CORES+=ms MYVISION_VARS= _CORES+=myvision _N64_BR_DEPENDS= vulkan-loader>0:graphics/vulkan-loader -N64_BUILD_DEPENDS= ${_N64_BR_DEPENDS} +_N64_BUILD_DEPENDS_aarch64= sse2neon>0:devel/sse2neon +N64_BUILD_DEPENDS= ${_N64_BR_DEPENDS} \ + ${_N64_BUILD_DEPENDS_${ARCH}} \ + xxhash>0:devel/xxhash N64_RUN_DEPENDS= ${_N64_BR_DEPENDS} +N64_USES= localbase N64_VARS= _CORES+=n64 NGP_VARS= _CORES+=ngp @@ -164,6 +178,20 @@ USBHID_CMAKE_BOOL= ARES_ENABLE_USBHID WS_VARS= _CORES+=ws +.include <bsd.port.options.mk> + +.if ${PORT_OPTIONS:MTOOLS} && (${PORT_OPTIONS:MGBA} || ${PORT_OPTIONS:MSFC}) +PLIST_SUB+= TOOLSARM7TDMI="" +.else +PLIST_SUB+= TOOLSARM7TDMI="@comment " +.endif + +.if ${PORT_OPTIONS:MTOOLS} && (${PORT_OPTIONS:MMD} || ${PORT_OPTIONS:MNG}) +PLIST_SUB+= TOOLSM68000="" +.else +PLIST_SUB+= TOOLSM68000="@comment " +.endif + post-patch: ${REINPLACE_CMD} 's|/usr/local|${LOCALBASE}|g' \ ${WRKSRC}/cmake/finders/* diff --git a/emulators/ares/distinfo b/emulators/ares/distinfo index 67421c24b118..5cdf41f6260d 100644 --- a/emulators/ares/distinfo +++ b/emulators/ares/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1745841018 -SHA256 (ares-emulator-ares-v144_GH0.tar.gz) = 8d66fc880375293aaddbff575f21571ed9c7bc05bd5dd0e8e9ea65b104d5a458 -SIZE (ares-emulator-ares-v144_GH0.tar.gz) = 8959609 +TIMESTAMP = 1756454355 +SHA256 (ares-146/ares-source.tar.gz) = 0f0b878c19ce09dab57584235e9c639c4c14a0bd1de6cef50238f006bd797bf1 +SIZE (ares-146/ares-source.tar.gz) = 9021617 diff --git a/emulators/ares/files/patch-thirdparty_CMakeLists.txt b/emulators/ares/files/patch-thirdparty_CMakeLists.txt new file mode 100644 index 000000000000..0a9b749623bd --- /dev/null +++ b/emulators/ares/files/patch-thirdparty_CMakeLists.txt @@ -0,0 +1,75 @@ +--- thirdparty/CMakeLists.txt.orig 2025-08-27 21:41:50 UTC ++++ thirdparty/CMakeLists.txt +@@ -7,55 +7,9 @@ if(ARES_ENABLE_CHD) + option(ARES_ENABLE_CHD "Enable CHD format support via libchdr" ON) + + if(ARES_ENABLE_CHD) +- # lzma +- add_subdirectory(libchdr/deps/lzma-24.05 EXCLUDE_FROM_ALL) +- list(APPEND CHDR_LIBS lzma) +- list(APPEND CHDR_INCLUDES lzma) +- +- if(OS_MACOS) +- option(WITH_SYSTEM_ZLIB "Use system zlib" ON) +- endif() +- # zlib +- if(WITH_SYSTEM_ZLIB) +- find_package(ZLIB REQUIRED) +- list(APPEND PLATFORM_LIBS ZLIB::ZLIB) +- else() +- option(ZLIB_BUILD_EXAMPLES "Enable Zlib Examples" OFF) +- add_subdirectory(libchdr/deps/zlib-1.3.1 EXCLUDE_FROM_ALL) +- set_target_properties( +- zlibstatic +- PROPERTIES POSITION_INDEPENDENT_CODE ON FOLDER thirdparty PREFIX "" +- ) +- list(APPEND CHDR_LIBS zlibstatic) +- endif() +- +- # zstd +- option(ZSTD_BUILD_SHARED "BUILD SHARED LIBRARIES" OFF) +- option(ZSTD_BUILD_PROGRAMS "BUILD PROGRAMS" OFF) +- add_subdirectory(libchdr/deps/zstd-1.5.6/build/cmake EXCLUDE_FROM_ALL) +- list(APPEND CHDR_LIBS libzstd_static) +- #-------------------------------------------------- +- # chdr +- #-------------------------------------------------- +- +- set( +- CHDR_SOURCES +- libchdr/src/libchdr_bitstream.c +- libchdr/src/libchdr_cdrom.c +- libchdr/src/libchdr_chd.c +- libchdr/src/libchdr_flac.c +- libchdr/src/libchdr_huffman.c +- ) +- +- list(APPEND CHDR_INCLUDES ${CMAKE_CURRENT_BINARY_DIR}/libchdr/include) +- +- add_library(chdr-static STATIC ${CHDR_SOURCES}) +- target_include_directories(chdr-static PUBLIC ${CHDR_INCLUDES} PUBLIC libchdr/include) +- target_link_libraries(chdr-static PRIVATE ${CHDR_LIBS} ${PLATFORM_LIBS}) +- target_compile_options( +- chdr-static +- PRIVATE $<$<CXX_COMPILER_ID:Clang,AppleClang>:-Wno-unreachable-code -Wno-unused-function> +- ) ++ find_package(PkgConfig REQUIRED) ++ pkg_check_modules(libchdr REQUIRED IMPORTED_TARGET GLOBAL libchdr) ++ add_library(chdr-static ALIAS PkgConfig::libchdr) + endif() + + add_library( +@@ -111,12 +65,4 @@ set_target_properties(sljit PROPERTIES FOLDER thirdpar + set_target_properties(ymfm PROPERTIES FOLDER thirdparty PREFIX "") + set_target_properties(tzxfile PROPERTIES FOLDER thirdparty PREFIX "") + set_target_properties(sljit PROPERTIES FOLDER thirdparty PREFIX "") +-if(ARES_ENABLE_CHD) +- set_target_properties(chdr-static PROPERTIES FOLDER thirdparty PREFIX "") +- if(NOT WITH_SYSTEM_ZLIB) +- set_target_properties(zlib PROPERTIES FOLDER thirdparty PREFIX "") +- endif() +- set_target_properties(lzma PROPERTIES FOLDER thirdparty PREFIX "") +- set_target_properties(libzstd_static PROPERTIES FOLDER thirdparty PREFIX "") +-endif() + set_target_properties(qon PROPERTIES FOLDER thirdparty PREFIX "") +\ No newline at end of file diff --git a/emulators/ares/pkg-descr b/emulators/ares/pkg-descr index 1d1df5876394..51eba6b65b62 100644 --- a/emulators/ares/pkg-descr +++ b/emulators/ares/pkg-descr @@ -3,14 +3,15 @@ preservation. It is a descendant of the emulators higan and bsnes. It's source code is structured to be maximally readable and self-documenting. ares supports the following systems: Arcade, WonderSwan, WonderSwan Color, -Pocket Challenge V2, ColecoVision, PC-Engine / TurboGrafx, SuperGrafx, My -Vision, NES / Famicom, Famicom Disk System, SNES / Super Famicom, Satellaview, -Sufami Turbo, Nintendo 64, Nintendo 64DD, Game Boy, Game Boy Color, Game Boy -Advance, SG-1000, Master System / Mark III, Mega Drive / Genesis, Mega CD, 32X, -Game Gear, Neo Geo Pocket, Neo Geo Pocket Color +Pocket Challenge V2, ColecoVision, PC-Engine / TurboGrafx, PC-Engine SuperGrafx, +My Vision, NES / Famicom, Famicom Disk System, Game Boy, SNES / Super Famicom, +Satellaview, Nintendo 64, SuFami Turbo, Game Boy Color, Nintendo 64DD, Game Boy +Advance, SG-1000, Master System / Mark III, Mega Drive / Genesis, Game Gear, +Mega CD, 32X, Neo Geo Pocket, Neo Geo Pocket Color ares has experimental support for the following systems: Atari 2600, MSX, MSX2, -PC-Engine CD / TurboGrafx CD, ZX Spectrum, Neo Geo (AES/MVS), PlayStation +PC-Engine CD / TurboGrafx CD, LaserActive, ZX Spectrum, Neo Geo (AES/MVS), +PlayStation ares has all the features one would expect from a great emulator system: native multi-platform UI, dynamic rate control, save states, run-ahead, rewind and diff --git a/emulators/ares/pkg-plist b/emulators/ares/pkg-plist index 035623ec753e..476ac9756832 100644 --- a/emulators/ares/pkg-plist +++ b/emulators/ares/pkg-plist @@ -1,8 +1,8 @@ bin/ares -%%TOOLS%%bin/arm7tdmi +%%TOOLSARM7TDMI%%bin/arm7tdmi %%TOOLS%%bin/genius %%TOOLS%%bin/i8080 -%%TOOLS%%bin/m68000 +%%TOOLSM68000%%bin/m68000 %%TOOLS%%bin/mame2bml %%TOOLS%%bin/mia bin/sourcery diff --git a/emulators/citra/Makefile b/emulators/citra/Makefile index 5db1b3bb3ee3..56bda1777a87 100644 --- a/emulators/citra/Makefile +++ b/emulators/citra/Makefile @@ -104,7 +104,7 @@ post-patch: .endif post-configure: - @${CP} ${DISTFILES:M*\:gamedb:C/\:.*//:S,^,${_DISTDIR},} \ + @${CP} ${DISTFILES:M*\:gamedb:C/\:.*//:S,^,${DISTDIR}/,} \ ${BUILD_WRKSRC}/dist/compatibility_list/ .include <bsd.port.post.mk> diff --git a/emulators/dolphin-emu/Makefile b/emulators/dolphin-emu/Makefile index 71612ba87946..28a4114b8714 100644 --- a/emulators/dolphin-emu/Makefile +++ b/emulators/dolphin-emu/Makefile @@ -1,5 +1,6 @@ PORTNAME= dolphin-emu PORTVERSION= 2506 +PORTREVISION= 1 CATEGORIES= emulators MAINTAINER= martymac@FreeBSD.org diff --git a/emulators/dosbox-staging/Makefile b/emulators/dosbox-staging/Makefile index b013dfafdf98..0b75575cc5de 100644 --- a/emulators/dosbox-staging/Makefile +++ b/emulators/dosbox-staging/Makefile @@ -1,6 +1,7 @@ PORTNAME= dosbox-staging DISTVERSIONPREFIX= v DISTVERSION= 0.82.2 +PORTREVISION= 1 CATEGORIES= emulators MAINTAINER= makc@FreeBSD.org diff --git a/emulators/dosbox-x/files/patch-fix-ffmpeg8 b/emulators/dosbox-x/files/patch-fix-ffmpeg8 new file mode 100644 index 000000000000..7c1782a7b3bd --- /dev/null +++ b/emulators/dosbox-x/files/patch-fix-ffmpeg8 @@ -0,0 +1,88 @@ +Fix build with FFmpeg 8 +https://github.com/joncampbell123/dosbox-x/issues/5803 + +--- src/hardware/hardware.cpp.orig 2025-08-25 08:00:00 UTC ++++ src/hardware/hardware.cpp +@@ -123,20 +123,18 @@ void ffmpeg_closeall() { + ffmpeg_avformat_began = false; + } + avio_close(ffmpeg_fmt_ctx->pb); +- if (ffmpeg_vid_ctx != NULL) avcodec_close(ffmpeg_vid_ctx); +- if (ffmpeg_aud_ctx != NULL) avcodec_close(ffmpeg_aud_ctx); ++ if (ffmpeg_vid_ctx != NULL) avcodec_free_context(&ffmpeg_vid_ctx); ++ if (ffmpeg_aud_ctx != NULL) avcodec_free_context(&ffmpeg_aud_ctx); + avformat_free_context(ffmpeg_fmt_ctx); + ffmpeg_fmt_ctx = NULL; + ffmpeg_vid_ctx = NULL; // NTS: avformat_free_context() freed this for us, don't free again + ffmpeg_aud_ctx = NULL; // NTS: avformat_free_context() freed this for us, don't free again + } + if (ffmpeg_vid_ctx != NULL) { +- avcodec_close(ffmpeg_vid_ctx); + avcodec_free_context(&ffmpeg_vid_ctx); + ffmpeg_vid_ctx = NULL; + } + if (ffmpeg_aud_ctx != NULL) { +- avcodec_close(ffmpeg_aud_ctx); + avcodec_free_context(&ffmpeg_aud_ctx); + ffmpeg_aud_ctx = NULL; + } +@@ -171,7 +169,6 @@ void ffmpeg_audio_frame_send() { + + if (!pkt) E_Exit("Error: Unable to alloc packet"); + +- ffmpeg_aud_frame->key_frame = 1; + ffmpeg_aud_frame->pts = (int64_t)ffmpeg_audio_sample_counter; + r=avcodec_send_frame(ffmpeg_aud_ctx,ffmpeg_aud_frame); + if (r < 0 && r != AVERROR(EAGAIN)) +@@ -426,7 +423,6 @@ void ffmpeg_reopen_video(double fps,const int bpp) { + + void ffmpeg_reopen_video(double fps,const int bpp) { + if (ffmpeg_vid_ctx != NULL) { +- avcodec_close(ffmpeg_vid_ctx); + avcodec_free_context(&ffmpeg_vid_ctx); + ffmpeg_vid_ctx = NULL; + } +@@ -1271,7 +1267,7 @@ skip_shot: + ffmpeg_aud_ctx->sample_rate = (int)capture.video.audiorate; + ffmpeg_aud_ctx->flags = 0; // do not use global headers + ffmpeg_aud_ctx->bit_rate = 320000; +- ffmpeg_aud_ctx->profile = FF_PROFILE_AAC_LOW; ++ // ffmpeg_aud_ctx->profile = FF_PROFILE_AAC_LOW; + + #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(59,24,100) + ffmpeg_aud_ctx->channels = 2; +@@ -1531,7 +1527,6 @@ skip_shot: + + // encode it + ffmpeg_vid_frame->pts = (int64_t)capture.video.frames; // or else libx264 complains about non-monotonic timestamps +- ffmpeg_vid_frame->key_frame = ((capture.video.frames % 15) == 0)?1:0; + + r=avcodec_send_frame(ffmpeg_vid_ctx,ffmpeg_vid_frame); + if (r < 0 && r != AVERROR(EAGAIN)) +@@ -1768,7 +1763,7 @@ skip_mt_wav: + } + + #pragma pack(push,1) +-typedef struct pcap_hdr_struct_t { ++typedef struct { + uint32_t magic_number; /* magic number */ + uint16_t version_major; /* major version number */ + uint16_t version_minor; /* minor version number */ +@@ -1776,14 +1771,14 @@ typedef struct pcap_hdr_struct_t { + uint32_t sigfigs; /* accuracy of timestamps */ + uint32_t snaplen; /* max length of captured packets, in octets */ + uint32_t network; /* data link type */ +-}; ++} pcap_hdr_struct_t; + +-typedef struct pcaprec_hdr_struct_t { ++typedef struct { + uint32_t ts_sec; /* timestamp seconds */ + uint32_t ts_usec; /* timestamp microseconds */ + uint32_t incl_len; /* number of octets of packet saved in file */ + uint32_t orig_len; /* actual length of packet */ +-}; ++} pcaprec_hdr_struct_t; + #pragma pack(pop) + + void Capture_WritePacket(bool /*send*/,const unsigned char *buf,size_t len) { diff --git a/emulators/dps8m/Makefile b/emulators/dps8m/Makefile index 748efbfd4bd4..59c203adf4e2 100644 --- a/emulators/dps8m/Makefile +++ b/emulators/dps8m/Makefile @@ -1,7 +1,6 @@ PORTNAME= dps8m DISTVERSIONPREFIX= R -DISTVERSION= 3.0.1 -PORTREVISION= 1 +DISTVERSION= 3.1.0 CATEGORIES= emulators MAINTAINER= gspurki@gmail.com diff --git a/emulators/dps8m/distinfo b/emulators/dps8m/distinfo index 3385ea725cbb..1da2f3f4a6e5 100644 --- a/emulators/dps8m/distinfo +++ b/emulators/dps8m/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1691794269 -SHA256 (dps8m-R3.0.1.tar.bz2) = 583b2e333f094d5e2a5139c832d5aa907455be34edf61560590ac27398208147 -SIZE (dps8m-R3.0.1.tar.bz2) = 13052895 +TIMESTAMP = 1748948393 +SHA256 (dps8m-R3.1.0.tar.bz2) = ec9dd499eb5a32be717d7ad3f8a8e34f12ff5a66a44aa1ebb4bf6cf17ad3b88c +SIZE (dps8m-R3.1.0.tar.bz2) = 15635134 diff --git a/emulators/dps8m/files/patch-src_Makefile.mk b/emulators/dps8m/files/patch-src_Makefile.mk deleted file mode 100644 index be9c3e886588..000000000000 --- a/emulators/dps8m/files/patch-src_Makefile.mk +++ /dev/null @@ -1,11 +0,0 @@ ---- src/Makefile.mk.orig 2023-08-13 10:22:22 UTC -+++ src/Makefile.mk -@@ -294,7 +294,7 @@ endif - - _DEBUGOPTFLAG := -g - ifndef TESTING -- OPTFLAGS = -O3 $(_DEBUGOPTFLAG) -U_FORTIFY_SOURCE -fno-stack-protector -+# OPTFLAGS = -O3 $(_DEBUGOPTFLAG) -U_FORTIFY_SOURCE -fno-stack-protector - ifdef DUMA - CFLAGS += -I../dps8 -I. -include dps8_duma.h - OPTFLAGS += -DDUMA=1 diff --git a/emulators/es-de/Makefile b/emulators/es-de/Makefile index 5e494aad2821..3695fa607252 100644 --- a/emulators/es-de/Makefile +++ b/emulators/es-de/Makefile @@ -1,7 +1,6 @@ PORTNAME= es-de DISTVERSIONPREFIX= v -DISTVERSION= 3.2.0 -PORTREVISION= 1 +DISTVERSION= 3.3.0 CATEGORIES= emulators MAINTAINER= bsdcode@disroot.org @@ -29,7 +28,7 @@ LIB_DEPENDS= libavcodec.so:multimedia/ffmpeg \ libharfbuzz.so:print/harfbuzz \ libicuuc.so:devel/icu \ liblunasvg.so:graphics/lunasvg \ - libpoppler.so:graphics/poppler \ + libpoppler-cpp.so:graphics/poppler \ libpugixml.so:textproc/pugixml \ librlottie.so:graphics/rlottie RUN_DEPENDS= ${_BR_DEPENDS} diff --git a/emulators/es-de/distinfo b/emulators/es-de/distinfo index c3e2a5486a63..d77a0d35d056 100644 --- a/emulators/es-de/distinfo +++ b/emulators/es-de/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1743784837 -SHA256 (emulationstation-de-v3.2.0.tar.bz2) = dbe8e087042e49ec58d893a2408acbb45409b8b8f6f90afcbd9ad1219da612d3 -SIZE (emulationstation-de-v3.2.0.tar.bz2) = 72149068 +TIMESTAMP = 1752597245 +SHA256 (emulationstation-de-v3.3.0.tar.bz2) = e191f2ab66fdb0aea98369c4e5d94dd414a873d00b0129dfb65a502429f7eb93 +SIZE (emulationstation-de-v3.3.0.tar.bz2) = 72775703 diff --git a/emulators/es-de/files/patch-es-app_CMakeLists.txt b/emulators/es-de/files/patch-es-app_CMakeLists.txt new file mode 100644 index 000000000000..534d9feeea1c --- /dev/null +++ b/emulators/es-de/files/patch-es-app_CMakeLists.txt @@ -0,0 +1,11 @@ +--- es-app/CMakeLists.txt.orig 2025-07-15 16:46:41 UTC ++++ es-app/CMakeLists.txt +@@ -147,7 +147,7 @@ else() + else() + include_directories(${COMMON_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/src) + add_executable(es-de ${ES_SOURCES} ${ES_HEADERS}) +- target_link_libraries(es-de ${COMMON_LIBRARIES} ${CMAKE_DL_LIBS} es-core lunasvg::lunasvg) ++ target_link_libraries(es-de ${COMMON_LIBRARIES} ${CMAKE_DL_LIBS} es-core) + set_target_properties(es-de PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE) + endif() + diff --git a/emulators/es-de/pkg-plist b/emulators/es-de/pkg-plist index b21bd1041343..75a84449b9d3 100644 --- a/emulators/es-de/pkg-plist +++ b/emulators/es-de/pkg-plist @@ -25,6 +25,9 @@ share/applications/org.es_de.frontend.desktop %%DATADIR%%/licenses/DroidSans %%DATADIR%%/licenses/FFmpeg %%DATADIR%%/licenses/FontAwesome +%%DATADIR%%/licenses/Fontconfig +%%DATADIR%%/licenses/FreeImage +%%DATADIR%%/licenses/FreeType %%DATADIR%%/licenses/Freesound_CC0 %%DATADIR%%/licenses/Freesound_CCBY %%DATADIR%%/licenses/GLEW @@ -32,23 +35,31 @@ share/applications/org.es_de.frontend.desktop %%DATADIR%%/licenses/GNUFreeFont %%DATADIR%%/licenses/HarfBuzz %%DATADIR%%/licenses/ICU +%%DATADIR%%/licenses/LibTIFF %%DATADIR%%/licenses/LunaSVG %%DATADIR%%/licenses/MAME %%DATADIR%%/licenses/NanumSquareNeo %%DATADIR%%/licenses/NotoEmoji %%DATADIR%%/licenses/Ogg +%%DATADIR%%/licenses/OpenJPEG +%%DATADIR%%/licenses/OpenSSL %%DATADIR%%/licenses/OpenSans %%DATADIR%%/licenses/Opus %%DATADIR%%/licenses/PhosphorIcons %%DATADIR%%/licenses/Poppler +%%DATADIR%%/licenses/SDL %%DATADIR%%/licenses/UTF8-CPP %%DATADIR%%/licenses/Vorbis +%%DATADIR%%/licenses/curl %%DATADIR%%/licenses/libgit2 +%%DATADIR%%/licenses/libiconv %%DATADIR%%/licenses/libintl -%%DATADIR%%/licenses/libvpx +%%DATADIR%%/licenses/libjpeg-turbo +%%DATADIR%%/licenses/libpng %%DATADIR%%/licenses/linear-es-de %%DATADIR%%/licenses/modern-es-de %%DATADIR%%/licenses/modern-es-de_nsoicons +%%DATADIR%%/licenses/pugixml %%DATADIR%%/licenses/rlottie %%DATADIR%%/licenses/slate-es-de %%DATADIR%%/licenses/ubuntu-font-licence-1.0 @@ -219,20 +230,24 @@ share/applications/org.es_de.frontend.desktop %%DATADIR%%/resources/graphics/textinput_focused.svg %%DATADIR%%/resources/graphics/white.png %%DATADIR%%/resources/graphics/window_icon_256.png +%%NLS%%%%DATADIR%%/resources/locale/bs_BA/LC_MESSAGES/bs_BA.mo %%NLS%%%%DATADIR%%/resources/locale/ca_ES/LC_MESSAGES/ca_ES.mo %%NLS%%%%DATADIR%%/resources/locale/de_DE/LC_MESSAGES/de_DE.mo %%NLS%%%%DATADIR%%/resources/locale/en_GB/LC_MESSAGES/en_GB.mo %%NLS%%%%DATADIR%%/resources/locale/en_US/LC_MESSAGES/en_US.mo %%NLS%%%%DATADIR%%/resources/locale/es_ES/LC_MESSAGES/es_ES.mo %%NLS%%%%DATADIR%%/resources/locale/fr_FR/LC_MESSAGES/fr_FR.mo +%%NLS%%%%DATADIR%%/resources/locale/hr_HR/LC_MESSAGES/hr_HR.mo %%NLS%%%%DATADIR%%/resources/locale/it_IT/LC_MESSAGES/it_IT.mo %%NLS%%%%DATADIR%%/resources/locale/ja_JP/LC_MESSAGES/ja_JP.mo %%NLS%%%%DATADIR%%/resources/locale/ko_KR/LC_MESSAGES/ko_KR.mo %%NLS%%%%DATADIR%%/resources/locale/nl_NL/LC_MESSAGES/nl_NL.mo %%NLS%%%%DATADIR%%/resources/locale/pl_PL/LC_MESSAGES/pl_PL.mo %%NLS%%%%DATADIR%%/resources/locale/pt_BR/LC_MESSAGES/pt_BR.mo +%%NLS%%%%DATADIR%%/resources/locale/pt_PT/LC_MESSAGES/pt_PT.mo %%NLS%%%%DATADIR%%/resources/locale/ro_RO/LC_MESSAGES/ro_RO.mo %%NLS%%%%DATADIR%%/resources/locale/ru_RU/LC_MESSAGES/ru_RU.mo +%%NLS%%%%DATADIR%%/resources/locale/sr_RS/LC_MESSAGES/sr_RS.mo %%NLS%%%%DATADIR%%/resources/locale/sv_SE/LC_MESSAGES/sv_SE.mo %%NLS%%%%DATADIR%%/resources/locale/zh_CN/LC_MESSAGES/zh_CN.mo %%NLS%%%%DATADIR%%/resources/locale/zh_TW/LC_MESSAGES/zh_TW.mo @@ -252,17 +267,23 @@ share/applications/org.es_de.frontend.desktop %%DATADIR%%/resources/sounds/select.wav %%DATADIR%%/resources/sounds/systembrowse.wav %%DATADIR%%/resources/systems/android/es_find_rules.xml +%%DATADIR%%/resources/systems/android/es_import_rules.xml %%DATADIR%%/resources/systems/android/es_systems.xml %%DATADIR%%/resources/systems/haiku/es_find_rules.xml +%%DATADIR%%/resources/systems/haiku/es_import_rules.xml %%DATADIR%%/resources/systems/haiku/es_systems.xml %%DATADIR%%/resources/systems/linux/es_find_rules.xml +%%DATADIR%%/resources/systems/linux/es_import_rules.xml %%DATADIR%%/resources/systems/linux/es_systems.xml %%DATADIR%%/resources/systems/macos/es_find_rules.xml +%%DATADIR%%/resources/systems/macos/es_import_rules.xml %%DATADIR%%/resources/systems/macos/es_systems.xml %%DATADIR%%/resources/systems/unix/es_find_rules.xml +%%DATADIR%%/resources/systems/unix/es_import_rules.xml %%DATADIR%%/resources/systems/unix/es_systems.xml %%DATADIR%%/resources/systems/windows/es_find_rules.xml %%DATADIR%%/resources/systems/windows/es_find_rules_portable.xml +%%DATADIR%%/resources/systems/windows/es_import_rules.xml %%DATADIR%%/resources/systems/windows/es_systems.xml %%DATADIR%%/themes/linear-es-de/CREDITS.md %%DATADIR%%/themes/linear-es-de/LICENSE diff --git a/emulators/flycast/Makefile b/emulators/flycast/Makefile index c67ffa3354d0..770d580c03ca 100644 --- a/emulators/flycast/Makefile +++ b/emulators/flycast/Makefile @@ -1,7 +1,7 @@ PORTNAME= flycast DISTVERSIONPREFIX= v DISTVERSION= 2.5 -PORTREVISION= 2 +PORTREVISION= 5 CATEGORIES= emulators MAINTAINER= bsdcode@disroot.org @@ -20,10 +20,11 @@ LIB_DEPENDS= libchdr.so:devel/libchdr \ USES= cmake compiler:c++20-lang pkgconfig sdl USE_GITHUB= yes GH_ACCOUNT= flyinghead +GH_TUPLE= vinniefalco:LuaBridge:5d21e35633a1f87ed08af115b07d3386096f792b:LuaBridge/core/deps/luabridge \ + GPUOpen-LibrariesAndSDKs:VulkanMemoryAllocator:6eb62e1515072827db992c2befd80b71b2d04329:VulkanMemoryAllocator/core/deps/VulkanMemoryAllocator \ + RetroAchievements:rcheevos:563230b1c249774b4852c944dc7cdcb952c9e8e8:rcheevos/core/deps/rcheevos USE_SDL= sdl2 -.include "${.CURDIR}/Makefile.tuples" - CMAKE_ON= USE_HOST_LIBCHDR OPTIONS_DEFINE= DOCS LUA OPENMP VULKAN @@ -63,15 +64,4 @@ post-install-DOCS-on: (cd ${WRKSRC}/docs && \ ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}) -# For maintainer (do not forget to clean up Makefile.tuples afterwards to -# remove useless submodules) -Makefile.tuples:: - ${RM} -f ${.CURDIR}/Makefile.tuples - ${RM} -rf ${WRKDIR}/.maintainer.checkout - ${MKDIR} ${WRKDIR}/.maintainer.checkout - (cd ${WRKDIR}/.maintainer.checkout && \ - git clone --recursive --branch=${DISTVERSIONPREFIX}${DISTVERSION} \ - https://github.com/${GH_ACCOUNT}/${PORTNAME} . && \ - ${SH} ${FILESDIR}/gen_gh_tuple.sh > ${.CURDIR}/Makefile.tuples) - .include <bsd.port.mk> diff --git a/emulators/flycast/Makefile.tuples b/emulators/flycast/Makefile.tuples deleted file mode 100644 index 3dc85b571e43..000000000000 --- a/emulators/flycast/Makefile.tuples +++ /dev/null @@ -1,4 +0,0 @@ -GH_TUPLE= \ - vinniefalco:LuaBridge:5d21e35633a1f87ed08af115b07d3386096f792b:LuaBridge/core/deps/luabridge \ - GPUOpen-LibrariesAndSDKs:VulkanMemoryAllocator:6eb62e1515072827db992c2befd80b71b2d04329:VulkanMemoryAllocator/core/deps/VulkanMemoryAllocator \ - RetroAchievements:rcheevos:563230b1c249774b4852c944dc7cdcb952c9e8e8:rcheevos/core/deps/rcheevos \ diff --git a/emulators/flycast/files/gen_gh_tuple.sh b/emulators/flycast/files/gen_gh_tuple.sh deleted file mode 100644 index ab014ef5f473..000000000000 --- a/emulators/flycast/files/gen_gh_tuple.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh - -echo "GH_TUPLE= \\" -for _sm_root in $(find . -type f -name .gitmodules | sed 's/\.gitmodules$//' | sort) -do - ( - cd "${_sm_root}" - - # Crawl name|path|url list of submodules within _sm_root - grep -e '^\[submodule "' -e 'path = ' -e 'url = ' .gitmodules | \ - sed -E -e 's|.*"([^"]+)".*|\1|' -e 's|.*= ||' | \ - paste - - - | \ - sed -E 's/[[:space:]]+/|/g' | \ - while read _sm - do - _sm_name=$(echo "${_sm}" | cut -d '|' -f 1) - _sm_path=$(echo "${_sm}" | cut -d '|' -f 2) - _sm_url=$(echo "${_sm}" | cut -d '|' -f 3) - - _sm_prefix=$(echo "${_sm_root}" | sed 's|^\./||') - - _account_project=$(echo "${_sm_url}" | sed -e 's|^https://github.com/||' -e 's|/|:|g' -e 's|\.git$||') - _group=$(echo "${_account_project}" | cut -d ':' -f 2 | tr -cd 'a-zA-Z0-9_') - _tagname_group_subdir=$(git submodule status "${_sm_path}" | sed -E -e 's|^.||' -e "s|[[:space:]]+|:${_group}/${_sm_prefix}|" -e 's|[[:space:]]+.*$||') - echo -e "\t${_account_project}:${_tagname_group_subdir} \\" - done - ) -done -echo "" diff --git a/emulators/flycast/files/patch-core_network_dcnet.cpp b/emulators/flycast/files/patch-core_network_dcnet.cpp new file mode 100644 index 000000000000..cf7c76d929cf --- /dev/null +++ b/emulators/flycast/files/patch-core_network_dcnet.cpp @@ -0,0 +1,38 @@ +--- core/network/dcnet.cpp.orig 2025-07-18 15:30:48 UTC ++++ core/network/dcnet.cpp +@@ -222,7 +222,7 @@ class EthSocket (private) + } + + private: +- using iterator = asio::buffers_iterator<asio::const_buffers_1>; ++ using iterator = asio::buffers_iterator<asio::const_buffer>; + + std::pair<iterator, bool> + static packetMatcher(iterator begin, iterator end) +@@ -502,7 +502,7 @@ class AccessPointFinder (private) + { + std::error_code e; + socket.close(e); +- timer.cancel(e); ++ timer.cancel(); + if (ec) { + handler(ec, {}, {}); + } +@@ -584,7 +584,7 @@ class DCNetThread (public) + { + if (io_context == nullptr || pppSocket == nullptr) + return; +- io_context->post([this, v]() { ++ asio::post([this, v]() { + pppSocket->send(v); + }); + } +@@ -593,7 +593,7 @@ class DCNetThread (public) + if (io_context != nullptr && ethSocket != nullptr) + { + std::vector<u8> vbuf(frame, frame + len); +- io_context->post([this, vbuf]() { ++ asio::post([this, vbuf]() { + ethSocket->send(vbuf.data(), vbuf.size()); + }); + } diff --git a/emulators/fs-uae-launcher/Makefile b/emulators/fs-uae-launcher/Makefile index 869330b66d1f..dcd019265555 100644 --- a/emulators/fs-uae-launcher/Makefile +++ b/emulators/fs-uae-launcher/Makefile @@ -1,27 +1,29 @@ PORTNAME= fs-uae-launcher -PORTVERSION= 3.1.68 -PORTREVISION= 2 +PORTVERSION= 3.1.70 CATEGORIES= emulators MASTER_SITES= https://fs-uae.net/files/FS-UAE-Launcher/Stable/${PORTVERSION}/ -MAINTAINER= ports@FreeBSD.org +MAINTAINER= atanubiswas484@gmail.com COMMENT= GUI launcher for the FS-UAE Amiga emulator WWW= http://fs-uae.net/launcher LICENSE= GPLv2+ LICENSE_FILE= ${WRKSRC}/COPYING -RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR} \ +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}python-lhafile>0:archivers/py-python-lhafile@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}requests>0:www/py-requests@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}python-lhafile>0:archivers/py-python-lhafile@${PY_FLAVOR} + ${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR} -USES= gettext gmake gnome pathfix pyqt:5 python tar:xz -USE_PYTHON= distutils autoplist noflavors +USES= gmake gnome pathfix pyqt:5 python tar:xz +USE_PYTHON= autoplist distutils noflavors USE_PYQT= pyqt5 -MAKE_ARGS= prefix=${PREFIX} PYTHON=${PYTHON_CMD} +MAKE_ARGS= prefix=${PREFIX} \ + PYTHON=${PYTHON_CMD} PYDISTUTILS_INSTALLARGS+= --install-lib=${PYTHON_SITELIBDIR} -OPTIONS_DEFINE= DOCS +OPTIONS_DEFINE= DOCS NLS +OPTIONS_SUB= yes +NLS_USES= gettext-tools .include <bsd.port.mk> diff --git a/emulators/fs-uae-launcher/distinfo b/emulators/fs-uae-launcher/distinfo index b52e2b016ccb..776477a49ed6 100644 --- a/emulators/fs-uae-launcher/distinfo +++ b/emulators/fs-uae-launcher/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1698712158 -SHA256 (fs-uae-launcher-3.1.68.tar.xz) = e36104442db278e0f1d073dbc2be2f9a937cd33e964968b75b324c393f8ec030 -SIZE (fs-uae-launcher-3.1.68.tar.xz) = 7736036 +TIMESTAMP = 1752274726 +SHA256 (fs-uae-launcher-3.1.70.tar.xz) = caf27cb1ae38575dd211427a0bd4a04be3766451f9fb6d134cbd88098f40dfa7 +SIZE (fs-uae-launcher-3.1.70.tar.xz) = 7707368 diff --git a/emulators/hatari/Makefile b/emulators/hatari/Makefile index e4f43322717f..01c91dfe4cc4 100644 --- a/emulators/hatari/Makefile +++ b/emulators/hatari/Makefile @@ -1,8 +1,7 @@ PORTNAME= hatari -PORTVERSION= 2.5.0 -PORTREVISION= 1 +DISTVERSIONPREFIX= v +DISTVERSION= 2.6.1 CATEGORIES= emulators -MASTER_SITES= http://download.tuxfamily.org/hatari/${PORTVERSION}/ MAINTAINER= laurent.chardon@gmail.com COMMENT= Atari ST emulator @@ -18,48 +17,56 @@ LIB_DEPENDS= libpng.so:graphics/png \ libreadline.so:devel/readline \ libcapstone.so:devel/capstone -USES= cmake desktop-file-utils gnome python readline \ - sdl shared-mime-info shebangfix tar:bzip2 xorg iconv +USES= cmake desktop-file-utils gnome localbase python readline sdl \ + shared-mime-info shebangfix tar:bzip2 xorg + +USE_GITLAB= yes +GL_SITE= https://framagit.org/ + USE_GNOME= gtk30 pygobject3 -USE_XORG= sm ice x11 xext USE_SDL= sdl2 +USE_XORG= ice sm x11 xext SHEBANG_FILES= python-ui/*.py tools/*.py \ tools/debugger/*.py tools/hconsole/*.py CMAKE_ARGS= -DETCDIR:PATH="${PREFIX}/etc" -OPTIONS_DEFINE= DEBUG DOCS DSP TRACE SMALL +TEST_TARGET= test + +OPTIONS_DEFINE= DEBUG DOCS DSP SMALL TRACE OPTIONS_DEFAULT= DOCS DSP TRACE DEBUG_DESC= Build with debug information DOCS_DESC= Install extra documentation DSP_DESC= DSP 56k emulator for Falcon mode -TRACE_DESC= Tracing messages for debugging SMALL_DESC= Use less memory at the expense of emulation speed +TRACE_DESC= Tracing messages for debugging DSP_CMAKE_BOOL= ENABLE_DSP_EMU -TRACE_CMAKE_BOOL= ENABLE_TRACING SMALL_CMAKE_BOOL= ENABLE_SMALL_MEM - -TEST_TARGET= test +TRACE_CMAKE_BOOL= ENABLE_TRACING .include <bsd.port.options.mk> # CMAKE_ARGS CMAKE_BUILD_TYPE is getting overriden .if ${PORT_OPTIONS:MDEBUG} -CMAKE_BUILD_TYPE=Debug -INSTALL_TARGET=install +CMAKE_BUILD_TYPE= Debug +INSTALL_TARGET= install .else -CMAKE_BUILD_TYPE=Release +CMAKE_BUILD_TYPE= Release .endif post-patch: -.for i in doc/*.1 python-ui/*.1 tools/*.1 tools/debugger/*.1 tools/hconsole/*.1 tools/hmsa/*.1 @${REINPLACE_CMD} -e \ 's|^/etc/hatari.cfg .*|${PREFIX}/etc/hatari.cfg| ; \ - s|/usr/share|${PREFIX}/share|' ${WRKSRC}/${i} -.endfor + s|/usr/share|${PREFIX}/share|' \ + ${WRKSRC}/doc/*.1 \ + ${WRKSRC}/python-ui/*.1 \ + ${WRKSRC}/tools/*.1 \ + ${WRKSRC}/tools/debugger/*.1 \ + ${WRKSRC}/tools/hconsole/*.1 \ + ${WRKSRC}/tools/hmsa/*.1 @${REINPLACE_CMD} -e \ 's|-Wno-maybe-uninitialized||' ${WRKSRC}/src/cpu/CMakeLists.txt @${REINPLACE_CMD} -e \ @@ -68,12 +75,13 @@ post-patch: post-install: ${MKDIR} ${STAGEDIR}${PREFIX}/share/man/man1 - ${INSTALL_MAN} ${WRKSRC}/doc/*.1 ${STAGEDIR}${PREFIX}/share/man/man1 - ${INSTALL_MAN} ${WRKSRC}/python-ui/*.1 ${STAGEDIR}${PREFIX}/share/man/man1 - ${INSTALL_MAN} ${WRKSRC}/tools/*.1 ${STAGEDIR}${PREFIX}/share/man/man1 - ${INSTALL_MAN} ${WRKSRC}/tools/debugger/*.1 ${STAGEDIR}${PREFIX}/share/man/man1 - ${INSTALL_MAN} ${WRKSRC}/tools/hconsole/*.1 ${STAGEDIR}${PREFIX}/share/man/man1 - ${INSTALL_MAN} ${WRKSRC}/tools/hmsa/*.1 ${STAGEDIR}${PREFIX}/share/man/man1 + ${INSTALL_MAN} ${WRKSRC}/doc/*.1 \ + ${WRKSRC}/python-ui/*.1 \ + ${WRKSRC}/tools/*.1 \ + ${WRKSRC}/tools/debugger/*.1 \ + ${WRKSRC}/tools/hconsole/*.1 \ + ${WRKSRC}/tools/hmsa/*.1 \ + ${STAGEDIR}${PREFIX}/share/man/man1 post-install-DOCS-on: ${MKDIR} ${STAGEDIR}${DOCSDIR} diff --git a/emulators/hatari/distinfo b/emulators/hatari/distinfo index 5a3cac4e6c7d..b906c130c2ad 100644 --- a/emulators/hatari/distinfo +++ b/emulators/hatari/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1714071173 -SHA256 (hatari-2.5.0.tar.bz2) = d76c22fc3de69fb1bb4af3e8ba500b7e40f5a2a45d07783f24cb7101e53c3457 -SIZE (hatari-2.5.0.tar.bz2) = 2820580 +TIMESTAMP = 1755395096 +SHA256 (hatari-v2.6.1.tar.bz2) = de2fd445c48ab1c79aebdebf722e1c9e6c8b9cc291a777409d8eb01d145da4f1 +SIZE (hatari-v2.6.1.tar.bz2) = 2128063 diff --git a/emulators/hatari/files/patch-tools_atari-hd-image.sh b/emulators/hatari/files/patch-tools_atari-hd-image.sh index 9b92f43e239b..2b6cb31943d8 100644 --- a/emulators/hatari/files/patch-tools_atari-hd-image.sh +++ b/emulators/hatari/files/patch-tools_atari-hd-image.sh @@ -1,4 +1,4 @@ ---- tools/atari-hd-image.sh.orig 2024-04-26 10:23:56 UTC +--- tools/atari-hd-image.sh.orig 2025-08-09 22:33:00 UTC +++ tools/atari-hd-image.sh @@ -33,8 +33,8 @@ export PATH export PATH @@ -6,19 +6,17 @@ # check tools -if [ -z "$(which mkdosfs)" ] || [ -z "$(which python3)" ]; then - echo "ERROR: either mkdosfs or python3 missing!" -+if [ -z "$(which mkdosfs)" ] || [ -z "$(which %%PYTHON_VERSION%%)" ]; then -+ echo "ERROR: either mkdosfs or %%PYTHON_VERSION%% missing!" ++if [ -z "$(which mkdosfs)" ] || [ -z "$(which %%PYTHON_CMD%%)" ]; then ++ echo "ERROR: either mkdosfs or %%PYTHON_CMD%% missing!" exit 1 fi -@@ -147,8 +147,8 @@ echo "$step) Create DOS Master Boot Record / partition +@@ -147,7 +147,7 @@ echo "$step) Create DOS Master Boot Record / partition # - http://en.wikipedia.org/wiki/File_Allocation_Table#Boot_Sector # For DOS MBR, the values are little endian. # ----------- -python3 << EOF --#!/usr/bin/env python3 -+%%PYTHON_VERSION%% << EOF -+#!/usr/bin/env %%PYTHON_VERSION%% ++%%PYTHON_CMD%% << EOF + #!/usr/bin/python3 mbr = bytearray(512) - def set_long(idx, value): diff --git a/emulators/hatari/pkg-plist b/emulators/hatari/pkg-plist index c1b06045aef2..a7923bf0d7ca 100644 --- a/emulators/hatari/pkg-plist +++ b/emulators/hatari/pkg-plist @@ -12,7 +12,6 @@ share/applications/hatariui.desktop %%PORTDOCS%%%%DOCSDIR%%/CMakeLists.txt %%PORTDOCS%%%%DOCSDIR%%/authors.txt %%PORTDOCS%%%%DOCSDIR%%/bugs.txt -%%PORTDOCS%%%%DOCSDIR%%/changelog.txt %%PORTDOCS%%%%DOCSDIR%%/coding.txt %%PORTDOCS%%%%DOCSDIR%%/compatibility.html %%PORTDOCS%%%%DOCSDIR%%/debugger.html @@ -80,7 +79,6 @@ share/applications/hatariui.desktop %%DATADIR%%/hconsole/example-debugger %%DATADIR%%/hconsole/example.py %%DATADIR%%/hconsole/hconsole.py -%%DATADIR%%/tos.img share/icons/hicolor/128x128/apps/hatari.png share/icons/hicolor/128x128/mimetypes/application-vnd.fastcopy-disk-image.png share/icons/hicolor/128x128/mimetypes/application-vnd.msa-disk-image.png diff --git a/emulators/magia/Makefile b/emulators/magia/Makefile index 81588293a169..0adbb51276f9 100644 --- a/emulators/magia/Makefile +++ b/emulators/magia/Makefile @@ -1,7 +1,7 @@ PORTNAME= magia DISTVERSIONPREFIX= v DISTVERSION= 0.2.0 -PORTREVISION= 27 +PORTREVISION= 29 CATEGORIES= emulators MAINTAINER= ports@FreeBSD.org diff --git a/emulators/mame/Makefile b/emulators/mame/Makefile index 793f30a06ba3..c4cda0872bf7 100644 --- a/emulators/mame/Makefile +++ b/emulators/mame/Makefile @@ -1,6 +1,6 @@ PORTNAME= mame DISTVERSION= 0.277 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= emulators games PATCH_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/ diff --git a/emulators/pcsx2/Makefile b/emulators/pcsx2/Makefile index 2430f5ea598d..c9fcbf764fba 100644 --- a/emulators/pcsx2/Makefile +++ b/emulators/pcsx2/Makefile @@ -1,5 +1,6 @@ PORTNAME= pcsx2 PORTVERSION= 2.3.439 +PORTREVISION= 1 DISTVERSIONPREFIX= v CATEGORIES= emulators diff --git a/emulators/ppsspp/Makefile b/emulators/ppsspp/Makefile index 8ae5f69a4b14..18747dd52b1d 100644 --- a/emulators/ppsspp/Makefile +++ b/emulators/ppsspp/Makefile @@ -1,6 +1,6 @@ PORTNAME= ppsspp DISTVERSIONPREFIX= v -DISTVERSION?= 1.19.2 +DISTVERSION?= 1.19.3 CATEGORIES= emulators MAINTAINER= kreinholz@gmail.com @@ -29,17 +29,18 @@ USES= cmake compiler:c++11-lib gl localbase:ldflags pkgconfig \ desktop-file-utils USE_GITHUB= yes GH_ACCOUNT= hrydgard -GH_TUPLE?= hrydgard:glslang:8.13.3743-948-g50e0708:glslang/ext/glslang \ - google:cpu_features:v0.8.0-27-gfd4ffc1:cpu_features/ext/cpu_features \ +GH_TUPLE?= Kingcom:armips:v0.11.0-195-ga8d71f0:armips/ext/armips \ + hrydgard:glslang:2.3-3991-g50e0708e:glslang/ext/glslang \ + KhronosGroup:SPIRV-Cross:4212eef67ed0ca048cb726a6767185504e7695e5:SPIRVCross/ext/SPIRV-Cross \ + Tencent:rapidjson:73063f5002612c6bf64fe24f851cd5cc0d83eef9:rapidjson/ext/rapidjson \ + unknownbrackets:ppsspp-debugger:9776332f720c854ef26f325a0cf9e32c02115a9c:ppssppdebugger/assets/debugger \ + google:cpu_features:v0.4.1-211-gfd4ffc1:cpu_features/ext/cpu_features \ + RetroAchievements:rcheevos:v11.6.0-61-gef0e22b:rcheevos/ext/rcheevos \ rtissera:libchdr:26d27ca:libchdr/ext/libchdr \ - unknownbrackets:ppsspp-debugger:d358a87:debugger/assets/debugger \ - KhronosGroup:SPIRV-Cross:sdk-1.3.239.0:SPIRV/ext/SPIRV-Cross \ - Kingcom:armips:v0.11.0-195-ga8d71f0:armips/ext/armips \ - Kingcom:filesystem:v1.3.2-12-g3f1c185:filesystem/ext/armips/ext/filesystem \ - RetroAchievements:rcheevos:v11.6.0-gef0e22b:rcheevos/ext/rcheevos \ - Tencent:rapidjson:v1.1.0-415-g73063f5:rapidjson/ext/rapidjson \ - hrydgard:ppsspp-lua:7648485:lua/ext/lua -EXCLUDE= libpng17 libzip zlib + hrydgard:ppsspp-lua:7648485f14e8e5ee45e8e39b1eb4d3206dbd405a:ppsspplua/ext/lua \ + Kingcom:filesystem:v1.1.2-171-g3f1c185:filesystem/ext/armips/ext/filesystem + +EXCLUDE= libzip zlib USE_GL= glew opengl CMAKE_ON= ${LIBZIP MINIUPNPC SNAPPY ZSTD:L:S/^/USE_SYSTEM_/} USE_VULKAN_DISPLAY_KHR CMAKE_OFF= USE_DISCORD diff --git a/emulators/ppsspp/distinfo b/emulators/ppsspp/distinfo index 5588a603ebe1..bfe6f531f0ef 100644 --- a/emulators/ppsspp/distinfo +++ b/emulators/ppsspp/distinfo @@ -1,23 +1,23 @@ -TIMESTAMP = 1750002545 -SHA256 (hrydgard-ppsspp-v1.19.2_GH0.tar.gz) = 4b3abbdc2f76daad5d038c0676ab0ec91a4588a30a894e6604b76a061d683583 -SIZE (hrydgard-ppsspp-v1.19.2_GH0.tar.gz) = 38797975 -SHA256 (hrydgard-glslang-8.13.3743-948-g50e0708_GH0.tar.gz) = c5d7837395b5c076371d74d9d8adf0d0408c002f2e4fe08bc3eef1db6f608ceb -SIZE (hrydgard-glslang-8.13.3743-948-g50e0708_GH0.tar.gz) = 3689922 -SHA256 (google-cpu_features-v0.8.0-27-gfd4ffc1_GH0.tar.gz) = 0bcb1a537b8fc184b9df9ddde9d15868efe7f651139ea84d3e20ac9900a43c60 -SIZE (google-cpu_features-v0.8.0-27-gfd4ffc1_GH0.tar.gz) = 109044 -SHA256 (rtissera-libchdr-26d27ca_GH0.tar.gz) = 49e028fadd0640926da158408c9eafb22fc89ccb0de69c67b167ef0a11f6a0c5 -SIZE (rtissera-libchdr-26d27ca_GH0.tar.gz) = 4274377 -SHA256 (unknownbrackets-ppsspp-debugger-d358a87_GH0.tar.gz) = 468ec2ca27aefa81657bc679c0983dbbd693b99e8b803a465bb42cd8e2993cb2 -SIZE (unknownbrackets-ppsspp-debugger-d358a87_GH0.tar.gz) = 815889 -SHA256 (KhronosGroup-SPIRV-Cross-sdk-1.3.239.0_GH0.tar.gz) = a1695022880e7ef3c2d407647f79876045dc2a3ed012753adc71ead5cc5178ba -SIZE (KhronosGroup-SPIRV-Cross-sdk-1.3.239.0_GH0.tar.gz) = 1707048 +TIMESTAMP = 1752627057 +SHA256 (hrydgard-ppsspp-v1.19.3_GH0.tar.gz) = 2e02c3e0a7f5a2311f6e37f3e2fc9760d14eb7af5051bc251f168505f1ca9ad8 +SIZE (hrydgard-ppsspp-v1.19.3_GH0.tar.gz) = 38805948 SHA256 (Kingcom-armips-v0.11.0-195-ga8d71f0_GH0.tar.gz) = 8a46d92b070de90cefcd89c2894344d040481e1cf6216b31f4a5e531254fed88 SIZE (Kingcom-armips-v0.11.0-195-ga8d71f0_GH0.tar.gz) = 223306 -SHA256 (Kingcom-filesystem-v1.3.2-12-g3f1c185_GH0.tar.gz) = 9fa5a690e341bea1935a7f6b256e1bbd864abee988f834f10307f646dc38e604 -SIZE (Kingcom-filesystem-v1.3.2-12-g3f1c185_GH0.tar.gz) = 163401 -SHA256 (RetroAchievements-rcheevos-v11.6.0-gef0e22b_GH0.tar.gz) = 5d424b58ae280f56ee04a846d7f5e90e289f747e9ae4ac2d29e46761133d009e -SIZE (RetroAchievements-rcheevos-v11.6.0-gef0e22b_GH0.tar.gz) = 417751 -SHA256 (Tencent-rapidjson-v1.1.0-415-g73063f5_GH0.tar.gz) = bfc1c1d5fbd9dbc78600798d8a8bfcb93f9d308d55564e012b64e8ca272ecea4 -SIZE (Tencent-rapidjson-v1.1.0-415-g73063f5_GH0.tar.gz) = 1054127 -SHA256 (hrydgard-ppsspp-lua-7648485_GH0.tar.gz) = e7dba820ddd788976810b4f21d1c4781a617e66c7bd67ee71acedd5d60db608e -SIZE (hrydgard-ppsspp-lua-7648485_GH0.tar.gz) = 239547 +SHA256 (hrydgard-glslang-2.3-3991-g50e0708e_GH0.tar.gz) = 720e01f16e5ee2f7ada49ba0464232380bf71339c836cc4fabbabef2a741818b +SIZE (hrydgard-glslang-2.3-3991-g50e0708e_GH0.tar.gz) = 3689100 +SHA256 (KhronosGroup-SPIRV-Cross-4212eef67ed0ca048cb726a6767185504e7695e5_GH0.tar.gz) = a7adf77b5680795302aee160309c6cb81b0da341d92bd7face01f9a156b65aeb +SIZE (KhronosGroup-SPIRV-Cross-4212eef67ed0ca048cb726a6767185504e7695e5_GH0.tar.gz) = 1703767 +SHA256 (Tencent-rapidjson-73063f5002612c6bf64fe24f851cd5cc0d83eef9_GH0.tar.gz) = 896eb817fb2bc62a0a84ca65fac3e3c385b410e6dbf70d69c411e25776663e39 +SIZE (Tencent-rapidjson-73063f5002612c6bf64fe24f851cd5cc0d83eef9_GH0.tar.gz) = 1054419 +SHA256 (unknownbrackets-ppsspp-debugger-9776332f720c854ef26f325a0cf9e32c02115a9c_GH0.tar.gz) = 495db15fa9716d78c4958004df5a1487a94155694cceabd61fb40a2d0090fea3 +SIZE (unknownbrackets-ppsspp-debugger-9776332f720c854ef26f325a0cf9e32c02115a9c_GH0.tar.gz) = 810347 +SHA256 (google-cpu_features-v0.4.1-211-gfd4ffc1_GH0.tar.gz) = 20115fd59cf2db71594d71acf3dacfdaf6c1bdf54c1656f781fce4844a803e08 +SIZE (google-cpu_features-v0.4.1-211-gfd4ffc1_GH0.tar.gz) = 109042 +SHA256 (RetroAchievements-rcheevos-v11.6.0-61-gef0e22b_GH0.tar.gz) = 11c12a5ce2e61917edbd4634fc0623528267c51dae2303bfc55cbbb7ee7299fa +SIZE (RetroAchievements-rcheevos-v11.6.0-61-gef0e22b_GH0.tar.gz) = 417819 +SHA256 (rtissera-libchdr-26d27ca_GH0.tar.gz) = 49e028fadd0640926da158408c9eafb22fc89ccb0de69c67b167ef0a11f6a0c5 +SIZE (rtissera-libchdr-26d27ca_GH0.tar.gz) = 4274377 +SHA256 (hrydgard-ppsspp-lua-7648485f14e8e5ee45e8e39b1eb4d3206dbd405a_GH0.tar.gz) = ee31027159979d7be564e19710e10339179992f6d663d38337e78340dd31987b +SIZE (hrydgard-ppsspp-lua-7648485f14e8e5ee45e8e39b1eb4d3206dbd405a_GH0.tar.gz) = 239843 +SHA256 (Kingcom-filesystem-v1.1.2-171-g3f1c185_GH0.tar.gz) = 9f3866efc8b8b29cd9ff51c0cce8a281ff88cd34694d8da0d064cb82d95b8b71 +SIZE (Kingcom-filesystem-v1.1.2-171-g3f1c185_GH0.tar.gz) = 163405 diff --git a/emulators/ppsspp/files/patch-Common_GPU_Vulkan_VulkanContext.cpp b/emulators/ppsspp/files/patch-Common_GPU_Vulkan_VulkanContext.cpp deleted file mode 100644 index 4ecc5e23175e..000000000000 --- a/emulators/ppsspp/files/patch-Common_GPU_Vulkan_VulkanContext.cpp +++ /dev/null @@ -1,11 +0,0 @@ ---- Common/GPU/Vulkan/VulkanContext.cpp.orig 2025-06-11 21:04:20 UTC -+++ Common/GPU/Vulkan/VulkanContext.cpp -@@ -119,7 +119,7 @@ VkResult VulkanContext::CreateInstance(const CreateInf - if (vkEnumerateInstanceVersion) { - vkEnumerateInstanceVersion(&vulkanInstanceApiVersion_); - vulkanInstanceApiVersion_ &= 0xFFFFF000; // Remove patch version. -- vulkanInstanceApiVersion_ = std::min(VK_API_VERSION_1_4, vulkanInstanceApiVersion_); -+ vulkanInstanceApiVersion_ = std::min(VK_API_VERSION_1_3, vulkanInstanceApiVersion_); - std::string versionString = FormatAPIVersion(vulkanInstanceApiVersion_); - INFO_LOG(Log::G3D, "Detected Vulkan API version: %s", versionString.c_str()); - } diff --git a/emulators/qemu-devel/Makefile b/emulators/qemu-devel/Makefile index 9724d1baccae..35177ea0471e 100644 --- a/emulators/qemu-devel/Makefile +++ b/emulators/qemu-devel/Makefile @@ -1,5 +1,5 @@ PORTNAME= qemu -DISTVERSION= 10.0.20250630 +DISTVERSION= 10.0.20250731 CATEGORIES= emulators PKGNAMESUFFIX= -devel DIST_SUBDIR= qemu/${PORTVERSION} @@ -23,11 +23,11 @@ USES= bison compiler:c11 cpe gmake gnome iconv:wchar_t localbase:ldflags \ ninja perl5 pkgconfig python:build shebangfix tar:xz xorg USE_GITLAB= yes GL_ACCOUNT= qemu-project -GL_TAGNAME= 0d0fc3f4658937fb81fcc16a89738e83bd8d4795 +GL_TAGNAME= cd9f752fee75238f842a91be1146c988bd16a010 GL_TUPLE= qemu-project:keycodemapdb:f5772a62ec52591ff6870b7e8ef32482371f22c6:keycodemapdb/subprojects/keycodemapdb \ qemu-project:dtc:b6910bec11614980a21e46fbccc35934b671bd81:dtc/subprojects/dtc \ qemu-project:libvfio-user:0b28d205572c80b568a1003db2c8f37ca333e4d7:libvfio/subprojects/libvfio-user \ - qemu-project:meson:68d29ef7f62df5481aa4de8eaf421f25243f4cb2:meson/meson \ + qemu-project:meson:dd7cf67f00f1b08fc15885d9bade23f8e76845c0:meson/meson \ qemu-project:berkeley-softfloat-3:b64af41c3276f97f0e181920400ee056b9c88037:berkeleysoftfloat3/subprojects/berkeley-softfloat-3 \ qemu-project:berkeley-testfloat-3:e7af9751d9f9fd3b47911f51a5cfd08af256a9ab:berkeleytestfloat3/subprojects/berkeley-testfloat-3 USE_GNOME= cairo glib20 diff --git a/emulators/qemu-devel/distinfo b/emulators/qemu-devel/distinfo index 98727eef212b..c95f967d168a 100644 --- a/emulators/qemu-devel/distinfo +++ b/emulators/qemu-devel/distinfo @@ -1,15 +1,15 @@ -TIMESTAMP = 1751498296 -SHA256 (qemu/10.0.20250630/qemu-project-qemu-0d0fc3f4658937fb81fcc16a89738e83bd8d4795_GL0.tar.gz) = 15207cad59b6b4b0b72e6ac740b0cbb3766cbf5a87ef9e1346284b14febcb6ef -SIZE (qemu/10.0.20250630/qemu-project-qemu-0d0fc3f4658937fb81fcc16a89738e83bd8d4795_GL0.tar.gz) = 39963969 -SHA256 (qemu/10.0.20250630/qemu-project-keycodemapdb-f5772a62ec52591ff6870b7e8ef32482371f22c6_GL0.tar.gz) = d014b53382dbb17b8196ad12f50de7f20d0ef1b9f7d54b0be51a6cbb14209195 -SIZE (qemu/10.0.20250630/qemu-project-keycodemapdb-f5772a62ec52591ff6870b7e8ef32482371f22c6_GL0.tar.gz) = 29580 -SHA256 (qemu/10.0.20250630/qemu-project-dtc-b6910bec11614980a21e46fbccc35934b671bd81_GL0.tar.gz) = e115f987eec23a1ba25150a46ced1675de3716072d3b4905afb3a9cda0f007c7 -SIZE (qemu/10.0.20250630/qemu-project-dtc-b6910bec11614980a21e46fbccc35934b671bd81_GL0.tar.gz) = 205556 -SHA256 (qemu/10.0.20250630/qemu-project-libvfio-user-0b28d205572c80b568a1003db2c8f37ca333e4d7_GL0.tar.gz) = d2f60cd4f86f345aab1332953eb736cce3518159e6e99bcc2d10467c06f717fe -SIZE (qemu/10.0.20250630/qemu-project-libvfio-user-0b28d205572c80b568a1003db2c8f37ca333e4d7_GL0.tar.gz) = 189943 -SHA256 (qemu/10.0.20250630/qemu-project-meson-68d29ef7f62df5481aa4de8eaf421f25243f4cb2_GL0.tar.gz) = 836c21bb3a0413f3028fce19e2a939c3f581668161b12b208b559b2bdf46876c -SIZE (qemu/10.0.20250630/qemu-project-meson-68d29ef7f62df5481aa4de8eaf421f25243f4cb2_GL0.tar.gz) = 4913620 -SHA256 (qemu/10.0.20250630/qemu-project-berkeley-softfloat-3-b64af41c3276f97f0e181920400ee056b9c88037_GL0.tar.gz) = faae889814ea6a292f7ca03d9b36e6c7e95bab2a64777804883cc822b8d48757 -SIZE (qemu/10.0.20250630/qemu-project-berkeley-softfloat-3-b64af41c3276f97f0e181920400ee056b9c88037_GL0.tar.gz) = 148741 -SHA256 (qemu/10.0.20250630/qemu-project-berkeley-testfloat-3-e7af9751d9f9fd3b47911f51a5cfd08af256a9ab_GL0.tar.gz) = e7a09d51dc7e96cb8422c919c85fc3833d4f788567638c9162ef5cd7db59b1df -SIZE (qemu/10.0.20250630/qemu-project-berkeley-testfloat-3-e7af9751d9f9fd3b47911f51a5cfd08af256a9ab_GL0.tar.gz) = 139308 +TIMESTAMP = 1755427471 +SHA256 (qemu/10.0.20250731/qemu-project-qemu-cd9f752fee75238f842a91be1146c988bd16a010_GL0.tar.gz) = bf689d75145890fb417efe61d6e3a1bc017357c8a0490f920df7d1b7da5b02ab +SIZE (qemu/10.0.20250731/qemu-project-qemu-cd9f752fee75238f842a91be1146c988bd16a010_GL0.tar.gz) = 40103786 +SHA256 (qemu/10.0.20250731/qemu-project-keycodemapdb-f5772a62ec52591ff6870b7e8ef32482371f22c6_GL0.tar.gz) = d014b53382dbb17b8196ad12f50de7f20d0ef1b9f7d54b0be51a6cbb14209195 +SIZE (qemu/10.0.20250731/qemu-project-keycodemapdb-f5772a62ec52591ff6870b7e8ef32482371f22c6_GL0.tar.gz) = 29580 +SHA256 (qemu/10.0.20250731/qemu-project-dtc-b6910bec11614980a21e46fbccc35934b671bd81_GL0.tar.gz) = e115f987eec23a1ba25150a46ced1675de3716072d3b4905afb3a9cda0f007c7 +SIZE (qemu/10.0.20250731/qemu-project-dtc-b6910bec11614980a21e46fbccc35934b671bd81_GL0.tar.gz) = 205556 +SHA256 (qemu/10.0.20250731/qemu-project-libvfio-user-0b28d205572c80b568a1003db2c8f37ca333e4d7_GL0.tar.gz) = d2f60cd4f86f345aab1332953eb736cce3518159e6e99bcc2d10467c06f717fe +SIZE (qemu/10.0.20250731/qemu-project-libvfio-user-0b28d205572c80b568a1003db2c8f37ca333e4d7_GL0.tar.gz) = 189943 +SHA256 (qemu/10.0.20250731/qemu-project-meson-dd7cf67f00f1b08fc15885d9bade23f8e76845c0_GL0.tar.gz) = 16f79bf0ebccbc803045e802b8b7aa18913eed4c1195c485c6a25cf18526d563 +SIZE (qemu/10.0.20250731/qemu-project-meson-dd7cf67f00f1b08fc15885d9bade23f8e76845c0_GL0.tar.gz) = 4922724 +SHA256 (qemu/10.0.20250731/qemu-project-berkeley-softfloat-3-b64af41c3276f97f0e181920400ee056b9c88037_GL0.tar.gz) = faae889814ea6a292f7ca03d9b36e6c7e95bab2a64777804883cc822b8d48757 +SIZE (qemu/10.0.20250731/qemu-project-berkeley-softfloat-3-b64af41c3276f97f0e181920400ee056b9c88037_GL0.tar.gz) = 148741 +SHA256 (qemu/10.0.20250731/qemu-project-berkeley-testfloat-3-e7af9751d9f9fd3b47911f51a5cfd08af256a9ab_GL0.tar.gz) = e7a09d51dc7e96cb8422c919c85fc3833d4f788567638c9162ef5cd7db59b1df +SIZE (qemu/10.0.20250731/qemu-project-berkeley-testfloat-3-e7af9751d9f9fd3b47911f51a5cfd08af256a9ab_GL0.tar.gz) = 139308 diff --git a/emulators/qemu/Makefile b/emulators/qemu/Makefile index df1fa1174335..f6eff65b8ff2 100644 --- a/emulators/qemu/Makefile +++ b/emulators/qemu/Makefile @@ -1,5 +1,5 @@ PORTNAME= qemu -DISTVERSION= 10.0.2 +DISTVERSION= 10.1.0 CATEGORIES= emulators MASTER_SITES= https://download.qemu.org/ DIST_SUBDIR= qemu/${PORTVERSION} diff --git a/emulators/qemu/distinfo b/emulators/qemu/distinfo index 20b36677720e..da4eef02182e 100644 --- a/emulators/qemu/distinfo +++ b/emulators/qemu/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1748524246 -SHA256 (qemu/10.0.2/qemu-10.0.2.tar.xz) = ef786f2398cb5184600f69aef4d5d691efd44576a3cff4126d38d4c6fec87759 -SIZE (qemu/10.0.2/qemu-10.0.2.tar.xz) = 135678180 +TIMESTAMP = 1756287018 +SHA256 (qemu/10.1.0/qemu-10.1.0.tar.xz) = e0517349b50ca73ebec2fa85b06050d5c463ca65c738833bd8fc1f15f180be51 +SIZE (qemu/10.1.0/qemu-10.1.0.tar.xz) = 141999456 diff --git a/emulators/qemu/pkg-plist b/emulators/qemu/pkg-plist index 0622304d8a65..f6a824c2be31 100644 --- a/emulators/qemu/pkg-plist +++ b/emulators/qemu/pkg-plist @@ -53,10 +53,14 @@ include/qemu-plugin.h @sample etc/qemu-ifdown.sample %%DATADIR%%/QEMU,tcx.bin %%DATADIR%%/QEMU,cgthree.bin +%%DATADIR%%/ast27x0_bootrom.bin %%DATADIR%%/bios-256k.bin %%DATADIR%%/bios-microvm.bin %%DATADIR%%/bios.bin -%%DATADIR%%/canyonlands.dtb +%%DATADIR%%/dtb/bamboo.dtb +%%DATADIR%%/dtb/canyonlands.dtb +%%DATADIR%%/dtb/petalogix-ml605.dtb +%%DATADIR%%/dtb/petalogix-s3adsp1800.dtb %%DATADIR%%/edk2-aarch64-code.fd %%DATADIR%%/edk2-arm-code.fd %%DATADIR%%/edk2-arm-vars.fd @@ -134,7 +138,6 @@ include/qemu-plugin.h %%DATADIR%%/opensbi-riscv32-generic-fw_dynamic.bin %%DATADIR%%/opensbi-riscv64-generic-fw_dynamic.bin %%DATADIR%%/palcode-clipper -%%DATADIR%%/petalogix-ml605.dtb %%DATADIR%%/pnv-pnor.bin %%DATADIR%%/pxe-e1000.rom %%DATADIR%%/pxe-eepro100.rom @@ -157,8 +160,6 @@ include/qemu-plugin.h %%DATADIR%%/vgabios-vmware.bin %%DATADIR%%/skiboot.lid %%DATADIR%%/trace-events-all -%%DATADIR%%/petalogix-s3adsp1800.dtb -%%DATADIR%%/bamboo.dtb %%DATADIR%%/kvmvapic.bin %%DATADIR%%/u-boot.e500 %%DATADIR%%/pvh.bin diff --git a/emulators/sameboy/Makefile b/emulators/sameboy/Makefile index 065d043af171..7477c7e23aeb 100644 --- a/emulators/sameboy/Makefile +++ b/emulators/sameboy/Makefile @@ -1,6 +1,6 @@ PORTNAME= sameboy DISTVERSIONPREFIX= v -DISTVERSION= 1.0.1 +DISTVERSION= 1.0.2 CATEGORIES= emulators games MAINTAINER= eduardo@FreeBSD.org diff --git a/emulators/sameboy/distinfo b/emulators/sameboy/distinfo index 733bf7a93e9c..2aabea89411a 100644 --- a/emulators/sameboy/distinfo +++ b/emulators/sameboy/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1743805732 -SHA256 (LIJI32-SameBoy-v1.0.1_GH0.tar.gz) = ccaba9e567330e3c4ce4ac10e5a410797b148557b42482b4fd55c61d592cd0c9 -SIZE (LIJI32-SameBoy-v1.0.1_GH0.tar.gz) = 7438446 +TIMESTAMP = 1754069839 +SHA256 (LIJI32-SameBoy-v1.0.2_GH0.tar.gz) = 226fb89e0bffb750d59619a8da7d7885517a68d6be3eae682abc7a9a49b16571 +SIZE (LIJI32-SameBoy-v1.0.2_GH0.tar.gz) = 7852346 diff --git a/emulators/sameboy/pkg-plist b/emulators/sameboy/pkg-plist index 63106b2c8e6b..afa3cc348a6f 100644 --- a/emulators/sameboy/pkg-plist +++ b/emulators/sameboy/pkg-plist @@ -20,7 +20,7 @@ share/icons/hicolor/512x512/mimetypes/x-gameboy-rom.png share/icons/hicolor/64x64/apps/sameboy.png share/icons/hicolor/64x64/mimetypes/x-gameboy-color-rom.png share/icons/hicolor/64x64/mimetypes/x-gameboy-rom.png -share/mime/sameboy.xml +share/mime/packages/sameboy.xml @comment %%DATADIR%%/LICENSE %%DATADIR%%/Palettes/Canyon.sbp %%DATADIR%%/Palettes/Desert.sbp diff --git a/emulators/virtualbox-ose-70/Makefile b/emulators/virtualbox-ose-70/Makefile index 7b6efa0001d2..4d7dea9d02ca 100644 --- a/emulators/virtualbox-ose-70/Makefile +++ b/emulators/virtualbox-ose-70/Makefile @@ -45,7 +45,9 @@ CONFLICTS_INSTALL= virtualbox-ose-legacy \ virtualbox-ose \ virtualbox-ose-nox11 \ virtualbox-ose-71 \ - virtualbox-ose-nox11-71 + virtualbox-ose-nox11-71 \ + virtualbox-ose-72 \ + virtualbox-ose-nox11-72 PORTSCOUT= limit:^7\.0\. SUB_FILES= pkg-message diff --git a/emulators/virtualbox-ose-71/Makefile b/emulators/virtualbox-ose-71/Makefile index 7642c320ea48..7b5d79a0d306 100644 --- a/emulators/virtualbox-ose-71/Makefile +++ b/emulators/virtualbox-ose-71/Makefile @@ -1,6 +1,6 @@ PORTNAME= virtualbox-ose -DISTVERSION= 7.1.10 -PORTREVISION?= 2 +DISTVERSION= 7.1.12 +PORTREVISION?= 0 CATEGORIES= emulators MASTER_SITES= https://download.virtualbox.org/virtualbox/${DISTVERSION}/:src \ LOCAL/vvd:docs @@ -44,7 +44,9 @@ CONFLICTS_INSTALL= virtualbox-ose-legacy \ virtualbox-ose \ virtualbox-ose-nox11 \ virtualbox-ose-70 \ - virtualbox-ose-nox11-70 + virtualbox-ose-nox11-70 \ + virtualbox-ose-72 \ + virtualbox-ose-nox11-72 PORTSCOUT= limit:^7\.1\. SUB_FILES= pkg-message diff --git a/emulators/virtualbox-ose-71/distinfo b/emulators/virtualbox-ose-71/distinfo index 36ff7a2f5869..e7b992b0b10c 100644 --- a/emulators/virtualbox-ose-71/distinfo +++ b/emulators/virtualbox-ose-71/distinfo @@ -1,7 +1,7 @@ -TIMESTAMP = 1749075437 -SHA256 (VirtualBox-7.1.10.tar.bz2) = 7d60010a4c9102613554b46f61d17b825c30ee59d8be071e52d8aac664ca9869 -SIZE (VirtualBox-7.1.10.tar.bz2) = 233395034 -SHA256 (VirtualBox-docs-7.1.10.tar.bz2) = 5ff2827643d1d01ad6e26eb86dd7a2e1c9ce13c7049ab360054bd689253fd14b -SIZE (VirtualBox-docs-7.1.10.tar.bz2) = 10113312 -SHA256 (VBoxGuestAdditions_7.1.10.iso) = 59c92f7f5fd7e081211e989f5117fc53ad8d8800ad74a01b21e97bb66fe62972 -SIZE (VBoxGuestAdditions_7.1.10.iso) = 61378560 +TIMESTAMP = 1752700000 +SHA256 (VirtualBox-7.1.12.tar.bz2) = 6f9618f39168898134975f51df7c2d6d5129c0aa82b6ae11cf47f920c70df276 +SIZE (VirtualBox-7.1.12.tar.bz2) = 214691769 +SHA256 (VirtualBox-docs-7.1.12.tar.bz2) = ba48f2da2593d8cae56fcf601c132d77dbf1d16b1e26db162c89449250c269bd +SIZE (VirtualBox-docs-7.1.12.tar.bz2) = 10109084 +SHA256 (VBoxGuestAdditions_7.1.12.iso) = 256883e2eabf7ab5c10fb3b6831c294942ce34bc615807f9d0cf6c3d2e882236 +SIZE (VBoxGuestAdditions_7.1.12.iso) = 61331456 diff --git a/emulators/virtualbox-ose-71/files/patch-src-VBox-Runtime-Makefile.kmk b/emulators/virtualbox-ose-71/files/patch-src-VBox-Runtime-Makefile.kmk deleted file mode 100644 index f13be222ea9a..000000000000 --- a/emulators/virtualbox-ose-71/files/patch-src-VBox-Runtime-Makefile.kmk +++ /dev/null @@ -1,14 +0,0 @@ ---- src/VBox/Runtime/Makefile.kmk.orig 2021-01-07 15:41:50 UTC -+++ src/VBox/Runtime/Makefile.kmk -@@ -177,6 +177,11 @@ $(IPRT_OUT_DIR)/oiddb.h.ts +| $(IPRT_OUT_DIR)/oiddb.h: - - - # -+# Set the defines that utf8-posix.cpp needs. It's used by several targets. -+# -+r3/posix/utf8-posix.cpp_DEFS.freebsd = $(VBOX_ICONV_DEFS) -+ -+# - # Unicode Specification reader used to regenerate unidata-*.cpp. - # - uniread_TEMPLATE = VBoxBldProg diff --git a/emulators/virtualbox-ose-72/Makefile b/emulators/virtualbox-ose-72/Makefile new file mode 100644 index 000000000000..3110b3efe1aa --- /dev/null +++ b/emulators/virtualbox-ose-72/Makefile @@ -0,0 +1,426 @@ +PORTNAME= virtualbox-ose +DISTVERSION= 7.2.0 +PORTREVISION?= 0 +CATEGORIES= emulators +MASTER_SITES= https://download.virtualbox.org/virtualbox/${DISTVERSION}/:src \ + LOCAL/vvd:docs +PKGNAMESUFFIX?= -72 +DISTFILES= VirtualBox-${DISTVERSION}${EXTRACT_SUFX}:src \ + VirtualBox-docs-${DISTVERSION}${EXTRACT_SUFX}:docs +EXTRACT_ONLY= VirtualBox-${DISTVERSION}${EXTRACT_SUFX} \ + VirtualBox-docs-${DISTVERSION}${EXTRACT_SUFX} + +MAINTAINER= vbox@FreeBSD.org +COMMENT= General-purpose full virtualizer for x86 hardware +WWW= https://www.virtualbox.org/ + +LICENSE= GPLv2 +LICENSE_FILE= ${WRKSRC}/COPYING + +ONLY_FOR_ARCHS= amd64 + +BUILD_DEPENDS= gtar:archivers/gtar \ + kmk:devel/kBuild \ + yasm:devel/yasm \ + xsltproc:textproc/libxslt +LIB_DEPENDS= libpng.so:graphics/png \ + libcurl.so:ftp/curl +RUN_DEPENDS= ${LOCALBASE}/etc/rc.d/vboxnet:emulators/virtualbox-ose-kmod-72 + +USES= compiler:c++17-lang cpe gnome iconv pkgconfig qt:6 ssl tar:bzip2 +CPE_VENDOR= oracle +CPE_PRODUCT= vm_virtualbox +USE_BINUTILS= yes +USE_GNOME= libxml2 +USE_QT= tools:build +USE_RC_SUBR= vboxheadless vboxwatchdog + +HAS_CONFIGURE= yes +CONFIGURE_ARGS= --disable-java --passive-mesa --disable-docs +CONFIGURE_ARGS+= --with-gcc="${CC}" --with-g++="${CXX}" + +CONFLICTS_INSTALL= virtualbox-ose-legacy \ + virtualbox-ose-nox11-legacy \ + virtualbox-ose \ + virtualbox-ose-nox11 \ + virtualbox-ose-70 \ + virtualbox-ose-nox11-70 \ + virtualbox-ose-71 \ + virtualbox-ose-nox11-71 + +PORTSCOUT= limit:^7\.2\. +SUB_FILES= pkg-message +SUB_LIST= VBOXDIR=${VBOX_DIR} \ + VBOX_ETC=${VBOX_ETC} \ + VBOXGROUP=${VBOXGROUP} \ + VBOXUSER=${VBOXUSER} \ + VBOXWSUSER=${VBOXWSUSER} + +WRKSRC= ${WRKDIR}/VirtualBox-${DISTVERSION} + +VBOXUSER?= vboxusers +VBOXWSUSER?= vboxusers +VBOXGROUP?= vboxusers +USERS= ${VBOXUSER} +GROUPS= ${VBOXGROUP} +VBOX_DIR= ${PREFIX}/${VBOX_DIR_REL} +VBOX_DIR_REL= lib/virtualbox +VBOX_ETC= ${PREFIX}/etc/vbox +VBOX_LINKS= VBoxVRDP +VBOX_PROGS= VBoxAutostart VBoxBalloonCtrl VBoxBugReport VBoxHeadless \ + VBoxManage +VBOX_UTILS= VBoxExtPackHelperApp VBoxNetAdpCtl VBoxNetDHCP VBoxNetNAT \ + VBoxSVC + +PLIST_SUB= GUEST_VER=${DISTVERSION} \ + PYTHON_VERU=${PYTHON_VER:S/./_/}${PYTHON_ABIVER} \ + VBOXGROUP=${VBOXGROUP} + +SLAVE_PORT?= no + +OPTIONS_DEFINE= AIO ALSA DBUS DEBUG DOCS GUESTADDITIONS NLS OGG PULSEAUDIO \ + PYTHON QT6 R0LOGGING UDPTUNNEL VBOXIMG VDE VNC VORBIS VPX \ + WEBSERVICE X11 +OPTIONS_DEFAULT= AIO DBUS QT6 UDPTUNNEL VNC WEBSERVICE X11 +.if ${SLAVE_PORT} == no +OPTIONS_DEFAULT+= PYTHON +.endif +# Since version 6.1.24 pulseaudio is broken at runtime, preventing +# virtual machines from starting if configured to use it. +OPTIONS_EXCLUDE+= PULSEAUDIO +OPTIONS_SUB= yes + +AIO_DESC= Enable Asyncronous IO support (check pkg-message) +DEBUG_DESC= Debug symbols, additional logs and assertions +GUESTADDITIONS_DESC= Build with Guest Additions +NLS_DESC= Native language support (requires QT6) +OGG_DESC= Use libogg from audio/libogg instead of bundled one +QT6_DESC= Build with QT6 frontend (requires X11) +R0LOGGING_DESC= Enable R0 logging (requires DEBUG) +UDPTUNNEL_DESC= Build with UDP tunnel support +VBOXIMG_DESC= Build vboximg-mount (requires fuse-libs) +VDE_DESC= Build with VDE support +VNC_DESC= Build with VNC support +VORBIS_DESC= Use libvorbis from audio/libvorbis instead of bundled one +VPX_DESC= Use libvpx for video recording +WEBSERVICE_DESC= Build Webservice + +ALSA_LIB_DEPENDS= libasound.so:audio/alsa-lib +ALSA_CONFIGURE_OFF= --disable-alsa +DBUS_LIB_DEPENDS= libdbus-1.so:devel/dbus +DBUS_CONFIGURE_OFF= --disable-dbus +DEBUG_CONFIGURE_ON= --build-debug +NLS_IMPLIES= QT6 +OGG_LIB_DEPENDS= libogg.so:audio/libogg +OGG_CONFIGURE_ON= --enable-libogg +PULSEAUDIO_LIB_DEPENDS= libpulse.so:audio/pulseaudio +PULSEAUDIO_CONFIGURE_OFF= --disable-pulse +PYTHON_USES= python +PYTHON_USES_OFF= python:build +PYTHON_USE= PYTHON=distutils,noegginfo,noflavors +PYTHON_CONFIGURE_OFF= --disable-python +PYTHON_VARS= pydistutils_pkgname=vboxapi pydistutils_pkgversion=1.0 +QT6_IMPLIES= X11 +QT6_USES= gl qmake:no_env qt:6 xorg +QT6_USE= QT=base,scxml,tools,translations \ + XORG=xcb GL=gl +QT6_CONFIGURE_OFF= --disable-qt +R0LOGGING_IMPLIES= DEBUG +UDPTUNNEL_CONFIGURE_OFF= --disable-udptunnel +VBOXIMG_LIB_DEPENDS= libfuse.so.2:filesystems/fusefs-libs +VDE_RUN_DEPENDS= vde_switch:net/vde2 +VDE_CONFIGURE_ON= --enable-vde +VNC_LIB_DEPENDS= libvncserver.so:net/libvncserver +VNC_CONFIGURE_ON= --enable-vnc +VORBIS_LIB_DEPENDS= libvorbis.so:audio/libvorbis \ + libvorbisenc.so:audio/libvorbis +VORBIS_CONFIGURE_ON= --enable-libvorbis +VPX_LIB_DEPENDS= libvpx.so:multimedia/libvpx +VPX_CONFIGURE_OFF= --disable-libvpx +WEBSERVICE_BUILD_DEPENDS= soapcpp2:devel/gsoap +X11_USES= sdl xorg +X11_USE= SDL=sdl XORG=x11,xcursor,xext,xinerama,xmu,xorgproto,xt +X11_CONFIGURE_OFF= --build-headless + +ENV= +.export ENV + +.include <bsd.port.options.mk> + +.if ${SLAVE_PORT} == no +CONFLICTS_INSTALL+= virtualbox-ose-nox11-72 +.else +CONFLICTS_INSTALL+= virtualbox-ose-72 +.endif + +.if ${PORT_OPTIONS:MDEBUG} +KMK_BUILDTYPE= debug +KMK_FLAGS+= BUILD_TYPE=debug +.else +KMK_BUILDTYPE= release +.endif + +.if ${PORT_OPTIONS:MGUESTADDITIONS} +GUESTADDITIONS= VBoxGuestAdditions_${DISTVERSION}.iso +DISTFILES+= ${GUESTADDITIONS}:src +LICENSE+= Additions +LICENSE_COMB= multi +LICENSE_NAME_Additions= Guest Additions +LICENSE_PERMS_Additions= auto-accept +LICENSE_DISTFILES_Additions= ${GUESTADDITIONS} +.endif + +.if ${PORT_OPTIONS:MQT6} +PLIST_SUB+= QT="" +VBOX_PROGS+= VirtualBox VirtualBoxVM +VBOX_WITH_QT= 1 +.else +PLIST_SUB+= QT="@comment " +.endif + +.if ${PORT_OPTIONS:MWEBSERVICE} +USE_RC_SUBR+= vboxinit vboxwebsrv +VBOX_LINKS+= vboxwebsrv +VBOX_UTILS+= vboxwebsrv webtest +.endif + +.if ${PORT_OPTIONS:MX11} +#VBOX_PROGS+= VBoxSDL +.endif + +.if ${PORT_OPTIONS:MPYTHON} || ${PORT_OPTIONS:MWEBSERVICE} +PLIST_SUB+= SDK="" +.else +PLIST_SUB+= SDK="@comment " +.endif + +.if ${PORT_OPTIONS:MVBOXIMG} +EXTRA_PATCHES+= ${PATCHDIR}/extrapatch-vboximg-Config.kmk +VBOX_UTILS+= vboximg-mount +PLIST_SUB+= VBOXIMG="" +.else +PLIST_SUB+= VBOXIMG="@comment " +.endif + +KMK_ARCH= freebsd.${ARCH} +PLIST_SUB+= ARCH="${KMK_ARCH}" + +KMK_BUILDDIR= ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE} +KMK_CONFIG= VBOX_LIBPATH_X11=${LOCALBASE} VBOX_FREEBSD_SRC=${SRC_BASE}/sys VBOX_WITHOUT_DOCS=1 VBOX_GCC_std=-std=c++17 +KMK_FLAGS+= -j${MAKE_JOBS_NUMBER} + +.include <bsd.port.pre.mk> + +.if ${CHOSEN_COMPILER_TYPE} == clang +PATCH_DEPENDS+= ${LOCALBASE}/share/kBuild/tools/GXX3.kmk:devel/kBuild +.endif + +.if ${PYTHON_MAJOR_VER} >= 3 +PLIST_SUB+= PYTHON_PYCDIR=/__pycache__/ \ + PYTHON_PYCEXT=.cpython-${PYTHON_SUFFIX}.pyc +.else +PLIST_SUB+= PYTHON_PYCDIR=/ \ + PYTHON_PYCEXT=.pyc +.endif + +.if ${SSL_DEFAULT} != base +CONFIGURE_ARGS+= --with-openssl-dir="${OPENSSLBASE}" +.endif + +post-patch: + @${ECHO_CMD} 'VBOX_PATH_APP_PRIVATE_ARCH = ${VBOX_DIR}' > \ + ${WRKSRC}/LocalConfig.kmk + @${ECHO_CMD} 'VBOX_PATH_DOCBOOK = ${DBKXSLDIR}' >> \ + ${WRKSRC}/LocalConfig.kmk + @${ECHO_CMD} 'VBOX_PATH_DOCBOOK_DTD = ${DBKXMLDIR}' >> \ + ${WRKSRC}/LocalConfig.kmk + @${ECHO_CMD} 'VBOX_PATH_SHARED_LIBS = ${VBOX_DIR}' >> \ + ${WRKSRC}/LocalConfig.kmk + # Please keep this even if using Clang to avoid repeated regressions. + # PR 245048 + @${ECHO_CMD} "VBOX_WITH_RUNPATH = ${_GCC_RUNTIME:D${_GCC_RUNTIME}\:}${VBOX_DIR}" >> \ + ${WRKSRC}/LocalConfig.kmk + @${ECHO_CMD} 'VBOX_PATH_APP_PRIVATE = ${DATADIR}' >> \ + ${WRKSRC}/LocalConfig.kmk + @${ECHO_CMD} 'VBOX_PATH_APP_DOCS = ${DOCSDIR}' >> ${WRKSRC}/LocalConfig.kmk +.if ${SSL_DEFAULT} != base + @${ECHO_CMD} 'VBOX_WITH_ALT_HASH_CODE = 1' >> ${WRKSRC}/LocalConfig.kmk +.endif + @${ECHO_CMD} 'VBOX_WITH_EXTPACK_VBOXDTRACE =' >> ${WRKSRC}/LocalConfig.kmk + @${ECHO_CMD} 'VBOX_WITH_INSTALLER = 1' >> ${WRKSRC}/LocalConfig.kmk + @${ECHO_CMD} 'VBOX_WITH_VBOXDRV =' >> ${WRKSRC}/LocalConfig.kmk + @${ECHO_CMD} 'VBOX_WITH_TESTCASES =' >> ${WRKSRC}/LocalConfig.kmk + @${ECHO_CMD} 'SDK_VBOX_LIBPNG_INCS = ${PREFIX}/include/libpng' >> \ + ${WRKSRC}/LocalConfig.kmk + @${ECHO_CMD} 'SDK_VBOX_LIBPNG_LIBS = png' >> ${WRKSRC}/LocalConfig.kmk + @${ECHO_CMD} 'VBOX_WITH_ADDITIONS =' >> ${WRKSRC}/LocalConfig.kmk + @${ECHO_CMD} 'VBOX_WITH_DRAG_AND_DROP = ${VBOX_WITH_QT}' >> \ + ${WRKSRC}/LocalConfig.kmk + @${ECHO_CMD} 'VBOX_WITH_DRAG_AND_DROP_GH = ${VBOX_WITH_QT}' >> \ + ${WRKSRC}/LocalConfig.kmk + @${ECHO_CMD} 'VBOX_WITH_VALIDATIONKIT =' >> ${WRKSRC}/LocalConfig.kmk + @${ECHO_CMD} 'VBOX_WITH_X11_ADDITIONS =' >> ${WRKSRC}/LocalConfig.kmk + @${ECHO_CMD} 'VBOX_BLD_PYTHON = ${LOCALBASE}/bin/${PYTHON_VERSION}' >> \ + ${WRKSRC}/LocalConfig.kmk +.if ${PORT_OPTIONS:MR0LOGGING} + @${ECHO_CMD} 'VBOX_WITH_R0_LOGGING = 1' >> ${WRKSRC}/LocalConfig.kmk +.endif +.if ${PORT_OPTIONS:MWEBSERVICE} + @${ECHO_CMD} 'VBOX_WITH_WEBSERVICES = 1' >> ${WRKSRC}/LocalConfig.kmk + @${ECHO_CMD} 'VBOX_GSOAP_INSTALLED = 1' >> ${WRKSRC}/LocalConfig.kmk + @${ECHO_CMD} 'VBOX_PATH_GSOAP = ${PREFIX}/lib/gsoap' >> \ + ${WRKSRC}/LocalConfig.kmk + @${ECHO_CMD} 'VBOX_PATH_GSOAP_BIN = ${PREFIX}/bin' >> \ + ${WRKSRC}/LocalConfig.kmk + @${ECHO_CMD} 'VBOX_PATH_GSOAP_IMPORT = ${PREFIX}/share/gsoap/import' >> \ + ${WRKSRC}/LocalConfig.kmk + @${ECHO_CMD} 'VBOX_GCC_PEDANTIC_CXX = -Wshadow $$(VBOX_GCC_WARN) -Wno-long-long' >> \ + ${WRKSRC}/LocalConfig.kmk +.endif +.if empty(PORT_OPTIONS:MX11) + @${ECHO} 'VBOX_WITH_VMSVGA3D =' >> ${WRKSRC}/LocalConfig.kmk +.endif +.if ${CHOSEN_COMPILER_TYPE} == clang + @${REINPLACE_CMD} -e 's| -finline-limit=8000||' \ + -e 's| -mpreferred-stack-boundary=2||' ${WRKSRC}/Config.kmk + @${REINPLACE_CMD} -e 's| -fpermissive||' ${WRKSRC}/Config.kmk \ + ${WRKSRC}/src/VBox/Main/webservice/Makefile.kmk + @${ECHO_CMD} 'TOOL_VBoxGccFreeBSD_LD = ${CXX}' >> ${WRKSRC}/LocalConfig.kmk + @${SED} -e 's|GXX3|VBoxGccFreeBSD|g' \ + ${LOCALBASE}/share/kBuild/tools/GXX3.kmk > \ + ${WRKSRC}/tools/kBuildTools/VBoxGccFreeBSD.kmk +.endif +.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1500013 + @${ECHO_CMD} 'VBoxSVC_LDFLAGS.freebsd = -lsys' >> ${WRKSRC}/LocalConfig.kmk +.endif + # Causes a "reinplace" QA warning with default LOCALBASE + @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \ + ${WRKSRC}/Config.kmk ${WRKSRC}/configure \ + ${WRKSRC}/kBuild/header.kmk ${WRKSRC}/kBuild/units/qt4.kmk \ + ${WRKSRC}/kBuild/units/qt5.kmk ${WRKSRC}/kBuild/units/qt6.kmk ${WRKSRC}/kBuild/sdks/LIBSDL.kmk \ + ${WRKSRC}/src/libs/xpcom18a4/python/gen_python_deps.py + @${REINPLACE_CMD} \ + -e 's|\$$KBUILDDIR_BIN/kmk_sed|${LOCALBASE}/bin/kmk_sed|g' \ + -e 's|SUPPYTHONLIBS=.*|SUPPYTHONLIBS="${PYTHON_VERSION}${PYTHON_ABIVER}"|' \ + ${WRKSRC}/configure +.if empty(ICONV_LIB) + @${REINPLACE_CMD} -e 's|iconv||' ${WRKSRC}/Config.kmk \ + ${WRKSRC}/src/VBox/Runtime/Makefile.kmk + @${ECHO_CMD} 'VBOX_ICONV_DEFS = LIBICONV_PLUG' >> ${WRKSRC}/LocalConfig.kmk +.endif + @${REINPLACE_CMD} -e 's|%%VBOX_DIR%%|${VBOX_DIR}|g' \ + -e 's|%%VBOX_ETC%%|${VBOX_ETC}|g' \ + -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ + ${WRKSRC}/src/VBox/Installer/freebsd/VBox.sh + @${REINPLACE_CMD} -e 's|%%VBOX_ETC%%|${VBOX_ETC}|g' \ + ${WRKSRC}/src/VBox/HostDrivers/adpctl/VBoxNetAdpCtl.cpp + @${REINPLACE_CMD} \ + -e 's|^versions =.*|versions = ["${PYTHON_VER}${PYTHON_ABIVER}"]|' \ + ${WRKSRC}/src/libs/xpcom18a4/python/gen_python_deps.py + +post-patch-AIO-off: + @${REINPLACE_CMD} 's|r3/freebsd/fileaio-freebsd.cpp|r3/posix/fileaio-posix.cpp|' \ + ${WRKSRC}/src/VBox/Runtime/Makefile.kmk + +do-build: + cd ${WRKSRC} && ${SH} -c '. ${WRKSRC}/env.sh && \ + ${SETENV} ${MAKE_ENV} ${KMK_CONFIG} ${LOCALBASE}/bin/kmk ${KMK_FLAGS}' +.if ${PORT_OPTIONS:MPYTHON} + ${PYTHON_CMD} -mcompileall \ + ${KMK_BUILDDIR}/bin/sdk/bindings/xpcom/python/xpcom +.endif + +do-install: +.if ${PORT_OPTIONS:MPYTHON} || ${PORT_OPTIONS:MWEBSERVICE} + ${MKDIR} ${STAGEDIR}${DATADIR}/sdk +.endif + cd ${KMK_BUILDDIR}/bin/sdk/bindings/xpcom && \ + ${COPYTREE_SHARE} "idl samples" ${STAGEDIR}${DATADIR} + + ${MKDIR} ${STAGEDIR}${PREFIX}/include/virtualbox + cd ${KMK_BUILDDIR}/bin/sdk/bindings/xpcom/include && \ + ${COPYTREE_SHARE} "*" ${STAGEDIR}${PREFIX}/include/virtualbox + + ${MKDIR} ${STAGEDIR}${VBOX_DIR} + cd ${KMK_BUILDDIR}/bin && ${COPYTREE_SHARE} \ + "*.fd *.r0 *.so components" ${STAGEDIR}${VBOX_DIR} +.if ${PORT_OPTIONS:MPYTHON} || ${PORT_OPTIONS:MWEBSERVICE} + ${RLN} ${STAGEDIR}${DATADIR}/sdk ${STAGEDIR}${VBOX_DIR} +.endif + + ${INSTALL_SCRIPT} ${WRKSRC}/src/VBox/Installer/freebsd/VBox.sh \ + ${STAGEDIR}${VBOX_DIR} +.for f in ${VBOX_PROGS} ${VBOX_UTILS} + ${INSTALL_PROGRAM} ${KMK_BUILDDIR}/bin/${f} ${STAGEDIR}${VBOX_DIR} +.endfor +.for f in ${VBOX_PROGS} ${VBOX_LINKS} + ${LN} -fs ../${VBOX_DIR_REL}/VBox.sh ${STAGEDIR}${PREFIX}/bin/${f} +.endfor +.for f in ${VBOX_PROGS} + ${LN} -fs ../${VBOX_DIR_REL}/VBox.sh ${STAGEDIR}${PREFIX}/bin/${f:tl} +.endfor + +.if ${PORT_OPTIONS:MGUESTADDITIONS} + ${MKDIR} ${STAGEDIR}${VBOX_DIR}/additions + ${INSTALL_DATA} ${DISTDIR}/${GUESTADDITIONS} \ + ${STAGEDIR}${VBOX_DIR}/additions/ + ${RLN} ${STAGEDIR}${VBOX_DIR}/additions/${GUESTADDITIONS} \ + ${STAGEDIR}${VBOX_DIR}/additions/VBoxGuestAdditions.iso +.endif + +.if ${PORT_OPTIONS:MDOCS} + ${MKDIR} ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} ${WRKDIR}/VirtualBox-docs-${DISTVERSION}/UserManual.pdf \ + ${STAGEDIR}${DOCSDIR} +.endif + +.if ${PORT_OPTIONS:MNLS} + cd ${KMK_BUILDDIR}/obj/VirtualBox/qtnls && \ + ${COPYTREE_SHARE} "*.qm" ${STAGEDIR}${DATADIR}/nls +.endif + +.if ${PORT_OPTIONS:MPYTHON} + cd ${KMK_BUILDDIR}/bin/sdk/installer/python && \ + ${SETENV} VBOX_INSTALL_PATH="${VBOX_DIR}" \ + ${PYTHON_CMD} vboxapisetup.py install --root=${STAGEDIR} + + @${MKDIR} ${STAGEDIR}${PYTHON_SITELIBDIR}/xpcom + cd ${KMK_BUILDDIR}/bin/sdk/bindings/xpcom/python/xpcom && \ + ${COPYTREE_SHARE} "*" ${STAGEDIR}${PYTHON_SITELIBDIR}/xpcom + @${MKDIR} ${STAGEDIR}${DATADIR}/sdk/bindings/xpcom/python + ${RLN} ${STAGEDIR}${PYTHON_SITELIBDIR}/xpcom \ + ${STAGEDIR}${DATADIR}/sdk/bindings/xpcom/python +.endif + +.if ${PORT_OPTIONS:MQT6} + ${INSTALL_DATA} \ + ${WRKSRC}/src/VBox/Frontends/VirtualBox/images/OSE/VirtualBox_48px.png \ + ${STAGEDIR}${PREFIX}/share/pixmaps/VBox.png + ${INSTALL_DATA} \ + ${FILESDIR}/virtualbox.desktop \ + ${STAGEDIR}${PREFIX}/share/applications/virtualbox.desktop +.endif + +.if ${PORT_OPTIONS:MVNC} + ${MKDIR} ${STAGEDIR}${VBOX_DIR}/ExtensionPacks/VNC/${KMK_ARCH} + ${INSTALL_DATA} ${KMK_BUILDDIR}/bin/ExtensionPacks/VNC/ExtPack* \ + ${STAGEDIR}${VBOX_DIR}/ExtensionPacks/VNC/ + ${INSTALL_LIB} ${KMK_BUILDDIR}/bin/ExtensionPacks/VNC/${KMK_ARCH}/* \ + ${STAGEDIR}${VBOX_DIR}/ExtensionPacks/VNC/${KMK_ARCH}/ +.endif + +.if ${PORT_OPTIONS:MVBOXIMG} + ${LN} -fs ../${VBOX_DIR_REL}/vboximg-mount ${STAGEDIR}${PREFIX}/bin/ +.endif + +.if ${PORT_OPTIONS:MWEBSERVICE} + ${MKDIR} ${STAGEDIR}${DATADIR}/sdk/bindings/webservice + ${INSTALL_DATA} ${KMK_BUILDDIR}/obj/webservice/vboxweb.wsdl \ + ${STAGEDIR}${DATADIR}/sdk/bindings/webservice/ +.endif + +post-install: + ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/virtualbox/*.so \ + ${STAGEDIR}${PREFIX}/lib/virtualbox/components/*.so + +.include <bsd.port.post.mk> diff --git a/emulators/virtualbox-ose-72/distinfo b/emulators/virtualbox-ose-72/distinfo new file mode 100644 index 000000000000..ed4ac420cdd3 --- /dev/null +++ b/emulators/virtualbox-ose-72/distinfo @@ -0,0 +1,7 @@ +TIMESTAMP = 1756400000 +SHA256 (VirtualBox-7.2.0.tar.bz2) = 4f2804ff27848ea772aee6b637bb1e10ee74ec2da117c257413e2d2c4f670ba0 +SIZE (VirtualBox-7.2.0.tar.bz2) = 206755781 +SHA256 (VirtualBox-docs-7.2.0.tar.bz2) = 12b27989f2ab9b9316384322a8f1cdadd7003d2e2d6592298e1a84e81f5e0572 +SIZE (VirtualBox-docs-7.2.0.tar.bz2) = 9200668 +SHA256 (VBoxGuestAdditions_7.2.0.iso) = 43f7a1045cad0aab40e3af906fea37244ba6873b91b4e227245a14e51b399abd +SIZE (VBoxGuestAdditions_7.2.0.iso) = 53143552 diff --git a/emulators/virtualbox-ose-72/files/extrapatch-Config.kmk b/emulators/virtualbox-ose-72/files/extrapatch-Config.kmk new file mode 100644 index 000000000000..775508d23b1b --- /dev/null +++ b/emulators/virtualbox-ose-72/files/extrapatch-Config.kmk @@ -0,0 +1,11 @@ +--- Config.kmk.orig 2021-04-28 16:21:25 UTC ++++ Config.kmk +@@ -4931,7 +4931,7 @@ define TOOL_FREEBSDKMODLD_LINK_SYSMOD_CMDS + | xargs -J% objcopy % $(out) + + ## Strip debug info (comment out if debugging or something). +- objcopy --strip-debug $(out) ++# objcopy --strip-debug $(out) + endef + else # x86 + TOOL_FREEBSDKMODLD_LINK_SYSMOD_OUTPUT = $(outbase).kld diff --git a/emulators/virtualbox-ose-72/files/extrapatch-src-VBox-HostDrivers-Support-freebsd-Makefile b/emulators/virtualbox-ose-72/files/extrapatch-src-VBox-HostDrivers-Support-freebsd-Makefile new file mode 100644 index 000000000000..67361da543f7 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/extrapatch-src-VBox-HostDrivers-Support-freebsd-Makefile @@ -0,0 +1,11 @@ +--- src/VBox/HostDrivers/Support/freebsd/Makefile.orig 2012-10-18 16:23:16.000000000 +0200 ++++ src/VBox/HostDrivers/Support/freebsd/Makefile 2012-10-20 08:13:07.301179212 +0200 +@@ -27,7 +27,7 @@ + + KMOD = vboxdrv + +-CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DSUPDRV_WITH_RELEASE_LOGGER -DVBOX -DRT_WITH_VBOX -Iinclude -I. -Ir0drv -w -DVBOX_WITH_HARDENING -DVBOX_WITH_64_BITS_GUESTS ++CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DSUPDRV_WITH_RELEASE_LOGGER -DVBOX -DRT_WITH_VBOX -Iinclude -I. -Ir0drv -w -DVBOX_WITH_HARDENING -DVBOX_WITH_64_BITS_GUESTS -DDEBUG + + .if (${MACHINE_ARCH} == "i386") + CFLAGS += -DRT_ARCH_X86 diff --git a/emulators/virtualbox-ose-72/files/extrapatch-vboximg-Config.kmk b/emulators/virtualbox-ose-72/files/extrapatch-vboximg-Config.kmk new file mode 100644 index 000000000000..d84209faa8cd --- /dev/null +++ b/emulators/virtualbox-ose-72/files/extrapatch-vboximg-Config.kmk @@ -0,0 +1,11 @@ +--- Config.kmk.orig 2023-10-12 15:43:35.000000000 +0700 ++++ Config.kmk 2023-10-30 22:11:09.119922000 +0700 +@@ -869,7 +869,7 @@ + # windows versions (only define when buildling win.x86). + #VBOX_WITH_MORE_NT4_COMPAT_BINARIES = 1 + # Set this to enable building of the vboximg-mount FUSE mounting utility. +-if1of ($(KBUILD_TARGET), darwin linux) ++if1of ($(KBUILD_TARGET), darwin freebsd linux) + VBOX_WITH_VBOXIMGMOUNT = 1 + endif + # Set this to enable packaging the fuse related bits into our installer. diff --git a/emulators/virtualbox-ose-72/files/patch-Config.kmk b/emulators/virtualbox-ose-72/files/patch-Config.kmk new file mode 100644 index 000000000000..c284262eb189 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-Config.kmk @@ -0,0 +1,421 @@ +--- Config.kmk.orig 2025-08-28 22:09:24 UTC ++++ Config.kmk +@@ -624,11 +624,11 @@ endif + # Enable OSS audio support. + VBOX_WITH_AUDIO_OSS = 1 + endif +-if1of ($(KBUILD_TARGET), linux) ++if1of ($(KBUILD_TARGET), freebsd linux) + # Enable ALSA audio support. + VBOX_WITH_AUDIO_ALSA = 1 + endif +-if1of ($(KBUILD_TARGET), linux) ++if1of ($(KBUILD_TARGET), freebsd linux) + # Enable PulseAudio audio support. + VBOX_WITH_AUDIO_PULSE = 1 + endif +@@ -641,11 +641,11 @@ VBOX_WITH_PCI_PASSTHROUGH = + # (disabled with 6.1, since it's not complete/useful enough) + VBOX_WITH_PCI_PASSTHROUGH = + # Enable statically linked dbus support. +-if1of ($(KBUILD_TARGET), linux solaris) ++if1of ($(KBUILD_TARGET), freebsd linux solaris) + VBOX_WITH_DBUS = 1 + endif + # Enable building PAM modules. +-if1of ($(KBUILD_TARGET), linux solaris) ++if1of ($(KBUILD_TARGET), freebsd linux solaris) + VBOX_WITH_PAM = 1 + endif + # Enable internal networking. +@@ -653,7 +653,7 @@ VBOX_WITH_VMSVGA = 1 + # Enable vmsvga (svga2) graphics device variant, 2D part + VBOX_WITH_VMSVGA = 1 + # Enable vmsvga (svga2) graphics device variant, 3D part +-if1of ($(KBUILD_TARGET), darwin linux win) ++if1of ($(KBUILD_TARGET), darwin freebsd linux win) + VBOX_WITH_VMSVGA3D = 1 + endif + # Enable vmsvga (svga2) graphics device variant, 3D part, VGPU10 DX commands +@@ -847,7 +847,7 @@ VBOX_WITH_VBOXMANAGE_NLS = 1 + #endif + # Set this to prefix all C symbols in XPCOM, to avoid dynamic linking problems + # caused by our XPCOM library polluting the symbol namespace for system libs. +-if1of ($(KBUILD_TARGET), linux solaris) ++if1of ($(KBUILD_TARGET), freebsd linux solaris) + VBOX_WITH_XPCOM_NAMESPACE_CLEANUP = 1 + endif + # The webservices api. +@@ -1376,10 +1376,6 @@ endif + endif + endif + +-ifeq ($(KBUILD_TARGET),freebsd) +- VBOX_WITH_DOCS = +-endif +- + ifeq ($(KBUILD_TARGET),haiku) + VBOX_WITH_VRDP_RDESKTOP = + # Permanent (no working SDL). +@@ -1563,7 +1559,7 @@ ifdef VBOX_OSE + # not yet + VBOX_WITH_PLUGIN_CRYPT = + VBOX_WITH_DRAG_AND_DROP_PROMISES = +- ifn1of ($(KBUILD_TARGET), linux) ++ ifn1of ($(KBUILD_TARGET), freebsd linux) + VBOX_WITH_DOCS = + VBOX_WITH_DOCS_PACKING = + endif +@@ -3637,19 +3633,19 @@ ifndef VBOX_GCC_std + # + ## @todo consider maxing this out. + ifndef VBOX_GCC_std +- if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), darwin.arm64 linux.arm64) # Go straight for c++17 here. ++# if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), darwin.arm64 linux.arm64) # Go straight for c++17 here. + VBOX_GCC_std := -std=c++17 +- # else if "$(VBOX_CLANG_VERSION_CXX)" vge 60000 # Most language features complete by v6. Lib stuff was less complete in v6, but hopefully acceptable for out purposes. +- #VBOX_GCC_std := -std=c++17 +- else if "$(VBOX_CLANG_VERSION_CXX)" vge 50000 # darwin Xcode 5 allegedly knows what C++11 is +- VBOX_GCC_std := -std=c++11 +- # else if "$(VBOX_GCC_VERSION_CXX)" vge 70000 # Language feature P0512R0 was v8, rest v7 or earlier. Most lib stuff present in 7, complete in v12. +- #VBOX_GCC_std := -std=gnu++17 +- else if "$(VBOX_GCC_VERSION_CXX)" vge 40800 +- VBOX_GCC_std := -std=c++11 +- else if "$(VBOX_GCC_VERSION_CXX)" vge 40600 +- VBOX_GCC_std := -std=c++0x +- endif ++# # else if "$(VBOX_CLANG_VERSION_CXX)" vge 60000 # Most language features complete by v6. Lib stuff was less complete in v6, but hopefully acceptable for out purposes. ++# #VBOX_GCC_std := -std=c++17 ++# else if "$(VBOX_CLANG_VERSION_CXX)" vge 50000 # darwin Xcode 5 allegedly knows what C++11 is ++# VBOX_GCC_std := -std=c++11 ++# # else if "$(VBOX_GCC_VERSION_CXX)" vge 70000 # Language feature P0512R0 was v8, rest v7 or earlier. Most lib stuff present in 7, complete in v12. ++# #VBOX_GCC_std := -std=gnu++17 ++# else if "$(VBOX_GCC_VERSION_CXX)" vge 40800 ++# VBOX_GCC_std := -std=c++11 ++# else if "$(VBOX_GCC_VERSION_CXX)" vge 40600 ++# VBOX_GCC_std := -std=c++0x ++# endif + endif + ifndef VBOX_VCC_std + if $(VBOX_VCC_TOOL_STEM) >= VCC141 # since 2017 15.3 +@@ -5688,11 +5684,11 @@ ifeq ($(VBOX_LDR_FMT),elf) + # Solaris driver signing. + TEMPLATE_VBoxR0_POST_CMDS = $(VBOX_SIGN_DRIVER_CMDS) + else +- TEMPLATE_VBoxR0_LDFLAGS = -nostdlib -Bsymbolic -g ++ TEMPLATE_VBoxR0_LDFLAGS = -nostdlib -Bsymbolic -g -fuse-ld=bfd + ## @todo WTF doesn't the globals work? Debug info is supposed to be split everywhere. GRR + TEMPLATE_VBoxR0_LD_DEBUG = split + endif +- if "$(KBUILD_TARGET)" == "linux" && !defined(VBOX_WITH_KMOD_WRAPPED_R0_MODS) ++ if ( "$(KBUILD_TARGET)" == "linux" || "$(KBUILD_TARGET)" == "freebsd") && !defined(VBOX_WITH_KMOD_WRAPPED_R0_MODS) + VBOX_WITH_VBOXR0_AS_DLL = 1 + TEMPLATE_VBoxR0_DLLSUFF = .r0 + TEMPLATE_VBoxR0_CFLAGS += -fPIC +@@ -5703,7 +5699,7 @@ ifeq ($(VBOX_LDR_FMT),elf) + else + TEMPLATE_VBoxR0_CFLAGS.amd64 += -mcmodel=kernel + TEMPLATE_VBoxR0_CXXFLAGS.amd64 += -mcmodel=kernel +- endif ++endif + ifdef VBOX_WITH_KMOD_WRAPPED_R0_MODS # For BTF/pahold issue we use -g1 + TEMPLATE_VBoxR0_DEFS += VBOX_WITH_KMOD_WRAPPED_R0_MODS + TEMPLATE_VBoxR0_LDFLAGS.linux += $(PATH_ROOT)/src/VBox/HostDrivers/Support/linux/VBoxR0-wrapped.lds +@@ -6100,7 +6096,7 @@ ifeq ($(KBUILD_TARGET),freebsd) + # x86 FreeBSD (6.2 or something): + # cc -O2 -fno-strict-aliasing -pipe -Werror -D_KERNEL -DKLD_MODULE \ + # -nostdinc -I- -I. -I@ -I@/contrib/altq -I@/../include -I/usr/include \ +- # -finline-limit=8000 -fno-common -mno-align-long-strings -mpreferred-stack-boundary=2 \ ++ # -fno-common -mno-align-long-strings \ + # -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -ffreestanding -Wall -Wredundant-decls -Wnested-externs \ + # -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -fformat-extensions \ + # -std=c99 -c ../my.c +@@ -6111,7 +6107,7 @@ ifeq ($(KBUILD_TARGET),freebsd) + # + # AMD64 FreeBSD (7.1): + # cc -O2 -fno-strict-aliasing -pipe -D_KERNEL -DKLD_MODULE -std=c99 -nostdinc -I. -I@ -I@/contrib/altq \ +- # -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -fno-common \ ++ # --param inline-unit-growth=100 --param large-function-growth=1000 -fno-common \ + # -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx \ + # -mno-3dnow -msoft-float -fno-asynchronous-unwind-tables -ffreestanding \ + # -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign \ +@@ -6193,7 +6189,7 @@ ifeq ($(KBUILD_TARGET),freebsd) + | xargs -J% objcopy % $(outbase).kld + + # Link the final .ko (a shared object). +- ld $(flags) -Bshareable -o $(out) $(outbase).kld ++ ld $(flags) -Bshareable -znotext -o $(out) $(outbase).kld + endef + endif # x86 + +@@ -6228,7 +6224,7 @@ ifeq ($(KBUILD_TARGET),netbsd) + $(VBOX_GCC_fdiagnostics-show-option) $(VBOX_GCC_fdiagnostics-color) \ + -Wstrict-prototypes -Wmissing-prototypes -Wstrict-prototypes \ + -Wimplicit-function-declaration -Werror-implicit-function-declaration \ +- -O2 -ffreestanding -fno-strict-aliasing -fno-common -finline-limit=8000 \ ++ -O2 -ffreestanding -fno-strict-aliasing -fno-common \ + $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \ + -nostdinc -std=c99 -msoft-float + TEMPLATE_VBoxR0Drv_CFLAGS.x86 = -m32 -mno-mmx -mno-sse -mno-avx \ +@@ -6239,7 +6235,7 @@ ifeq ($(KBUILD_TARGET),netbsd) + -fno-asynchronous-unwind-tables -mno-fp-ret-in-387 + TEMPLATE_VBoxR0Drv_CXXFLAGS = -fno-exceptions -fno-rtti \ + $(VBOX_GCC_WARN) -Wpointer-arith -Winline \ +- -O2 -fno-strict-aliasing -fno-common -finline-limit=8000 \ ++ -O2 -fno-strict-aliasing -fno-common \ + $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \ + -nostdinc -msoft-float + TEMPLATE_VBoxR0Drv_CXXFLAGS.x86 = $(TEMPLATE_VBoxR0Drv_CFLAGS.x86) +@@ -6565,11 +6561,11 @@ else # the gcc guys + TEMPLATE_VBoxR3Exe_LATE_LIBS = pthread m rt dl + else ifeq ($(KBUILD_TARGET),os2) + TEMPLATE_VBoxR3Exe_TOOL = GXX3OMF +- TEMPLATE_VBoxR3Exe_LATE_LIBS = socket iconv ++ TEMPLATE_VBoxR3Exe_LATE_LIBS = socket + else ifeq ($(KBUILD_TARGET),darwin) + TEMPLATE_VBoxR3Exe_TOOL = $(VBOX_GCC_TOOL) + TEMPLATE_VBoxR3Exe_LATE_LIBS = +- TEMPLATE_VBoxR3Exe_DEFS += LIBICONV_PLUG # Avoid 3rd party libiconv (from macports). ++ TEMPLATE_VBoxR3Exe_DEFS += LIBICONV_PLUG # Avoid 3rd party lib (from macports). + TEMPLATE_VBoxR3Exe_SDKS.darwin = $(VBOX_DARWIN_DEF_SDK_SDKS) + TEMPLATE_VBoxR3Exe_DEFS.darwin = $(VBOX_DARWIN_DEF_SDK_DEFS) + TEMPLATE_VBoxR3Exe_CFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_CFLAGS) -fno-common +@@ -6585,24 +6581,29 @@ else # the gcc guys + else ifeq ($(KBUILD_TARGET),haiku) + TEMPLATE_VBoxR3Exe_TOOL = GXX3 + TEMPLATE_VBoxR3Exe_POST_CMDS = $(VBOX_HAIKU_XRES_SETVER_CMDS) +- TEMPLATE_VBoxR3Exe_LATE_LIBS = network iconv stdc++ supc++ ++ TEMPLATE_VBoxR3Exe_LATE_LIBS = network stdc++ supc++ + TEMPLATE_VBoxR3Exe_LIBPATH += \ + /boot/common/lib + # Haiku uses PIC by default... + TEMPLATE_VBoxR3Exe_CFLAGS += -fno-pic + TEMPLATE_VBoxR3Exe_CXXFLAGS += -fno-pic + TEMPLATE_VBoxR3Exe_LDFLAGS += -fno-pic +- else if1of ($(KBUILD_TARGET), freebsd openbsd) ++ else if1of ($(KBUILD_TARGET), freebsd) + TEMPLATE_VBoxR3Exe_TOOL = GXX3 + TEMPLATE_VBoxR3Exe_LATE_LIBS = pthread ++ TEMPLATE_VBoxR3Exe_LDFLAGS = -Wl,-z,noexecstack,-z,relro $(VBOX_LD_as_needed) ++ TEMPLATE_VBoxR3Exe_LDFLAGS.freebsd.x86 = -Wl,-z,notext + TEMPLATE_VBoxR3Exe_INCS += \ +- /usr/include \ +- /usr/X11R6/include \ + /usr/local/include + TEMPLATE_VBoxR3Exe_LIBPATH += \ +- /usr/lib \ +- /usr/X11R6/lib \ + /usr/local/lib ++ else ifeq ($(KBUILD_TARGET), openbsd) ++ TEMPLATE_VBoxR3Exe_TOOL = GXX3 ++ TEMPLATE_VBoxR3Exe_LIBS = pthread ++ TEMPLATE_VBoxR3Exe_INCS += \ ++ /usr/include \ ++ /usr/X11R6/include \ ++ /usr/local/include + else ifeq ($(KBUILD_TARGET),netbsd) + TEMPLATE_VBoxR3Exe_TOOL = GXX3 + TEMPLATE_VBoxR3Exe_LATE_LIBS = pthread +@@ -6614,7 +6615,7 @@ else # the gcc guys + /usr/X11R7/lib + else ifeq ($(KBUILD_TARGET),solaris) + TEMPLATE_VBoxR3Exe_TOOL = GXX3PLAIN +- TEMPLATE_VBoxR3Exe_DEFS += LIBICONV_PLUG _REENTRANT # Avoid the GNU libiconv, for now at least. ++ TEMPLATE_VBoxR3Exe_DEFS += LIBICONV_PLUG _REENTRANT # Avoid the GNU lib, for now at least. + if $(VBOX_GCC_VERSION_CC) < 30500 + TEMPLATE_VBoxR3Exe_CFLAGS += -std=gnu99 + endif +@@ -6630,6 +6631,7 @@ else # the gcc guys + TEMPLATE_VBoxR3Exe_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)' + endif + ifdef VBOX_WITH_ORIGIN ++ TEMPLATE_VBoxR3Exe_LDFLAGS.freebsd += $(VBOX_GCC_ORIGIN_OPT) + TEMPLATE_VBoxR3Exe_LDFLAGS.linux += $(VBOX_GCC_ORIGIN_OPT) + endif + endif +@@ -6868,7 +6870,7 @@ else + ifdef VBOX_WITH_NOCRT_STATIC + TEMPLATE_VBoxR3StaticBase_DEFS += RT_WITH_NOCRT_WRAPPERS + endif +- ifn1of ($(KBUILD_TARGET), darwin linux solaris) ++ ifn1of ($(KBUILD_TARGET), darwin freebsd linux solaris) + # The gcc guys sans darwin, linux and solaris (don't depend on statically compiled system libs there) + TEMPLATE_VBoxR3StaticBase_CFLAGS = $(TEMPLATE_VBoxR3Exe_CFLAGS) -static + TEMPLATE_VBoxR3StaticBase_CXXFLAGS = $(TEMPLATE_VBoxR3Exe_CXXFLAGS) -static +@@ -6936,7 +6938,7 @@ else + $(SDK_VBoxZlib_LATE_LIBS) \ + $(SDK_VBoxLibLzma_LIBS) + if1of ($(KBUILD_TARGET), darwin freebsd) +- TEMPLATE_VBoxR3Static_LATE_LIBS += iconv ++ TEMPLATE_VBoxR3Static_LATE_LIBS += + else ifeq ($(KBUILD_TARGET),solaris) + TEMPLATE_VBoxR3Static_LATE_LIBS += kstat + endif +@@ -7137,6 +7139,7 @@ else ifn1of ($(KBUILD_TARGET), os2) + else ifn1of ($(KBUILD_TARGET), os2) + ifneq ($(KBUILD_TYPE),asan) # Keep RPATH in asan builds so we can find libasan.so.X and libubsan.so.Y. + TEMPLATE_VBoxR3HardenedExe_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_VBoxR3Exe_LDFLAGS)) ++ TEMPLATE_VBoxR3HardenedExe_LDFLAGS.freebsd = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBoxR3Exe_LDFLAGS.freebsd)) + TEMPLATE_VBoxR3HardenedExe_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBoxR3Exe_LDFLAGS.linux)) + endif + endif +@@ -7168,6 +7171,7 @@ ifn1of ($(KBUILD_TARGET), win os2) + $(if-expr !defined(VBOX_WITHOUT_WINDOWS_KERNEL_CODE_SIGNING_CERT),-IntegrityCheck,) + ifn1of ($(KBUILD_TARGET), win os2) + TEMPLATE_VBoxR3HardenedTstDll_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_VBoxR3TstDll_LDFLAGS)) ++ TEMPLATE_VBoxR3HardenedTstDll_LDFLAGS.freebsd = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBoxR3TstDll_LDFLAGS.freebsd)) + TEMPLATE_VBoxR3HardenedTstDll_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBoxR3TstDll_LDFLAGS.linux)) + endif + +@@ -7192,6 +7196,7 @@ ifndef VBOX_WITH_HARDENING + TEMPLATE_VBoxR3SetUidToRoot_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)' + endif + ifdef VBOX_WITH_ORIGIN ++ TEMPLATE_VBoxR3SetUidToRoot_LDFLAGS.freebsd += $(VBOX_GCC_ORIGIN_OPT) + TEMPLATE_VBoxR3SetUidToRoot_LDFLAGS.linux += $(VBOX_GCC_ORIGIN_OPT) + endif + endif +@@ -7570,7 +7575,7 @@ else # the GCC guys: + endif + TEMPLATE_VBoxMainExe_CXXFLAGS = -g $(VBOX_GCC_pipe) \ + $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_Wno-multistatement-macros) $(VBOX_GCC_Wno-class-memaccess) -Wshadow \ +- -fshort-wchar -fpermissive -fexceptions -frtti $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing \ ++ -fshort-wchar -fexceptions -frtti $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing \ + $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_std) $(VBOX_GCC_IPRT_FMT_CHECK) \ + $(VBOX_GCC_SANITIZER_FLAGS) + if !defined("VBOX_GCC_Wno-delete-non-virtual-dtor") && defined("VBOX_GCC_Wno-non-virtual-dtor") +@@ -7633,10 +7638,19 @@ else # the GCC guys: + else ifeq ($(KBUILD_TARGET),haiku) + TEMPLATE_VBoxMainExe_TOOL = GXX3 + TEMPLATE_VBoxMainExe_LATE_LIBS = $(LIB_RUNTIME) network stdc++ supc++ +- else if1of ($(KBUILD_TARGET), freebsd openbsd) ++ else if1of ($(KBUILD_TARGET), freebsd) + TEMPLATE_VBoxMainExe_TOOL = GXX3 + TEMPLATE_VBoxMainExe_LATE_LIBS = $(LIB_RUNTIME) ++ TEMPLATE_VBoxMainExe_LDFLAGS = -Wl,-z,noexecstack,-z,relro $(VBOX_LD_as_needed) ++ TEMPLATE_VBoxMainExe_LDFLAGS.freebsd.x86 = -Wl,-z,notext + TEMPLATE_VBoxMainExe_INCS += \ ++ /usr/local/include ++ TEMPLATE_VBoxMainExe_LIBPATH += \ ++ /usr/local/lib ++ else ifeq ($(KBUILD_TARGET), openbsd) ++ TEMPLATE_VBoxMainExe_TOOL = GXX3 ++ TEMPLATE_VBoxMainExe_LIBS = $(LIB_RUNTIME) ++ TEMPLATE_VBoxMainExe_INCS += \ + /usr/include \ + /usr/X11R6/include \ + /usr/local/include +@@ -7668,6 +7682,7 @@ else # the GCC guys: + TEMPLATE_VBoxMainExe_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)' + endif + ifdef VBOX_WITH_ORIGIN ++ TEMPLATE_VBoxMainExe_LDFLAGS.freebsd += $(VBOX_GCC_ORIGIN_OPT) + TEMPLATE_VBoxMainExe_LDFLAGS.linux += $(VBOX_GCC_ORIGIN_OPT) + endif + +@@ -8352,14 +8367,13 @@ ifdef VBOX_WITH_QTGUI + TEMPLATE_VBoxQtGuiExe_LIBPATH += \ + $(VBOX_LIBPATH_X11) + ifeq ($(KBUILD_TARGET),freebsd) ++ TEMPLATE_VBoxQtGuiExe_LDFLAGS += -Wl,-z,noexecstack,-z,relro $(VBOX_LD_as_needed) ++ TEMPLATE_VBoxQtGuiExe_LDFLAGS.freebsd.x86 = -Wl,-z,notext + TEMPLATE_VBoxQtGuiExe_INCS += \ +- /usr/include \ +- /usr/X11R6/include \ + /usr/local/include + TEMPLATE_VBoxQtGuiExe_LIBPATH += \ +- /usr/lib \ +- /usr/X11R6/lib \ + /usr/local/lib ++ TEMPLATE_VBoxQtGuiExe_LIBS += /usr/local/lib/qt6/libQt6PrintSupport.so + endif + ifeq ($(KBUILD_TARGET),solaris) + TEMPLATE_VBoxQtGuiExe_LDFLAGS.solaris = -Wl,-z,ignore # Same as VBOX_LD_as_needed. +@@ -8623,7 +8637,7 @@ else + TEMPLATE_VBoxBldProg_LATE_LIBS = pthread m rt dl + else ifeq ($(KBUILD_HOST),os2) + TEMPLATE_VBoxBldProg_TOOL = GXX3OMF +- TEMPLATE_VBoxBldProg_LATE_LIBS = socket iconv ++ TEMPLATE_VBoxBldProg_LATE_LIBS = socket + else ifeq ($(KBUILD_HOST),darwin) + TEMPLATE_VBoxBldProg_TOOL = $(VBOX_GCC_TOOL) + if "$(VBOX_DEF_MACOSX_VERSION_MIN)" == "10.7" || "$(VBOX_DARWIN_HOST_VERSION_MAJOR)" == "7" +@@ -8663,13 +8677,20 @@ else + TEMPLATE_VBoxBldProg_LATE_LIBS = + else ifeq ($(KBUILD_HOST),haiku) + TEMPLATE_VBoxBldProg_TOOL = GXX3 +- TEMPLATE_VBoxBldProg_LATE_LIBS = network iconv ++ TEMPLATE_VBoxBldProg_LATE_LIBS = network + TEMPLATE_VBoxBldProg_LIBPATH += \ + /boot/common/lib +- else if1of ($(KBUILD_HOST), freebsd openbsd) ++ else if1of ($(KBUILD_HOST), freebsd) + TEMPLATE_VBoxBldProg_TOOL = $(VBOX_GCC_TOOL) + TEMPLATE_VBoxBldProg_LATE_LIBS = pthread + TEMPLATE_VBoxBldProg_INCS += \ ++ /usr/local/include ++ TEMPLATE_VBoxBldProg_LIBPATH += \ ++ /usr/local/lib ++ else ifeq ($(KBUILD_HOST), openbsd) ++ TEMPLATE_VBoxBldProg_TOOL = $(VBOX_GCC_TOOL) ++ TEMPLATE_VBoxBldProg_LIBS = pthread ++ TEMPLATE_VBoxBldProg_INCS += \ + /usr/include \ + /usr/X11R6/include \ + /usr/local/include +@@ -8716,11 +8737,11 @@ TEMPLATE_VBoxAdvBldProg_LATE_LIBS.darwin = \ + $(TEMPLATE_VBoxBldProg_LATE_LIBS) + TEMPLATE_VBoxAdvBldProg_LATE_LIBS.darwin = \ + $(TEMPLATE_VBoxAdvBldProg_LATE_LIBS) \ +- iconv \ ++ \ + $(TEMPLATE_VBoxBldProg_LATE_LIBS.darwin) + TEMPLATE_VBoxAdvBldProg_LATE_LIBS.freebsd = \ + $(TEMPLATE_VBoxAdvBldProg_LATE_LIBS) \ +- iconv \ ++ \ + rt \ + $(TEMPLATE_VBoxBldProg_LATE_LIBS.freebsd) + TEMPLATE_VBoxAdvBldProg_LATE_LIBS.linux = \ +@@ -8813,6 +8834,7 @@ else # the gcc guys + # Do not inherit sanitizer flags from VBoxR3Exe in guest executables. Deal with them separately. + TEMPLATE_VBoxGuestR3ExeBase_CXXFLAGS.debug = $(NO_SUCH_VARIABLE) + TEMPLATE_VBoxGuestR3ExeBase_CFLAGS.debug = $(NO_SUCH_VARIABLE) ++ TEMPLATE_VBoxGuestR3ExeBase_LDFLAGS.freebsd = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_$(TEMPLATE_VBoxGuestR3ExeBase_EXTENDS)_LDFLAGS.freebsd)) + TEMPLATE_VBoxGuestR3ExeBase_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_$(TEMPLATE_VBoxGuestR3ExeBase_EXTENDS)_LDFLAGS.linux)) + TEMPLATE_VBoxGuestR3ExeBase_LDFLAGS.debug = $(NO_SUCH_VARIABLE) + TEMPLATE_VBoxGuestR3ExeBase_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_$(TEMPLATE_VBoxGuestR3ExeBase_EXTENDS)_LDFLAGS)) +@@ -8836,7 +8858,7 @@ else if1of ($(KBUILD_TARGET), darwin freebsd openbsd) + ifeq ($(KBUILD_TARGET),linux) # As few libs as possible on linux. + TEMPLATE_VBoxGuestR3ExeBase_LATE_LIBS = pthread rt m dl + else if1of ($(KBUILD_TARGET), darwin freebsd openbsd) +- TEMPLATE_VBoxGuestR3ExeBase_LATE_LIBS = $(TEMPLATE_$(TEMPLATE_VBoxGuestR3ExeBase_EXTENDS)_LATE_LIBS) iconv ++ TEMPLATE_VBoxGuestR3ExeBase_LATE_LIBS = $(TEMPLATE_$(TEMPLATE_VBoxGuestR3ExeBase_EXTENDS)_LATE_LIBS) + else ifeq ($(KBUILD_TARGET),solaris) + TEMPLATE_VBoxGuestR3ExeBase_LATE_LIBS = $(TEMPLATE_$(TEMPLATE_VBoxGuestR3ExeBase_EXTENDS)_LATE_LIBS) nsl + endif +@@ -8849,6 +8871,7 @@ TEMPLATE_VBoxGuestR3ExeBase_CFLAGS.linux = $(TEMP + $(VBOX_GCC_fno-stack-protector) + TEMPLATE_VBoxGuestR3ExeBase_CFLAGS.linux = $(TEMPLATE_VBoxGuestR3ExeBase_CXXFLAGS.linux) + # The GNU_HASH ELF tag is not supported by older systems. ++TEMPLATE_VBoxGuestR3ExeBase_LDFLAGS.freebsd += $(VBOX_LD_hash_style_sysv) + TEMPLATE_VBoxGuestR3ExeBase_LDFLAGS.linux += $(VBOX_LD_hash_style_sysv) + + +@@ -9085,6 +9108,7 @@ TEMPLATE_VBoxGuestR3XFree86Mod_LDFLAGS.$(KBUILD_TARGET + TEMPLATE_VBoxGuestR3XFree86Mod_CXXFLAGS.linux = $(VBOX_GCC_fno-stack-protector) # Remove symvers.h + TEMPLATE_VBoxGuestR3XFree86Mod_LDFLAGS.$(KBUILD_TARGET) = $(NO_SUCH_VARIABLE) + # The GNU_HASH ELF tag is not supported by older glibc dynamic linkers. ++TEMPLATE_VBoxGuestR3XFree86Mod_LDFLAGS.freebsd = $(subst -Wl$(COMMA),,$(VBOX_LD_hash_style_sysv)) + TEMPLATE_VBoxGuestR3XFree86Mod_LDFLAGS.linux = $(subst -Wl$(COMMA),,$(VBOX_LD_hash_style_sysv)) + TEMPLATE_VBoxGuestR3XFree86Mod_LDFLAGS.$(KBUILD_TYPE) = $(NO_SUCH_VARIABLE) + TEMPLATE_VBoxGuestR3XFree86Mod_LDFLAGS := -r +@@ -9128,7 +9152,7 @@ TEMPLATE_VBoxGuestR3XOrgMod_LATE_LIBS.$(KBUILD_TARGET) + TEMPLATE_VBoxGuestR3XOrgMod_LATE_LIBS = $(VBOX_LIB_VBGL_R3_XORG) + TEMPLATE_VBoxGuestR3XOrgMod_LATE_LIBS.$(KBUILD_TYPE) = $(NO_SUCH_VARIABLE) + TEMPLATE_VBoxGuestR3XOrgMod_LATE_LIBS.$(KBUILD_TARGET) = $(NO_SUCH_VARIABLE) +-TEMPLATE_VBoxGuestR3XOrgMod_LATE_LIBS.freebsd = iconv ++TEMPLATE_VBoxGuestR3XOrgMod_LATE_LIBS.freebsd = + TEMPLATE_VBoxGuestR3XOrgMod_LIBS = $(NO_SUCH_VARIABLE) # These three aren't necessary, just being careful. + TEMPLATE_VBoxGuestR3XOrgMod_LIBS.$(KBUILD_TYPE) = $(NO_SUCH_VARIABLE) + TEMPLATE_VBoxGuestR3XOrgMod_LIBS.$(KBUILD_TARGET) = $(NO_SUCH_VARIABLE) diff --git a/emulators/virtualbox-ose-72/files/patch-configure b/emulators/virtualbox-ose-72/files/patch-configure new file mode 100644 index 000000000000..76ed44e26acf --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-configure @@ -0,0 +1,126 @@ +--- configure.orig 2025-08-13 19:37:05 UTC ++++ configure +@@ -155,10 +155,14 @@ if [ "$OS" = "freebsd" ]; then + if [ "$OS" = "freebsd" ]; then + INCCURL="-I/usr/local/include" + LIBCURL="-L/usr/local/lib -lcurl" ++ INCALSA="-I/usr/local/include" ++ LIBALSA="-L/usr/local/lib" + INCPULSE="-I/usr/local/include" + LIBPULSE="-L/usr/local/lib" + INCPNG="-I/usr/local/include" + LIBPNG="-L/usr/local/lib -lpng" ++ INCVNCSERVER="-I/usr/local/include" ++ LIBVNCSERVER="-L/usr/local/lib" + else + INCCURL="" + LIBCURL="-lcurl" +@@ -1171,6 +1175,9 @@ extern "C" int main(int argc, char** argv) + printf("found version %d.%d.%d", + SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL); + #if SDL_VERSION_ATLEAST(1,2,7) ++#if !defined(SDL_VIDEO_DRIVER_X11) ++#error SDL must be compiled with X11 support ++#endif + printf(", OK.\n"); + return 0; + #else +@@ -1255,7 +1262,7 @@ EOF + #endif + } + EOF +- if test_compile "-lasound" asound asound; then ++ if test_compile "$INCALSA $LIBALSA -lasound" asound asound; then + test_execute + fi + } +@@ -1559,6 +1566,7 @@ EOF + SDKQT6=$PATH_SDK_QT6 + fi + FLGQT6="-framework QtCore -std=c++17 -Wl,-rpath,`L_to_PATH "$LIBQT6"`" ++ FLGQT6="$FLGQT6 -std=c++11" + else + log_failure "Qt6 framework not found (can be disabled using --disable-qt)" + fail +@@ -1897,7 +1905,7 @@ EOF + return 0; + } + EOF +- [ -n "$INCOGG" ] && I_INCVRB=`prefix_I "$INCOGG"` ++ [ -n "$INCOGG" ] && I_INCOGG=`prefix_I "$INCOGG"` + if test_compile "$LIBOGG $I_INCOGG" ogg ogg nofatal; then + if test_execute; then + cnf_append "SDK_VBoxLibOgg_INCS" "$INCOGG" +@@ -2125,8 +2133,8 @@ EOF + echo "compiling the following source file:" >> $LOG + cat $ODIR.tmp_src.cc >> $LOG + echo "using the following command line:" >> $LOG +- echo "$CXX -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc -I$p/include/$d $p/$b/lib$d.so" >> $LOG +- $CXX -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc -I$p/include/$d $p/$b/lib$d.so >> $LOG 2>&1 ++ echo "$CXX -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc -I$p/include/$d $p/$b/lib$d.so -pthread" >> $LOG ++ $CXX -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc -I$p/include/$d $p/$b/lib$d.so -pthread >> $LOG 2>&1 + if [ $? -eq 0 ]; then + found=1 + break +@@ -2246,7 +2254,7 @@ check_gsoap() + else + cnf_append "VBOX_GSOAP_CXX_SOURCES" "" + fi +- cnf_append "VBOX_GSOAP_CXX_LIBS" "`strip_l "$GSOAP_CXX_LIBS"`" ++ cnf_append "VBOX_GSOAP_CXX_LIBS" "`strip_l "$GSOAP_CXX_LIBS"` z" + gsoap_version=`pkg-config gsoapssl++ --modversion` + log_success "found version $gsoap_version" + return +@@ -2619,7 +2627,7 @@ for option in "$@"; do + --with-openssl-dir=*) + OPENSSLDIR=`echo $option | cut -d'=' -f2` + INCCRYPTO="-I${OPENSSLDIR}/include" +- LIBCRYPTO="${OPENSSLDIR}/lib/libssl.a ${OPENSSLDIR}/lib/libcrypto.a" ++ LIBCRYPTO="-L${OPENSSLDIR}/lib -lssl -lcrypto" + # On Darwin (at least for macports) static OpenSSL also needs zlib. + [ "$OS" = "darwin" ] && LIBCRYPTO="$LIBCRYPTO ${OPENSSLDIR}/lib/libz.a" + # On Linux static OpenSSL typically needs a few additional libraries. +@@ -2978,12 +2986,22 @@ if [ $ONLY_ADDITIONS -eq 0 ]; then + [ $WITH_JAVA -eq 1 ] && check_java + + # PulseAudio +- if [ $WITH_PULSE -eq 1 ]; then +- check_pulse +- elif [ $WITH_PULSE -eq 0 ]; then # Force disabling PulseAudio. +- cnf_append "VBOX_WITH_AUDIO_PULSE" "" +- elif [ $WITH_PULSE -eq 2 ]; then # --enable-pulse was passed, force PulseAudio. +- cnf_append "VBOX_WITH_AUDIO_PULSE" "1" ++ if [ "$OS" = "linux" -o "$OS" = "freebsd" -o "$OS" = "netbsd" ]; then ++ if [ $WITH_ALSA -eq 1 ]; then ++ check_alsa ++ else ++ cnf_append "VBOX_WITH_AUDIO_ALSA" "" ++ fi ++ if [ $WITH_PULSE -eq 1 ]; then ++ check_pulse ++ elif [ $WITH_PULSE -eq 0 ]; then # Force disabling PulseAudio. ++ cnf_append "VBOX_WITH_AUDIO_PULSE" "" ++ elif [ $WITH_PULSE -eq 2 ]; then # --enable-pulse was passed, force PulseAudio. ++ cnf_append "VBOX_WITH_AUDIO_PULSE" "1" ++ fi ++ if [ $WITH_DBUS -eq 0 ]; then ++ cnf_append "VBOX_WITH_DBUS" "" ++ fi + fi + fi + +@@ -2999,14 +3017,6 @@ if [ "$OS" = "linux" ]; then + cnf_append "VBOX_WITHOUT_LINUX_TEST_BUILDS" "1" + fi + if [ $ONLY_ADDITIONS -eq 0 ]; then +- if [ $WITH_ALSA -eq 1 ]; then +- check_alsa +- else +- cnf_append "VBOX_WITH_AUDIO_ALSA" "" +- fi +- if [ $WITH_DBUS -eq 0 ]; then +- cnf_append "VBOX_WITH_DBUS" "" +- fi + if [ $WITH_DEVMAPPER -eq 1 ]; then + check_libdevmapper + else diff --git a/emulators/virtualbox-ose-72/files/patch-doc_manual_en__US_dita_UserManual.ditamap b/emulators/virtualbox-ose-72/files/patch-doc_manual_en__US_dita_UserManual.ditamap new file mode 100644 index 000000000000..c8337d7aeba6 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-doc_manual_en__US_dita_UserManual.ditamap @@ -0,0 +1,11 @@ +--- doc/manual/en_US/dita/UserManual.ditamap.orig 2025-08-13 19:37:06 UTC ++++ doc/manual/en_US/dita/UserManual.ditamap +@@ -540,7 +540,7 @@ + <topicref href="topics/security-model.dita"/> + <topicref href="topics/secure-config-vms.dita"> + <topicref href="topics/security-networking.dita"/> +- <topicref href="topics/security-of-remote-vms.dita"/> ++<!-- <topicref href="topics/security-of-remote-vms.dita"/> --> + <topicref href="topics/security-vrdp-auth.dita"/> + <topicref href="topics/security_clipboard.dita"/> + <topicref href="topics/security-shared-folders.dita"/> diff --git a/emulators/virtualbox-ose-72/files/patch-include-iprt-x86.h b/emulators/virtualbox-ose-72/files/patch-include-iprt-x86.h new file mode 100644 index 000000000000..cedf78a0ef02 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-include-iprt-x86.h @@ -0,0 +1,19 @@ +--- include/iprt/x86.h.orig 2025-08-13 19:37:26 UTC ++++ include/iprt/x86.h +@@ -53,6 +53,16 @@ + # pragma D depends_on library vbox-types.d + #endif + ++/* Workaround for FreeBSD machine/specialreg.h defining MSRs */ ++#ifdef RT_OS_FREEBSD ++# undef MSR_P5_MC_ADDR ++# undef MSR_P5_MC_TYPE ++# undef MSR_IA32_PLATFORM_ID ++# undef MSR_BBL_CR_CTL3 ++# undef MSR_IA32_MISC_ENABLE ++# undef MSR_IA32_FEATURE_CONTROL ++#endif ++ + /** Workaround for Solaris sys/regset.h defining CS, DS and sys/controlregs.h + * defining MSR_IA32_FLUSH_CMD and MSR_AMD_VIRT_SPEC_CTL */ + #ifdef RT_OS_SOLARIS diff --git a/emulators/virtualbox-ose-72/files/patch-include_VBox_com_array.h b/emulators/virtualbox-ose-72/files/patch-include_VBox_com_array.h new file mode 100644 index 000000000000..77d77ddd3e11 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-include_VBox_com_array.h @@ -0,0 +1,36 @@ +--- include/VBox/com/array.h.orig 2025-08-13 19:37:15 UTC ++++ include/VBox/com/array.h +@@ -181,7 +181,7 @@ + + #include "VBox/com/defs.h" + +-#if RT_GNUC_PREREQ(4, 6) || (defined(_MSC_VER) && (_MSC_VER >= 1600)) ++#if RT_GNUC_PREREQ(4, 6) || (defined(_MSC_VER) && (_MSC_VER >= 1600)) || defined(_LIBCPP_VERSION) + /** @def VBOX_WITH_TYPE_TRAITS + * Type traits are a C++ 11 feature, so not available everywhere (yet). + * Only GCC 4.6 or newer and MSVC++ 16.0 (Visual Studio 2010) or newer. +@@ -1014,12 +1014,12 @@ class SafeArray : public Traits (public) + { + /** @todo r=klaus should do this as a AssertCompile, but cannot find a way which works. */ + Assert(sizeof(T) <= sizeof(Zeroes)); +- AssertReturn(m.arr != NULL, *(T *)&Zeroes[0]); +- AssertReturn(aIdx < size(), *(T *)&Zeroes[0]); ++ AssertReturn(m.arr != NULL, *((T *)1)); ++ AssertReturn(aIdx < size(), *((T *)1)); + #ifdef VBOX_WITH_XPCOM + return m.arr[aIdx]; + #else +- AssertReturn(m.raw != NULL, *(T *)&Zeroes[0]); ++ AssertReturn(m.raw != NULL, *((T *)1)); + return m.raw[aIdx]; + #endif + } +@@ -1034,7 +1034,7 @@ class SafeArray : public Traits (public) + #ifdef VBOX_WITH_XPCOM + return m.arr[aIdx]; + #else +- AssertReturn(m.raw != NULL, *(const T *)&Zeroes[0]); ++ AssertReturn(m.raw != NULL, *((T *)1)); + return m.raw[aIdx]; + #endif + } diff --git a/emulators/virtualbox-ose-72/files/patch-include_VBox_sup.h b/emulators/virtualbox-ose-72/files/patch-include_VBox_sup.h new file mode 100644 index 000000000000..77fee2d23d0a --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-include_VBox_sup.h @@ -0,0 +1,11 @@ +--- include/VBox/sup.h.orig 2025-08-13 19:37:16 UTC ++++ include/VBox/sup.h +@@ -2325,7 +2325,7 @@ SUPR0DECL(void) SUPR0BadContext(PSUPDRVSESSION pSessio + + SUPR0DECL(void) SUPR0BadContext(PSUPDRVSESSION pSession, const char *pszFile, uint32_t uLine, const char *pszExpr); + +-#if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) ++#if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) + /** + * Translates a physical address to a virtual mapping (valid up to end of page). + * @returns VBox status code. diff --git a/emulators/virtualbox-ose-72/files/patch-include_iprt_string.h b/emulators/virtualbox-ose-72/files/patch-include_iprt_string.h new file mode 100644 index 000000000000..b06991588730 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-include_iprt_string.h @@ -0,0 +1,14 @@ +--- include/iprt/string.h.orig 2025-08-13 19:37:25 UTC ++++ include/iprt/string.h +@@ -57,6 +57,11 @@ + #elif defined(RT_OS_FREEBSD) && defined(_KERNEL) + RT_C_DECLS_BEGIN + # include <sys/libkern.h> ++ /* ++ * Kludge for the FreeBSD kernel: ++ * sys/libkern.h includes sys/param.h via sys/systm.h since r335879. ++ */ ++# undef PVM + RT_C_DECLS_END + + #elif defined(RT_OS_NETBSD) && defined(_KERNEL) diff --git a/emulators/virtualbox-ose-72/files/patch-src-VBox-Additions-common-VBoxGuest-VBoxGuest-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src-VBox-Additions-common-VBoxGuest-VBoxGuest-freebsd.c new file mode 100644 index 000000000000..5344a7ab812f --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src-VBox-Additions-common-VBoxGuest-VBoxGuest-freebsd.c @@ -0,0 +1,284 @@ +--- src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c.orig 2025-08-13 19:41:14 UTC ++++ src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c +@@ -55,6 +55,7 @@ + #include <sys/uio.h> + #include <sys/bus.h> + #include <sys/poll.h> ++#include <sys/proc.h> + #include <sys/selinfo.h> + #include <sys/queue.h> + #include <sys/lock.h> +@@ -71,6 +72,7 @@ + #include <VBox/version.h> + #include <VBox/log.h> + #include <iprt/assert.h> ++#include <iprt/err.h> + #include <iprt/initterm.h> + #include <iprt/process.h> + #include <iprt/string.h> +@@ -112,8 +114,6 @@ struct VBoxGuestDeviceState + struct resource *pIrqRes; + /** Pointer to the IRQ handler. */ + void *pfnIrqHandler; +- /** VMMDev version */ +- uint32_t u32Version; + }; + + +@@ -123,8 +123,7 @@ struct VBoxGuestDeviceState + /* + * Character device file handlers. + */ +-static d_fdopen_t vgdrvFreeBSDOpen; +-static d_close_t vgdrvFreeBSDClose; ++static d_open_t vgdrvFreeBSDOpen; + static d_ioctl_t vgdrvFreeBSDIOCtl; + static int vgdrvFreeBSDIOCtlSlow(PVBOXGUESTSESSION pSession, u_long ulCmd, caddr_t pvData, struct thread *pTd); + static d_write_t vgdrvFreeBSDWrite; +@@ -155,8 +154,7 @@ static struct cdevsw g_vgdrvFreeBSDChrDevSW = + { + .d_version = D_VERSION, + .d_flags = D_TRACKCLOSE | D_NEEDMINOR, +- .d_fdopen = vgdrvFreeBSDOpen, +- .d_close = vgdrvFreeBSDClose, ++ .d_open = vgdrvFreeBSDOpen, + .d_ioctl = vgdrvFreeBSDIOCtl, + .d_read = vgdrvFreeBSDRead, + .d_write = vgdrvFreeBSDWrite, +@@ -164,81 +162,28 @@ static struct cdevsw g_vgdrvFreeBSDChrDevSW = + .d_name = "vboxguest" + }; + ++/** Device structure. */ ++static struct cdev *g_pDev; ++ + /** Device extention & session data association structure. */ + static VBOXGUESTDEVEXT g_DevExt; + +-/** List of cloned device. Managed by the kernel. */ +-static struct clonedevs *g_pvgdrvFreeBSDClones; +-/** The dev_clone event handler tag. */ +-static eventhandler_tag g_vgdrvFreeBSDEHTag; + /** Reference counter */ + static volatile uint32_t cUsers; + /** selinfo structure used for polling. */ + static struct selinfo g_SelInfo; + +-/** +- * DEVFS event handler. +- */ +-static void vgdrvFreeBSDClone(void *pvArg, struct ucred *pCred, char *pszName, int cchName, struct cdev **ppDev) ++static void vgdrvFreeBSDDtr(void *pSession) + { +- int iUnit; +- int rc; +- +- Log(("vgdrvFreeBSDClone: pszName=%s ppDev=%p\n", pszName, ppDev)); +- +- /* +- * One device node per user, si_drv1 points to the session. +- * /dev/vboxguest<N> where N = {0...255}. +- */ +- if (!ppDev) +- return; +- if (strcmp(pszName, "vboxguest") == 0) +- iUnit = -1; +- else if (dev_stdclone(pszName, NULL, "vboxguest", &iUnit) != 1) +- return; +- if (iUnit >= 256) +- { +- Log(("vgdrvFreeBSDClone: iUnit=%d >= 256 - rejected\n", iUnit)); +- return; +- } +- +- Log(("vgdrvFreeBSDClone: pszName=%s iUnit=%d\n", pszName, iUnit)); +- +- rc = clone_create(&g_pvgdrvFreeBSDClones, &g_vgdrvFreeBSDChrDevSW, &iUnit, ppDev, 0); +- Log(("vgdrvFreeBSDClone: clone_create -> %d; iUnit=%d\n", rc, iUnit)); +- if (rc) +- { +- *ppDev = make_dev(&g_vgdrvFreeBSDChrDevSW, +- iUnit, +- UID_ROOT, +- GID_WHEEL, +- 0664, +- "vboxguest%d", iUnit); +- if (*ppDev) +- { +- dev_ref(*ppDev); +- (*ppDev)->si_flags |= SI_CHEAPCLONE; +- Log(("vgdrvFreeBSDClone: Created *ppDev=%p iUnit=%d si_drv1=%p si_drv2=%p\n", +- *ppDev, iUnit, (*ppDev)->si_drv1, (*ppDev)->si_drv2)); +- (*ppDev)->si_drv1 = (*ppDev)->si_drv2 = NULL; +- } +- else +- Log(("vgdrvFreeBSDClone: make_dev iUnit=%d failed\n", iUnit)); +- } +- else +- Log(("vgdrvFreeBSDClone: Existing *ppDev=%p iUnit=%d si_drv1=%p si_drv2=%p\n", +- *ppDev, iUnit, (*ppDev)->si_drv1, (*ppDev)->si_drv2)); ++ VGDrvCommonCloseSession(&g_DevExt, pSession); ++ ASMAtomicDecU32(&cUsers); + } + + /** + * File open handler + * + */ +-#if __FreeBSD_version >= 700000 +-static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOpen, struct thread *pTd, struct file *pFd) +-#else +-static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOpen, struct thread *pTd) +-#endif ++static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOpen, int DevType, struct thread *pTd) + { + int rc; + PVBOXGUESTSESSION pSession; +@@ -250,12 +195,6 @@ static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOp + LogFlow(("vgdrvFreeBSDOpen:\n")); + + /* +- * Try grab it (we don't grab the giant, remember). +- */ +- if (!ASMAtomicCmpXchgPtr(&pDev->si_drv1, (void *)0x42, NULL)) +- return EBUSY; +- +- /* + * Create a new session. + */ + fRequestor = VMMDEV_REQUESTOR_USERMODE | VMMDEV_REQUESTOR_TRUST_NOT_GIVEN; +@@ -272,47 +211,20 @@ static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOp + rc = VGDrvCommonCreateUserSession(&g_DevExt, fRequestor, &pSession); + if (RT_SUCCESS(rc)) + { +- if (ASMAtomicCmpXchgPtr(&pDev->si_drv1, pSession, (void *)0x42)) +- { +- Log(("vgdrvFreeBSDOpen: success - g_DevExt=%p pSession=%p rc=%d pid=%d\n", &g_DevExt, pSession, rc, (int)RTProcSelf())); ++ Log(("vgdrvFreeBSDOpen: success - g_DevExt=%p pSession=%p rc=%d pid=%d\n", &g_DevExt, pSession, rc, (int)RTProcSelf())); ++ rc = devfs_set_cdevpriv(pSession, vgdrvFreeBSDDtr); ++ if (rc) ++ VGDrvCommonCloseSession(&g_DevExt, pSession); ++ else + ASMAtomicIncU32(&cUsers); +- return 0; +- } +- +- VGDrvCommonCloseSession(&g_DevExt, pSession); ++ return rc; + } + + LogRel(("vgdrvFreeBSDOpen: failed. rc=%d\n", rc)); + return RTErrConvertToErrno(rc); + } + +-/** +- * File close handler +- * +- */ +-static int vgdrvFreeBSDClose(struct cdev *pDev, int fFile, int DevType, struct thread *pTd) +-{ +- PVBOXGUESTSESSION pSession = (PVBOXGUESTSESSION)pDev->si_drv1; +- Log(("vgdrvFreeBSDClose: fFile=%#x pSession=%p\n", fFile, pSession)); + +- /* +- * Close the session if it's still hanging on to the device... +- */ +- if (RT_VALID_PTR(pSession)) +- { +- VGDrvCommonCloseSession(&g_DevExt, pSession); +- if (!ASMAtomicCmpXchgPtr(&pDev->si_drv1, NULL, pSession)) +- Log(("vgdrvFreeBSDClose: si_drv1=%p expected %p!\n", pDev->si_drv1, pSession)); +- ASMAtomicDecU32(&cUsers); +- /* Don't use destroy_dev here because it may sleep resulting in a hanging user process. */ +- destroy_dev_sched(pDev); +- } +- else +- Log(("vgdrvFreeBSDClose: si_drv1=%p!\n", pSession)); +- return 0; +-} +- +- + /** + * I/O control request. + * +@@ -326,8 +238,12 @@ static int vgdrvFreeBSDIOCtl(struct cdev *pDev, u_long + static int vgdrvFreeBSDIOCtl(struct cdev *pDev, u_long ulCmd, caddr_t pvData, int fFile, struct thread *pTd) + { + PVBOXGUESTSESSION pSession; +- devfs_get_cdevpriv((void **)&pSession); ++ int rc; + ++ rc = devfs_get_cdevpriv((void **)&pSession); ++ if (rc) ++ return rc; ++ + /* + * Deal with the fast ioctl path first. + */ +@@ -526,8 +442,10 @@ static int vgdrvFreeBSDPoll(struct cdev *pDev, int fEv + + LogFlow(("vgdrvFreeBSDPoll: fEvents=%d\n", fEvents)); + +- PVBOXGUESTSESSION pSession = (PVBOXGUESTSESSION)pDev->si_drv1; +- if (RT_UNLIKELY(!RT_VALID_PTR(pSession))) { ++ ++ rc = devfs_get_cdevpriv((void **)&pSession); ++ if (rc) ++ { + Log(("vgdrvFreeBSDPoll: no state data for %s\n", devtoname(pDev))); + return (fEvents & (POLLHUP|POLLIN|POLLRDNORM|POLLOUT|POLLWRNORM)); + } +@@ -568,11 +486,8 @@ static int vgdrvFreeBSDDetach(device_t pDevice) + /* + * Reverse what we did in vgdrvFreeBSDAttach. + */ +- if (g_vgdrvFreeBSDEHTag != NULL) +- EVENTHANDLER_DEREGISTER(dev_clone, g_vgdrvFreeBSDEHTag); ++ destroy_dev(g_pDev); + +- clone_cleanup(&g_pvgdrvFreeBSDClones); +- + vgdrvFreeBSDRemoveIRQ(pDevice, pState); + + if (pState->pVMMDevMemRes) +@@ -738,18 +653,21 @@ static int vgdrvFreeBSDAttach(device_t pDevice) + VGDrvCommonProcessOptionsFromHost(&g_DevExt); + + /* +- * Configure device cloning. ++ * Configure device. + */ +- clone_setup(&g_pvgdrvFreeBSDClones); +- g_vgdrvFreeBSDEHTag = EVENTHANDLER_REGISTER(dev_clone, vgdrvFreeBSDClone, 0, 1000); +- if (g_vgdrvFreeBSDEHTag) ++ g_pDev = make_dev(&g_vgdrvFreeBSDChrDevSW, ++ 0, ++ UID_ROOT, ++ GID_WHEEL, ++ 0664, ++ "vboxguest"); ++ if (g_pDev) + { + printf(DEVICE_NAME ": loaded successfully\n"); + return 0; + } + +- printf(DEVICE_NAME ": EVENTHANDLER_REGISTER(dev_clone,,,) failed\n"); +- clone_cleanup(&g_pvgdrvFreeBSDClones); ++ printf(DEVICE_NAME ": make_dev failed\n"); + vgdrvFreeBSDRemoveIRQ(pDevice, pState); + } + else +@@ -793,8 +711,12 @@ static driver_t vgdrvFreeBSDDriver = + sizeof(struct VBoxGuestDeviceState), + }; + ++#if __FreeBSD_version >= 1400058 ++DRIVER_MODULE(vboxguest, pci, vgdrvFreeBSDDriver, 0, 0); ++#else + static devclass_t vgdrvFreeBSDClass; + + DRIVER_MODULE(vboxguest, pci, vgdrvFreeBSDDriver, vgdrvFreeBSDClass, 0, 0); ++#endif + MODULE_VERSION(vboxguest, 1); + diff --git a/emulators/virtualbox-ose-72/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-Makefile b/emulators/virtualbox-ose-72/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-Makefile new file mode 100644 index 000000000000..1430dbb721fb --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-Makefile @@ -0,0 +1,27 @@ +--- src/VBox/Additions/common/VBoxGuest/freebsd/Makefile.orig 2025-08-13 19:41:14 UTC ++++ src/VBox/Additions/common/VBoxGuest/freebsd/Makefile +@@ -35,7 +35,7 @@ KMOD = vboxguest + # + KMOD = vboxguest + +-CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -Iinclude -I. -Ir0drv -w -DVBGL_VBOXGUEST -DVBOX_WITH_HGCM -DVBOX_WITH_64_BITS_GUESTS ++CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_GUEST -DIN_GUEST_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -Iinclude -I. -Ir0drv -w -DVBGL_VBOXGUEST -DVBOX_WITH_HGCM -DVBOX_WITH_64_BITS_GUESTS + + .if (${MACHINE_ARCH} == "i386") + CFLAGS += -DRT_ARCH_X86 +@@ -91,6 +91,7 @@ SRCS += \ + handletable.c \ + handletablectx.c \ + once.c \ ++ term.c \ + thread.c + + .PATH: ${.CURDIR}/common/string +@@ -163,6 +164,7 @@ SRCS += \ + + .PATH: ${.CURDIR}/r0drv + SRCS += \ ++ alloc-ef-r0drv.c \ + alloc-r0drv.c \ + initterm-r0drv.c \ + memobj-r0drv.c \ diff --git a/emulators/virtualbox-ose-72/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-files_vboxguest b/emulators/virtualbox-ose-72/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-files_vboxguest new file mode 100644 index 000000000000..57eed06c6dbe --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-files_vboxguest @@ -0,0 +1,34 @@ +--- src/VBox/Additions/common/VBoxGuest/freebsd/files_vboxguest.orig 2025-08-13 19:41:14 UTC ++++ src/VBox/Additions/common/VBoxGuest/freebsd/files_vboxguest +@@ -74,6 +74,7 @@ FILES_VBOXGUEST_NOBIN=" \ + ${PATH_ROOT}/include/iprt/time.h=>include/iprt/time.h \ + ${PATH_ROOT}/include/iprt/timer.h=>include/iprt/timer.h \ + ${PATH_ROOT}/include/iprt/types.h=>include/iprt/types.h \ ++ ${PATH_ROOT}/include/iprt/uni.h=>include/iprt/uni.h \ + ${PATH_ROOT}/include/iprt/utf16.h=>include/iprt/utf16.h \ + ${PATH_ROOT}/include/iprt/uuid.h=>include/iprt/uuid.h \ + ${PATH_ROOT}/include/iprt/crc.h=>include/iprt/crc.h \ +@@ -125,6 +126,7 @@ FILES_VBOXGUEST_NOBIN=" \ + ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.h=>common/misc/handletable.h \ + ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletablectx.cpp=>common/misc/handletablectx.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/misc/once.cpp=>common/misc/once.c \ ++ ${PATH_ROOT}/src/VBox/Runtime/common/misc/term.cpp=>common/misc/term.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/misc/thread.cpp=>common/misc/thread.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/misc/RTAssertMsg1Weak.cpp=>common/misc/RTAssertMsg1Weak.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/misc/RTAssertMsg2.cpp=>common/misc/RTAssertMsg2.c \ +@@ -200,6 +202,7 @@ FILES_VBOXGUEST_NOBIN=" \ + ${PATH_ROOT}/src/VBox/Runtime/generic/errvars-generic.cpp=>generic/errvars-generic.c \ + ${PATH_ROOT}/src/VBox/Runtime/generic/timer-generic.cpp=>generic/timer-generic.c \ + ${PATH_ROOT}/src/VBox/Runtime/generic/mppresent-generic.cpp=>generic/mppresent-generic.c \ ++ ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-ef-r0drv.cpp=>r0drv/alloc-ef-r0drv.c \ + ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-r0drv.cpp=>r0drv/alloc-r0drv.c \ + ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-r0drv.h=>r0drv/alloc-r0drv.h \ + ${PATH_ROOT}/src/VBox/Runtime/r0drv/initterm-r0drv.cpp=>r0drv/initterm-r0drv.c \ +@@ -226,6 +229,7 @@ FILES_VBOXGUEST_NOBIN=" \ + ${PATH_ROOT}/src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h=>r0drv/freebsd/sleepqueue-r0drv-freebsd.h \ + ${PATH_ROOT}/src/VBox/Runtime/r0drv/generic/semspinmutex-r0drv-generic.c=>r0drv/generic/semspinmutex-r0drv-generic.c \ + ${PATH_ROOT}/src/VBox/Runtime/r0drv/generic/mpnotification-r0drv-generic.cpp=>r0drv/generic/mpnotification-r0drv-generic.c \ ++ ${PATH_ROOT}/src/VBox/Runtime/r0drv/generic/threadctxhooks-r0drv-generic.cpp=>r0drv/generic/threadctxhooks-r0drv-generic.c \ + ${PATH_ROOT}/src/VBox/Runtime/r0drv/generic/RTMpIsCpuWorkPending-r0drv-generic.cpp=>r0drv/generic/RTMpIsCpuWorkPending-r0drv-generic.c \ + ${PATH_ROOT}/src/VBox/Runtime/r0drv/memobj-r0drv.cpp=>r0drv/memobj-r0drv.c \ + ${PATH_ROOT}/src/VBox/Runtime/VBox/log-vbox.cpp=>VBox/log-vbox.c \ diff --git a/emulators/virtualbox-ose-72/files/patch-src-VBox-Additions-x11-Installer-98vboxadd-xclient b/emulators/virtualbox-ose-72/files/patch-src-VBox-Additions-x11-Installer-98vboxadd-xclient new file mode 100644 index 000000000000..5ac88befbb88 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src-VBox-Additions-x11-Installer-98vboxadd-xclient @@ -0,0 +1,25 @@ +--- src/VBox/Additions/x11/Installer/98vboxadd-xclient.orig 2025-08-13 19:41:21 UTC ++++ src/VBox/Additions/x11/Installer/98vboxadd-xclient +@@ -42,15 +42,15 @@ elif test -z "${SSH_CONNECTION}"; then + # not use "exit" here as this script is "source"d, not executed. + + # Check wheather X11 or Wayland version of VBoxClient should be started. +- vbox_wl_check=$(/usr/bin/vboxwl --check 2> /dev/null) ++ vbox_wl_check=$(/usr/local/bin/vboxwl --check 2> /dev/null) + if test "$vbox_wl_check" = "WL"; then +- /usr/bin/VBoxClient --wayland ++ /usr/local/bin/VBoxClient --wayland + else +- /usr/bin/VBoxClient --clipboard +- /usr/bin/VBoxClient --seamless +- /usr/bin/VBoxClient --draganddrop ++ /usr/local/bin/VBoxClient --clipboard ++ /usr/local/bin/VBoxClient --seamless ++ /usr/local/bin/VBoxClient --draganddrop + fi + +- /usr/bin/VBoxClient --checkhostversion +- /usr/bin/VBoxClient --vmsvga-session # In case VMSVGA emulation is enabled ++ /usr/local/bin/VBoxClient --checkhostversion ++ /usr/local/bin/VBoxClient --vmsvga-session # In case VMSVGA emulation is enabled + fi diff --git a/emulators/virtualbox-ose-72/files/patch-src-VBox-Additions-x11-Installer-vboxclient.desktop b/emulators/virtualbox-ose-72/files/patch-src-VBox-Additions-x11-Installer-vboxclient.desktop new file mode 100644 index 000000000000..a76eb7616038 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src-VBox-Additions-x11-Installer-vboxclient.desktop @@ -0,0 +1,10 @@ +--- src/VBox/Additions/x11/Installer/vboxclient.desktop.orig 2020-05-13 19:37:09 UTC ++++ src/VBox/Additions/x11/Installer/vboxclient.desktop +@@ -8,6 +8,6 @@ Comment[C]=VirtualBox User Session Services + Comment=VirtualBox User Session Services + Comment[it]=Servizi di sessione utente di VirtualBox + Comment[pl]=Usługi sesji użytkownika VirtualBox +-Exec=/usr/bin/VBoxClient-all ++Exec=/usr/local/bin/VBoxClient-all + X-GNOME-Autostart-enabled=true + X-KDE-autostart-after=panel diff --git a/emulators/virtualbox-ose-72/files/patch-src-VBox-HostDrivers-VBoxNetAdp-Makefile.kmk b/emulators/virtualbox-ose-72/files/patch-src-VBox-HostDrivers-VBoxNetAdp-Makefile.kmk new file mode 100644 index 000000000000..2427e708059b --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src-VBox-HostDrivers-VBoxNetAdp-Makefile.kmk @@ -0,0 +1,20 @@ +--- src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk.orig 2025-08-13 19:51:10 UTC ++++ src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk +@@ -220,10 +220,14 @@ ifeq ($(KBUILD_TARGET),freebsd) + $$(if $$(eq $$(VBoxNetAdp/freebsd/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \ + | $$(dir $$@) + $(QUIET)$(RM) -f -- $@ +- ifndef VBOX_WITH_HARDENING +- $(QUIET)$(SED) -e "s;VBOX_WITH_HARDENING;;g" --output $@ $< +- else + $(QUIET)$(CP) -f $< $@ ++ ifndef VBOX_WITH_HARDENING ++ $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@.tmp $@ ++ $(QUIET)$(MV) -f $@.tmp $@ ++ endif ++ ifndef VBOX_WITH_NETFLT_VIMAGE ++ $(QUIET)$(SED) -e "s;-DVIMAGE;;g" --output $@.tmp $@ ++ $(QUIET)$(MV) -f $@.tmp $@ + endif + + endif # freebsd diff --git a/emulators/virtualbox-ose-72/files/patch-src-VBox-HostDrivers-VBoxNetFlt-freebsd-files_vboxnetflt b/emulators/virtualbox-ose-72/files/patch-src-VBox-HostDrivers-VBoxNetFlt-freebsd-files_vboxnetflt new file mode 100644 index 000000000000..1ee95be5b24d --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src-VBox-HostDrivers-VBoxNetFlt-freebsd-files_vboxnetflt @@ -0,0 +1,10 @@ +--- src/VBox/HostDrivers/VBoxNetFlt/freebsd/files_vboxnetflt.orig 2025-08-13 19:51:11 UTC ++++ src/VBox/HostDrivers/VBoxNetFlt/freebsd/files_vboxnetflt +@@ -73,6 +73,7 @@ VBOX_VBOXNETFLT_SOURCES=" \ + ${PATH_ROOT}/include/iprt/uni.h=>include/iprt/uni.h \ + ${PATH_ROOT}/include/iprt/utf16.h=>include/iprt/utf16.h \ + ${PATH_ROOT}/include/iprt/uuid.h=>include/iprt/uuid.h \ ++ ${PATH_ROOT}/include/iprt/x86.h=>include/iprt/x86.h \ + ${PATH_ROOT}/include/iprt/x86-helpers.h=>include/iprt/x86-helpers.h \ + ${PATH_ROOT}/include/iprt/nocrt/limits.h=>include/iprt/nocrt/limits.h \ + ${PATH_ROOT}/include/VBox/cdefs.h=>include/VBox/cdefs.h \ diff --git a/emulators/virtualbox-ose-72/files/patch-src-VBox-Installer-Makefile.kmk b/emulators/virtualbox-ose-72/files/patch-src-VBox-Installer-Makefile.kmk new file mode 100644 index 000000000000..f9e9ce8ec516 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src-VBox-Installer-Makefile.kmk @@ -0,0 +1,14 @@ +--- src/VBox/Installer/Makefile.kmk.orig 2025-08-13 19:51:15 UTC ++++ src/VBox/Installer/Makefile.kmk +@@ -51,9 +51,11 @@ ifndef VBOX_ONLY_SDK + if "$(KBUILD_TARGET)" == "win" && "$(KBUILD_HOST)" == "win" + include $(PATH_SUB_CURRENT)/win/Makefile.kmk + endif ++if 0 + if "$(KBUILD_TARGET)" == "freebsd" && "$(KBUILD_HOST)" == "freebsd" + include $(PATH_SUB_CURRENT)/freebsd/Makefile.kmk + endif ++endif + endif + + include $(PATH_SUB_CURRENT)/common/Makefile.kmk diff --git a/emulators/virtualbox-ose-72/files/patch-src-VBox-Installer-freebsd-VBox.sh b/emulators/virtualbox-ose-72/files/patch-src-VBox-Installer-freebsd-VBox.sh new file mode 100644 index 000000000000..b4c177a54d1c --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src-VBox-Installer-freebsd-VBox.sh @@ -0,0 +1,77 @@ +--- src/VBox/Installer/freebsd/VBox.sh.orig 2016-08-27 05:10:34 UTC ++++ src/VBox/Installer/freebsd/VBox.sh +@@ -0,0 +1,74 @@ ++#!/bin/sh ++# ++# Oracle VM VirtualBox startup script, FreeBSD hosts. ++# ++# Copyright (C) 2006-2012 Oracle Corporation ++# ++# This file is part of VirtualBox Open Source Edition (OSE), as ++# available from http://www.virtualbox.org. This file is free software; ++# you can redistribute it and/or modify it under the terms of the GNU ++# General Public License (GPL) as published by the Free Software ++# Foundation, in version 2 as it comes in the "COPYING" file of the ++# VirtualBox OSE distribution. VirtualBox OSE is distributed in the ++# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. ++# ++ ++PATH="/sbin:/bin:/usr/sbin:/usr/bin:%%LOCALBASE%%/sbin:%%LOCALBASE%%/bin" ++CONFIG="%%VBOX_ETC%%/vbox.cfg" ++ ++test -r "${CONFIG}" && ++ . "${CONFIG}" ++test -z "${INSTALL_DIR}" && ++ if test -d %%VBOX_DIR%% && ++ test -f %%VBOX_DIR%%/VBoxRT.so; then ++ INSTALL_DIR=%%VBOX_DIR%% ++ else ++ >&2 echo "Could not find VirtualBox installation. Please reinstall." ++ exit 1 ++ fi ++ ++if [ -d /etc/vbox ]; then ++ >&2 cat <<-EOH ++ WARNING: Directory /etc/vbox found, but ignored. VirtualBox ++ configuration files are stored in %%VBOX_ETC%%/. ++ EOH ++fi ++ ++# workaround for the KDE dialog problem ++KDE_FORK_SLAVES=1; export KDE_FORK_SLAVES ++ ++APP=`basename $0` ++case "$APP" in ++ VirtualBox|virtualbox) ++ exec "$INSTALL_DIR/VirtualBox" "$@" ++ ;; ++ VirtualBoxVM|virtualboxvm) ++ exec "$INSTALL_DIR/VirtualBoxVM" "$@" ++ ;; ++ VBoxManage|vboxmanage) ++ exec "$INSTALL_DIR/VBoxManage" "$@" ++ ;; ++ VBoxSDL|vboxsdl) ++ exec "$INSTALL_DIR/VBoxSDL" "$@" ++ ;; ++ VBoxVRDP|VBoxHeadless|vboxheadless) ++ exec "$INSTALL_DIR/VBoxHeadless" "$@" ++ ;; ++ VBoxAutostart|vboxautostart) ++ exec "$INSTALL_DIR/VBoxAutostart" "$@" ++ ;; ++ VBoxBalloonCtrl|vboxballoonctrl) ++ exec "$INSTALL_DIR/VBoxBalloonCtrl" "$@" ++ ;; ++ VBoxBugReport|vboxbugreport) ++ exec "$INSTALL_DIR/VBoxBugReport" "$@" ++ ;; ++ vboxwebsrv) ++ exec "$INSTALL_DIR/vboxwebsrv" "$@" ++ ;; ++ *) ++ >&2 echo "Unknown application - $APP" ++ exit 1 ++ ;; ++esac ++exit 0 diff --git a/emulators/virtualbox-ose-72/files/patch-src-VBox-Main-src-server-VirtualBoxImpl.cpp b/emulators/virtualbox-ose-72/files/patch-src-VBox-Main-src-server-VirtualBoxImpl.cpp new file mode 100644 index 000000000000..85c886d9ec84 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src-VBox-Main-src-server-VirtualBoxImpl.cpp @@ -0,0 +1,11 @@ +--- src/VBox/Main/src-server/VirtualBoxImpl.cpp.orig 2025-08-13 19:51:27 UTC ++++ src/VBox/Main/src-server/VirtualBoxImpl.cpp +@@ -3097,7 +3097,7 @@ int VirtualBox::i_encryptSettingBytes(const uint8_t *a + if (aCiphertextSize < 32) + return VERR_INVALID_PARAMETER; + +- AssertCompile(sizeof(m->SettingsCipherKey) >= 32); ++ // AssertCompile(sizeof(m->SettingsCipherKey) >= 32); + + /* store the first 8 bytes of the cipherkey for verification */ + for (i = 0, j = 0; i < 8; i++, j++) diff --git a/emulators/virtualbox-ose-72/files/patch-src-VBox-Runtime-r0drv-freebsd-sleepqueue-r0drv-freebsd.h b/emulators/virtualbox-ose-72/files/patch-src-VBox-Runtime-r0drv-freebsd-sleepqueue-r0drv-freebsd.h new file mode 100644 index 000000000000..d3f79ede9e50 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src-VBox-Runtime-r0drv-freebsd-sleepqueue-r0drv-freebsd.h @@ -0,0 +1,39 @@ +Without the first part of this patch, any waits for periods shorter than a +single tick return immediately leading to a lot of unnecessary spinning. For +example, I observe that my guest's idle loop does a lot of sleeps with periods +slightly shorter than 1 ms (1/hz), e.g. 900us. All that waiting turns into pure +spinning and VirtualBox eats 100% of a core. + +The clamping improves the situation significantly. Also, it (approximately) +follows what tvtohz does. The rest of the patch just chases an upstream +KPI change. + +Submitted by: Andriy Gapon <avg@FreeBSD.org> +--- src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h.orig 2025-08-13 19:51:51 UTC ++++ src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h +@@ -94,6 +94,8 @@ DECLINLINE(uint32_t) rtR0SemBsdWaitUpdateTimeout(PRTR0 + uint64_t cTicks = ASMMultU64ByU32DivByU32(uTimeout, hz, UINT32_C(1000000000)); + if (cTicks >= INT_MAX) + return RTSEMWAIT_FLAGS_INDEFINITE; ++ else if (cTicks == 0 && uTimeout > 0) ++ pWait->iTimeout = 1; + else + pWait->iTimeout = (int)cTicks; + #endif +@@ -310,10 +312,16 @@ DECLINLINE(void) rtR0SemBsdSignal(void *pvWaitChan) + DECLINLINE(void) rtR0SemBsdSignal(void *pvWaitChan) + { + sleepq_lock(pvWaitChan); ++#if __FreeBSD_version < 1500022 + int fWakeupSwapProc = sleepq_signal(pvWaitChan, SLEEPQ_CONDVAR, 0, 0); ++#else ++ sleepq_signal(pvWaitChan, SLEEPQ_CONDVAR, 0, 0); ++#endif + sleepq_release(pvWaitChan); ++#if __FreeBSD_version < 1500022 + if (fWakeupSwapProc) + kick_proc0(); ++#endif + } + + /** diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_common_VBoxService_VBoxServiceVMInfo.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_common_VBoxService_VBoxServiceVMInfo.cpp new file mode 100644 index 000000000000..0c463e3d9923 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_common_VBoxService_VBoxServiceVMInfo.cpp @@ -0,0 +1,71 @@ +--- src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp.orig 2025-08-13 19:41:16 UTC ++++ src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp +@@ -77,8 +77,8 @@ + # include <net/if.h> + # include <pwd.h> /* getpwuid */ + # include <unistd.h> +-# if !defined(RT_OS_OS2) && !defined(RT_OS_FREEBSD) && !defined(RT_OS_HAIKU) +-# include <utmpx.h> /** @todo FreeBSD 9 should have this. */ ++# if !defined(RT_OS_OS2) && !defined(RT_OS_HAIKU) ++# include <utmpx.h> + # endif + # ifdef RT_OS_OS2 + # include <net/if_dl.h> +@@ -573,7 +573,7 @@ static void vgsvcVMInfoWriteFixedProperties(void) + } + + +-#if defined(VBOX_WITH_DBUS) && defined(RT_OS_LINUX) /* Not yet for Solaris/FreeBSB. */ ++#if defined(VBOX_WITH_DBUS) && (defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD)) /* Not yet for Solaris. */ + /* + * Simple wrappers to work around compiler-specific va_list madness. + */ +@@ -702,12 +702,6 @@ static int vgsvcVMInfoWriteUsers(void) + #ifdef RT_OS_WINDOWS + rc = VGSvcVMInfoWinWriteUsers(&g_VMInfoPropCache, &pszUserList, &cUsersInList); + +-#elif defined(RT_OS_FREEBSD) +- /** @todo FreeBSD: Port logged on user info retrieval. +- * However, FreeBSD 9 supports utmpx, so we could use the code +- * block below (?). */ +- rc = VERR_NOT_IMPLEMENTED; +- + #elif defined(RT_OS_HAIKU) + /** @todo Haiku: Port logged on user info retrieval. */ + rc = VERR_NOT_IMPLEMENTED; +@@ -733,7 +727,7 @@ static int vgsvcVMInfoWriteUsers(void) + while ( (ut_user = getutxent()) + && RT_SUCCESS(rc)) + { +-# ifdef RT_OS_DARWIN /* No ut_user->ut_session on Darwin */ ++# if defined(RT_OS_DARWIN) || defined(RT_OS_FREEBSD) /* No ut_user->ut_session on Darwin/FreeBSD */ + VGSvcVerbose(4, "Found entry '%s' (type: %d, PID: %RU32)\n", ut_user->ut_user, ut_user->ut_type, ut_user->ut_pid); + # else + VGSvcVerbose(4, "Found entry '%s' (type: %d, PID: %RU32, session: %RU32)\n", +@@ -749,7 +743,7 @@ static int vgsvcVMInfoWriteUsers(void) + } + + # ifdef VBOX_WITH_DBUS +-# if defined(RT_OS_LINUX) /* Not yet for Solaris/FreeBSB. */ ++# if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) /* Not yet for Solaris. */ + DBusError dbErr; + DBusConnection *pConnection = NULL; + int rc2 = RTDBusLoadLib(); +@@ -1074,7 +1068,7 @@ static int vgsvcVMInfoWriteUsers(void) + if ( fHaveLibDbus + && dbus_error_is_set(&dbErr)) + dbus_error_free(&dbErr); +-# endif /* RT_OS_LINUX */ ++# endif /* RT_OS_LINUX || RT_OS_FREEBSD */ + # endif /* VBOX_WITH_DBUS */ + + /* Calc the string length. */ +@@ -1109,7 +1103,7 @@ static int vgsvcVMInfoWriteUsers(void) + RTMemFree(papszUsers); + + endutxent(); /* Close utmpx file. */ +-#endif /* !RT_OS_WINDOWS && !RT_OS_FREEBSD && !RT_OS_HAIKU && !RT_OS_OS2 */ ++#endif /* !RT_OS_WINDOWS && !RT_OS_HAIKU && !RT_OS_OS2 */ + + Assert(RT_FAILURE(rc) || cUsersInList == 0 || (pszUserList && *pszUserList)); + diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_common_pam_pam__vbox.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_common_pam_pam__vbox.cpp new file mode 100644 index 000000000000..ff9853417bdd --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_common_pam_pam__vbox.cpp @@ -0,0 +1,20 @@ +--- src/VBox/Additions/common/pam/pam_vbox.cpp.orig 2025-08-13 19:41:17 UTC ++++ src/VBox/Additions/common/pam/pam_vbox.cpp +@@ -113,7 +113,7 @@ static void pam_vbox_writesyslog(char *pszBuf) + openlog("pam_vbox", LOG_PID, LOG_AUTHPRIV); + syslog(LOG_ERR, "%s", pszBuf); + closelog(); +-#elif defined(RT_OS_SOLARIS) ++#elif defined(RT_OS_FREEBSD) || defined(RT_OS_SOLARIS) + syslog(LOG_ERR, "pam_vbox: %s\n", pszBuf); + #endif + } +@@ -192,7 +192,7 @@ static int vbox_set_msg(pam_handle_t *hPAM, int iStyle + + pam_message msg; + msg.msg_style = iStyle; +-#ifdef RT_OS_SOLARIS ++#if defined(RT_OS_FREEBSD) || defined(RT_OS_SOLARIS) + msg.msg = (char*)pszText; + #else + msg.msg = pszText; diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_Makefile b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_Makefile new file mode 100644 index 000000000000..4f026e38c70a --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_Makefile @@ -0,0 +1,38 @@ +--- src/VBox/Additions/freebsd/Makefile.orig 2025-08-13 19:41:17 UTC ++++ src/VBox/Additions/freebsd/Makefile +@@ -40,6 +40,14 @@ all: + cp vboxvfs/vboxvfs.ko .; \ + fi; \ + fi ++ @echo ++ @if [ -d mount_vboxvfs ]; then \ ++ echo "=== Building mount_vboxvfs binary ==="; \ ++ $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C mount_vboxvfs clean obj depend all; \ ++ if [ -f mount_vboxvfs ]; then \ ++ cp mount_vboxvfs/mount_vboxvfs .; \ ++ fi; \ ++ fi + + + install: +@@ -47,13 +55,19 @@ install: + @if [ -d vboxvfs ]; then \ + $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxvfs install; \ + fi ++ @if [ -d mount_vboxvfs ]; then \ ++ $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C mount_vboxvfs install; \ ++ fi + + clean: + @$(MAKE) -C vboxguest clean + @if [ -d vboxvfs ]; then \ + $(MAKE) -C vboxvfs clean; \ + fi +- rm -f vboxguest.*o vboxvfs.*o ++ @if [ -d mount_vboxvfs ]; then \ ++ $(MAKE) -C mount_vboxvfs clean; \ ++ fi ++ rm -f vboxguest.*o vboxvfs.*o mount_vboxvfs + + load: + @/sbin/kldunload vboxvfs || true diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_Makefile.kmk b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_Makefile.kmk new file mode 100644 index 000000000000..821e1fc5d431 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_Makefile.kmk @@ -0,0 +1,31 @@ +--- src/VBox/Additions/freebsd/Makefile.kmk.orig 2025-08-13 19:41:17 UTC ++++ src/VBox/Additions/freebsd/Makefile.kmk +@@ -33,8 +33,9 @@ endif + endif + + # Include sub-makefiles. +-#include $(PATH_SUB_CURRENT)/vboxvfs/Makefile.kmk +-include $(PATH_SUB_CURRENT)/drm/Makefile.kmk ++include $(PATH_SUB_CURRENT)/vboxvfs/Makefile.kmk ++#include $(PATH_SUB_CURRENT)/drm/Makefile.kmk ++include $(PATH_SUB_CURRENT)/mount_vboxvfs/Makefile.kmk + + # + # Globals +@@ -76,11 +77,14 @@ VBOX_FBSD_ADD_STRIP_BIN = \ + vboxvideo_drv_14.so \ + vboxvideo_drv_15.so \ + vboxvideo_drv_16.so \ +- vboxvideo_drv_17.so ++ vboxvideo_drv_17.so \ ++ $(if $(VBOX_WITH_PAM),pam_vbox.so,) \ ++ VBoxOGL.so \ ++ mount_vboxvfs + + VBOX_FBSD_ADD_MODULES = \ + vboxguest \ +- vboxvideo_drm ++ vboxvfs + + # + # All the bin files that go into the archives. diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_drm_vboxvideo__drm.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_drm_vboxvideo__drm.c new file mode 100644 index 000000000000..3ab11cbd1ed7 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_drm_vboxvideo__drm.c @@ -0,0 +1,17 @@ +--- src/VBox/Additions/freebsd/drm/vboxvideo_drm.c.orig 2025-08-13 19:41:18 UTC ++++ src/VBox/Additions/freebsd/drm/vboxvideo_drm.c +@@ -164,10 +164,14 @@ static driver_t vboxvideo_driver = { + sizeof(struct drm_device) + }; + ++#if __FreeBSD_version >= 1400058 ++DRIVER_MODULE(vboxvideo, vgapci, vboxvideo_driver, 0, 0); ++#else + extern devclass_t drm_devclass; + #if __FreeBSD_version >= 700010 + DRIVER_MODULE(vboxvideo, vgapci, vboxvideo_driver, drm_devclass, 0, 0); + #else + DRIVER_MODULE(vboxvideo, pci, vboxvideo_driver, drm_devclass, 0, 0); ++#endif + #endif + MODULE_DEPEND(vboxvideo, drm, 1, 1, 1); diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_mount__vboxvfs_Makefile.kmk b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_mount__vboxvfs_Makefile.kmk new file mode 100644 index 000000000000..270472c045e3 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_mount__vboxvfs_Makefile.kmk @@ -0,0 +1,31 @@ +--- src/VBox/Additions/freebsd/mount_vboxvfs/Makefile.kmk.orig 2025-05-11 03:54:13 UTC ++++ src/VBox/Additions/freebsd/mount_vboxvfs/Makefile.kmk +@@ -0,0 +1,28 @@ ++# $Id: Makefile.kmk $ ++## @file ++# Sub-Makefile for the FreeBSD Shared folder mount utility. ++# ++ ++SUB_DEPTH = ../../../../.. ++include $(KBUILD_PATH)/subheader.kmk ++ ++ifneq ($(KBUILD_HOST),freebsd) ++$(error "The FreeBSD guest additions can only be built on FreeBSD!") ++endif ++ ++MOUNT= $(VBOX_FREEBSD_SRC)/../sbin/mount ++ ++CFLAGS+=-I$(MOUNT) ++ ++PROGRAMS += mount_vboxvfs ++mount_vboxvfs_TEMPLATE = NewVBoxGuestR3Exe ++mount_vboxvfs_SOURCES = mount_vboxvfs.c ++ ++ifdef HAVE_MNTOPTS_IN_LIBUTIL ++mount_vboxvfs_LIBS = util ++else ++mount_vboxvfs_SOURCES += $(MOUNT)/getmntopts.c ++endif ++ ++include $(FILE_KBUILD_SUB_FOOTER) ++ diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_mount__vboxvfs_mount__vboxvfs.8 b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_mount__vboxvfs_mount__vboxvfs.8 new file mode 100644 index 000000000000..41fcdd6d019b --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_mount__vboxvfs_mount__vboxvfs.8 @@ -0,0 +1,56 @@ +--- src/VBox/Additions/freebsd/mount_vboxvfs/mount_vboxvfs.8.orig 2025-08-28 22:09:24 UTC ++++ src/VBox/Additions/freebsd/mount_vboxvfs/mount_vboxvfs.8 +@@ -0,0 +1,53 @@ ++.\" ++.\" Copyright (c) 1992, 1993, 1994 ++.\" The Regents of the University of California. All rights reserved. ++.\" ++.\" Redistribution and use in source and binary forms, with or without ++.\" modification, are permitted provided that the following conditions ++.\" are met: ++.\" 1. Redistributions of source code must retain the above copyright ++.\" notice, this list of conditions and the following disclaimer. ++.\" 2. Redistributions in binary form must reproduce the above copyright ++.\" notice, this list of conditions and the following disclaimer in the ++.\" documentation and/or other materials provided with the distribution. ++.\" 4. Neither the name of the University nor the names of its contributors ++.\" may be used to endorse or promote products derived from this software ++.\" without specific prior written permission. ++.\" ++.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ++.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE ++.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++.\" SUCH DAMAGE. ++.\" ++.Dd August 5, 2013 ++.Dt MOUNT_VBOXFS 8 ++.Os ++.Sh NAME ++.Nm mount_vboxfs ++.Nd "Mount the VirtualBox shared folder NAME from the host system to MOUNTPOINT" ++.Sh SYNOPSIS ++.Nm ++.Op Fl o Ar options ++.Ar NAME ++.Ar MOUNTPOINT ++.Sh DESCRIPTION ++The ++.Nm ++Mount the VirtualBox shared folder NAME from the host system to MOUNTPOINT ++.Pp ++The options are as follows: ++.Bl -tag -width indent ++.Fl w ++mount the shared folder writably (the default) ++.Fl r ++mount the shared folder read-only ++.Fl o ++OPTION[,OPTION...] use the mount options specified ++.El diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_mount__vboxvfs_mount__vboxvfs.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_mount__vboxvfs_mount__vboxvfs.c new file mode 100644 index 000000000000..1f85abc198b9 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_mount__vboxvfs_mount__vboxvfs.c @@ -0,0 +1,171 @@ +--- src/VBox/Additions/freebsd/mount_vboxvfs/mount_vboxvfs.c.orig 2025-08-28 22:09:24 UTC ++++ src/VBox/Additions/freebsd/mount_vboxvfs/mount_vboxvfs.c +@@ -0,0 +1,168 @@ ++/* ++* Copyright (c) 1992, 1993, 1994 ++* The Regents of the University of California. All rights reserved. ++* ++* Redistribution and use in source and binary forms, with or without ++* modification, are permitted provided that the following conditions ++* are met: ++* 1. Redistributions of source code must retain the above copyright ++* notice, this list of conditions and the following disclaimer. ++* 2. Redistributions in binary form must reproduce the above copyright ++* notice, this list of conditions and the following disclaimer in the ++* documentation and/or other materials provided with the distribution. ++* 4. Neither the name of the University nor the names of its contributors ++* may be used to endorse or promote products derived from this software ++* without specific prior written permission. ++* ++* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ++* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE ++* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++* SUCH DAMAGE. ++*/ ++ ++#include <sys/cdio.h> ++#include <sys/stat.h> ++#include <sys/file.h> ++#include <sys/iconv.h> ++#include <sys/param.h> ++#include <sys/linker.h> ++#include <sys/module.h> ++#include <sys/mount.h> ++#include <sys/uio.h> ++ ++#include <err.h> ++#include <errno.h> ++#include <stdlib.h> ++#include <stdio.h> ++#include <string.h> ++#include <sysexits.h> ++#include <unistd.h> ++ ++#include "mntopts.h" ++ ++#define MAX_HOST_NAME 256 ++static char mount_point[MAXPATHLEN + 1]; ++static char vboxfs_vfsname[] = "vboxvfs"; ++static struct mntopt mopts[] = { ++ MOPT_STDOPTS, ++ MOPT_END ++}; ++ ++static void usage(void) __dead2; ++ ++static void ++usage(void) ++{ ++ fprintf(stderr, ++ "Usage: [OPTIONS] NAME MOUNTPOINT\n" ++ "Mount the VirtualBox shared folder NAME to MOUNTPOINT.\n" ++ "\nOptions:\n" ++ " -w mount the shared folder writable \n" ++ " -r mount the shared folder read-only (the default)\n"); ++ exit(1); ++} ++ ++int ++main(int argc, char *argv[]) ++{ ++ struct iovec *iov; ++ struct stat st; ++ char *host_name; ++ char errmsg[255]; ++ uid_t uid; ++ gid_t gid; ++ mode_t dir_mode, file_mode; ++ int iovlen; ++ int ronly = 0; ++ int error, ch; ++ int mntflags = 0; ++ ++ iov = NULL; ++ iovlen = 0; ++ errmsg[0] = '\0'; ++ uid = (uid_t)-1; ++ gid = (gid_t)-1; ++ file_mode = 0; ++ dir_mode = 0; ++ ++ while ((ch = getopt(argc, argv, "rwo:h")) != -1) ++ switch(ch) { ++ default: ++ fprintf(stderr, "unknown option `%c:%#x'\n", ch, ch); ++ return (1); ++ ++ case '?': ++ case 'h': ++ usage(); ++ case 'r': ++ ronly = 1; ++ break; ++ case 'w': ++ ronly = 0; ++ break; ++ case 'o': ++ getmntopts(optarg, mopts, &mntflags, 0); ++ break; ++ } ++ ++ if (argc - optind < 2) ++ usage(); ++ ++ host_name = argv[optind]; ++ realpath(argv[optind+1], mount_point); ++ ++ if (stat(mount_point, &st) == -1) ++ err(EX_OSERR, "could not find mount point %s", mount_point); ++ ++ if (!S_ISDIR(st.st_mode)) { ++ errno = ENOTDIR; ++ err(EX_OSERR, "can't mount on %s", mount_point); ++ } ++ ++ if (strlen(host_name) > MAX_HOST_NAME - 1) ++ err(EX_OSERR, "host name is too big %s", host_name); ++ ++ if (ronly == 0) ++ mntflags |= MNT_ASYNC; ++ if (uid == (uid_t)-1) ++ uid = st.st_uid; ++ if (gid == (gid_t)-1) ++ gid = st.st_gid; ++ if (file_mode == 0) ++ file_mode = st.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO); ++ if (dir_mode == 0) { ++ dir_mode = file_mode; ++ if (dir_mode & S_IRUSR) ++ dir_mode |= S_IXUSR; ++ if (dir_mode & S_IRGRP) ++ dir_mode |= S_IXGRP; ++ if (dir_mode & S_IROTH) ++ dir_mode |= S_IXOTH; ++ } ++ ++ build_iovec(&iov, &iovlen, "fstype", vboxfs_vfsname, (size_t)-1); ++ build_iovec(&iov, &iovlen, "fspath", mount_point, (size_t)-1); ++ build_iovec(&iov, &iovlen, "from", host_name, (size_t)-1); ++ build_iovec_argf(&iov, &iovlen, "uid", "%d", uid); ++ build_iovec_argf(&iov, &iovlen, "gid", "%d", gid); ++ build_iovec_argf(&iov, &iovlen, "file_mode", "%o", file_mode); ++ build_iovec_argf(&iov, &iovlen, "dir_mode", "%o", dir_mode); ++ build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); ++ ++ error = nmount(iov, iovlen, mntflags); ++ if (error == -1) { ++ if (errmsg[0] != '\0') ++ err(1, "%s: error: %s", mount_point, errmsg); ++ else ++ err(1, "%s: error %d", mount_point, error); ++ } ++ ++ return (0); ++} diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_vboxvfs_bcmp.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_vboxvfs_bcmp.c new file mode 100644 index 000000000000..fb4d7fac8c06 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_vboxvfs_bcmp.c @@ -0,0 +1,12 @@ +--- src/VBox/Additions/freebsd/vboxvfs/bcmp.c.orig 2021-02-21 19:09:22 UTC ++++ src/VBox/Additions/freebsd/vboxvfs/bcmp.c +@@ -0,0 +1,9 @@ ++#include <sys/types.h> ++ ++int bcmp(const void *b1, const void *b2, size_t len); ++ ++int ++bcmp(const void *b1, const void *b2, size_t len) ++{ ++ return __builtin_memcmp((b1), (b2), (len)); ++} diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs.h b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs.h new file mode 100644 index 000000000000..46b57e5a9d13 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs.h @@ -0,0 +1,428 @@ +--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs.h.orig 2025-08-13 19:41:18 UTC ++++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs.h +@@ -1,8 +1,3 @@ +-/* $Id: vboxvfs.h $ */ +-/** @file +- * Description. +- */ +- + /* + * Copyright (C) 2010-2025 Oracle and/or its affiliates. + * +@@ -34,72 +29,378 @@ + #define VBOXVFS_VFSNAME "vboxvfs" + #define VBOXVFS_VERSION 1 + +-#define MAX_HOST_NAME 256 +-#define MAX_NLS_NAME 32 ++#define MAX_HOST_NAME 256 ++#define MAX_NLS_NAME 32 ++//#define MODEMASK 07777 /* mode bits plus permission bits */ ++/** Helper macros */ ++#define VFSTOVBOXFS(mp) ((struct vboxfs_mnt *)((mp)->mnt_data)) ++#define VP_TO_VBOXFS_NODE(vp) ((struct vboxfs_node *)(vp)->v_data) ++#define VBOXTOV(np) ((struct vnode *)(np)->n_vnode) + +-struct vboxvfs_mount_info { +- char name[MAX_HOST_NAME]; +- char nls_name[MAX_NLS_NAME]; +- int uid; +- int gid; +- int ttl; +-}; ++#define ROOTDIR_INO 1 ++#define THEFILE_INO 2 ++#define THEFILE_NAME "thefile" + ++#define VBOXFS_NODE_LOCK(node) mtx_lock(&(node)->sf_interlock) ++#define VBOXFS_NODE_UNLOCK(node) mtx_unlock(&(node)->sf_interlock) ++#define VBOXFS_NODE_MTX(node) (&(node)->sf_interlock) ++#define VBOXFS_NODE_ASSERT_LOCKED(node) mtx_assert(VBOXFS_NODE_MTX(node), \ ++ MA_OWNED) ++ ++#ifdef INVARIANTS ++#define VBOXFS_ASSERT_LOCKED(node) do { \ ++ MPASS(node != NULL); \ ++ MPASS(node->sf_vnode != NULL); \ ++ if (!VOP_ISLOCKED(node->sf_vnode) && \ ++ !mtx_owned(VBOXFS_NODE_MTX(node))) \ ++ panic("vboxfs: node is not locked: %p", node); \ ++ } while (0) ++#define VBOXFS_ASSERT_ELOCKED(node) do { \ ++ MPASS((node) != NULL); \ ++ MPASS((node)->sf_vnode != NULL); \ ++ mtx_assert(VBOXFS_NODE_MTX(node), MA_OWNED); \ ++ ASSERT_VOP_LOCKED((node)->sf_vnode, "vboxfs"); \ ++ } while (0) ++#else ++#define VBOXFS_ASSERT_LOCKED(node) (void)0 ++#define VBOXFS_ASSERT_ELOCKED(node) (void)0 ++#endif ++ ++#define VBOXFS_VNODE_ALLOCATING 1 ++#define VBOXFS_VNODE_WANT 2 ++#define VBOXFS_VNODE_DOOMED 4 ++#define VBOXFS_VNODE_WRECLAIM 8 ++ ++MALLOC_DECLARE(M_VBOXVFS); ++ + #ifdef _KERNEL ++#ifndef FREEBSD_STYLE ++#include "../../../../../include/iprt/nocrt/limits.h" ++#include "../../../../../include/iprt/alloc.h" ++#include "../../../../../include/iprt/asm.h" ++#include "../../../../../include/iprt/asm-amd64-x86.h" ++#include "../../../../../include/iprt/asm-math.h" ++#include "../../../../../include/iprt/assert.h" ++#include "../../../../../include/iprt/cdefs.h" ++#include "../../../../../include/iprt/err.h" ++#include "../../../../../include/iprt/fs.h" ++#include "../../../../../include/iprt/log.h" ++#include "../../../../../include/iprt/mem.h" ++#include "../../../../../include/iprt/param.h" ++#include "../../../../../include/iprt/path.h" ++#include "../../../../../include/iprt/semaphore.h" ++#include "../../../../../include/iprt/stdarg.h" ++#include "../../../../../include/iprt/stdint.h" ++#include "../../../../../include/iprt/string.h" ++#include "../../../../../include/iprt/time.h" ++#include "../../../../../include/iprt/types.h" ++#include "../../../../../include/iprt/uni.h" + +-#include <VBox/VBoxGuestLibSharedFolders.h> ++#else ++ ++#include "iprt/nocrt/limits.h" ++#include "iprt/alloc.h" ++#include "iprt/asm.h" ++#include "iprt/asm-amd64-x86.h" ++#include "iprt/asm-math.h" ++#include "iprt/assert.h" ++#include "iprt/cdefs.h" ++#include "iprt/err.h" ++#include "iprt/fs.h" ++#include "iprt/log.h" ++#include "iprt/mem.h" ++#include "iprt/param.h" ++#include "iprt/path.h" ++#include "iprt/semaphore.h" ++#include "iprt/stdarg.h" ++#include "iprt/stdint.h" ++#include "iprt/string.h" ++#include "iprt/time.h" ++#include "iprt/types.h" ++#include "iprt/uni.h" ++ ++#include "common/VBoxGuestLib/SysHlp.h" ++ ++#endif /* !FREEBSD_STYLE */ ++ + #include <sys/mount.h> + #include <sys/vnode.h> ++#include <sys/_timespec.h> + +-struct vboxvfsmount { +- uid_t uid; +- gid_t gid; +- mode_t file_mode; +- mode_t dir_mode; +- struct mount *mp; +- struct ucred *owner; +- u_int flags; +- long nextino; +- int caseopt; +- int didrele; ++#include <VBox/VBoxGuestLibSharedFolders.h> ++ ++#if __FreeBSD_version >= 1400093 ++typedef __enum_uint8(vtype) enum_vtype_t; ++#else ++typedef enum vtype enum_vtype_t; ++#endif ++ ++#define VBOXVFS_DEBUG(lvl, ...) do { \ ++ if (vboxvfs_debug >= (lvl)) { \ ++ printf("VBOXVFS[%u]: ", lvl); \ ++ printf(__VA_ARGS__); \ ++ printf("\n"); \ ++ } \ ++} while (0) ++ ++/* ++ * representation of an active mount point ++ */ ++struct sfp_mount { ++ VBGLSFMAP map; + }; + +-/* structs - stolen from the linux shared module code */ ++/* ++ * Mount / Unmount a shared folder. ++ * ++ * sfprov_mount() takes as input the connection pointer and the name of ++ * the shared folder. On success, it returns zero and supplies an ++ * sfp_mount_t handle. On failure it returns any relevant errno value. ++ * ++ * sfprov_unmount() unmounts the mounted file system. It returns 0 on ++ * success and any relevant errno on failure. ++ */ ++typedef struct sfp_mount sfp_mount_t; ++ ++struct sfp_file { ++ SHFLHANDLE handle; ++ VBGLSFMAP map; /* need this again for the close operation */ ++}; ++ ++typedef struct sfp_file sfp_file_t; ++ ++/* ++ * File operations: open/close/read/write/etc. ++ * ++ * open/create can return any relevant errno, however ENOENT ++ * generally means that the host file didn't exist. ++ */ ++typedef struct sffs_stat { ++ mode_t sf_mode; ++ off_t sf_size; ++ off_t sf_alloc; ++ struct timespec sf_atime; ++ struct timespec sf_mtime; ++ struct timespec sf_ctime; ++} sffs_stat_t; ++ ++/* ++ * Read directory entries. ++ */ ++/* ++ * a singly linked list of buffers, each containing an array of stat's+dirent's. ++ * sf_len is length of the sf_entries array, in bytes. ++ */ ++typedef struct sffs_dirents { ++ struct sffs_dirents *sf_next; ++ long long sf_len; ++ struct sffs_dirent { ++ sffs_stat_t sf_stat; ++ struct dirent sf_entry; /* this is variable length */ ++ off_t sf_off; ++ } sf_entries[1]; ++} sffs_dirents_t; ++ ++/* ++ * Shared Folders filesystem per-mount data structure. ++ */ ++struct vboxfs_mnt { ++ struct mount *sf_vfsp; /* filesystem's vfs struct */ ++ sfp_mount_t *sf_handle; /* guest-host communication handle */ ++ uid_t sf_uid; /* owner of all shared folders */ ++ gid_t sf_gid; /* group of all shared folders */ ++ mode_t sf_dmode; /* mode of all directories */ ++ mode_t sf_fmode; /* mode of all files */ ++ mode_t sf_dmask; /* mask of all directories */ ++ mode_t sf_fmask; /* mask of all files */ ++ int sf_stat_ttl; /* ttl for stat caches (in ms) */ ++ int sf_fsync; /* whether to honor fsync or not */ ++ uint64_t sf_ino; /* per FS ino generator */ ++ uma_zone_t sf_node_pool; ++ struct vboxfs_node *sf_root; ++}; ++ ++/* ++ * vboxfs_node is the file system dependent vnode data for vboxfs. ++ * vboxfs_node's also track all files ever accessed, both open and closed. ++ * It duplicates some of the information in vnode, since it holds ++ * information for files that may have been completely closed. ++ * ++ */ ++struct vboxfs_node { ++ struct vboxfs_mnt *vboxfsmp; /* containing mounted file system */ ++ char *sf_path; /* full pathname to file or dir */ ++ uint64_t sf_ino; /* assigned unique ID number */ ++ struct vnode *sf_vnode; /* vnode if active */ ++ sfp_file_t *sf_file; /* non NULL if open */ ++ struct vboxfs_node *sf_parent; /* parent sfnode of this one */ ++ uint32_t sf_opencnt; /* sf_file reference counter */ ++ uint16_t sf_children; /* number of children sfnodes */ ++ uint8_t sf_type; /* VDIR or VREG */ ++ uint8_t sf_vpstate; /* XXX: ADD COMMENT */ ++ uint8_t sf_is_stale; /* this is stale and should be purged */ ++ sffs_stat_t sf_stat; /* cached file attrs for this node */ ++ uint64_t sf_stat_time; /* last-modified time of sf_stat */ ++ sffs_dirents_t *sf_dir_list; /* list of entries for this directory */ ++ ++ /* interlock to protect sf_vpstate, sf_file and sf_opencnt */ ++ struct mtx sf_interlock; ++}; ++ ++struct vboxfs_mount_info { ++ char name[MAX_HOST_NAME]; /* share name */ ++ char nls_name[MAX_NLS_NAME];/* name of an I/O charset */ ++ int uid; /* user ID for all entries, default 0=root */ ++ int gid; /* group ID for all entries, default 0=root */ ++ int ttl; /* time to live */ ++ int dmode; /* mode for directories if != 0xffffffff */ ++ int fmode; /* mode for regular files if != 0xffffffff */ ++ int dmask; /* umask applied to directories */ ++ int fmask; /* umask applied to regular files */ ++}; ++ + struct sf_glob_info { +- VBGLSFMAP map; +-/* struct nls_table *nls;*/ +- int ttl; +- int uid; +- int gid; +- struct vnode *vnode_root; ++ VBGLSFMAP map; ++/* struct nls_table *nls;*/ ++ int ttl; ++ int uid; ++ int gid; ++ struct vnode *vnode_root; + }; + ++/** Per-file system mount instance data. */ ++typedef struct vboxfs_globinfo ++{ ++ VBGLSFMAP Map; ++ int Ttl; ++ int Uid; ++ int Gid; ++ struct mount *pVFS; ++ struct vboxfs_node *pVNodeRoot; ++} vboxfs_globinfo_t; ++ + struct sf_inode_info { +- SHFLSTRING *path; +- int force_restat; ++ SHFLSTRING *path; ++ int force_restat; + }; + + #if 0 + struct sf_dir_info { +- struct list_head info_list; ++ struct list_head info_list; + }; + #endif + + struct sf_dir_buf { +- size_t nb_entries; +- size_t free_bytes; +- size_t used_bytes; +- void *buf; ++ size_t nb_entries; ++ size_t free_bytes; ++ size_t used_bytes; ++ void *buf; + #if 0 +- struct list_head head; ++ struct list_head head; + #endif + }; + + struct sf_reg_info { +- SHFLHANDLE handle; ++ SHFLHANDLE handle; + }; + ++int vboxfs_alloc_vp(struct mount *, struct vboxfs_node *, int, ++ struct vnode **); ++void vboxfs_free_vp(struct vnode *); ++ ++int vboxfs_alloc_node(struct mount *, struct vboxfs_mnt *, const char*, ++ enum_vtype_t, uid_t, gid_t, mode_t, struct vboxfs_node *, ++ struct vboxfs_node **); ++void vboxfs_free_node(struct vboxfs_mnt *, struct vboxfs_node *); ++ ++/* ++ * These are the provider interfaces used by sffs to access the underlying ++ * shared file system. ++ */ ++#define SFPROV_VERSION 1 ++ ++/* ++ * Initialization and termination. ++ * sfprov_connect() is called once before any other interfaces and returns ++ * a handle used in further calls. The argument should be SFPROV_VERSION ++ * from above. On failure it returns a NULL pointer. ++ * ++ * sfprov_disconnect() must only be called after all sf file systems have been ++ * unmounted. ++ */ ++typedef struct sfp_connection sfp_connection_t; ++ ++extern sfp_connection_t *sfprov_connect(int); ++extern void sfprov_disconnect(void); ++ ++extern int sfprov_mount(char *, sfp_mount_t **); ++extern int sfprov_unmount(sfp_mount_t *); ++ ++/* ++ * query information about a mounted file system ++ */ ++typedef struct sffs_fsinfo { ++ uint64_t blksize; ++ uint64_t blksused; ++ uint64_t blksavail; ++ uint32_t maxnamesize; ++ uint32_t readonly; ++ uint32_t serial; ++} sffs_fsinfo_t; ++ ++extern int sfprov_get_fsinfo(sfp_mount_t *, sffs_fsinfo_t *); ++ ++extern int sfprov_create(sfp_mount_t *, char *path, mode_t mode, ++ sffs_stat_t *stat); ++extern int sfprov_open(sfp_mount_t *, char *path, sfp_file_t **fp); ++extern int sfprov_close(sfp_file_t *fp); ++extern int sfprov_read(sfp_file_t *, char * buffer, uint64_t offset, ++ uint32_t *numbytes, int buflocked); ++extern int sfprov_write(sfp_file_t *, char * buffer, uint64_t offset, ++ uint32_t *numbytes, int buflocked); ++extern int sfprov_fsync(sfp_file_t *fp); ++ ++ ++/* ++ * get/set information about a file (or directory) using pathname ++ */ ++extern int sfprov_get_mode(sfp_mount_t *, char *, mode_t *); ++extern int sfprov_get_size(sfp_mount_t *, char *, uint64_t *); ++extern int sfprov_get_atime(sfp_mount_t *, char *, struct timespec *); ++extern int sfprov_get_mtime(sfp_mount_t *, char *, struct timespec *); ++extern int sfprov_get_ctime(sfp_mount_t *, char *, struct timespec *); ++extern int sfprov_get_attr(sfp_mount_t *, char *, sffs_stat_t *); ++extern int sfprov_set_attr(sfp_mount_t *, char *, mode_t, ++ struct timespec, struct timespec, struct timespec); ++extern int sfprov_set_size(sfp_mount_t *, char *, uint64_t); ++ ++ ++/* ++ * File/Directory operations ++ */ ++extern int sfprov_trunc(sfp_mount_t *, char *); ++extern int sfprov_remove(sfp_mount_t *, char *path, u_int is_link); ++extern int sfprov_mkdir(sfp_mount_t *, char *path, mode_t mode, ++ sffs_stat_t *stat); ++extern int sfprov_rmdir(sfp_mount_t *, char *path); ++extern int sfprov_rename(sfp_mount_t *, char *from, char *to, u_int is_dir); ++ ++ ++/* ++ * Symbolic link operations ++ */ ++extern int sfprov_set_show_symlinks(void); ++extern int sfprov_readlink(sfp_mount_t *, char *path, char *target, ++ size_t tgt_size); ++extern int sfprov_symlink(sfp_mount_t *, char *linkname, char *target, ++ sffs_stat_t *stat); ++ ++#define SFFS_DIRENTS_SIZE 8192 ++#define SFFS_DIRENTS_OFF (offsetof(sffs_dirents_t, sf_entries[0])) ++ ++extern int sfprov_readdir(sfp_mount_t *mnt, char *path, ++ sffs_dirents_t **dirents); ++ + #endif /* KERNEL */ + + #endif /* !GA_INCLUDED_SRC_freebsd_vboxvfs_vboxvfs_h */ +- diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__prov.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__prov.c new file mode 100644 index 000000000000..1d793f39e3bc --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__prov.c @@ -0,0 +1,1015 @@ +--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_prov.c.orig 2025-08-28 22:09:24 UTC ++++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_prov.c +@@ -0,0 +1,1012 @@ ++/* ++ * Copyright (C) 2008-2016 Oracle Corporation ++ * ++ * This file is part of VirtualBox Open Source Edition (OSE), as ++ * available from http://www.virtualbox.org. This file is free software; ++ * you can redistribute it and/or modify it under the terms of the GNU ++ * General Public License (GPL) as published by the Free Software ++ * Foundation, in version 2 as it comes in the "COPYING" file of the ++ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the ++ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. ++ * ++ * The contents of this file may alternatively be used under the terms ++ * of the Common Development and Distribution License Version 1.0 ++ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the ++ * VirtualBox OSE distribution, in which case the provisions of the ++ * CDDL are applicable instead of those of the GPL. ++ * ++ * You may elect to license modified versions of this file under the ++ * terms and conditions of either the GPL or the CDDL or both. ++ */ ++ ++/* ++ * Provider interfaces for shared folder file system. ++ */ ++ ++#include <sys/types.h> ++#include <sys/stat.h> ++#include <sys/param.h> ++#include <sys/systm.h> ++#include <sys/kernel.h> ++#include <sys/malloc.h> ++#include <sys/mount.h> ++#include <sys/vnode.h> ++#include <sys/dirent.h> ++#include <sys/proc.h> ++#include <vm/vm.h> ++#include <vm/pmap.h> ++#include <vm/vm_kern.h> ++#include <vm/vm_map.h> ++#include <vm/vm_object.h> ++#include <vm/vm_extern.h> ++#include <vm/uma.h> ++#include "vboxvfs.h" ++ ++#define DIRENT_RECLEN(namelen) \ ++ ((offsetof(struct dirent, d_name[0]) + 1 + (namelen) + 7) & ~ 7) ++#define DIRENT_NAMELEN(reclen) \ ++ ((reclen) - (offsetof(struct dirent, d_name[0]))) ++ ++static VBGLSFCLIENT vbox_client; ++ ++extern u_int vboxvfs_debug; ++ ++static int ++sfprov_vbox2errno(int rc) ++{ ++ if (rc == VERR_ACCESS_DENIED) ++ return (EACCES); ++ if (rc == VERR_INVALID_NAME) ++ return (ENOENT); ++ return (RTErrConvertToErrno(rc)); ++} ++ ++/* ++ * utility to create strings ++ */ ++static SHFLSTRING * ++sfprov_string(char *path, int *sz) ++{ ++ SHFLSTRING *str; ++ int len = strlen(path); ++ ++ *sz = len + 1 + sizeof (*str) - sizeof (str->String); ++ str = malloc(*sz, M_VBOXVFS, M_WAITOK | M_ZERO); ++ str->u16Size = len + 1; ++ str->u16Length = len; ++ strcpy(str->String.utf8, path); ++ return (str); ++} ++ ++sfp_connection_t * ++sfprov_connect(int version) ++{ ++ /* only one version for now, so must match */ ++ int error = -1; ++ ++ if (version != SFPROV_VERSION) { ++ printf("%s: version mismatch (%d, expected %d)\n", __func__, ++ version, SFPROV_VERSION); ++ return (NULL); ++ } ++ ++ if (RT_FAILURE(VbglR0SfInit())) ++ return (NULL); ++ ++ if (RT_FAILURE(VbglR0SfConnect(&vbox_client))) { ++ VbglR0SfTerm(); ++ return (NULL); ++ } ++ ++ if (RT_FAILURE(VbglR0SfSetUtf8(&vbox_client))) { ++ VbglR0SfDisconnect(&vbox_client); ++ VbglR0SfTerm(); ++ return (NULL); ++ } ++ return ((sfp_connection_t *)&vbox_client); ++} ++ ++void ++sfprov_disconnect() ++{ ++ VbglR0SfDisconnect(&vbox_client); ++ VbglR0SfTerm(); ++} ++ ++int ++sfprov_mount(char *path, sfp_mount_t **mnt) ++{ ++ sfp_mount_t *m; ++ SHFLSTRING *str; ++ int size; ++ int rc; ++ ++ VBOXVFS_DEBUG(1, "%s: Enter", __FUNCTION__); ++ VBOXVFS_DEBUG(1, "%s: path: [%s]", __FUNCTION__, path); ++ ++ m = malloc(sizeof (*m), M_VBOXVFS, M_WAITOK | M_ZERO); ++ str = sfprov_string(path, &size); ++ ++ int error; ++ rc = VbglR0SfMapFolder(&vbox_client, str, &m->map); ++ if (RT_FAILURE(rc)) { ++ free(m, M_VBOXVFS); ++ *mnt = NULL; ++ error = sfprov_vbox2errno(rc); ++ } else { ++ *mnt = m; ++ error = 0; ++ } ++ free(str, M_VBOXVFS); ++ printf("%s(%s): error=%d rc=%d\n", __func__, path, error, rc); ++ return (error); ++} ++ ++int ++sfprov_unmount(sfp_mount_t *mnt) ++{ ++ int rc; ++ ++ rc = VbglR0SfUnmapFolder(&vbox_client, &mnt->map); ++ if (RT_FAILURE(rc)) { ++ printf("sfprov_unmount: VbglR0SfUnmapFolder() failed rc=%d\n", rc); ++ rc = sfprov_vbox2errno(rc); ++ } else { ++ rc = 0; ++ } ++ ++ free(mnt, M_VBOXVFS); ++ return (rc); ++} ++ ++/* ++ * query information about a mounted file system ++ */ ++int ++sfprov_get_fsinfo(sfp_mount_t *mnt, sffs_fsinfo_t *fsinfo) ++{ ++ int rc; ++ SHFLVOLINFO info; ++ uint32_t bytes = sizeof(SHFLVOLINFO); ++ size_t bytesused; ++ ++ rc = VbglR0SfFsInfo(&vbox_client, &mnt->map, 0, ++ (SHFL_INFO_GET | SHFL_INFO_VOLUME), &bytes, (SHFLDIRINFO *)&info); ++ if (RT_FAILURE(rc)) ++ return (sfprov_vbox2errno(rc)); ++ ++ fsinfo->blksize = info.ulBytesPerAllocationUnit; ++ bytesused = ++ info.ullTotalAllocationBytes - info.ullAvailableAllocationBytes; ++ fsinfo->blksused = bytesused / info.ulBytesPerAllocationUnit; ++ fsinfo->blksavail = info.ullAvailableAllocationBytes / ++ info.ulBytesPerAllocationUnit; ++ fsinfo->maxnamesize = info.fsProperties.cbMaxComponent; ++ fsinfo->readonly = info.fsProperties.fReadOnly; ++ fsinfo->serial = info.ulSerial; ++ return (0); ++} ++ ++/* ++ * file/directory information conversions. ++ */ ++static void ++sfprov_fmode_from_mode(RTFMODE *fMode, mode_t mode) ++{ ++ RTFMODE m = 0; ++ ++#define mode_set(r) ((mode & (S_##r)) ? RTFS_UNIX_##r : 0) ++ m = mode_set (ISUID); ++ m |= mode_set (ISGID); ++ m |= (mode & S_ISVTX) ? RTFS_UNIX_ISTXT : 0; ++ m |= mode_set (IRUSR); ++ m |= mode_set (IWUSR); ++ m |= mode_set (IXUSR); ++ m |= mode_set (IRGRP); ++ m |= mode_set (IWGRP); ++ m |= mode_set (IXGRP); ++ m |= mode_set (IROTH); ++ m |= mode_set (IWOTH); ++ m |= mode_set (IXOTH); ++ ++ if (S_ISDIR(mode)) ++ m |= RTFS_TYPE_DIRECTORY; ++ else if (S_ISREG(mode)) ++ m |= RTFS_TYPE_FILE; ++ else if (S_ISFIFO(mode)) ++ m |= RTFS_TYPE_FIFO; ++ else if (S_ISCHR(mode)) ++ m |= RTFS_TYPE_DEV_CHAR; ++ else if (S_ISBLK(mode)) ++ m |= RTFS_TYPE_DEV_BLOCK; ++ else if (S_ISLNK(mode)) ++ m |= RTFS_TYPE_SYMLINK; ++ else if (S_ISSOCK(mode)) ++ m |= RTFS_TYPE_SOCKET; ++ else ++ m |= RTFS_TYPE_FILE; ++ ++ *fMode = m; ++} ++ ++static void ++sfprov_mode_from_fmode(mode_t *mode, RTFMODE fMode) ++{ ++ mode_t m = 0; ++ ++ if (RTFS_IS_DIRECTORY(fMode)) ++ m |= S_IFDIR; ++ else if (RTFS_IS_FILE(fMode)) ++ m |= S_IFREG; ++ else if (RTFS_IS_FIFO(fMode)) ++ m |= S_IFIFO; ++ else if (RTFS_IS_DEV_CHAR(fMode)) ++ m |= S_IFCHR; ++ else if (RTFS_IS_DEV_BLOCK(fMode)) ++ m |= S_IFBLK; ++ else if (RTFS_IS_SYMLINK(fMode)) ++ m |= S_IFLNK; ++ else if (RTFS_IS_SOCKET(fMode)) ++ m |= S_IFSOCK; ++ ++ if (fMode & RTFS_UNIX_IRUSR) ++ m |= S_IRUSR; ++ if (fMode & RTFS_UNIX_IWUSR) ++ m |= S_IWUSR; ++ if (fMode & RTFS_UNIX_IXUSR) ++ m |= S_IXUSR; ++ if (fMode & RTFS_UNIX_IRGRP) ++ m |= S_IRGRP; ++ if (fMode & RTFS_UNIX_IWGRP) ++ m |= S_IWGRP; ++ if (fMode & RTFS_UNIX_IXGRP) ++ m |= S_IXGRP; ++ if (fMode & RTFS_UNIX_IROTH) ++ m |= S_IROTH; ++ if (fMode & RTFS_UNIX_IWOTH) ++ m |= S_IWOTH; ++ if (fMode & RTFS_UNIX_IXOTH) ++ m |= S_IXOTH; ++ if (fMode & RTFS_UNIX_ISUID) ++ m |= S_ISUID; ++ if (fMode & RTFS_UNIX_ISGID) ++ m |= S_ISGID; ++ if (fMode & RTFS_UNIX_ISTXT) ++ m |= S_ISVTX; ++ *mode = m; ++} ++ ++static void ++sfprov_ftime_from_timespec(struct timespec *time, RTTIMESPEC *ts) ++{ ++ uint64_t nanosec = RTTimeSpecGetNano(ts); ++ time->tv_sec = nanosec / UINT64_C(1000000000); ++ time->tv_nsec = nanosec % UINT64_C(1000000000); ++} ++ ++static void ++sfprov_stat_from_info(sffs_stat_t *stat, SHFLFSOBJINFO *info) ++{ ++ sfprov_mode_from_fmode(&stat->sf_mode, info->Attr.fMode); ++ stat->sf_size = info->cbObject; ++ stat->sf_alloc = info->cbAllocated; ++ sfprov_ftime_from_timespec(&stat->sf_atime, &info->AccessTime); ++ sfprov_ftime_from_timespec(&stat->sf_mtime, &info->ModificationTime); ++ sfprov_ftime_from_timespec(&stat->sf_ctime, &info->ChangeTime); ++} ++ ++/* ++ * File operations: open/close/read/write/etc. ++ * ++ * open/create can return any relevant errno, however ENOENT ++ * generally means that the host file didn't exist. ++ */ ++int ++sfprov_create( ++ sfp_mount_t *mnt, ++ char *path, ++ mode_t mode, ++ sffs_stat_t *stat) ++{ ++ int rc; ++ SHFLCREATEPARMS parms; ++ SHFLSTRING *str; ++ int size; ++ sfp_file_t *newfp; ++ ++ str = sfprov_string(path, &size); ++ parms.Handle = SHFL_HANDLE_NIL; ++ parms.Info.cbObject = 0; ++ sfprov_fmode_from_mode(&parms.Info.Attr.fMode, mode); ++ parms.CreateFlags = SHFL_CF_ACT_CREATE_IF_NEW | ++ SHFL_CF_ACT_REPLACE_IF_EXISTS | SHFL_CF_ACCESS_READWRITE; ++ rc = VbglR0SfCreate(&vbox_client, &mnt->map, str, &parms); ++ free(str, M_VBOXVFS); ++ ++ if (RT_FAILURE(rc)) ++ return (sfprov_vbox2errno(rc)); ++ if (parms.Handle == SHFL_HANDLE_NIL) { ++ if (parms.Result == SHFL_FILE_EXISTS) ++ return (EEXIST); ++ return (ENOENT); ++ } ++ (void)VbglR0SfClose(&vbox_client, &mnt->map, parms.Handle); ++ sfprov_stat_from_info(stat, &parms.Info); ++ return (0); ++} ++ ++int ++sfprov_open(sfp_mount_t *mnt, char *path, sfp_file_t **fp) ++{ ++ int rc; ++ SHFLCREATEPARMS parms; ++ SHFLSTRING *str; ++ int size; ++ sfp_file_t *newfp; ++ ++ /* ++ * First we attempt to open it read/write. If that fails we ++ * try read only. ++ */ ++ bzero(&parms, sizeof(parms)); ++ str = sfprov_string(path, &size); ++ parms.Handle = SHFL_HANDLE_NIL; ++ parms.Info.cbObject = 0; ++ parms.CreateFlags = SHFL_CF_ACT_FAIL_IF_NEW | SHFL_CF_ACCESS_READWRITE; ++ rc = VbglR0SfCreate(&vbox_client, &mnt->map, str, &parms); ++ if (RT_FAILURE(rc) && rc != VERR_ACCESS_DENIED) { ++ free(str, M_VBOXVFS); ++ return (sfprov_vbox2errno(rc)); ++ } ++ if (parms.Handle == SHFL_HANDLE_NIL) { ++ if (parms.Result == SHFL_PATH_NOT_FOUND || ++ parms.Result == SHFL_FILE_NOT_FOUND) { ++ free(str, M_VBOXVFS); ++ return (ENOENT); ++ } ++ parms.CreateFlags = ++ SHFL_CF_ACT_FAIL_IF_NEW | SHFL_CF_ACCESS_READ; ++ rc = VbglR0SfCreate(&vbox_client, &mnt->map, str, &parms); ++ if (RT_FAILURE(rc)) { ++ free(str, M_VBOXVFS); ++ return (sfprov_vbox2errno(rc)); ++ } ++ if (parms.Handle == SHFL_HANDLE_NIL) { ++ free(str, M_VBOXVFS); ++ return (ENOENT); ++ } ++ } ++ else ++ free(str, M_VBOXVFS); ++ newfp = malloc(sizeof(sfp_file_t), M_VBOXVFS, M_WAITOK | M_ZERO); ++ newfp->handle = parms.Handle; ++ newfp->map = mnt->map; ++ *fp = newfp; ++ return (0); ++} ++ ++int ++sfprov_trunc(sfp_mount_t *mnt, char *path) ++{ ++ int rc; ++ SHFLCREATEPARMS parms; ++ SHFLSTRING *str; ++ int size; ++ ++ /* ++ * open it read/write. ++ */ ++ str = sfprov_string(path, &size); ++ parms.Handle = 0; ++ parms.Info.cbObject = 0; ++ parms.CreateFlags = SHFL_CF_ACT_FAIL_IF_NEW | SHFL_CF_ACCESS_READWRITE | ++ SHFL_CF_ACT_OVERWRITE_IF_EXISTS; ++ rc = VbglR0SfCreate(&vbox_client, &mnt->map, str, &parms); ++ free(str, M_VBOXVFS); ++ ++ if (RT_FAILURE(rc)) { ++ return (sfprov_vbox2errno(rc)); ++ } ++ (void)VbglR0SfClose(&vbox_client, &mnt->map, parms.Handle); ++ return (0); ++} ++ ++int ++sfprov_close(sfp_file_t *fp) ++{ ++ int rc; ++ ++ rc = VbglR0SfClose(&vbox_client, &fp->map, fp->handle); ++ free(fp, M_VBOXVFS); ++ return (0); ++} ++ ++int ++sfprov_read(sfp_file_t *fp, char *buffer, uint64_t offset, uint32_t *numbytes, ++ int buflocked) ++{ ++ int rc; ++ ++ rc = VbglR0SfRead(&vbox_client, &fp->map, fp->handle, offset, ++ numbytes, (uint8_t *)buffer, buflocked); ++ if (RT_FAILURE(rc)) ++ return (sfprov_vbox2errno(rc)); ++ return (0); ++} ++ ++int ++sfprov_write(sfp_file_t *fp, char *buffer, uint64_t offset, uint32_t *numbytes, ++ int buflocked) ++{ ++ int rc; ++ ++ rc = VbglR0SfWrite(&vbox_client, &fp->map, fp->handle, offset, ++ numbytes, (uint8_t *)buffer, buflocked); ++ if (RT_FAILURE(rc)) ++ return (sfprov_vbox2errno(rc)); ++ return (0); ++} ++ ++int ++sfprov_fsync(sfp_file_t *fp) ++{ ++ int rc; ++ ++ rc = VbglR0SfFlush(&vbox_client, &fp->map, fp->handle); ++ if (RT_FAILURE(rc)) ++ return (sfprov_vbox2errno(rc)); ++ return (0); ++} ++ ++ ++static int ++sfprov_getinfo(sfp_mount_t *mnt, char *path, PSHFLFSOBJINFO info) ++{ ++ int rc; ++ SHFLCREATEPARMS parms; ++ SHFLSTRING *str; ++ int size; ++ ++ str = sfprov_string(path, &size); ++ parms.Handle = 0; ++ parms.Info.cbObject = 0; ++ parms.CreateFlags = SHFL_CF_LOOKUP | SHFL_CF_ACT_FAIL_IF_NEW; ++ rc = VbglR0SfCreate(&vbox_client, &mnt->map, str, &parms); ++ free(str, M_VBOXVFS); ++ ++ if (RT_FAILURE(rc)) ++ return (sfprov_vbox2errno(rc)); ++ if (parms.Result != SHFL_FILE_EXISTS) ++ return (ENOENT); ++ *info = parms.Info; ++ return (0); ++} ++ ++/* ++ * get information about a file (or directory) ++ */ ++int ++sfprov_get_mode(sfp_mount_t *mnt, char *path, mode_t *mode) ++{ ++ int rc; ++ SHFLFSOBJINFO info; ++ ++ rc = sfprov_getinfo(mnt, path, &info); ++ if (rc) ++ return (rc); ++ sfprov_mode_from_fmode(mode, info.Attr.fMode); ++ return (0); ++} ++ ++int ++sfprov_get_size(sfp_mount_t *mnt, char *path, uint64_t *size) ++{ ++ int rc; ++ SHFLFSOBJINFO info; ++ ++ rc = sfprov_getinfo(mnt, path, &info); ++ if (rc) ++ return (rc); ++ *size = info.cbObject; ++ return (0); ++} ++ ++ ++int ++sfprov_get_atime(sfp_mount_t *mnt, char *path, struct timespec *time) ++{ ++ int rc; ++ SHFLFSOBJINFO info; ++ ++ rc = sfprov_getinfo(mnt, path, &info); ++ if (rc) ++ return (rc); ++ sfprov_ftime_from_timespec(time, &info.AccessTime); ++ return (0); ++} ++ ++int ++sfprov_get_mtime(sfp_mount_t *mnt, char *path, struct timespec *time) ++{ ++ int rc; ++ SHFLFSOBJINFO info; ++ ++ rc = sfprov_getinfo(mnt, path, &info); ++ if (rc) ++ return (rc); ++ sfprov_ftime_from_timespec(time, &info.ModificationTime); ++ return (0); ++} ++ ++int ++sfprov_get_ctime(sfp_mount_t *mnt, char *path, struct timespec *time) ++{ ++ int rc; ++ SHFLFSOBJINFO info; ++ ++ rc = sfprov_getinfo(mnt, path, &info); ++ if (rc) ++ return (rc); ++ sfprov_ftime_from_timespec(time, &info.ChangeTime); ++ return (0); ++} ++ ++int ++sfprov_get_attr(sfp_mount_t *mnt, char *path, sffs_stat_t *attr) ++{ ++ int rc; ++ SHFLFSOBJINFO info; ++ ++ rc = sfprov_getinfo(mnt, path, &info); ++ if (rc) ++ return (rc); ++ sfprov_stat_from_info(attr, &info); ++ return (0); ++} ++ ++static void ++sfprov_timespec_from_ftime(RTTIMESPEC *ts, struct timespec time) ++{ ++ uint64_t nanosec = UINT64_C(1000000000) * time.tv_sec + time.tv_nsec; ++ RTTimeSpecSetNano(ts, nanosec); ++} ++ ++int ++sfprov_set_attr( ++ sfp_mount_t *mnt, ++ char *path, ++ mode_t mode, ++ struct timespec atime, ++ struct timespec mtime, ++ struct timespec ctime) ++{ ++ int rc, err; ++ SHFLCREATEPARMS parms; ++ SHFLSTRING *str; ++ SHFLFSOBJINFO info; ++ uint32_t bytes; ++ int str_size; ++ ++ str = sfprov_string(path, &str_size); ++ parms.Handle = 0; ++ parms.Info.cbObject = 0; ++ parms.CreateFlags = SHFL_CF_ACT_OPEN_IF_EXISTS ++ | SHFL_CF_ACT_FAIL_IF_NEW ++ | SHFL_CF_ACCESS_ATTR_WRITE; ++ ++ rc = VbglR0SfCreate(&vbox_client, &mnt->map, str, &parms); ++ ++ if (RT_FAILURE(rc)) { ++ printf("sfprov_set_attr: VbglR0SfCreate(%s) failed rc=%d\n", ++ path, rc); ++ err = sfprov_vbox2errno(rc); ++ goto fail2; ++ } ++ if (parms.Result != SHFL_FILE_EXISTS) { ++ err = ENOENT; ++ goto fail1; ++ } ++ ++ RT_ZERO(info); ++#if 0 ++ if (mask & AT_MODE) ++ sfprov_fmode_from_mode(&info.Attr.fMode, mode); ++ if (mask & AT_ATIME) ++ sfprov_timespec_from_ftime(&info.AccessTime, atime); ++ if (mask & AT_MTIME) ++ sfprov_timespec_from_ftime(&info.ModificationTime, mtime); ++ if (mask & AT_CTIME) ++ sfprov_timespec_from_ftime(&info.ChangeTime, ctime); ++#endif ++ bytes = sizeof(info); ++ rc = VbglR0SfFsInfo(&vbox_client, &mnt->map, parms.Handle, ++ (SHFL_INFO_SET | SHFL_INFO_FILE), &bytes, (SHFLDIRINFO *)&info); ++ if (RT_FAILURE(rc)) { ++ if (rc != VERR_ACCESS_DENIED && rc != VERR_WRITE_PROTECT) ++ { ++ printf("sfprov_set_attr: VbglR0SfFsInfo(%s, FILE) failed rc=%d\n", ++ path, rc); ++ } ++ err = sfprov_vbox2errno(rc); ++ goto fail1; ++ } ++ ++ err = 0; ++ ++fail1: ++ rc = VbglR0SfClose(&vbox_client, &mnt->map, parms.Handle); ++ if (RT_FAILURE(rc)) { ++ printf("sfprov_set_attr: VbglR0SfClose(%s) failed rc=%d\n", ++ path, rc); ++ } ++fail2: ++ free(str, M_VBOXVFS); ++ return err; ++} ++ ++int ++sfprov_set_size(sfp_mount_t *mnt, char *path, uint64_t size) ++{ ++ int rc, err; ++ SHFLCREATEPARMS parms; ++ SHFLSTRING *str; ++ SHFLFSOBJINFO info; ++ uint32_t bytes; ++ int str_size; ++ ++ str = sfprov_string(path, &str_size); ++ parms.Handle = 0; ++ parms.Info.cbObject = 0; ++ parms.CreateFlags = SHFL_CF_ACT_OPEN_IF_EXISTS ++ | SHFL_CF_ACT_FAIL_IF_NEW ++ | SHFL_CF_ACCESS_WRITE; ++ ++ rc = VbglR0SfCreate(&vbox_client, &mnt->map, str, &parms); ++ ++ if (RT_FAILURE(rc)) { ++ printf("sfprov_set_size: VbglR0SfCreate(%s) failed rc=%d\n", ++ path, rc); ++ err = sfprov_vbox2errno(rc); ++ goto fail2; ++ } ++ if (parms.Result != SHFL_FILE_EXISTS) { ++ err = ENOENT; ++ goto fail1; ++ } ++ ++ RT_ZERO(info); ++ info.cbObject = size; ++ bytes = sizeof(info); ++ rc = VbglR0SfFsInfo(&vbox_client, &mnt->map, parms.Handle, ++ (SHFL_INFO_SET | SHFL_INFO_SIZE), &bytes, (SHFLDIRINFO *)&info); ++ if (RT_FAILURE(rc)) { ++ printf("sfprov_set_size: VbglR0SfFsInfo(%s, SIZE) failed rc=%d\n", ++ path, rc); ++ err = sfprov_vbox2errno(rc); ++ goto fail1; ++ } ++ ++ err = 0; ++ ++fail1: ++ rc = VbglR0SfClose(&vbox_client, &mnt->map, parms.Handle); ++ if (RT_FAILURE(rc)) { ++ printf("sfprov_set_size: VbglR0SfClose(%s) failed rc=%d\n", ++ path, rc); ++ } ++fail2: ++ free(str, M_VBOXVFS); ++ return err; ++} ++ ++/* ++ * Directory operations ++ */ ++int ++sfprov_mkdir( ++ sfp_mount_t *mnt, ++ char *path, ++ mode_t mode, ++ sffs_stat_t *stat) ++{ ++ int rc; ++ SHFLCREATEPARMS parms; ++ SHFLSTRING *str; ++ int size; ++ ++ str = sfprov_string(path, &size); ++ parms.Handle = SHFL_HANDLE_NIL; ++ parms.Info.cbObject = 0; ++ sfprov_fmode_from_mode(&parms.Info.Attr.fMode, mode); ++ parms.CreateFlags = SHFL_CF_DIRECTORY | SHFL_CF_ACT_CREATE_IF_NEW | ++ SHFL_CF_ACT_FAIL_IF_EXISTS | SHFL_CF_ACCESS_READ; ++ rc = VbglR0SfCreate(&vbox_client, &mnt->map, str, &parms); ++ free(str, M_VBOXVFS); ++ ++ if (RT_FAILURE(rc)) ++ return (sfprov_vbox2errno(rc)); ++ if (parms.Handle == SHFL_HANDLE_NIL) { ++ if (parms.Result == SHFL_FILE_EXISTS) ++ return (EEXIST); ++ return (ENOENT); ++ } ++ (void)VbglR0SfClose(&vbox_client, &mnt->map, parms.Handle); ++ sfprov_stat_from_info(stat, &parms.Info); ++ return (0); ++} ++ ++int ++sfprov_set_show_symlinks(void) ++{ ++ int rc; ++ ++ rc = VbglR0SfSetSymlinks(&vbox_client); ++ if (RT_FAILURE(rc)) ++ return (sfprov_vbox2errno(rc)); ++ ++ return (0); ++} ++ ++int ++sfprov_remove(sfp_mount_t *mnt, char *path, u_int is_link) ++{ ++ int rc; ++ SHFLSTRING *str; ++ int size; ++ ++ str = sfprov_string(path, &size); ++ rc = VbglR0SfRemove(&vbox_client, &mnt->map, str, ++ SHFL_REMOVE_FILE | (is_link ? SHFL_REMOVE_SYMLINK : 0)); ++ free(str, M_VBOXVFS); ++ if (RT_FAILURE(rc)) ++ return (sfprov_vbox2errno(rc)); ++ return (0); ++} ++ ++int ++sfprov_readlink( ++ sfp_mount_t *mnt, ++ char *path, ++ char *target, ++ size_t tgt_size) ++{ ++ int rc; ++ SHFLSTRING *str; ++ int size; ++ ++ str = sfprov_string(path, &size); ++ ++ rc = VbglR0SfReadLink(&vbox_client, &mnt->map, str, (uint32_t) tgt_size, ++ target); ++ if (RT_FAILURE(rc)) ++ rc = sfprov_vbox2errno(rc); ++ ++ free(str, M_VBOXVFS); ++ return (rc); ++} ++ ++int ++sfprov_symlink( ++ sfp_mount_t *mnt, ++ char *linkname, ++ char *target, ++ sffs_stat_t *stat) ++{ ++ int rc; ++ SHFLSTRING *lnk, *tgt; ++ int lnk_size, tgt_size; ++ SHFLFSOBJINFO info; ++ ++ lnk = sfprov_string(linkname, &lnk_size); ++ tgt = sfprov_string(target, &tgt_size); ++ ++ rc = VbglR0SfSymlink(&vbox_client, &mnt->map, lnk, tgt, &info); ++ if (RT_FAILURE(rc)) { ++ rc = sfprov_vbox2errno(rc); ++ goto done; ++ } ++ ++ if (stat != NULL) ++ sfprov_stat_from_info(stat, &info); ++ ++done: ++ free(lnk, M_VBOXVFS); ++ free(tgt, M_VBOXVFS); ++ ++ return (rc); ++} ++ ++int ++sfprov_rmdir(sfp_mount_t *mnt, char *path) ++{ ++ int rc; ++ SHFLSTRING *str; ++ int size; ++ ++ str = sfprov_string(path, &size); ++ rc = VbglR0SfRemove(&vbox_client, &mnt->map, str, SHFL_REMOVE_DIR); ++ free(str, M_VBOXVFS); ++ if (RT_FAILURE(rc)) ++ return (sfprov_vbox2errno(rc)); ++ return (0); ++} ++ ++int ++sfprov_rename(sfp_mount_t *mnt, char *from, char *to, u_int is_dir) ++{ ++ int rc; ++ SHFLSTRING *old, *new; ++ int old_size, new_size; ++ ++ old = sfprov_string(from, &old_size); ++ new = sfprov_string(to, &new_size); ++ rc = VbglR0SfRename(&vbox_client, &mnt->map, old, new, ++ (is_dir ? SHFL_RENAME_DIR : SHFL_RENAME_FILE) | ++ SHFL_RENAME_REPLACE_IF_EXISTS); ++ free(old, M_VBOXVFS); ++ free(new, M_VBOXVFS); ++ if (RT_FAILURE(rc)) ++ return (sfprov_vbox2errno(rc)); ++ return (0); ++} ++ ++/* ++ * Read all filenames in a directory. ++ * ++ * - success - all entries read and returned ++ * - ENOENT - Couldn't open the directory for reading ++ * - EINVAL - Internal error of some kind ++ * ++ * On successful return, *dirents points to a list of sffs_dirents_t; ++ * for each dirent, all fields except the d_ino will be set appropriately. ++ * The caller is responsible for freeing the dirents buffer. ++ */ ++int ++sfprov_readdir( ++ sfp_mount_t *mnt, ++ char *path, ++ sffs_dirents_t **dirents) ++{ ++ int error; ++ char *cp; ++ int len; ++ SHFLSTRING *mask_str = NULL; /* must be path with "/" appended */ ++ int mask_size; ++ sfp_file_t *fp; ++ uint32_t infobuff_alloc = 16384; ++ SHFLDIRINFO *infobuff = NULL, *info; ++ uint32_t numbytes; ++ uint32_t nents; ++ uint32_t size; ++ off_t offset; ++ sffs_dirents_t *cur_buf; ++ struct sffs_dirent *dirent; ++ unsigned short reclen; ++ unsigned short entlen; ++ ++ *dirents = NULL; ++ ++ error = sfprov_open(mnt, path, &fp); ++ if (error != 0) ++ return (ENOENT); ++ ++ /* ++ * Allocate the first dirents buffers. ++ */ ++ *dirents = malloc(SFFS_DIRENTS_SIZE, M_VBOXVFS, M_WAITOK | M_ZERO); ++ if (*dirents == NULL) { ++ error = (ENOSPC); ++ goto done; ++ } ++ cur_buf = *dirents; ++ cur_buf->sf_next = NULL; ++ cur_buf->sf_len = 0; ++ ++ /* ++ * Create mask that VBox expects. This needs to be the directory path, ++ * plus a "*" wildcard to get all files. ++ */ ++ len = strlen(path) + 3; ++ cp = malloc(len, M_VBOXVFS, M_WAITOK | M_ZERO); ++ if (cp == NULL) { ++ error = (ENOSPC); ++ goto done; ++ } ++ strcpy(cp, path); ++ strcat(cp, "/*"); ++ mask_str = sfprov_string(cp, &mask_size); ++ free(cp, M_VBOXVFS); ++ ++ /* ++ * Now loop using VbglR0SfDirInfo ++ */ ++ infobuff = malloc(infobuff_alloc, M_VBOXVFS, M_WAITOK | M_ZERO); ++ if (infobuff == NULL) { ++ error = (ENOSPC); ++ goto done; ++ } ++ ++ offset = 0; ++ for (;;) { ++ numbytes = infobuff_alloc; ++ error = VbglR0SfDirInfo(&vbox_client, &fp->map, fp->handle, ++ mask_str, 0, 0, &numbytes, infobuff, &nents); ++ ++ switch (error) { ++ case VINF_SUCCESS: ++ /* fallthrough */ ++ case VERR_NO_MORE_FILES: ++ break; ++ case VERR_NO_TRANSLATION: ++ /* XXX ??? */ ++ break; ++ default: ++ error = sfprov_vbox2errno(error); ++ goto done; ++ } ++ ++ /* ++ * Create the dirent_t's and save the stats for each name ++ */ ++ for (info = infobuff; (char *) info < (char *) infobuff + numbytes; nents--) { ++ size_t buflen; ++ ++ /* expand buffers if we need more space */ ++ reclen = DIRENT_RECLEN(strlen(info->name.String.utf8)); ++ entlen = sizeof(struct sffs_dirent) + reclen; ++ buflen = SFFS_DIRENTS_OFF + cur_buf->sf_len + entlen; ++ if (buflen > SFFS_DIRENTS_SIZE) { ++ cur_buf->sf_next = malloc(SFFS_DIRENTS_SIZE, ++ M_VBOXVFS, M_WAITOK | M_ZERO); ++ if (cur_buf->sf_next == NULL) { ++ error = ENOSPC; ++ goto done; ++ } ++ cur_buf = cur_buf->sf_next; ++ cur_buf->sf_next = NULL; ++ cur_buf->sf_len = 0; ++ } ++ ++ /* create the dirent with the name, offset, and len */ ++ dirent = (struct sffs_dirent *) ++ (((char *) &cur_buf->sf_entries[0]) + cur_buf->sf_len); ++ strncpy(&dirent->sf_entry.d_name[0], ++ info->name.String.utf8, DIRENT_NAMELEN(reclen)); ++ dirent->sf_entry.d_reclen = reclen; ++ dirent->sf_entry.d_namlen = strlen(info->name.String.utf8); ++ dirent->sf_entry.d_name[dirent->sf_entry.d_namlen] = 0; ++ offset += entlen; ++ dirent->sf_off = offset; ++ ++ /* save the stats */ ++ sfprov_stat_from_info(&dirent->sf_stat, &info->Info); ++ ++ /* next info */ ++ cur_buf->sf_len += entlen; ++ size = offsetof (SHFLDIRINFO, name.String) + info->name.u16Size; ++ info = (SHFLDIRINFO *) ((uintptr_t) info + size); ++ } ++ KASSERT(nents == 0, ("nents != 0")); ++ KASSERT((char *) info == (char *) infobuff + numbytes, "(char *) info != (char *) infobuff + numbytes"); ++ ++ if (error == VERR_NO_MORE_FILES) ++ break; ++ } ++ error = 0; ++ ++done: ++ if (error != 0) { ++ while (*dirents) { ++ cur_buf = (*dirents)->sf_next; ++ free(*dirents, M_VBOXVFS); ++ *dirents = cur_buf; ++ } ++ } ++ if (infobuff != NULL) ++ free(infobuff, M_VBOXVFS); ++ if (mask_str != NULL) ++ free(mask_str, M_VBOXVFS); ++ sfprov_close(fp); ++ ++ return (error); ++} diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c new file mode 100644 index 000000000000..cd272f0205e8 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c @@ -0,0 +1,644 @@ +--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vfsops.c.orig 2025-08-13 19:41:18 UTC ++++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vfsops.c +@@ -1,8 +1,3 @@ +-/* $Id: vboxvfs_vfsops.c $ */ +-/** @file +- * Description. +- */ +- + /* + * Copyright (C) 2008-2025 Oracle and/or its affiliates. + * +@@ -24,245 +19,478 @@ + * + * SPDX-License-Identifier: GPL-3.0-only + */ +- +-#include "vboxvfs.h" ++#include <sys/types.h> + #include <sys/param.h> + #include <sys/systm.h> + #include <sys/proc.h> + #include <sys/bio.h> + #include <sys/buf.h> ++#include <sys/conf.h> ++#include <sys/dirent.h> + #include <sys/kernel.h> + #include <sys/sysctl.h> + #include <sys/vnode.h> + #include <sys/mount.h> ++#include <sys/namei.h> ++#include <sys/fcntl.h> ++#include <sys/priv.h> + #include <sys/stat.h> + #include <sys/malloc.h> + #include <sys/module.h> ++#include <sys/sbuf.h> + +-#include <iprt/mem.h> ++#include <geom/geom.h> ++#include <geom/geom_vfs.h> ++#include <vm/uma.h> ++#include "vboxvfs.h" + + #define VFSMP2SFGLOBINFO(mp) ((struct sf_glob_info *)mp->mnt_data) + +-static int vboxvfs_version = VBOXVFS_VERSION; ++#ifdef MALLOC_DECLARE ++MALLOC_DEFINE(M_VBOXVFS, "vboxvfs", "VBOX VFS"); ++#endif + +-SYSCTL_NODE(_vfs, OID_AUTO, vboxvfs, CTLFLAG_RW, 0, "VirtualBox shared filesystem"); +-SYSCTL_INT(_vfs_vboxvfs, OID_AUTO, version, CTLFLAG_RD, &vboxvfs_version, 0, ""); ++static sfp_connection_t *sfprov = NULL; + +-/* global connection to the host service. */ +-static VBGLSFCLIENT g_vboxSFClient; ++static int vboxfs_version = VBOXVFS_VERSION; ++u_int vboxvfs_debug = 1; + +-static vfs_init_t vboxvfs_init; +-static vfs_uninit_t vboxvfs_uninit; +-static vfs_cmount_t vboxvfs_cmount; +-static vfs_mount_t vboxvfs_mount; +-static vfs_root_t vboxvfs_root; +-static vfs_quotactl_t vboxvfs_quotactl; +-static vfs_statfs_t vboxvfs_statfs; +-static vfs_unmount_t vboxvfs_unmount; ++SYSCTL_NODE(_vfs, OID_AUTO, vboxfs, CTLFLAG_RW, 0, "VirtualBox shared filesystem"); ++SYSCTL_INT(_vfs_vboxfs, OID_AUTO, version, CTLFLAG_RD, &vboxfs_version, 0, ""); ++SYSCTL_UINT(_vfs_vboxfs, OID_AUTO, debug, CTLFLAG_RW, &vboxvfs_debug, 0, "Debug level"); + +-static struct vfsops vboxvfs_vfsops = { +- .vfs_init = vboxvfs_init, +- .vfs_cmount = vboxvfs_cmount, +- .vfs_mount = vboxvfs_mount, +- .vfs_quotactl = vboxvfs_quotactl, +- .vfs_root = vboxvfs_root, +- .vfs_statfs = vboxvfs_statfs, +- .vfs_sync = vfs_stdsync, +- .vfs_uninit = vboxvfs_uninit, +- .vfs_unmount = vboxvfs_unmount, ++static vfs_init_t vboxfs_init; ++static vfs_uninit_t vboxfs_uninit; ++static vfs_cmount_t vboxfs_cmount; ++static vfs_mount_t vboxfs_mount; ++static vfs_root_t vboxfs_root; ++static vfs_quotactl_t vboxfs_quotactl; ++static vfs_statfs_t vboxfs_statfs; ++static vfs_unmount_t vboxfs_unmount; ++ ++static struct vfsops vboxfs_vfsops = { ++ .vfs_init = vboxfs_init, ++ .vfs_cmount = vboxfs_cmount, ++ .vfs_mount = vboxfs_mount, ++ .vfs_quotactl = vboxfs_quotactl, ++ .vfs_root = vboxfs_root, ++ .vfs_statfs = vboxfs_statfs, ++ .vfs_sync = vfs_stdsync, ++ .vfs_uninit = vboxfs_uninit, ++ .vfs_unmount = vboxfs_unmount + }; + + +-VFS_SET(vboxvfs_vfsops, vboxvfs, VFCF_NETWORK); ++VFS_SET(vboxfs_vfsops, vboxvfs, VFCF_NETWORK); + MODULE_DEPEND(vboxvfs, vboxguest, 1, 1, 1); + +-static int vboxvfs_cmount(struct mntarg *ma, void * data, int flags, struct thread *td) ++/* ++ * Allocates a new node of type 'type' inside the 'tmp' mount point, with ++ * its owner set to 'uid', its group to 'gid' and its mode set to 'mode', ++ * using the credentials of the process 'p'. ++ * ++ * If the node type is set to 'VDIR', then the parent parameter must point ++ * to the parent directory of the node being created. It may only be NULL ++ * while allocating the root node. ++ * ++ * If the node type is set to 'VBLK' or 'VCHR', then the rdev parameter ++ * specifies the device the node represents. ++ * ++ * If the node type is set to 'VLNK', then the parameter target specifies ++ * the file name of the target file for the symbolic link that is being ++ * created. ++ * ++ * Note that new nodes are retrieved from the available list if it has ++ * items or, if it is empty, from the node pool as long as there is enough ++ * space to create them. ++ * ++ * Returns zero on success or an appropriate error code on failure. ++ */ ++int ++vboxfs_alloc_node(struct mount *mp, struct vboxfs_mnt *vsfmp, const char *fullpath, ++ enum_vtype_t type, uid_t uid, gid_t gid, mode_t mode, struct vboxfs_node *parent, ++ struct vboxfs_node **node) + { +- struct vboxvfs_mount_info args; +- int rc = 0; ++ struct vboxfs_node *nnode; + +- printf("%s: Enter\n", __FUNCTION__); ++ if ((mp->mnt_kern_flag & MNTK_UNMOUNT) != 0) { ++ /* ++ * When a new tmpfs node is created for fully ++ * constructed mount point, there must be a parent ++ * node, which vnode is locked exclusively. As ++ * consequence, if the unmount is executing in ++ * parallel, vflush() cannot reclaim the parent vnode. ++ * Due to this, the check for MNTK_UNMOUNT flag is not ++ * racy: if we did not see MNTK_UNMOUNT flag, then tmp ++ * cannot be destroyed until node construction is ++ * finished and the parent vnode unlocked. ++ * ++ * Tmpfs does not need to instantiate new nodes during ++ * unmount. ++ */ ++ return (EBUSY); ++ } + +- rc = copyin(data, &args, sizeof(struct vboxvfs_mount_info)); +- if (rc) +- return rc; ++ nnode = (struct vboxfs_node *)uma_zalloc_arg( ++ vsfmp->sf_node_pool, vsfmp, M_WAITOK); + +- ma = mount_argf(ma, "uid", "%d", args.uid); +- ma = mount_argf(ma, "gid", "%d", args.gid); +- ma = mount_arg(ma, "from", args.name, -1); ++ /* Generic initialization. */ ++ nnode->sf_type = type; ++ nnode->sf_ino = vsfmp->sf_ino++; ++ nnode->sf_path = strdup(fullpath, M_VBOXVFS); ++ nnode->sf_parent = parent; ++ nnode->vboxfsmp = vsfmp; + +- rc = kernel_mount(ma, flags); ++ /* Type-specific initialization. */ ++ switch (nnode->sf_type) { ++ case VBLK: ++ case VCHR: ++ case VDIR: ++ case VFIFO: ++ case VSOCK: ++ case VLNK: ++ case VREG: ++ break; + +- printf("%s: Leave rc=%d\n", __FUNCTION__, rc); ++ default: ++ panic("vboxfs_alloc_node: type %p %d", nnode, (int)nnode->sf_type); ++ } + +- return rc; ++ *node = nnode; ++ return 0; + } + +-static const char *vboxvfs_opts[] = { +- "uid", "gid", "from", "fstype", "fspath", "errmsg", NULL +-}; +- +-static int vboxvfs_mount(struct mount *mp, struct thread *td) ++void ++vboxfs_free_node(struct vboxfs_mnt *vboxfs, struct vboxfs_node *node) + { +- int rc; +- char *pszShare; +- int cbShare, cbOption; +- int uid = 0, gid = 0; +- struct sf_glob_info *pShFlGlobalInfo; +- SHFLSTRING *pShFlShareName = NULL; +- int cbShFlShareName; + +- printf("%s: Enter\n", __FUNCTION__); ++#ifdef INVARIANTS ++ TMPFS_NODE_LOCK(node); ++ MPASS(node->sf_vnode == NULL); ++ MPASS((node->sf_vpstate & TMPFS_VNODE_ALLOCATING) == 0); ++ TMPFS_NODE_UNLOCK(node); ++#endif ++ if (node->sf_path) ++ free(node->sf_path, M_VBOXVFS); + +- if (mp->mnt_flag & (MNT_UPDATE | MNT_ROOTFS)) +- return EOPNOTSUPP; ++ uma_zfree(vboxfs->sf_node_pool, node); ++} + +- if (vfs_filteropt(mp->mnt_optnew, vboxvfs_opts)) +- { +- vfs_mount_error(mp, "%s", "Invalid option"); +- return EINVAL; +- } ++static int ++vboxfs_cmount(struct mntarg *ma, void *data, uint64_t flags) ++{ ++ struct vboxfs_mount_info args; ++ int error = 0; + +- rc = vfs_getopt(mp->mnt_optnew, "from", (void **)&pszShare, &cbShare); +- if (rc || pszShare[cbShare-1] != '\0' || cbShare > 0xfffe) +- return EINVAL; ++ if (data == NULL) ++ return (EINVAL); ++ error = copyin(data, &args, sizeof(struct vboxfs_mount_info)); ++ if (error) ++ return (error); + +- rc = vfs_getopt(mp->mnt_optnew, "gid", (void **)&gid, &cbOption); +- if ((rc != ENOENT) && (rc || cbOption != sizeof(gid))) +- return EINVAL; ++ ma = mount_argf(ma, "uid", "%d", args.uid); ++ ma = mount_argf(ma, "gid", "%d", args.gid); ++ ma = mount_argf(ma, "file_mode", "%d", args.fmode); ++ ma = mount_argf(ma, "dir_mode", "%d", args.dmode); ++ ma = mount_arg(ma, "from", args.name, -1); + +- rc = vfs_getopt(mp->mnt_optnew, "uid", (void **)&uid, &cbOption); +- if ((rc != ENOENT) && (rc || cbOption != sizeof(uid))) +- return EINVAL; ++ return (kernel_mount(ma, flags)); ++} + +- pShFlGlobalInfo = RTMemAllocZ(sizeof(struct sf_glob_info)); +- if (!pShFlGlobalInfo) +- return ENOMEM; ++static const char *vboxfs_opts[] = { ++ "fstype", ++ "fspath", ++ "from", ++ "uid", ++ "gid", ++ "file_mode", ++ "dir_mode", ++ "errmsg", ++ NULL ++}; + +- cbShFlShareName = offsetof (SHFLSTRING, String.utf8) + cbShare + 1; +- pShFlShareName = RTMemAllocZ(cbShFlShareName); +- if (!pShFlShareName) +- return VERR_NO_MEMORY; ++#define VBOX_INTOPT(optname, val, base) do { \ ++ char *ep, *optarg = NULL; \ ++ if (vfs_getopt(opts, optname, (void **)&optarg, NULL) == 0) { \ ++ if (optarg != NULL && *optarg == '\0') \ ++ optarg = NULL; \ ++ if (optarg != NULL) \ ++ val = strtoul(optarg, &ep, base); \ ++ if (optarg == NULL || *ep != '\0') { \ ++ struct sbuf *sb = sbuf_new_auto(); \ ++ sbuf_printf(sb, "Invalid %s: \"%s\"", optname, \ ++ optarg); \ ++ sbuf_finish(sb); \ ++ vfs_mount_error(mp, sbuf_data(sb)); \ ++ sbuf_delete(sb); \ ++ return (EINVAL); \ ++ } \ ++ } \ ++} while (0) + +- pShFlShareName->u16Length = cbShare; +- pShFlShareName->u16Size = cbShare + 1; +- memcpy (pShFlShareName->String.utf8, pszShare, cbShare + 1); ++static int ++vboxfs_node_ctor(void *mem, int size, void *arg, int flags) ++{ ++ struct vboxfs_node *node = (struct vboxfs_node *)mem; + +- rc = VbglR0SfMapFolder (&g_vboxSFClient, pShFlShareName, &pShFlGlobalInfo->map); +- RTMemFree(pShFlShareName); ++ node->sf_vnode = NULL; ++ node->sf_vpstate = 0; + +- if (RT_FAILURE (rc)) +- { +- RTMemFree(pShFlGlobalInfo); +- printf("VbglR0SfMapFolder failed rc=%d\n", rc); +- return EPROTO; +- } ++ return (0); ++} + +- pShFlGlobalInfo->uid = uid; +- pShFlGlobalInfo->gid = gid; ++static void ++vboxfs_node_dtor(void *mem, int size, void *arg) ++{ ++ struct vboxfs_node *node = (struct vboxfs_node *)mem; ++ node->sf_type = VNON; ++} + +- mp->mnt_data = pShFlGlobalInfo; ++static int ++vboxfs_node_init(void *mem, int size, int flags) ++{ ++ struct vboxfs_node *node = (struct vboxfs_node *)mem; ++ node->sf_ino = 0; + +- /** @todo root vnode. */ ++ mtx_init(&node->sf_interlock, "tmpfs node interlock", NULL, MTX_DEF); + +- vfs_getnewfsid(mp); +- vfs_mountedfrom(mp, pszShare); ++ return (0); ++} + +- printf("%s: Leave rc=0\n", __FUNCTION__); ++static void ++vboxfs_node_fini(void *mem, int size) ++{ ++ struct vboxfs_node *node = (struct vboxfs_node *)mem; + +- return 0; ++ mtx_destroy(&node->sf_interlock); + } + +-static int vboxvfs_unmount(struct mount *mp, int mntflags, struct thread *td) ++static int ++vboxfs_mount(struct mount *mp) + { +- struct sf_glob_info *pShFlGlobalInfo = VFSMP2SFGLOBINFO(mp); +- int rc; +- int flags = 0; ++ struct vboxfs_mnt *vboxfsmp = NULL; ++ struct vfsoptlist *opts = mp->mnt_optnew; ++ sfp_mount_t *handle = NULL; ++ int readonly = 0; ++ sffs_fsinfo_t fsinfo; ++ int error, share_len; ++ char *share_name; ++ mode_t file_mode = 0, dir_mode = 0; ++ uid_t uid = 0; ++ gid_t gid = 0; ++ struct vboxfs_node *root; + +- rc = VbglR0SfUnmapFolder(&g_vboxSFClient, &pShFlGlobalInfo->map); +- if (RT_FAILURE(rc)) +- printf("Failed to unmap shared folder\n"); ++ if (mp->mnt_flag & (MNT_UPDATE | MNT_ROOTFS)) ++ return (EOPNOTSUPP); + +- if (mntflags & MNT_FORCE) +- flags |= FORCECLOSE; ++ if (vfs_filteropt(opts, vboxfs_opts)) { ++ vfs_mount_error(mp, "%s", "Invalid option"); ++ return (EINVAL); ++ } + +- /* There is 1 extra root vnode reference (vnode_root). */ +- rc = vflush(mp, 1, flags, td); +- if (rc) +- return rc; ++ VBOX_INTOPT("uid", uid, 10); ++ VBOX_INTOPT("gid", gid, 10); ++ VBOX_INTOPT("file_mode", file_mode, 8); ++ VBOX_INTOPT("dir_mode", dir_mode, 8); ++ VBOX_INTOPT("ro", readonly, 10); + ++ error = vfs_getopt(opts, "from", (void **)&share_name, &share_len); ++ if (error != 0 || share_len == 0) { ++ vfs_mount_error(mp, "Invalid from"); ++ return (EINVAL); ++ } + +- RTMemFree(pShFlGlobalInfo); +- mp->mnt_data = NULL; ++ vboxfsmp = malloc(sizeof(struct vboxfs_mnt), M_VBOXVFS, M_WAITOK | M_ZERO); ++ vboxfsmp->sf_uid = uid; ++ vboxfsmp->sf_gid = gid; ++ vboxfsmp->sf_fmode = file_mode & (S_IRWXU | S_IRWXG | S_IRWXO); ++ vboxfsmp->sf_dmode = dir_mode & (S_IRWXU | S_IRWXG | S_IRWXO); ++ vboxfsmp->sf_ino = 3; ++ vboxfsmp->sf_stat_ttl = 200; + +- return 0; ++ /* Invoke Hypervisor mount interface before proceeding */ ++ error = sfprov_mount(share_name, &handle); ++ if (error) ++ return (error); ++ ++ /* Determine whether the filesystem must be read-only. */ ++ error = sfprov_get_fsinfo(handle, &fsinfo); ++ if (error != 0) { ++ sfprov_unmount(handle); ++ return (error); ++ } ++ if (readonly == 0) ++ readonly = (fsinfo.readonly != 0); ++ ++ vboxfsmp->sf_handle = handle; ++ vboxfsmp->sf_vfsp = mp; ++ ++ vboxfsmp->sf_node_pool = uma_zcreate("VBOXFS node", ++ sizeof(struct vboxfs_node), ++ vboxfs_node_ctor, vboxfs_node_dtor, ++ vboxfs_node_init, vboxfs_node_fini, ++ UMA_ALIGN_PTR, 0); ++ ++ /* Allocate the root node. */ ++ error = vboxfs_alloc_node(mp, vboxfsmp, "", VDIR, 0, ++ 0, 0755, NULL, &root); ++ ++ if (error != 0 || root == NULL) { ++ uma_zdestroy(vboxfsmp->sf_node_pool); ++ free(vboxfsmp, M_VBOXVFS); ++ return error; ++ } ++ ++ root->sf_parent = root; ++ vboxfsmp->sf_root = root; ++ ++ MNT_ILOCK(mp); ++ mp->mnt_data = vboxfsmp; ++ mp->mnt_stat.f_fsid.val[0] = fsinfo.serial; ++ mp->mnt_stat.f_fsid.val[1] = 0; ++ mp->mnt_flag |= MNT_LOCAL; ++ if (readonly != 0) ++ mp->mnt_flag |= MNT_RDONLY; ++ ++ mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED; ++ MNT_IUNLOCK(mp); ++ vfs_mountedfrom(mp, share_name); ++ ++ return (0); + } + +-static int vboxvfs_root(struct mount *mp, int flags, struct vnode **vpp, struct thread *td) ++/* ++ * Unmount a shared folder. ++ * ++ * vboxfs_unmount umounts the mounted file system. It return 0 ++ * on sucess and any relevant errno on failure. ++ */ ++static int ++vboxfs_unmount(struct mount *mp, int mntflags) + { +- int rc = 0; +- struct sf_glob_info *pShFlGlobalInfo = VFSMP2SFGLOBINFO(mp); +- struct vnode *vp; ++ struct vboxfs_mnt *vboxfsmp; ++ struct thread *td; ++ int error; ++ int flags; + +- printf("%s: Enter\n", __FUNCTION__); ++ vboxfsmp = VFSTOVBOXFS(mp); ++ td = curthread; ++ flags = 0; ++ if (mntflags & MNT_FORCE) ++ flags |= FORCECLOSE; + +- vp = pShFlGlobalInfo->vnode_root; +- VREF(vp); ++ error = vflush(mp, 0, flags, td); ++ if (error) ++ return (error); + +- vn_lock(vp, flags | LK_RETRY, td); +- *vpp = vp; ++ /* Invoke Hypervisor unmount interface before proceeding */ ++ error = sfprov_unmount(vboxfsmp->sf_handle); ++ if (error != 0) { ++ /* TBD anything here? */ ++ } + +- printf("%s: Leave\n", __FUNCTION__); ++ uma_zdestroy(vboxfsmp->sf_node_pool); + +- return rc; ++ free(vboxfsmp, M_VBOXVFS); ++ MNT_ILOCK(mp); ++ mp->mnt_data = NULL; ++ mp->mnt_flag &= ~MNT_LOCAL; ++ MNT_IUNLOCK(mp); ++ ++ return (0); + } + +-static int vboxvfs_quotactl(struct mount *mp, int cmd, uid_t uid, void *arg, struct thread *td) ++static int ++vboxfs_root(struct mount *mp, int flags, struct vnode **vpp) + { +- return EOPNOTSUPP; ++ int error; ++ error = vboxfs_alloc_vp(mp, VFSTOVBOXFS(mp)->sf_root, flags, vpp); ++ ++ if (!error) ++ (*vpp)->v_vflag |= VV_ROOT; ++ ++ return error; + } + +-int vboxvfs_init(struct vfsconf *vfsp) ++/* ++ * Do operation associated with quotas, not supported ++ */ ++static int ++vboxfs_quotactl(struct mount *mp, int cmd, uid_t uid, void *arg ++#if __FreeBSD_version >= 1400018 ++ , bool *mp_busy ++#endif ++ ) + { +- int rc; ++ return (EOPNOTSUPP); ++} + +- /* Initialize the R0 guest library. */ +- rc = VbglR0SfInit(); +- if (RT_FAILURE(rc)) +- return ENXIO; ++/* ++ * Initialize the filesystem globals. ++ */ ++static int ++vboxfs_init(struct vfsconf *vfsp) ++{ ++ int error; + +- /* Connect to the host service. */ +- rc = VbglR0SfConnect(&g_vboxSFClient); +- if (RT_FAILURE(rc)) +- { +- printf("Failed to get connection to host! rc=%d\n", rc); +- VbglR0SfTerm(); +- return ENXIO; +- } ++ DROP_GIANT(); + +- rc = VbglR0SfSetUtf8(&g_vboxSFClient); +- if (RT_FAILURE (rc)) +- { +- printf("VbglR0SfSetUtf8 failed, rc=%d\n", rc); +- VbglR0SfDisconnect(&g_vboxSFClient); +- VbglR0SfTerm(); +- return EPROTO; +- } ++ sfprov = sfprov_connect(SFPROV_VERSION); ++ if (sfprov == NULL) { ++ printf("%s: couldn't connect to sf provider", __func__); ++ return (ENODEV); ++ } + +- printf("Successfully loaded shared folder module\n"); ++ error = sfprov_set_show_symlinks(); ++ if (error != 0) ++ printf("%s: host unable to show symlinks, error=%d\n", ++ __func__, error); + +- return 0; ++ PICKUP_GIANT(); ++ return (0); + } + +-int vboxvfs_uninit(struct vfsconf *vfsp) ++/* ++ * Undo the work of vboxfs_init(). ++ */ ++static int ++vboxfs_uninit(struct vfsconf *vfsp) + { +- VbglR0SfDisconnect(&g_vboxSFClient); +- VbglR0SfTerm(); + +- return 0; ++ DROP_GIANT(); ++ sfprov_disconnect(); ++ PICKUP_GIANT(); ++ return (0); + } + +-int vboxvfs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) ++/* ++ * Get filesystem statistics. ++ */ ++static int ++vboxfs_statfs(struct mount *mp, struct statfs *sbp) + { +- return 0; ++ struct vboxfs_mnt *vboxfsmp; ++ sffs_fsinfo_t fsinfo; ++ int error; ++ ++ vboxfsmp = VFSTOVBOXFS(mp); ++ ++ error = sfprov_get_fsinfo(vboxfsmp->sf_handle, &fsinfo); ++ if (error != 0) ++ return (error); ++ ++ sbp->f_iosize = fsinfo.blksize; ++ sbp->f_bsize = fsinfo.blksize; ++ ++ sbp->f_bfree = fsinfo.blksavail; ++ sbp->f_bavail = fsinfo.blksavail; ++ sbp->f_files = fsinfo.blksavail / 4; /* some kind of reasonable value */ ++ sbp->f_ffree = fsinfo.blksavail / 4; ++ ++ sbp->f_blocks = fsinfo.blksused + sbp->f_bavail; ++ sbp->f_fsid.val[0] = mp->mnt_stat.f_fsid.val[0]; ++ sbp->f_fsid.val[1] = mp->mnt_stat.f_fsid.val[1]; ++ sbp->f_namemax = fsinfo.maxnamesize; ++ ++ return (0); + } diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c new file mode 100644 index 000000000000..90a799eef1db --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c @@ -0,0 +1,1543 @@ +--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c.orig 2025-08-13 19:41:18 UTC ++++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c +@@ -24,228 +24,1416 @@ + * + * SPDX-License-Identifier: GPL-3.0-only + */ +- +-#include "vboxvfs.h" + #include <sys/param.h> + #include <sys/systm.h> + #include <sys/namei.h> + #include <sys/kernel.h> +-#include <sys/proc.h> ++#include <sys/types.h> ++#include <sys/malloc.h> ++#include <sys/stat.h> + #include <sys/bio.h> ++#include <sys/conf.h> + #include <sys/buf.h> +-#include <sys/fcntl.h> ++#include <sys/iconv.h> + #include <sys/mount.h> +-#include <sys/unistd.h> + #include <sys/vnode.h> +-#include <sys/limits.h> +-#include <sys/lockf.h> +-#include <sys/stat.h> ++#include <sys/dirent.h> ++#include <sys/queue.h> ++#include <sys/unistd.h> ++#include <sys/endian.h> + +-#include <vm/vm.h> +-#include <vm/vm_extern.h> ++#include <vm/uma.h> + ++#include "vboxvfs.h" ++ ++#if __FreeBSD_version < 1300063 ++#define VN_IS_DOOMED(vp) (((vp)->v_iflag & VI_DOOMED) != 0) ++#endif ++ + /* + * Prototypes for VBOXVFS vnode operations + */ +-static vop_create_t vboxvfs_create; +-static vop_mknod_t vboxvfs_mknod; +-static vop_open_t vboxvfs_open; +-static vop_close_t vboxvfs_close; +-static vop_access_t vboxvfs_access; +-static vop_getattr_t vboxvfs_getattr; +-static vop_setattr_t vboxvfs_setattr; +-static vop_read_t vboxvfs_read; +-static vop_write_t vboxvfs_write; +-static vop_fsync_t vboxvfs_fsync; +-static vop_remove_t vboxvfs_remove; +-static vop_link_t vboxvfs_link; +-static vop_lookup_t vboxvfs_lookup; +-static vop_rename_t vboxvfs_rename; +-static vop_mkdir_t vboxvfs_mkdir; +-static vop_rmdir_t vboxvfs_rmdir; +-static vop_symlink_t vboxvfs_symlink; +-static vop_readdir_t vboxvfs_readdir; +-static vop_strategy_t vboxvfs_strategy; +-static vop_print_t vboxvfs_print; +-static vop_pathconf_t vboxvfs_pathconf; +-static vop_advlock_t vboxvfs_advlock; +-static vop_getextattr_t vboxvfs_getextattr; +-static vop_ioctl_t vboxvfs_ioctl; +-static vop_getpages_t vboxvfs_getpages; +-static vop_inactive_t vboxvfs_inactive; +-static vop_putpages_t vboxvfs_putpages; +-static vop_reclaim_t vboxvfs_reclaim; ++static vop_create_t vboxfs_create; ++static vop_open_t vboxfs_open; ++static vop_close_t vboxfs_close; ++static vop_access_t vboxfs_access; ++static vop_getattr_t vboxfs_getattr; ++static vop_setattr_t vboxfs_setattr; ++static vop_read_t vboxfs_read; ++static vop_readlink_t vboxfs_readlink; ++static vop_write_t vboxfs_write; ++static vop_fsync_t vboxfs_fsync; ++static vop_remove_t vboxfs_remove; ++static vop_link_t vboxfs_link; ++static vop_lookup_t vboxfs_lookup; ++static vop_cachedlookup_t vboxfs_cachedlookup; ++static vop_rename_t vboxfs_rename; ++static vop_mkdir_t vboxfs_mkdir; ++static vop_rmdir_t vboxfs_rmdir; ++static vop_symlink_t vboxfs_symlink; ++static vop_readdir_t vboxfs_readdir; ++static vop_print_t vboxfs_print; ++static vop_pathconf_t vboxfs_pathconf; ++static vop_advlock_t vboxfs_advlock; ++static vop_ioctl_t vboxfs_ioctl; ++static vop_inactive_t vboxfs_inactive; ++static vop_reclaim_t vboxfs_reclaim; ++static vop_vptofh_t vboxfs_vptofh; + +-struct vop_vector vboxvfs_vnodeops = { +- .vop_default = &default_vnodeops, ++struct vop_vector vboxfs_vnodeops = { ++ .vop_default = &default_vnodeops, + +- .vop_access = vboxvfs_access, +- .vop_advlock = vboxvfs_advlock, +- .vop_close = vboxvfs_close, +- .vop_create = vboxvfs_create, +- .vop_fsync = vboxvfs_fsync, +- .vop_getattr = vboxvfs_getattr, +- .vop_getextattr = vboxvfs_getextattr, +- .vop_getpages = vboxvfs_getpages, +- .vop_inactive = vboxvfs_inactive, +- .vop_ioctl = vboxvfs_ioctl, +- .vop_link = vboxvfs_link, +- .vop_lookup = vboxvfs_lookup, +- .vop_mkdir = vboxvfs_mkdir, +- .vop_mknod = vboxvfs_mknod, +- .vop_open = vboxvfs_open, +- .vop_pathconf = vboxvfs_pathconf, +- .vop_print = vboxvfs_print, +- .vop_putpages = vboxvfs_putpages, +- .vop_read = vboxvfs_read, +- .vop_readdir = vboxvfs_readdir, +- .vop_reclaim = vboxvfs_reclaim, +- .vop_remove = vboxvfs_remove, +- .vop_rename = vboxvfs_rename, +- .vop_rmdir = vboxvfs_rmdir, +- .vop_setattr = vboxvfs_setattr, +- .vop_strategy = vboxvfs_strategy, +- .vop_symlink = vboxvfs_symlink, +- .vop_write = vboxvfs_write, ++ .vop_access = vboxfs_access, ++ .vop_advlock = VOP_EOPNOTSUPP, ++ .vop_close = vboxfs_close, ++ .vop_create = vboxfs_create, ++ .vop_fsync = vboxfs_fsync, ++ .vop_getattr = vboxfs_getattr, ++ .vop_getextattr = VOP_EOPNOTSUPP, ++ .vop_inactive = vboxfs_inactive, ++ .vop_ioctl = vboxfs_ioctl, ++ .vop_link = vboxfs_link, ++ .vop_lookup = vboxfs_lookup, ++ .vop_cachedlookup = vboxfs_cachedlookup, ++ .vop_mkdir = vboxfs_mkdir, ++ .vop_mknod = VOP_EOPNOTSUPP, ++ .vop_open = vboxfs_open, ++ .vop_pathconf = vboxfs_pathconf, ++ .vop_print = vboxfs_print, ++ .vop_read = vboxfs_read, ++ .vop_readdir = vboxfs_readdir, ++ .vop_readlink = vboxfs_readlink, ++ .vop_reclaim = vboxfs_reclaim, ++ .vop_remove = vboxfs_remove, ++ .vop_rename = vboxfs_rename, ++ .vop_rmdir = vboxfs_rmdir, ++ .vop_setattr = vboxfs_setattr, ++ .vop_vptofh = vboxfs_vptofh, ++ .vop_symlink = vboxfs_symlink, ++ .vop_write = vboxfs_write, ++ .vop_bmap = VOP_EOPNOTSUPP + }; ++#if __FreeBSD_version > 1300068 ++VFS_VOP_VECTOR_REGISTER(vboxfs_vnodeops); ++#endif + +-static int vboxvfs_access(struct vop_access_args *ap) ++static uint64_t ++vsfnode_cur_time_usec(void) + { +- return 0; ++ struct timeval now; ++ ++ getmicrotime(&now); ++ ++ return (now.tv_sec*1000 + now.tv_usec); + } + +-static int vboxvfs_open(struct vop_open_args *ap) ++static int ++vsfnode_stat_cached(struct vboxfs_node *np) + { +- return 0; ++ return (vsfnode_cur_time_usec() - np->sf_stat_time) < ++ np->vboxfsmp->sf_stat_ttl * 1000UL; + } + +-static int vboxvfs_close(struct vop_close_args *ap) ++static int ++vsfnode_update_stat_cache(struct vboxfs_node *np) + { +- return 0; ++ int error; ++ ++ error = sfprov_get_attr(np->vboxfsmp->sf_handle, np->sf_path, ++ &np->sf_stat); ++#if 0 ++ if (error == ENOENT) ++ sfnode_make_stale(node); ++#endif ++ if (error == 0) ++ np->sf_stat_time = vsfnode_cur_time_usec(); ++ ++ return (error); + } + +-static int vboxvfs_getattr(struct vop_getattr_args *ap) ++/* ++ * Need to clear v_object for insmntque failure. ++ */ ++static void ++vboxfs_insmntque_dtr(struct vnode *vp, void *dtr_arg) + { +- return 0; ++ ++ // XXX: vboxfs_destroy_vobject(vp, vp->v_object); ++ vp->v_object = NULL; ++ vp->v_data = NULL; ++ vp->v_op = &dead_vnodeops; ++ vgone(vp); ++ vput(vp); + } + +-static int vboxvfs_setattr(struct vop_setattr_args *ap) ++/* ++ * Allocates a new vnode for the node node or returns a new reference to ++ * an existing one if the node had already a vnode referencing it. The ++ * resulting locked vnode is returned in *vpp. ++ * ++ * Returns zero on success or an appropriate error code on failure. ++ */ ++int ++vboxfs_alloc_vp(struct mount *mp, struct vboxfs_node *node, int lkflag, ++ struct vnode **vpp) + { +- return 0; ++ struct vnode *vp; ++ int error; ++ ++ error = 0; ++loop: ++ VBOXFS_NODE_LOCK(node); ++loop1: ++ if ((vp = node->sf_vnode) != NULL) { ++ MPASS((node->sf_vpstate & VBOXFS_VNODE_DOOMED) == 0); ++ VI_LOCK(vp); ++ if ((node->sf_type == VDIR && node->sf_parent == NULL) || ++ (VN_IS_DOOMED(vp) && ++ (lkflag & LK_NOWAIT) != 0)) { ++ VI_UNLOCK(vp); ++ VBOXFS_NODE_UNLOCK(node); ++ error = ENOENT; ++ vp = NULL; ++ goto out; ++ } ++ if (VN_IS_DOOMED(vp)) { ++ VI_UNLOCK(vp); ++ node->sf_vpstate |= VBOXFS_VNODE_WRECLAIM; ++ while ((node->sf_vpstate & VBOXFS_VNODE_WRECLAIM) != 0) { ++ msleep(&node->sf_vnode, VBOXFS_NODE_MTX(node), ++ 0, "vsfE", 0); ++ } ++ goto loop1; ++ } ++ VBOXFS_NODE_UNLOCK(node); ++#if __FreeBSD_version < 1300109 ++ error = vget(vp, lkflag | LK_INTERLOCK, curthread); ++#else ++ error = vget(vp, lkflag | LK_INTERLOCK); ++#endif ++ if (error == ENOENT) ++ goto loop; ++ if (error != 0) { ++ vp = NULL; ++ goto out; ++ } ++ ++ /* ++ * Make sure the vnode is still there after ++ * getting the interlock to avoid racing a free. ++ */ ++ if (node->sf_vnode == NULL || node->sf_vnode != vp) { ++ vput(vp); ++ goto loop; ++ } ++ ++ goto out; ++ } ++ ++ if ((node->sf_vpstate & VBOXFS_VNODE_DOOMED) || ++ (node->sf_type == VDIR && node->sf_parent == NULL)) { ++ VBOXFS_NODE_UNLOCK(node); ++ error = ENOENT; ++ vp = NULL; ++ goto out; ++ } ++ ++ /* ++ * otherwise lock the vp list while we call getnewvnode ++ * since that can block. ++ */ ++ if (node->sf_vpstate & VBOXFS_VNODE_ALLOCATING) { ++ node->sf_vpstate |= VBOXFS_VNODE_WANT; ++ error = msleep((caddr_t) &node->sf_vpstate, ++ VBOXFS_NODE_MTX(node), PDROP | PCATCH, ++ "vboxfs_alloc_vp", 0); ++ if (error) ++ return error; ++ ++ goto loop; ++ } else ++ node->sf_vpstate |= VBOXFS_VNODE_ALLOCATING; ++ ++ VBOXFS_NODE_UNLOCK(node); ++ ++ /* Get a new vnode and associate it with our node. */ ++ error = getnewvnode("vboxfs", mp, &vboxfs_vnodeops, &vp); ++ if (error != 0) ++ goto unlock; ++ MPASS(vp != NULL); ++ ++ /* lkflag is ignored, the lock is exclusive */ ++ (void) vn_lock(vp, lkflag | LK_RETRY); ++ ++ vp->v_data = node; ++ vp->v_type = node->sf_type; ++ ++ /* Type-specific initialization. */ ++ switch (node->sf_type) { ++ case VBLK: ++ /* FALLTHROUGH */ ++ case VCHR: ++ /* FALLTHROUGH */ ++ case VLNK: ++ /* FALLTHROUGH */ ++ case VSOCK: ++ /* FALLTHROUGH */ ++ case VFIFO: ++ /* FALLTHROUGH */ ++ case VREG: ++ break; ++ case VDIR: ++ MPASS(node->sf_parent != NULL); ++ if (node->sf_parent == node) ++ vp->v_vflag |= VV_ROOT; ++ break; ++ ++ default: ++ panic("vboxfs_alloc_vp: type %p %d", node, (int)node->sf_type); ++ } ++ ++ if (vp->v_type != VFIFO) ++ VN_LOCK_ASHARE(vp); ++ ++#if __FreeBSD_version < 1400051 ++ error = insmntque1(vp, mp, vboxfs_insmntque_dtr, NULL); ++#else ++ error = insmntque(vp, mp); ++#endif ++ if (error) { ++#if __FreeBSD_version >= 1400051 ++ vboxfs_insmntque_dtr(vp, NULL); ++#endif ++ vp = NULL; ++ } ++ ++unlock: ++ VBOXFS_NODE_LOCK(node); ++ ++ MPASS(node->sf_vpstate & VBOXFS_VNODE_ALLOCATING); ++ node->sf_vpstate &= ~VBOXFS_VNODE_ALLOCATING; ++ node->sf_vnode = vp; ++ ++ if (node->sf_vpstate & VBOXFS_VNODE_WANT) { ++ node->sf_vpstate &= ~VBOXFS_VNODE_WANT; ++ VBOXFS_NODE_UNLOCK(node); ++ wakeup((caddr_t) &node->sf_vpstate); ++ } else ++ VBOXFS_NODE_UNLOCK(node); ++ ++out: ++ *vpp = vp; ++ ++#ifdef INVARIANTS ++ if (error == 0) { ++ MPASS(*vpp != NULL && VOP_ISLOCKED(*vpp)); ++ VBOXFS_NODE_LOCK(node); ++ MPASS(*vpp == node->sf_vnode); ++ VBOXFS_NODE_UNLOCK(node); ++ } ++#endif ++ ++ return error; + } + +-static int vboxvfs_read(struct vop_read_args *ap) ++/* ++ * Destroys the association between the vnode vp and the node it ++ * references. ++ */ ++void ++vboxfs_free_vp(struct vnode *vp) + { +- return 0; ++ struct vboxfs_node *node; ++ ++ node = VP_TO_VBOXFS_NODE(vp); ++ ++ VBOXFS_NODE_ASSERT_LOCKED(node); ++ node->sf_vnode = NULL; ++ if ((node->sf_vpstate & VBOXFS_VNODE_WRECLAIM) != 0) ++ wakeup(&node->sf_vnode); ++ node->sf_vpstate &= ~VBOXFS_VNODE_WRECLAIM; ++ vp->v_data = NULL; + } + +-static int vboxvfs_write(struct vop_write_args *ap) ++/* ++ * Allocate new vboxfs_node and vnode for given file ++ */ ++static int ++vboxfs_alloc_file(struct vboxfs_mnt *vboxfsmp, const char *fullpath, ++ enum_vtype_t type, mode_t mode, struct vboxfs_node *parent, ++ int lkflag, struct vnode **vpp) + { +- return 0; ++ int error; ++ struct vboxfs_node *unode; ++ ++ error = vboxfs_alloc_node(vboxfsmp->sf_vfsp, vboxfsmp, fullpath, type, ++ vboxfsmp->sf_uid, vboxfsmp->sf_gid, mode, parent, &unode); ++ ++ if (error) ++ goto out; ++ ++ error = vboxfs_alloc_vp(vboxfsmp->sf_vfsp, unode, lkflag, vpp); ++ if (error) ++ vboxfs_free_node(vboxfsmp, unode); ++ ++out: ++ return (error); + } + +-static int vboxvfs_create(struct vop_create_args *ap) ++static int ++vboxfs_vn_get_ino_alloc(struct mount *mp, void *arg, int lkflags, ++ struct vnode **rvp) + { +- return 0; ++ ++ return (vboxfs_alloc_vp(mp, arg, lkflags, rvp)); + } + +-static int vboxvfs_remove(struct vop_remove_args *ap) ++/* ++ * Construct a new pathname given an sfnode plus an optional tail ++ * component of length len ++ * This handles ".." and "." ++ */ ++static char * ++sfnode_construct_path(struct vboxfs_node *node, char *tail, int len) + { +- return 0; ++ char *p; ++ size_t dstsz; ++ ++ if (len <= 2 && tail[0] == '.' && (len == 1 || tail[1] == '.')) ++ panic("construct path for %s", tail); ++ dstsz = strlen(node->sf_path) + 1 + len + 1; ++ p = malloc(dstsz, M_VBOXVFS, M_WAITOK); ++ strcpy(p, node->sf_path); ++ strcat(p, "/"); ++ strlcat(p, tail, dstsz); ++ return (p); + } + +-static int vboxvfs_rename(struct vop_rename_args *ap) ++static int ++vboxfs_access(struct vop_access_args *ap) + { +- return 0; ++ struct vnode *vp = ap->a_vp; ++ accmode_t accmode = ap->a_accmode; ++ struct vboxfs_node *node; ++ int error; ++ mode_t m; ++ ++ MPASS(VOP_ISLOCKED(vp)); ++ ++ node = VP_TO_VBOXFS_NODE(vp); ++ ++ if ((accmode & VWRITE) && (vp->v_mount->mnt_flag & MNT_RDONLY)) { ++ switch (vp->v_type) { ++ case VDIR: ++ case VLNK: ++ case VREG: ++ return (EROFS); ++ /* NOT REACHED */ ++ default: ++ break; ++ } ++ } ++ ++ if (vsfnode_stat_cached(node)) ++ error = 0; ++ else ++ error = vsfnode_update_stat_cache(node); ++ m = (error == 0) ? node->sf_stat.sf_mode : 0; ++ ++#if __FreeBSD_version < 1300105 ++ return (vaccess(vp->v_type, m, node->vboxfsmp->sf_uid, ++ node->vboxfsmp->sf_gid, accmode, ap->a_cred, NULL)); ++#else ++ return (vaccess(vp->v_type, m, node->vboxfsmp->sf_uid, ++ node->vboxfsmp->sf_gid, accmode, ap->a_cred)); ++#endif + } + +-static int vboxvfs_link(struct vop_link_args *ap) ++/* ++ * Clears the (cached) directory listing for the node. ++ */ ++static void ++vfsnode_clear_dir_list(struct vboxfs_node *np) + { +- return EOPNOTSUPP; ++ while (np->sf_dir_list != NULL) { ++ sffs_dirents_t *next = np->sf_dir_list->sf_next; ++ free(np->sf_dir_list, M_VBOXVFS); ++ np->sf_dir_list = next; ++ } + } + +-static int vboxvfs_symlink(struct vop_symlink_args *ap) ++static int ++vboxfs_get_sfp_file(struct vboxfs_node *np) + { +- return EOPNOTSUPP; ++ sfp_file_t *fp; ++ int error; ++ ++ fp = NULL; ++ VBOXFS_NODE_LOCK(np); ++ for (;;) { ++ if (np->sf_file != NULL) { ++ if (fp != NULL) ++ (void) sfprov_close(fp); ++ np->sf_opencnt++; ++ fp = np->sf_file; ++ break; ++ } else if (fp != NULL) { ++ np->sf_file = fp; ++ KASSERT(np->sf_opencnt == 0, ++ ("np %p opencnt (%d) must be zero.", ++ np, np->sf_opencnt)); ++ np->sf_opencnt = 1; ++ break; ++ } ++ VBOXFS_NODE_UNLOCK(np); ++ error = sfprov_open(np->vboxfsmp->sf_handle, np->sf_path, &fp); ++ if (error != 0) ++ return (error); ++ VBOXFS_NODE_LOCK(np); ++ } ++ VBOXFS_NODE_UNLOCK(np); ++ ++ return (0); + } + +-static int vboxvfs_mknod(struct vop_mknod_args *ap) ++static void ++vboxfs_put_sfp_file(struct vboxfs_node *np) + { +- return EOPNOTSUPP; ++ VBOXFS_NODE_LOCK(np); ++ np->sf_opencnt--; ++ if (np->sf_opencnt == 0) { ++ (void) sfprov_close(np->sf_file); ++ np->sf_file = NULL; ++ } ++ VBOXFS_NODE_UNLOCK(np); + } + +-static int vboxvfs_mkdir(struct vop_mkdir_args *ap) ++static int ++vboxfs_open(struct vop_open_args *ap) + { +- return 0; ++ struct vboxfs_node *np; ++ int error; ++ ++ MPASS(VOP_ISLOCKED(vp)); ++ ++ np = VP_TO_VBOXFS_NODE(ap->a_vp); ++ error = vboxfs_get_sfp_file(np); ++ if (error != 0) ++ goto out; ++ ++ vnode_create_vobject(ap->a_vp, 0, ap->a_td); ++out: ++ MPASS(VOP_ISLOCKED(vp)); ++ ++ return (error); + } + +-static int vboxvfs_rmdir(struct vop_rmdir_args *ap) ++static void ++vfsnode_invalidate_stat_cache(struct vboxfs_node *np) + { +- return 0; ++ np->sf_stat_time = 0; + } + +-static int vboxvfs_readdir(struct vop_readdir_args *ap) ++static int ++vboxfs_close(struct vop_close_args *ap) + { +- return 0; ++ struct vnode *vp = ap->a_vp; ++ struct vboxfs_node *np; ++ ++ np = VP_TO_VBOXFS_NODE(vp); ++ ++ /* ++ * Free the directory entries for the node. We do this on this call ++ * here because the directory node may not become inactive for a long ++ * time after the readdir is over. Case in point, if somebody cd's into ++ * the directory then it won't become inactive until they cd away again. ++ * In such a case we would end up with the directory listing not getting ++ * updated (i.e. the result of 'ls' always being the same) until they ++ * change the working directory. ++ */ ++ vfsnode_clear_dir_list(np); ++ ++ vfsnode_invalidate_stat_cache(np); ++ ++ vboxfs_put_sfp_file(np); ++ ++ return (0); + } + +-static int vboxvfs_fsync(struct vop_fsync_args *ap) ++static int ++vboxfs_getattr(struct vop_getattr_args *ap) + { +- return 0; ++ struct vnode *vp = ap->a_vp; ++ struct vattr *vap = ap->a_vap; ++ struct vboxfs_node *np = VP_TO_VBOXFS_NODE(vp); ++ struct vboxfs_mnt *mp = np->vboxfsmp; ++ mode_t mode; ++ int error = 0; ++ ++ mode = 0; ++ vap->va_type = vp->v_type; ++ ++ vap->va_nlink = 1; /* number of references to file */ ++ vap->va_uid = mp->sf_uid; /* owner user id */ ++ vap->va_gid = mp->sf_gid; /* owner group id */ ++ vap->va_rdev = NODEV; /* device the special file represents */ ++ vap->va_gen = VNOVAL; /* generation number of file */ ++ vap->va_flags = 0; /* flags defined for file */ ++ vap->va_filerev = 0; /* file modification number */ ++ vap->va_vaflags = 0; /* operations flags */ ++ vap->va_fileid = np->sf_ino; /* file id */ ++ vap->va_fsid = vp->v_mount->mnt_stat.f_fsid.val[0]; ++ if (vap->va_fileid == 0) ++ vap->va_fileid = 2; ++ ++ vap->va_atime.tv_sec = VNOVAL; ++ vap->va_atime.tv_nsec = VNOVAL; ++ vap->va_mtime.tv_sec = VNOVAL; ++ vap->va_mtime.tv_nsec = VNOVAL; ++ vap->va_ctime.tv_sec = VNOVAL; ++ vap->va_ctime.tv_nsec = VNOVAL; ++ ++ if (!vsfnode_stat_cached(np)) { ++ error = vsfnode_update_stat_cache(np); ++ if (error != 0) ++ goto done; ++ } ++ ++ vap->va_atime = np->sf_stat.sf_atime; ++ vap->va_mtime = np->sf_stat.sf_mtime; ++ vap->va_ctime = np->sf_stat.sf_ctime; ++ ++ mode = np->sf_stat.sf_mode; ++ ++ vap->va_mode = mode; ++ if (S_ISDIR(mode)) { ++ vap->va_type = VDIR; /* vnode type (for create) */ ++ vap->va_mode = mp->sf_dmode != 0 ? (mp->sf_dmode & 0777) : vap->va_mode; ++ vap->va_mode &= ~mp->sf_dmask; ++ vap->va_mode |= S_IFDIR; ++ } else if (S_ISREG(mode)) { ++ vap->va_type = VREG; ++ vap->va_mode = mp->sf_fmode != 0 ? (mp->sf_fmode & 0777) : vap->va_mode; ++ vap->va_mode &= ~mp->sf_fmask; ++ vap->va_mode |= S_IFREG; ++ } else if (S_ISFIFO(mode)) ++ vap->va_type = VFIFO; ++ else if (S_ISCHR(mode)) ++ vap->va_type = VCHR; ++ else if (S_ISBLK(mode)) ++ vap->va_type = VBLK; ++ else if (S_ISLNK(mode)) { ++ vap->va_type = VLNK; ++ vap->va_mode = mp->sf_fmode != 0 ? (mp->sf_fmode & 0777) : vap->va_mode; ++ vap->va_mode &= ~mp->sf_fmask; ++ vap->va_mode |= S_IFLNK; ++ } else if (S_ISSOCK(mode)) ++ vap->va_type = VSOCK; ++ ++ vap->va_size = np->sf_stat.sf_size; ++ vap->va_blocksize = 512; ++ /* bytes of disk space held by file */ ++ vap->va_bytes = (np->sf_stat.sf_alloc + 511) / 512; ++ ++done: ++ return (error); + } + +-static int vboxvfs_print (struct vop_print_args *ap) ++static int ++vboxfs_setattr(struct vop_setattr_args *ap) + { +- return 0; ++ struct vnode *vp = ap->a_vp; ++ struct vattr *vap = ap->a_vap; ++ struct vboxfs_node *np = VP_TO_VBOXFS_NODE(vp); ++ int error; ++ mode_t mode; ++ ++ mode = vap->va_mode; ++ if (vp->v_type == VREG) ++ mode |= S_IFREG; ++ else if (vp->v_type == VDIR) ++ mode |= S_IFDIR; ++ else if (vp->v_type == VBLK) ++ mode |= S_IFBLK; ++ else if (vp->v_type == VCHR) ++ mode |= S_IFCHR; ++ else if (vp->v_type == VLNK) ++ mode |= S_IFLNK; ++ else if (vp->v_type == VFIFO) ++ mode |= S_IFIFO; ++ else if (vp->v_type == VSOCK) ++ mode |= S_IFSOCK; ++ ++ vfsnode_invalidate_stat_cache(np); ++ ++ error = sfprov_set_attr(np->vboxfsmp->sf_handle, np->sf_path, ++ mode, vap->va_atime, vap->va_mtime, vap->va_ctime); ++#if 0 ++ if (error == ENOENT) ++ sfnode_make_stale(np); ++#endif ++ if (vap->va_size != (u_quad_t)VNOVAL) { ++ switch (vp->v_type) { ++ case VDIR: ++ return (EISDIR); ++ case VLNK: ++ /* FALLTHROUGH */ ++ case VREG: ++ error = sfprov_set_size(np->vboxfsmp->sf_handle, np->sf_path, vap->va_size); ++ break; ++ case VCHR: ++ /* FALLTHROUGH */ ++ case VBLK: ++ /* FALLTHROUGH */ ++ case VSOCK: ++ /* FALLTHROUGH */ ++ case VFIFO: ++ /* FALLTHROUGH */ ++ case VNON: ++ /* FALLTHROUGH */ ++ case VBAD: ++ /* FALLTHROUGH */ ++ case VMARKER: ++ return (0); ++ } ++ } ++ ++ return (error); + } + +-static int vboxvfs_pathconf (struct vop_pathconf_args *ap) ++#define blkoff(vboxfsmp, loc) ((loc) & (vboxfsmp)->bmask) ++ ++static int ++vboxfs_read(struct vop_read_args *ap) + { +- return 0; ++ struct vnode *vp = ap->a_vp; ++ struct uio *uio = ap->a_uio; ++ struct vboxfs_node *np = VP_TO_VBOXFS_NODE(vp); ++ int error = 0; ++ uint32_t bytes; ++ uint32_t done; ++ unsigned long offset; ++ ssize_t total; ++ void *tmpbuf; ++ ++ if (vp->v_type == VDIR) ++ return (EISDIR); ++ ++ if (vp->v_type != VREG) ++ return (EINVAL); ++ ++ if (uio->uio_offset < 0) ++ return (EINVAL); ++ ++ total = uio->uio_resid; ++ if (total == 0) ++ return (0); ++ ++ /* ++ * XXXGONZO: this is just to get things working ++ * should be optimized ++ */ ++ tmpbuf = contigmalloc(PAGE_SIZE, M_DEVBUF, M_WAITOK, 0, ~0, PAGE_SIZE, 0); ++ if (tmpbuf == 0) ++ return (ENOMEM); ++ ++ /* ++ * XXX VOP_READ() is called without VOP_OPEN() on exec case. ++ * We need to ensure the file is opened here. ++ */ ++ error = vboxfs_get_sfp_file(np); ++ if (error != 0) /* Maybe removed on the host. */ ++ return (EIO); ++ do { ++ offset = uio->uio_offset; ++ done = bytes = min(PAGE_SIZE, uio->uio_resid); ++ error = sfprov_read(np->sf_file, tmpbuf, ++ offset, &done, 0); ++ if (error == 0 && done > 0) ++ error = uiomove(tmpbuf, done, uio); ++ } while (error == 0 && uio->uio_resid > 0 && done > 0); ++ vboxfs_put_sfp_file(np); ++ ++ contigfree(tmpbuf, PAGE_SIZE, M_DEVBUF); ++ ++ /* a partial read is never an error */ ++ if (total != uio->uio_resid) ++ error = 0; ++ ++ return (error); + } + +-static int vboxvfs_strategy (struct vop_strategy_args *ap) ++static int ++vboxfs_write(struct vop_write_args *ap) + { +- return 0; ++ struct vnode *vp = ap->a_vp; ++ struct uio *uio = ap->a_uio; ++ struct vboxfs_node *np = VP_TO_VBOXFS_NODE(vp); ++ int error = 0; ++ uint32_t bytes; ++ uint32_t done; ++ unsigned long offset; ++ ssize_t total; ++ void *tmpbuf; ++ ++ if (vp->v_type == VDIR) ++ return (EISDIR); ++ ++ if (vp->v_type != VREG) ++ return (EINVAL); ++ ++ if (uio->uio_offset < 0) ++ return (EINVAL); ++ ++ total = uio->uio_resid; ++ if (total == 0) ++ return (0); ++ ++ /* ++ * XXXGONZO: this is just to get things working ++ * should be optimized ++ */ ++ tmpbuf = contigmalloc(PAGE_SIZE, M_DEVBUF, M_WAITOK, 0, ~0, PAGE_SIZE, 0); ++ if (tmpbuf == 0) ++ return (ENOMEM); ++ ++ do { ++ offset = uio->uio_offset; ++ bytes = min(PAGE_SIZE, uio->uio_resid); ++ error = uiomove(tmpbuf, bytes, uio); ++ if (error != 0) ++ break; ++ done = bytes; ++ error = sfprov_write(np->sf_file, tmpbuf, ++ offset, &done, 0); ++ if (error != 0) ++ break; ++ total -= done; ++ if (done != bytes) ++ uio->uio_resid += bytes - done; ++ } while (error == 0 && uio->uio_resid > 0 && done > 0); ++ ++ contigfree(tmpbuf, PAGE_SIZE, M_DEVBUF); ++ ++ /* a partial write is never an error */ ++ if (total != uio->uio_resid) ++ error = 0; ++ ++ return (error); + } + +-static int vboxvfs_ioctl(struct vop_ioctl_args *ap) ++static int ++vboxfs_create(struct vop_create_args *ap) + { +- return ENOTTY; ++ struct vnode *dvp = ap->a_dvp; ++ struct vnode **vpp = ap->a_vpp; ++ struct componentname *cnp = ap->a_cnp; ++ struct vattr *vap = ap->a_vap; ++ sffs_stat_t stat; ++ char *fullpath = NULL; ++ struct vboxfs_node *dir = VP_TO_VBOXFS_NODE(dvp); ++ int error; ++ struct vboxfs_mnt *vboxfsmp = dir->vboxfsmp; ++ ++ MPASS(vap->va_type == VREG); ++ ++ fullpath = sfnode_construct_path(dir, cnp->cn_nameptr, cnp->cn_namelen); ++ error = sfprov_create(dir->vboxfsmp->sf_handle, fullpath, vap->va_mode, ++ &stat); ++ ++ if (error) ++ goto out; ++ ++ error = vboxfs_alloc_file(vboxfsmp, fullpath, VREG, vap->va_mode, dir, cnp->cn_lkflags, vpp); ++ ++out: ++ if (fullpath) ++ free(fullpath, M_VBOXVFS); ++ ++ if (error == 0) { ++ vfsnode_clear_dir_list(dir); ++ if ((cnp->cn_flags & MAKEENTRY) != 0) ++ cache_enter(dvp, *vpp, cnp); ++ } ++ ++ return (error); + } + +-static int vboxvfs_getextattr(struct vop_getextattr_args *ap) ++static int ++vboxfs_remove(struct vop_remove_args *ap) + { +- return 0; ++ struct vnode *dvp = ap->a_dvp; ++ struct vnode *vp = ap->a_vp; ++ struct vboxfs_node *np, *dir; ++ ++ int error; ++ ++ MPASS(VOP_ISLOCKED(dvp)); ++ MPASS(VOP_ISLOCKED(vp)); ++ ++ error = 0; ++ ++ np = VP_TO_VBOXFS_NODE(vp); ++ dir = VP_TO_VBOXFS_NODE(vp); ++ ++ error = sfprov_remove(np->vboxfsmp->sf_handle, np->sf_path, ++ np->sf_type == VLNK); ++ ++#if 0 ++ if (error == ENOENT || error == 0) ++ sfnode_make_stale(np); ++#endif ++ ++ if (error == 0) ++ vfsnode_clear_dir_list(dir); ++ ++out: ++ return (error); + } + +-static int vboxvfs_advlock(struct vop_advlock_args *ap) ++static int ++vboxfs_rename(struct vop_rename_args *ap) + { +- return 0; ++ struct vnode *fvp; ++ struct vnode *fdvp; ++ struct vnode *tvp; ++ struct vnode *tdvp; ++ struct componentname *fcnp; ++ struct componentname *tcnp; ++ struct vboxfs_node *np; ++ int ret; ++ ++ fvp = ap->a_fvp; ++ fdvp = ap->a_fdvp; ++ tvp = ap->a_tvp; ++ tdvp = ap->a_tdvp; ++ fcnp = ap->a_fcnp; ++ tcnp = ap->a_tcnp; ++ ++ /* Check for cross-device rename */ ++ if ((fvp->v_mount != tdvp->v_mount) || ++ (tvp && (fvp->v_mount != tvp->v_mount))) { ++ ret = EXDEV; ++ goto out; ++ } ++ np = VP_TO_VBOXFS_NODE(fvp); ++ if (np == NULL) ++ return (0); ++ ret = sfprov_rename(np->vboxfsmp->sf_handle, ++ fcnp->cn_nameptr, tcnp->cn_nameptr, fvp->v_type == VDIR); ++out: ++ if (tdvp == tvp) ++ vrele(tdvp); ++ else ++ vput(tdvp); ++ if (tvp) ++ vput(tvp); ++ vrele(fdvp); ++ vrele(fvp); ++ return (ret); + } + +-static int vboxvfs_lookup(struct vop_lookup_args *ap) ++static int ++vboxfs_link(struct vop_link_args *ap) + { +- return 0; ++ return (EOPNOTSUPP); + } + +-static int vboxvfs_inactive(struct vop_inactive_args *ap) ++static int ++vboxfs_symlink(struct vop_symlink_args *ap) + { +- return 0; ++ struct vnode *dvp = ap->a_dvp; ++ struct vnode **vpp = ap->a_vpp; ++ struct componentname *cnp = ap->a_cnp; ++ struct vattr *vap = ap->a_vap; ++ sffs_stat_t stat; ++ char *fullpath = NULL; ++ struct vboxfs_node *dir = VP_TO_VBOXFS_NODE(dvp); ++ int error; ++ struct vboxfs_mnt *vboxfsmp = dir->vboxfsmp; ++ ++ MPASS(vap->va_type == VLNK); ++ ++ fullpath = sfnode_construct_path(dir, cnp->cn_nameptr, cnp->cn_namelen); ++ error = sfprov_symlink(dir->vboxfsmp->sf_handle, fullpath, ap->a_target, &stat); ++ ++ if (error) ++ goto out; ++ ++ error = vboxfs_alloc_file(vboxfsmp, fullpath, VLNK, vap->va_mode, dir, cnp->cn_lkflags, vpp); ++ ++out: ++ if (fullpath) ++ free(fullpath, M_VBOXVFS); ++ ++ if (error == 0) ++ vfsnode_clear_dir_list(dir); ++ ++ return (error); + } + +-static int vboxvfs_reclaim(struct vop_reclaim_args *ap) ++static int ++vboxfs_mkdir(struct vop_mkdir_args *ap) + { +- return 0; ++ struct vnode *dvp = ap->a_dvp; ++ struct vnode **vpp = ap->a_vpp; ++ struct componentname *cnp = ap->a_cnp; ++ struct vattr *vap = ap->a_vap; ++ sffs_stat_t stat; ++ char *fullpath = NULL; ++ struct vboxfs_node *dir = VP_TO_VBOXFS_NODE(dvp); ++ int error; ++ struct vboxfs_mnt *vboxfsmp = dir->vboxfsmp; ++ ++ MPASS(vap->va_type == VDIR); ++ ++ fullpath = sfnode_construct_path(dir, cnp->cn_nameptr, cnp->cn_namelen); ++ error = sfprov_mkdir(dir->vboxfsmp->sf_handle, fullpath, vap->va_mode, ++ &stat); ++ ++ if (error) ++ goto out; ++ ++ error = vboxfs_alloc_file(vboxfsmp, fullpath, VDIR, vap->va_mode, dir, cnp->cn_lkflags, vpp); ++ ++out: ++ if (fullpath) ++ free(fullpath, M_VBOXVFS); ++ ++ if (error == 0) ++ vfsnode_clear_dir_list(dir); ++ ++ return (error); + } + +-static int vboxvfs_getpages(struct vop_getpages_args *ap) ++static int ++vboxfs_rmdir(struct vop_rmdir_args *ap) + { +- return 0; ++ struct vnode *dvp = ap->a_dvp; ++ struct vnode *vp = ap->a_vp; ++ struct vboxfs_node *np, *dir; ++ ++ int error; ++ ++ MPASS(VOP_ISLOCKED(dvp)); ++ MPASS(VOP_ISLOCKED(vp)); ++ ++ error = 0; ++ ++ np = VP_TO_VBOXFS_NODE(vp); ++ dir = VP_TO_VBOXFS_NODE(vp); ++ ++ error = sfprov_rmdir(np->vboxfsmp->sf_handle, np->sf_path); ++ ++#if 0 ++ if (error == ENOENT || error == 0) ++ sfnode_make_stale(np); ++#endif ++ ++ if (error == 0) ++ vfsnode_clear_dir_list(dir); ++ ++out: ++ return (error); + } + +-static int vboxvfs_putpages(struct vop_putpages_args *ap) ++static int ++vboxfs_readdir(struct vop_readdir_args *ap) + { +- return 0; ++ int *eofp = ap->a_eofflag; ++ struct vnode *vp = ap->a_vp; ++ struct uio *uio = ap->a_uio; ++ struct vboxfs_node *dir = VP_TO_VBOXFS_NODE(vp); ++ struct vboxfs_node *node = NULL; ++ struct sffs_dirent *dirent = NULL; ++ sffs_dirents_t *cur_buf; ++ off_t offset = 0; ++ off_t orig_off = uio->uio_offset; ++ int error = 0; ++ int dummy_eof; ++ ++ if (vp->v_type != VDIR) ++ return (ENOTDIR); ++ ++ if (eofp == NULL) ++ eofp = &dummy_eof; ++ *eofp = 0; ++ ++ /* ++ * Get the directory entry names from the host. This gets all ++ * entries. These are stored in a linked list of sffs_dirents_t ++ * buffers, each of which contains a list of dirent64_t's. ++ */ ++ if (dir->sf_dir_list == NULL) { ++ error = sfprov_readdir(dir->vboxfsmp->sf_handle, dir->sf_path, ++ &dir->sf_dir_list); ++ if (error != 0) ++ goto done; ++ } ++ ++ /* ++ * Validate and skip to the desired offset. ++ */ ++ cur_buf = dir->sf_dir_list; ++ offset = 0; ++ ++ while (cur_buf != NULL && offset + cur_buf->sf_len <= uio->uio_offset) { ++ offset += cur_buf->sf_len; ++ cur_buf = cur_buf->sf_next; ++ } ++ ++ if (cur_buf == NULL && offset != uio->uio_offset) { ++ error = EINVAL; ++ goto done; ++ } ++ ++ if (cur_buf != NULL && offset != uio->uio_offset) { ++ off_t off = offset; ++ int step; ++ dirent = &cur_buf->sf_entries[0]; ++ ++ while (off < uio->uio_offset) { ++ if (dirent->sf_off == uio->uio_offset) ++ break; ++ step = sizeof(struct sffs_dirent) + dirent->sf_entry.d_reclen; ++ dirent = (struct sffs_dirent *) (((char *) dirent) + step); ++ off += step; ++ } ++ ++ if (off >= uio->uio_offset) { ++ error = EINVAL; ++ goto done; ++ } ++ } ++ ++ offset = uio->uio_offset - offset; ++ ++ /* ++ * Lookup each of the names, so that we have ino's, and copy to ++ * result buffer. ++ */ ++ while (cur_buf != NULL) { ++ if (offset >= cur_buf->sf_len) { ++ cur_buf = cur_buf->sf_next; ++ offset = 0; ++ continue; ++ } ++ ++ dirent = (struct sffs_dirent *) ++ (((char *) &cur_buf->sf_entries[0]) + offset); ++ if (dirent->sf_entry.d_reclen > uio->uio_resid) ++ break; ++ ++ if (strcmp(dirent->sf_entry.d_name, ".") == 0) { ++ node = dir; ++ } else if (strcmp(dirent->sf_entry.d_name, "..") == 0) { ++ node = dir->sf_parent; ++ if (node == NULL) ++ node = dir; ++ } else { ++#if 0 ++ node = vsfnode_lookup(dir, dirent->sf_entry.d_name, VNON, ++ 0, &dirent->sf_stat, vsfnode_cur_time_usec(), NULL); ++ if (node == NULL) ++ panic("sffs_readdir() lookup failed"); ++#endif ++ } ++ ++ if (node) ++ dirent->sf_entry.d_fileno = node->sf_ino; ++ else ++ dirent->sf_entry.d_fileno = 0xdeadbeef; ++ ++ error = uiomove(&dirent->sf_entry, dirent->sf_entry.d_reclen, uio); ++ if (error != 0) ++ break; ++ ++ uio->uio_offset = dirent->sf_off; ++ offset += sizeof(struct sffs_dirent) + dirent->sf_entry.d_reclen; ++ } ++ ++ if (error == 0 && cur_buf == NULL) ++ *eofp = 1; ++done: ++ if (error != 0) ++ uio->uio_offset = orig_off; ++ return (error); + } + ++static int ++vboxfs_readlink(struct vop_readlink_args *v) ++{ ++ struct vnode *vp = v->a_vp; ++ struct uio *uio = v->a_uio; ++ ++ int error; ++ struct vboxfs_node *np; ++ void *tmpbuf; ++ ++ MPASS(uio->uio_offset == 0); ++ MPASS(vp->v_type == VLNK); ++ ++ np = VP_TO_VBOXFS_NODE(vp); ++ ++ tmpbuf = contigmalloc(MAXPATHLEN, M_DEVBUF, M_WAITOK, 0, ~0, 1, 0); ++ if (tmpbuf == NULL) ++ return (ENOMEM); ++ ++ error = sfprov_readlink(np->vboxfsmp->sf_handle, np->sf_path, tmpbuf, ++ MAXPATHLEN); ++ if (error) ++ goto done; ++ ++ error = uiomove(tmpbuf, strlen(tmpbuf), uio); ++ ++done: ++ if (tmpbuf) ++ contigfree(tmpbuf, MAXPATHLEN, M_DEVBUF); ++ return (error); ++} ++ ++static int ++vboxfs_fsync(struct vop_fsync_args *ap) ++{ ++ struct vnode *vp; ++ struct vboxfs_node *np; ++ int ret; ++ ++ vp = ap->a_vp; ++ np = VP_TO_VBOXFS_NODE(vp); ++ if (np == NULL) ++ return (0); ++ ret = sfprov_fsync(np->sf_file); ++ return (ret); ++} ++ ++static int ++vboxfs_print(struct vop_print_args *ap) ++{ ++ struct vnode *vp = ap->a_vp; ++ struct vboxfs_node *np; ++ ++ np = VP_TO_VBOXFS_NODE(vp); ++ ++ if (np == NULL) { ++ printf("No vboxfs_node data\n"); ++ return (0); ++ } ++ ++ printf("\tpath = %s, parent = %p", np->sf_path, ++ np->sf_parent ? np->sf_parent : NULL); ++ printf("\n"); ++ return (0); ++} ++ ++static int ++vboxfs_pathconf(struct vop_pathconf_args *ap) ++{ ++ register_t *retval = ap->a_retval; ++ int error = 0; ++ ++ switch (ap->a_name) { ++ case _PC_LINK_MAX: ++ *retval = 65535; ++ break; ++ case _PC_NAME_MAX: ++ *retval = NAME_MAX; ++ break; ++ case _PC_PATH_MAX: ++ *retval = PATH_MAX; ++ break; ++ default: ++ error = EINVAL; ++ break; ++ } ++ return (error); ++} ++ ++/* ++ * File specific ioctls. ++ */ ++static int ++vboxfs_ioctl(struct vop_ioctl_args *ap) ++{ ++ return (ENOTTY); ++} ++ ++/* ++ * Lookup an entry in a directory and create a new vnode if found. ++ */ ++static int ++vboxfs_lookup1(struct vnode *dvp, struct vnode **vpp, ++ struct componentname *cnp) ++{ ++ char *nameptr = cnp->cn_nameptr; /* the name of the file or directory */ ++ struct vnode *tdp = NULL; ++ struct vboxfs_node *node = VP_TO_VBOXFS_NODE(dvp); ++ struct vboxfs_mnt *vboxfsmp = node->vboxfsmp; ++ u_long nameiop = cnp->cn_nameiop; ++ u_long flags = cnp->cn_flags; ++ sffs_stat_t stat; ++ //long namelen; ++ ino_t id = 0; ++ int ltype, type, error = 0; ++ int lkflags = cnp->cn_lkflags; ++ char *fullpath = NULL; ++ ++ *vpp = NULLVP; ++ error = ENOENT; ++ if (cnp->cn_flags & ISDOTDOT) { ++ error = vn_vget_ino_gen(dvp, vboxfs_vn_get_ino_alloc, ++ node->sf_parent, cnp->cn_lkflags, vpp); ++ error = ENOENT; ++ if (error != 0) ++ goto out; ++ ++ } else if (cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.') { ++ VREF(dvp); ++ *vpp = dvp; ++ error = 0; ++ } else { ++ mode_t m; ++ type = VNON; ++ fullpath = sfnode_construct_path(node, cnp->cn_nameptr, cnp->cn_namelen); ++ error = sfprov_get_attr(node->vboxfsmp->sf_handle, ++ fullpath, &stat); ++ // stat_time = vsfnode_cur_time_usec(); ++ ++ m = stat.sf_mode; ++ if (error != 0) { ++ /* The entry was not found in the directory. ++ * This is OK if we are creating or renaming an ++ * entry and are working on the last component of ++ * the path name. */ ++ if ((cnp->cn_flags & ISLASTCN) && ++ (cnp->cn_nameiop == CREATE || \ ++ cnp->cn_nameiop == RENAME || ++ (cnp->cn_nameiop == DELETE && ++ cnp->cn_flags & DOWHITEOUT && ++ cnp->cn_flags & ISWHITEOUT))) { ++ error = VOP_ACCESS(dvp, VWRITE, cnp->cn_cred, ++#if __FreeBSD_version < 1400037 ++ cnp->cn_thread); ++#else ++ curthread); ++#endif ++ if (error != 0) ++ goto out; ++ ++#if __FreeBSD_version < 1400068 ++ /* Keep the component name in the buffer for ++ * future uses. */ ++ cnp->cn_flags |= SAVENAME; ++#endif ++ ++ error = EJUSTRETURN; ++ } else ++ error = ENOENT; ++ } ++ else { ++ if (S_ISDIR(m)) ++ type = VDIR; ++ else if (S_ISREG(m)) ++ type = VREG; ++ else if (S_ISLNK(m)) ++ type = VLNK; ++ error = vboxfs_alloc_file(vboxfsmp, fullpath, type, 0755, node, cnp->cn_lkflags, vpp); ++ } ++ } ++ ++ if ((cnp->cn_flags & MAKEENTRY) != 0) ++ cache_enter(dvp, *vpp, cnp); ++out: ++ if (fullpath) ++ free(fullpath, M_VBOXVFS); ++ ++ return (error); ++} ++ ++static int ++vboxfs_cachedlookup(struct vop_cachedlookup_args *ap) ++{ ++ return (vboxfs_lookup1(ap->a_dvp, ap->a_vpp, ap->a_cnp)); ++} ++ ++static int ++vboxfs_lookup(struct vop_lookup_args *ap) ++{ ++ struct vnode *dvp = ap->a_dvp; ++ struct componentname *cnp = ap->a_cnp; ++ struct vboxfs_node *np = VP_TO_VBOXFS_NODE(dvp); ++ struct timespec mtime; ++ int flags = cnp->cn_flags; ++ int error; ++ ++ if (dvp->v_type != VDIR) ++ return (ENOTDIR); ++ ++ if ((flags & ISLASTCN) && (dvp->v_mount->mnt_flag & MNT_RDONLY) && ++ (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)) ++ return (EROFS); ++ ++ error = vn_dir_check_exec(dvp, cnp); ++ if (error != 0) ++ return (error); ++ ++ /* Check if the directory is unmodified on the host. */ ++ mtime = np->sf_stat.sf_mtime; ++ error = vsfnode_update_stat_cache(np); ++ if (error == 0) { ++ if (mtime.tv_sec == np->sf_stat.sf_mtime.tv_sec && ++ mtime.tv_nsec == np->sf_stat.sf_mtime.tv_nsec) ++ return (vfs_cache_lookup(ap)); ++ } ++ ++ cache_purge(dvp); ++ ++ return (vboxfs_lookup1(ap->a_dvp, ap->a_vpp, ap->a_cnp)); ++} ++ ++static int ++vboxfs_inactive(struct vop_inactive_args *ap) ++{ ++ return (0); ++} ++ ++static int ++vboxfs_reclaim(struct vop_reclaim_args *ap) ++{ ++ struct vnode *vp; ++ struct vboxfs_node *node; ++ struct vboxfs_mnt *vboxfsmp; ++ ++ vp = ap->a_vp; ++ node = VP_TO_VBOXFS_NODE(vp); ++ vboxfsmp = node->vboxfsmp; ++ ++ vnode_destroy_vobject(vp); ++ vp->v_object = NULL; ++ cache_purge(vp); ++ ++ VBOXFS_NODE_LOCK(node); ++ VBOXFS_ASSERT_ELOCKED(node); ++ vboxfs_free_vp(vp); ++ ++ /* If the node referenced by this vnode was deleted by the user, ++ * we must free its associated data structures (now that the vnode ++ * is being reclaimed). */ ++ if ((node->sf_vpstate & VBOXFS_VNODE_ALLOCATING) == 0) { ++ node->sf_vpstate = VBOXFS_VNODE_DOOMED; ++ VBOXFS_NODE_UNLOCK(node); ++ vboxfs_free_node(vboxfsmp, node); ++ } else ++ VBOXFS_NODE_UNLOCK(node); ++ ++ MPASS(vp->v_data == NULL); ++ ++ return (0); ++} ++ ++static int ++vboxfs_vptofh(struct vop_vptofh_args *ap) ++{ ++ ++ return (EOPNOTSUPP); ++} diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_x11_vboxmouse_Makefile.kmk b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_x11_vboxmouse_Makefile.kmk new file mode 100644 index 000000000000..bd5e626ecea2 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_x11_vboxmouse_Makefile.kmk @@ -0,0 +1,29 @@ +--- src/VBox/Additions/x11/vboxmouse/Makefile.kmk.orig 2025-08-13 19:41:22 UTC ++++ src/VBox/Additions/x11/vboxmouse/Makefile.kmk +@@ -237,10 +237,22 @@ ifdef VBOX_USE_SYSTEM_XORG_HEADERS + + + ifdef VBOX_USE_SYSTEM_XORG_HEADERS +- # As vboxmouse_drv is not needed at all for X.Org Server 1.7 and later do not +- # build it in this case. +- DLLS := $(filter-out vboxmouse_drv_%,$(DLLS)) +- SYSMODS := $(filter-out vboxmouse_drv%,$(SYSMODS)) ++ ifeq ($(KBUILD_TARGET),freebsd) ++ DLLS += vboxmouse_drv_system ++ vboxmouse_drv_system_TEMPLATE = VBOXGUESTR3XORGMOD ++ vboxmouse_drv_system_DEFS := $(vboxmouse_drv_70_DEFS) NO_ANSIC ++ vboxmouse_drv_system_INCS := \ ++ /usr/local/include/pixman-1 \ ++ /usr/local/include/xorg \ ++ $(PATH_SUB_CURRENT) ++ vboxmouse_drv_system_SOURCES = \ ++ vboxmouse.c ++ else ++ # As vboxmouse_drv is not needed at all for X.Org Server 1.7 and later do not ++ # build it in this case. ++ DLLS := $(filter-out vboxmouse_drv_%,$(DLLS)) ++ SYSMODS := $(filter-out vboxmouse_drv%,$(SYSMODS)) ++ endif + endif + + diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA.cpp new file mode 100644 index 000000000000..de5a81911c03 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA.cpp @@ -0,0 +1,20 @@ +--- src/VBox/Devices/Graphics/DevVGA-SVGA.cpp.orig 2025-08-13 19:47:43 UTC ++++ src/VBox/Devices/Graphics/DevVGA-SVGA.cpp +@@ -178,7 +178,7 @@ + # ifdef RT_OS_DARWIN + # include "DevVGA-SVGA3d-cocoa.h" + # endif +-# ifdef RT_OS_LINUX ++# if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) + # ifdef IN_RING3 + # include "DevVGA-SVGA3d-glLdr.h" + # endif +@@ -7949,7 +7949,7 @@ static void vmsvgaR3PowerOnDevice(PPDMDEVINS pDevIns, + } + # endif + +-# if defined(VBOX_WITH_VMSVGA3D) && defined(RT_OS_LINUX) ++# if defined(VBOX_WITH_VMSVGA3D) && (defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX)) + if (pThis->svga.f3DEnabled) + { + /* The FIFO thread may use X API for accelerated screen output. */ diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-dx-dx11.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-dx-dx11.cpp new file mode 100644 index 000000000000..4d74ec64cec0 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-dx-dx11.cpp @@ -0,0 +1,11 @@ +--- src/VBox/Devices/Graphics/DevVGA-SVGA3d-dx-dx11.cpp.orig 2025-08-13 19:47:43 UTC ++++ src/VBox/Devices/Graphics/DevVGA-SVGA3d-dx-dx11.cpp +@@ -3021,7 +3021,7 @@ static DECLCALLBACK(int) vmsvga3dBackInit(PPDMDEVINS p + RT_NOREF(pDevIns, pThis); + + int rc; +-#ifdef RT_OS_LINUX /** @todo Remove, this is currently needed for loading the X11 library in order to call XInitThreads(). */ ++#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) /** @todo Remove, this is currently needed for loading the X11 library in order to call XInitThreads(). */ + rc = glLdrInit(pDevIns); + if (RT_FAILURE(rc)) + { diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.cpp new file mode 100644 index 000000000000..e9ae5d0b71f9 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.cpp @@ -0,0 +1,29 @@ +--- src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.cpp.orig 2025-04-14 17:55:41 UTC ++++ src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.cpp +@@ -196,7 +196,7 @@ int glLdrInit(PPDMDEVINS pDevIns) + pfn_wglDeleteContext = 0; + pfn_wglMakeCurrent = 0; + pfn_wglShareLists = 0; +-#elif defined(RT_OS_LINUX) ++#elif defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) + pfn_XConfigureWindow = 0; + pfn_XCloseDisplay = 0; + pfn_XCreateColormap = 0; +@@ -306,7 +306,7 @@ int glLdrInit(PPDMDEVINS pDevIns) + GLGETPROC_(wglDeleteContext, ""); + GLGETPROC_(wglMakeCurrent, ""); + GLGETPROC_(wglShareLists, ""); +-#elif defined(RT_OS_LINUX) ++#elif defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) + X11GETPROC_(XConfigureWindow); + X11GETPROC_(XCloseDisplay); + X11GETPROC_(XCreateColormap); +@@ -407,7 +407,7 @@ int glLdrInit(PPDMDEVINS pDevIns) + GLGETPROC_(glVertexPointer, ""); + GLGETPROC_(glViewport, ""); + +-#ifdef RT_OS_LINUX ++#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) + XInitThreads(); + #endif + return VINF_SUCCESS; diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.h b/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.h new file mode 100644 index 000000000000..52d86f546033 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.h @@ -0,0 +1,11 @@ +--- src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.h.orig 2025-04-14 17:55:41 UTC ++++ src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.h +@@ -346,7 +346,7 @@ GLPFN BOOL (WINAPI *pfn_wglShareLists)(HGLRC, HGLRC); + GLPFN BOOL (WINAPI *pfn_wglShareLists)(HGLRC, HGLRC); + #define wglShareLists pfn_wglShareLists + +-#elif defined(RT_OS_LINUX) ++#elif defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) + /* + * GLX + */ diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-ogl.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-ogl.cpp new file mode 100644 index 000000000000..74106db011ff --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-ogl.cpp @@ -0,0 +1,56 @@ +--- src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp.orig 2025-04-14 17:55:42 UTC ++++ src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp +@@ -1198,7 +1198,7 @@ static DECLCALLBACK(int) vmsvga3dBackTerminate(PVGASTA + RTSemEventDestroy(pState->WndRequestSem); + #elif defined(RT_OS_DARWIN) + +-#elif defined(RT_OS_LINUX) ++#elif defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) + /* signal to the thread that it is supposed to exit */ + pState->bTerminate = true; + /* wait for it to terminate */ +@@ -3216,7 +3216,7 @@ static DECLCALLBACK(int) vmsvga3dBackGenerateMipmaps(P + } + + +-#ifdef RT_OS_LINUX ++#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) + /** + * X11 event handling thread. + * +@@ -3246,7 +3246,7 @@ static DECLCALLBACK(int) vmsvga3dXEventThread(RTTHREAD + } + return VINF_SUCCESS; + } +-#endif // RT_OS_LINUX ++#endif // RT_OS_FREEBSD || RT_OS_LINUX + + + /** +@@ -3484,7 +3484,7 @@ int vmsvga3dContextDefineOgl(PVGASTATECC pThisCC, uint + return VINF_SUCCESS; + } + +-#if defined(RT_OS_LINUX) ++#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) + /* + * HW accelerated graphics output. + */ +@@ -3976,7 +3976,7 @@ static DECLCALLBACK(int) vmsvga3dBackSurfaceBlitToScre + return VINF_SUCCESS; + } + +-#else /* !RT_OS_LINUX */ ++#else /* !RT_OS_FREEBSD && !RT_OS_LINUX */ + + static DECLCALLBACK(int) vmsvga3dBackDefineScreen(PVGASTATE pThis, PVGASTATECC pThisCC, VMSVGASCREENOBJECT *pScreen) + { +@@ -4096,7 +4096,7 @@ static int vmsvga3dContextDestroyOgl(PVGASTATECC pThis + AssertRC(rc); + #elif defined(RT_OS_DARWIN) + vmsvga3dCocoaDestroyViewAndContext(pContext->cocoaView, pContext->cocoaContext); +-#elif defined(RT_OS_LINUX) ++#elif defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) + glXMakeCurrent(pState->display, None, NULL); + glXDestroyContext(pState->display, pContext->glxContext); + XDestroyWindow(pState->display, pContext->window); diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Makefile.kmk b/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Makefile.kmk new file mode 100644 index 000000000000..b66a828f5eb2 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Makefile.kmk @@ -0,0 +1,44 @@ +--- src/VBox/Devices/Makefile.kmk.orig 2025-08-13 19:48:02 UTC ++++ src/VBox/Devices/Makefile.kmk +@@ -135,6 +135,7 @@ if !defined(VBOX_ONLY_EXTPACKS) + VBoxDDU_LDFLAGS.darwin += -framework IOKit + endif + ++ VBoxDDU_LDFLAGS.freebsd = $(VBOX_GCC_NO_UNDEFINED) + VBoxDDU_LDFLAGS.linux = $(VBOX_GCC_NO_UNDEFINED) + $(call VBOX_SET_VER_INFO_DLL,VBoxDDU,VirtualBox VMM Devices and Drivers Utilities) + +@@ -290,6 +291,7 @@ if !defined(VBOX_ONLY_EXTPACKS) && "$(intersects $(KBU + -framework SystemConfiguration \ + -framework AVFoundation \ + -framework Foundation ++ VBoxDD_LDFLAGS.freebsd = $(VBOX_GCC_NO_UNDEFINED) + VBoxDD_LDFLAGS.linux = $(VBOX_GCC_NO_UNDEFINED) + + # --- Tracing bits. --- +@@ -334,7 +336,7 @@ if !defined(VBOX_ONLY_EXTPACKS) && "$(intersects $(KBU + Graphics/DevVGA-SVGA-cmd.cpp + endif + ifdef VBOX_WITH_VMSVGA3D +- if1of ($(KBUILD_TARGET), linux win) ++ if1of ($(KBUILD_TARGET), linux win freebsd) + # Dynamically load 3D library (opengl32, libGL). + # This is a temporary solution. In future the 3D backend will be in a separate library. + VBOX_WITH_VMSVGA3D_DYNAMIC_LOAD = 1 +@@ -410,6 +412,7 @@ if !defined(VBOX_ONLY_EXTPACKS) && "$(intersects $(KBU + Graphics/DevVGA-SVGA3d-glLdr.cpp + else + VBoxDD_LIBS.linux += X11 GL ++ VBoxDD_LIBS.freebsd += X11 GL + VBoxDD_LIBS.win += $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/Opengl32.lib + endif + VBoxDD_LDFLAGS.darwin += -framework OpenGL +@@ -1523,6 +1526,8 @@ if defined(VBOX_WITH_VMSVGA3D) && !defined(VBOX_ONLY_E + VBoxSVGA3D_INCS = $(VBOX_GRAPHICS_INCS) + VBoxSVGA3D_INCS.win := \ + Graphics/shaderlib/libWineStub/include ++ VBoxSVGA3D_INCS.freebsd := \ ++ Graphics/shaderlib/wine/include + VBoxSVGA3D_INCS.linux := \ + Graphics/shaderlib/wine/include + VBoxSVGA3D_INCS.darwin := \ diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Network_DrvNAT.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Network_DrvNAT.cpp new file mode 100644 index 000000000000..088c8e1fe3c1 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Network_DrvNAT.cpp @@ -0,0 +1,10 @@ +--- src/VBox/Devices/Network/DrvNAT.cpp.orig 2025-08-13 19:48:03 UTC ++++ src/VBox/Devices/Network/DrvNAT.cpp +@@ -57,6 +57,7 @@ + + #ifdef RT_OS_FREEBSD + # include <netinet/in.h> ++# include <sys/socket.h> + #endif + + #include <iprt/asm.h> diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_PC_ipxe_Makefile.kmk b/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_PC_ipxe_Makefile.kmk new file mode 100644 index 000000000000..fa3a87062c6c --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_PC_ipxe_Makefile.kmk @@ -0,0 +1,29 @@ +--- src/VBox/Devices/PC/ipxe/Makefile.kmk.orig 2025-08-13 19:48:06 UTC ++++ src/VBox/Devices/PC/ipxe/Makefile.kmk +@@ -45,7 +45,7 @@ iPxeBiosBin_CLEAN = \ + iPxeBiosBin_CLEAN = \ + $(iPxeBiosBin_0_OUTDIR)/iPxeBiosBin.c \ + +-if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), darwin.amd64 darwin.arm64 linux.arm64 os2.x86 solaris.amd64 win.amd64 win.arm64) ++if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), darwin.amd64 darwin.arm64 linux.arm64 os2.x86 solaris.amd64 win.amd64 win.arm64 linux.amd64 freebsd.amd64) + $$(iPxeBiosBin_0_OUTDIR)/iPxeBiosBin.c: $(PATH_SUB_CURRENT)/iPxeBiosBin.rom $(VBOX_BIN2C) | $$(dir $$@) + $(call MSG_TOOL,bin2c,iPxeBiosBin,$<,$@) + $(QUIET)$(VBOX_BIN2C) -min 32 -max 56 -mask 0x1ff -export NetBiosBinary $< $@ +@@ -131,7 +131,7 @@ endif + -falign-loops=1 \ + -Os \ + -falign-functions=1 \ +- -mpreferred-stack-boundary=2 \ ++ -mstack-alignment=2 \ + -mregparm=3 \ + -mrtd \ + -freg-struct-return \ +@@ -154,7 +154,7 @@ endif + -falign-jumps=1 \ + -falign-loops=1 \ + -falign-functions=1 \ +- -mpreferred-stack-boundary=2 \ ++ -mstack-alignment=2 \ + -mregparm=3 \ + -mrtd \ + -freg-struct-return \ diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_USB_freebsd_USBProxyDevice-freebsd.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_USB_freebsd_USBProxyDevice-freebsd.cpp new file mode 100644 index 000000000000..8258164501b2 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_USB_freebsd_USBProxyDevice-freebsd.cpp @@ -0,0 +1,11 @@ +--- src/VBox/Devices/USB/freebsd/USBProxyDevice-freebsd.cpp.orig 2025-08-13 19:49:01 UTC ++++ src/VBox/Devices/USB/freebsd/USBProxyDevice-freebsd.cpp +@@ -67,7 +67,7 @@ + #include "../USBProxyDevice.h" + + /** Maximum endpoints supported. */ +-#define USBFBSD_MAXENDPOINTS 127 ++#define USBFBSD_MAXENDPOINTS 126 + #define USBFBSD_MAXFRAMES 56 + + /** This really needs to be defined in vusb.h! */ diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_ExtPacks_VNC_VBoxVNC.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_ExtPacks_VNC_VBoxVNC.cpp new file mode 100644 index 000000000000..d4bae4a6c016 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_ExtPacks_VNC_VBoxVNC.cpp @@ -0,0 +1,58 @@ +--- src/VBox/ExtPacks/VNC/VBoxVNC.cpp.orig 2025-08-13 19:50:02 UTC ++++ src/VBox/ExtPacks/VNC/VBoxVNC.cpp +@@ -55,7 +55,7 @@ + + #ifdef LIBVNCSERVER_IPv6 + // enable manually! +-// #define VBOX_USE_IPV6 ++#define VBOX_USE_IPV6 + #endif + + +@@ -431,7 +431,7 @@ DECLCALLBACK(int) VNCServerImpl::VRDEEnableConnections + + // get address + char *pszTCPAddress = (char *)RTMemTmpAllocZ(VNC_ADDRESS_OPTION_MAX); +- rc = instance->mCallbacks->VRDECallbackProperty(instance->mCallback, ++ int rc = instance->mCallbacks->VRDECallbackProperty(instance->mCallback, + VRDE_QP_NETWORK_ADDRESS, + pszTCPAddress, + VNC_ADDRESS_OPTION_MAX, +@@ -592,19 +592,35 @@ DECLCALLBACK(int) VNCServerImpl::VRDEEnableConnections + pszServerAddress6 = szIPv6ListenAll; + } + +- if (pszVNCPort4 && uServerPort4 == 0) ++ if (strlen(pszVNCPort4) > 0 && uServerPort4 == 0) + { + rc = RTStrToUInt32Ex(pszVNCPort4, NULL, 10, &uServerPort4); + if (!RT_SUCCESS(rc) || uServerPort4 > 65535) + uServerPort4 = 0; + } + +- if (pszVNCPort6 && uServerPort6 == 0) ++ if (strlen(pszVNCPort6) > 0 && uServerPort6 == 0) + { + rc = RTStrToUInt32Ex(pszVNCPort6, NULL, 10, &uServerPort6); + if (!RT_SUCCESS(rc) || uServerPort6 > 65535) + uServerPort6 = 0; + } ++ ++/* Backward compatibility with set port in "TCP/Ports" only { */ ++ if (uServerPort4 == 0 && strlen(pszTCPPort) > 0) ++ { ++ rc = RTStrToUInt32Ex(pszTCPPort, NULL, 10, &uServerPort4); ++ if (!RT_SUCCESS(rc) || uServerPort4 > 65535) ++ uServerPort4 = 0; ++ } ++ ++ if (uServerPort6 == 0 && strlen(pszTCPPort) > 0) ++ { ++ rc = RTStrToUInt32Ex(pszTCPPort, NULL, 10, &uServerPort6); ++ if (!RT_SUCCESS(rc) || uServerPort6 > 65535) ++ uServerPort6 = 0; ++ } ++/* } */ + + if (uServerPort4 == 0 || uServerPort6 == 0) + vncServer->autoPort = 1; diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VBoxHeadless_VBoxHeadless.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VBoxHeadless_VBoxHeadless.cpp new file mode 100644 index 000000000000..ed1f32e0ce97 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VBoxHeadless_VBoxHeadless.cpp @@ -0,0 +1,11 @@ +--- src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp.orig 2025-08-13 19:50:04 UTC ++++ src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp +@@ -63,7 +63,7 @@ using namespace com; + # include <iprt/process.h> + #endif + +-#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) ++#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) + # include <cerrno> + #endif + diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VBoxManage_VBoxManageModifyVM.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VBoxManage_VBoxManageModifyVM.cpp new file mode 100644 index 000000000000..838da1e0f15d --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VBoxManage_VBoxManageModifyVM.cpp @@ -0,0 +1,29 @@ +--- src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp.orig 2025-08-13 19:50:05 UTC ++++ src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp +@@ -151,7 +151,7 @@ enum + MODIFYVM_UARTMODE, + MODIFYVM_UARTTYPE, + MODIFYVM_UART, +-#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) ++#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) + MODIFYVM_LPTMODE, + MODIFYVM_LPT, + #endif +@@ -393,7 +393,7 @@ static const RTGETOPTDEF g_aModifyVMOptions[] = + OPT2("--uart-mode", "--uartmode", MODIFYVM_UARTMODE, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX), + OPT2("--uart-type", "--uarttype", MODIFYVM_UARTTYPE, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX), + OPT1("--uart", MODIFYVM_UART, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX), +-#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) ++#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) || defined(RT_OS_FREEBSD) + OPT2("--lpt-mode", "--lptmode", MODIFYVM_LPTMODE, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX), + OPT1("--lpt", MODIFYVM_LPT, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX), + #endif +@@ -2680,7 +2680,7 @@ RTEXITCODE handleModifyVM(HandlerArg *a) + break; + } + +-#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) ++#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) + case MODIFYVM_LPTMODE: + { + ComPtr<IParallelPort> lpt; diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VirtualBox_src_manager_UIVirtualBoxManager.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VirtualBox_src_manager_UIVirtualBoxManager.cpp new file mode 100644 index 000000000000..7f18eb80356b --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VirtualBox_src_manager_UIVirtualBoxManager.cpp @@ -0,0 +1,46 @@ +--- src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp.orig 2025-08-13 19:50:55 UTC ++++ src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp +@@ -2402,6 +2402,9 @@ void UIVirtualBoxManager::prepare() + qApp->installEventFilter(this); + #endif + ++ /* Prepare notification-center invisibvle way: */ ++ prepareNotificationCenter(); ++ + /* Cache media data early if necessary: */ + if (uiCommon().agressiveCaching()) + gpMediumEnumerator->enumerateMedia(); +@@ -2446,6 +2449,12 @@ void UIVirtualBoxManager::prepare() + #endif /* VBOX_GUI_WITH_NETWORK_MANAGER && VBOX_WITH_UPDATE_REQUEST */ + } + ++void UIVirtualBoxManager::prepareNotificationCenter() ++{ ++ UINotificationCenter::create(); ++ ++} ++ + void UIVirtualBoxManager::prepareCloudMachineManager() + { + UICloudMachineManager::create(); +@@ -2805,6 +2814,12 @@ void UIVirtualBoxManager::cleanupCloudMachineManager() + UICloudMachineManager::destroy(); + } + ++void UIVirtualBoxManager::cleanupNotificationCenter() ++{ ++ UINotificationCenter::destroy(); ++ ++} ++ + void UIVirtualBoxManager::cleanup() + { + /* Ask sub-dialogs to commit data: */ +@@ -2814,6 +2829,7 @@ void UIVirtualBoxManager::cleanup() + cleanupWidgets(); + cleanupMenuBar(); + cleanupCloudMachineManager(); ++ cleanupNotificationCenter(); + } + + UIVirtualMachineItem *UIVirtualBoxManager::currentItem() const diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VirtualBox_src_manager_UIVirtualBoxManager.h b/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VirtualBox_src_manager_UIVirtualBoxManager.h new file mode 100644 index 000000000000..80daea0c318c --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VirtualBox_src_manager_UIVirtualBoxManager.h @@ -0,0 +1,20 @@ +--- src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h.orig 2025-08-13 19:50:55 UTC ++++ src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h +@@ -341,6 +341,8 @@ private slots: (private) + * @{ */ + /** Prepares window. */ + void prepare(); ++ /** Prepares notification-center. */ ++ void prepareNotificationCenter(); + /** Prepares cloud machine manager. */ + void prepareCloudMachineManager(); + /** Prepares icon. */ +@@ -366,6 +368,8 @@ private slots: (private) + void cleanupMenuBar(); + /** Cleanups cloud machine manager. */ + void cleanupCloudMachineManager(); ++ /** Cleanups notification-center. */ ++ void cleanupNotificationCenter(); + /** Cleanups window. */ + void cleanup(); + /** @} */ diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VirtualBox_src_manager_UIVirtualBoxWidget.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VirtualBox_src_manager_UIVirtualBoxWidget.cpp new file mode 100644 index 000000000000..52f736783c17 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VirtualBox_src_manager_UIVirtualBoxWidget.cpp @@ -0,0 +1,24 @@ +--- src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxWidget.cpp.orig 2025-08-13 19:50:55 UTC ++++ src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxWidget.cpp +@@ -399,8 +399,8 @@ void UIVirtualBoxWidget::prepareWidgets() + } + } + +- /* Create notification-center: */ +- UINotificationCenter::create(this); ++ /* Reparent notification-center: */ ++ gpNotificationCenter->setParent(this); + + /* Update toolbar finally: */ + updateToolbar(); +@@ -746,8 +746,8 @@ void UIVirtualBoxWidget::cleanup() + + void UIVirtualBoxWidget::cleanup() + { +- /* Destroy notification-center: */ +- UINotificationCenter::destroy(); ++ /* Reparent notification-center: */ ++ gpNotificationCenter->setParent(0); + } + + UIGlobalToolsWidget *UIVirtualBoxWidget::globalToolsWidget() const diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_SUPDrv.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_SUPDrv.cpp new file mode 100644 index 000000000000..9c25da533123 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_SUPDrv.cpp @@ -0,0 +1,13 @@ +--- src/VBox/HostDrivers/Support/SUPDrv.cpp.orig 2025-08-13 19:51:08 UTC ++++ src/VBox/HostDrivers/Support/SUPDrv.cpp +@@ -322,8 +322,8 @@ static SUPFUNC g_aFunctions[] = + SUPEXP_STK_BACK( 2, SUPR0PageFree), + SUPEXP_STK_BACK( 6, SUPR0PageMapKernel), + SUPEXP_STK_BACK( 6, SUPR0PageProtect), +-#if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) +- SUPEXP_STK_OKAY( 2, SUPR0HCPhysToVirt), /* only-linux, only-solaris, only-freebsd */ ++#if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) ++ SUPEXP_STK_OKAY( 2, SUPR0HCPhysToVirt), /* only-linux, only-solaris */ + #endif + SUPEXP_STK_BACK( 2, SUPR0PrintfV), + SUPEXP_STK_BACK( 1, SUPR0GetSessionGVM), diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_SUPDrvInternal.h b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_SUPDrvInternal.h new file mode 100644 index 000000000000..df4d3cd76817 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_SUPDrvInternal.h @@ -0,0 +1,11 @@ +--- src/VBox/HostDrivers/Support/SUPDrvInternal.h.orig 2025-08-13 19:51:08 UTC ++++ src/VBox/HostDrivers/Support/SUPDrvInternal.h +@@ -368,7 +368,7 @@ + # define SUPDRV_WITHOUT_MSR_PROBER + #endif + +-#if 1 ++#if 0 + /** @def SUPDRV_USE_TSC_DELTA_THREAD + * Use a dedicated kernel thread to service TSC-delta measurement requests. + * @todo Test on servers with many CPUs and sockets. */ diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_freebsd_Makefile b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_freebsd_Makefile new file mode 100644 index 000000000000..f0d605f2addd --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_freebsd_Makefile @@ -0,0 +1,30 @@ +--- src/VBox/HostDrivers/Support/freebsd/Makefile.orig 2025-08-13 19:51:09 UTC ++++ src/VBox/HostDrivers/Support/freebsd/Makefile +@@ -93,6 +93,7 @@ SRCS += \ + assert.c \ + handletable.c \ + handletablectx.c \ ++ handletablesimple.c \ + once.c \ + term.c \ + thread.c +@@ -117,7 +118,8 @@ SRCS += \ + strprintf2-ellipsis.c \ + strtonum.c \ + memchr.c \ +- stringalloc.c ++ stringalloc.c \ ++ utf-8.c + + .PATH: ${.CURDIR}/common/rand + SRCS += \ +@@ -163,7 +165,8 @@ SRCS += \ + rtStrFormatKernelAddress-generic.c \ + errvars-generic.c \ + mppresent-generic.c \ +- timer-generic.c ++ timer-generic.c \ ++ system-page-size-generic.c + + .PATH: ${.CURDIR}/r0drv + SRCS += \ diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c new file mode 100644 index 000000000000..7faa07739f14 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c @@ -0,0 +1,234 @@ +--- src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c.orig 2025-01-21 14:06:14 UTC ++++ src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c +@@ -44,9 +44,13 @@ + #include <sys/fcntl.h> + #include <sys/conf.h> + #include <sys/uio.h> ++#include <vm/vm.h> + #include <vm/pmap.h> /* for pmap_map() */ ++#include <sys/mutex.h> ++#include <sys/smp.h> /* mp_maxcpus */ + + #include "../SUPDrvInternal.h" ++#include "freebsd/the-freebsd-kernel.h" + #include <VBox/version.h> + #include <iprt/initterm.h> + #include <iprt/string.h> +@@ -58,7 +62,15 @@ + #include <iprt/alloc.h> + #include <iprt/err.h> + #include <iprt/asm.h> ++#include <iprt/x86.h> + ++ ++#ifdef VBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV ++# include <machine/cpufunc.h> ++# include <machine/md_var.h> ++# include <machine/specialreg.h> ++#endif ++ + #ifdef VBOX_WITH_HARDENING + # define VBOXDRV_PERM 0600 + #else +@@ -77,7 +89,9 @@ static d_ioctl_t VBoxDrvFreeBSDIOCtl; + static d_open_t VBoxDrvFreeBSDOpenSys; + static void vboxdrvFreeBSDDtr(void *pvData); + static d_ioctl_t VBoxDrvFreeBSDIOCtl; ++static d_ioctl_t VBoxDrvFreeBSDIOCtlSMAP; + static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSession, u_long ulCmd, caddr_t pvData, struct thread *pTd); ++static bool VBoxDrvFreeBSDCpuHasSMAP(void); + + + /********************************************************************************************************************************* +@@ -94,7 +108,8 @@ static moduledata_t g_VBoxDrvFreeBSDModule = + }; + + /** Declare the module as a pseudo device. */ +-DECLARE_MODULE(vboxdrv, g_VBoxDrvFreeBSDModule, SI_SUB_PSEUDO, SI_ORDER_ANY); ++#define KERNEL_RELBRANCHEND (roundup(__FreeBSD_version, 500) - 1) ++DECLARE_MODULE_WITH_MAXVER(vboxdrv, g_VBoxDrvFreeBSDModule, SI_SUB_PSEUDO, SI_ORDER_ANY, KERNEL_RELBRANCHEND); + MODULE_VERSION(vboxdrv, 1); + + /** +@@ -141,6 +156,13 @@ static int VBoxDrvFreeBSDModuleEvent(struct module *pM + static int VBoxDrvFreeBSDModuleEvent(struct module *pMod, int enmEventType, void *pvArg) + { + int rc; ++ ++ /* Refuse to load if mp_maxcpus is wrong */ ++ if (MAXCPU != mp_maxcpus) { ++ printf("vboxdrv: MAXCPU != mp_maxcpus (%d != %d)\n", MAXCPU, mp_maxcpus); ++ return EINVAL; ++ } ++ + switch (enmEventType) + { + case MOD_LOAD: +@@ -183,6 +205,13 @@ static int VBoxDrvFreeBSDLoad(void) + rc = supdrvInitDevExt(&g_VBoxDrvFreeBSDDevExt, sizeof(SUPDRVSESSION)); + if (RT_SUCCESS(rc)) + { ++ if (VBoxDrvFreeBSDCpuHasSMAP()) ++ { ++ LogRel(("disabling SMAP for VBoxDrvFreeBSDIOCtl\n")); ++ g_VBoxDrvFreeBSDChrDevSwSys.d_ioctl = VBoxDrvFreeBSDIOCtlSMAP; ++ g_VBoxDrvFreeBSDChrDevSwUsr.d_ioctl = VBoxDrvFreeBSDIOCtlSMAP; ++ } ++ + /* + * Configure character devices. Add symbolic links for compatibility. + */ +@@ -322,7 +351,45 @@ static int VBoxDrvFreeBSDIOCtl(struct cdev *pDev, u_lo + return VBoxDrvFreeBSDIOCtlSlow(pSession, ulCmd, pvData, pTd); + } + ++/** ++ * Alternative Device I/O Control entry point on hosts with SMAP support. ++ * ++ * @returns depends... ++ * @param pDev The device. ++ * @param ulCmd The command. ++ * @param pvData Pointer to the data. ++ * @param fFile The file descriptor flags. ++ * @param pTd The calling thread. ++ */ ++static int VBoxDrvFreeBSDIOCtlSMAP(struct cdev *pDev, u_long ulCmd, caddr_t pvData, int fFile, struct thread *pTd) ++{ ++ /* ++ * Allow VBox R0 code to touch R3 memory. Setting the AC bit disables the ++ * SMAP check. ++ */ ++ RTCCUINTREG fSavedEfl = ASMAddFlags(X86_EFL_AC); + ++ int rc = VBoxDrvFreeBSDIOCtl(pDev, ulCmd, pvData, fFile, pTd); ++ ++#ifdef VBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV ++ /* ++ * Before we restore AC and the rest of EFLAGS, check if the IOCtl handler code ++ * accidentially modified it or some other important flag. ++ */ ++ if (RT_UNLIKELY( (ASMGetFlags() & (X86_EFL_AC | X86_EFL_IF | X86_EFL_DF | X86_EFL_IOPL)) ++ != ((fSavedEfl & (X86_EFL_AC | X86_EFL_IF | X86_EFL_DF | X86_EFL_IOPL)) | X86_EFL_AC) )) ++ { ++ char szTmp[48]; ++ RTStrPrintf(szTmp, sizeof(szTmp), "ulCmd=%#x: %#x->%#x!", ulCmd, (uint32_t)fSavedEfl, (uint32_t)ASMGetFlags()); ++ supdrvBadContext(&g_VBoxDrvFreeBSDDevExt, "SUPDrv-freebsd.c", __LINE__, szTmp); ++ } ++#endif ++ ++ ASMSetFlags(fSavedEfl); ++ return rc; ++} ++ ++ + /** + * Deal with the 'slow' I/O control requests. + * +@@ -372,11 +439,10 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes + */ + SUPREQHDR Hdr; + pvUser = *(void **)pvData; +- int rc = copyin(pvUser, &Hdr, sizeof(Hdr)); +- if (RT_UNLIKELY(rc)) ++ if (RT_FAILURE(RTR0MemUserCopyFrom(&Hdr, (uintptr_t)pvUser, sizeof(Hdr)))) + { +- OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: copyin(%p,Hdr,) -> %#x; ulCmd=%#lx\n", pvUser, rc, ulCmd)); +- return rc; ++ OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: copyin(%p,Hdr,); ulCmd=%#lx\n", pvUser, ulCmd)); ++ return EFAULT; + } + if (RT_UNLIKELY((Hdr.fFlags & SUPREQHDR_FLAGS_MAGIC_MASK) != SUPREQHDR_FLAGS_MAGIC)) + { +@@ -401,13 +467,12 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes + OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: failed to allocate buffer of %d bytes; ulCmd=%#lx\n", cbReq, ulCmd)); + return ENOMEM; + } +- rc = copyin(pvUser, pHdr, Hdr.cbIn); +- if (RT_UNLIKELY(rc)) ++ if (RT_FAILURE(RTR0MemUserCopyFrom(pHdr, (uintptr_t)pvUser, Hdr.cbIn))) + { +- OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: copyin(%p,%p,%#x) -> %#x; ulCmd=%#lx\n", +- pvUser, pHdr, Hdr.cbIn, rc, ulCmd)); ++ OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: copyin(%p,%p,%#x); ulCmd=%#lx\n", ++ pvUser, pHdr, Hdr.cbIn, ulCmd)); + RTMemTmpFree(pHdr); +- return rc; ++ return EFAULT; + } + if (Hdr.cbIn < cbReq) + RT_BZERO((uint8_t *)pHdr + Hdr.cbIn, cbReq - Hdr.cbIn); +@@ -435,9 +500,8 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes + OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: too much output! %#x > %#x; uCmd=%#lx!\n", cbOut, cbReq, ulCmd)); + cbOut = cbReq; + } +- rc = copyout(pHdr, pvUser, cbOut); +- if (RT_UNLIKELY(rc)) +- OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: copyout(%p,%p,%#x) -> %d; uCmd=%#lx!\n", pHdr, pvUser, cbOut, rc, ulCmd)); ++ if (RT_FAILURE(RTR0MemUserCopyTo((uintptr_t)pvUser, pHdr, cbOut))) ++ OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: copyout(%p,%p,%#x); uCmd=%#lx!\n", pHdr, pvUser, cbOut, ulCmd)); + + Log(("VBoxDrvFreeBSDIOCtlSlow: returns %d / %d ulCmd=%lx\n", 0, pHdr->rc, ulCmd)); + +@@ -540,8 +604,7 @@ bool VBOXCALL supdrvOSAreCpusOfflinedOnSuspend(void) + + bool VBOXCALL supdrvOSAreCpusOfflinedOnSuspend(void) + { +- /** @todo verify this. */ +- return false; ++ return true; + } + + +@@ -637,31 +700,44 @@ int VBOXCALL supdrvOSMsrProberModify(RTCPUID idCpu, + #endif /* SUPDRV_WITH_MSR_PROBER */ + + +-#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_ARM64) +-SUPR0DECL(int) SUPR0HCPhysToVirt(RTHCPHYS HCPhys, void **ppv) ++/** ++ * Check if the CPU has SMAP support. ++ */ ++static bool VBoxDrvFreeBSDCpuHasSMAP(void) + { +- AssertReturn(!(HCPhys & PAGE_OFFSET_MASK), VERR_INVALID_POINTER); +- AssertReturn(HCPhys != NIL_RTHCPHYS, VERR_INVALID_POINTER); +- *ppv = (void *)(uintptr_t)pmap_map(NULL, HCPhys, (HCPhys | PAGE_OFFSET_MASK) + 1, VM_PROT_WRITE | VM_PROT_READ); +- return VINF_SUCCESS; +-} ++#ifdef VBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV ++ if ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0) ++ return true; + #endif ++ return false; ++} + + + SUPR0DECL(int) SUPR0PrintfV(const char *pszFormat, va_list va) + { + char szMsg[256]; ++ IPRT_FREEBSD_SAVE_EFL_AC(); ++ + RTStrPrintfV(szMsg, sizeof(szMsg), pszFormat, va); + szMsg[sizeof(szMsg) - 1] = '\0'; + + printf("%s", szMsg); ++ ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return 0; + } + + + SUPR0DECL(uint32_t) SUPR0GetKernelFeatures(void) + { +- return 0; ++ uint32_t fFlags = 0; ++#ifdef VBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV ++ if (g_VBoxDrvFreeBSDChrDevSwSys.d_ioctl == VBoxDrvFreeBSDIOCtlSMAP) ++ fFlags |= SUPKERNELFEATURES_SMAP; ++ else ++ Assert(!(ASMGetCR4() & X86_CR4_SMAP)); ++#endif ++ return fFlags; + } + + diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPLib-freebsd.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPLib-freebsd.cpp new file mode 100644 index 000000000000..11813244f938 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPLib-freebsd.cpp @@ -0,0 +1,11 @@ +--- src/VBox/HostDrivers/Support/freebsd/SUPLib-freebsd.cpp.orig 2025-08-13 19:51:09 UTC ++++ src/VBox/HostDrivers/Support/freebsd/SUPLib-freebsd.cpp +@@ -88,7 +88,7 @@ DECLHIDDEN(int) suplibOsInit(PSUPLIBDATA pThis, bool f + /* + * Try open the BSD device. + */ +- const char * const *pszDeviceNm = fFlags & SUPR3INIT_F_UNRESTRICTED ? DEVICE_NAME_SYS : DEVICE_NAME_USR; ++ const char * pszDeviceNm = fFlags & SUPR3INIT_F_UNRESTRICTED ? DEVICE_NAME_SYS : DEVICE_NAME_USR; + int hDevice = open(pszDeviceNm, O_RDWR, 0); + if (hDevice < 0) + { diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_freebsd_files__vboxdrv b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_freebsd_files__vboxdrv new file mode 100644 index 000000000000..013a5e605910 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_freebsd_files__vboxdrv @@ -0,0 +1,34 @@ +--- src/VBox/HostDrivers/Support/freebsd/files_vboxdrv.orig 2025-08-13 19:51:09 UTC ++++ src/VBox/HostDrivers/Support/freebsd/files_vboxdrv +@@ -71,6 +71,7 @@ FILES_VBOXDRV_NOBIN=" \ + ${PATH_ROOT}/include/iprt/stdarg.h=>include/iprt/stdarg.h \ + ${PATH_ROOT}/include/iprt/stdint.h=>include/iprt/stdint.h \ + ${PATH_ROOT}/include/iprt/string.h=>include/iprt/string.h \ ++ ${PATH_ROOT}/include/iprt/system.h=>include/iprt/system.h \ + ${PATH_ROOT}/include/iprt/thread.h=>include/iprt/thread.h \ + ${PATH_ROOT}/include/iprt/time.h=>include/iprt/time.h \ + ${PATH_ROOT}/include/iprt/timer.h=>include/iprt/timer.h \ +@@ -133,6 +134,7 @@ FILES_VBOXDRV_NOBIN=" \ + ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.cpp=>common/misc/handletable.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.h=>common/misc/handletable.h \ + ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletablectx.cpp=>common/misc/handletablectx.c \ ++ ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletablesimple.cpp=>common/misc/handletablesimple.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/misc/once.cpp=>common/misc/once.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/misc/term.cpp=>common/misc/term.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/misc/thread.cpp=>common/misc/thread.c \ +@@ -154,6 +156,7 @@ FILES_VBOXDRV_NOBIN=" \ + ${PATH_ROOT}/src/VBox/Runtime/common/string/strprintf2-ellipsis.cpp=>common/string/strprintf2-ellipsis.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/string/strtonum.cpp=>common/string/strtonum.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/string/memchr.cpp=>common/string/memchr.c \ ++ ${PATH_ROOT}/src/VBox/Runtime/common/string/utf-8.cpp=>common/string/utf-8.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/string/stringalloc.cpp=>common/string/stringalloc.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/rand/rand.cpp=>common/rand/rand.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/rand/randadv.cpp=>common/rand/randadv.c \ +@@ -200,6 +203,7 @@ FILES_VBOXDRV_NOBIN=" \ + ${PATH_ROOT}/src/VBox/Runtime/generic/RTMpOnPair-generic.cpp=>generic/RTMpOnPair-generic.c \ + ${PATH_ROOT}/src/VBox/Runtime/generic/errvars-generic.cpp=>generic/errvars-generic.c \ + ${PATH_ROOT}/src/VBox/Runtime/generic/mppresent-generic.cpp=>generic/mppresent-generic.c \ ++ ${PATH_ROOT}/src/VBox/Runtime/generic/system-page-size-generic.cpp=>generic/system-page-size-generic.c \ + ${PATH_ROOT}/src/VBox/Runtime/generic/timer-generic.cpp=>generic/timer-generic.c \ + ${PATH_ROOT}/src/VBox/Runtime/generic/uuid-generic.cpp=>generic/uuid-generic.c \ + ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-r0drv.cpp=>r0drv/alloc-r0drv.c \ diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_VBoxNetAdp_freebsd_Makefile b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_VBoxNetAdp_freebsd_Makefile new file mode 100644 index 000000000000..7275c942126d --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_VBoxNetAdp_freebsd_Makefile @@ -0,0 +1,11 @@ +--- src/VBox/HostDrivers/VBoxNetAdp/freebsd/Makefile.orig 2025-08-13 19:51:10 UTC ++++ src/VBox/HostDrivers/VBoxNetAdp/freebsd/Makefile +@@ -36,7 +36,7 @@ KMOD = vboxnetadp + + KMOD = vboxnetadp + +-CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -Iinclude -I. -Ir0drv -w -DVBOX_WITH_HARDENING -DVIMAGE ++CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING -DVBOX_WITH_64_BITS_GUESTS -DVIMAGE -Iinclude -I. -Ir0drv -w + + .if (${MACHINE_ARCH} == "i386") + CFLAGS += -DRT_ARCH_X86 diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_VBoxNetAdp_freebsd_VBoxNetAdp-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_VBoxNetAdp_freebsd_VBoxNetAdp-freebsd.c new file mode 100644 index 000000000000..8da432449fe1 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_VBoxNetAdp_freebsd_VBoxNetAdp-freebsd.c @@ -0,0 +1,147 @@ +--- src/VBox/HostDrivers/VBoxNetAdp/freebsd/VBoxNetAdp-freebsd.c.orig 2024-01-11 12:25:08 UTC ++++ src/VBox/HostDrivers/VBoxNetAdp/freebsd/VBoxNetAdp-freebsd.c +@@ -216,7 +216,11 @@ static void VBoxNetAdpFreeBSDNetinit(void *priv) + PVBOXNETADP pThis = priv; + struct ifnet *ifp = pThis->u.s.ifp; + ++#if __FreeBSD_version >= 1500000 ++ if_setdrvflagbits(ifp, IFF_DRV_RUNNING, 0); ++#else + ifp->if_drv_flags |= IFF_DRV_RUNNING; ++#endif + } + + /** +@@ -226,25 +230,46 @@ static void VBoxNetAdpFreeBSDNetstart(struct ifnet *if + */ + static void VBoxNetAdpFreeBSDNetstart(struct ifnet *ifp) + { ++#if __FreeBSD_version >= 1500000 ++ PVBOXNETADP pThis = if_getsoftc(ifp); ++#else + PVBOXNETADP pThis = ifp->if_softc; ++#endif + struct mbuf *m; + ++#if __FreeBSD_version >= 1500000 ++ if ((if_getdrvflags(ifp) & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) ++#else + if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) ++#endif + return; + ++#if __FreeBSD_version >= 1500000 ++ if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, 0); ++ while (!if_sendq_empty(ifp)) ++#else + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) ++#endif + { + #if __FreeBSD_version >= 1100036 + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + #else + ifp->if_opackets++; + #endif ++#if __FreeBSD_version >= 1500000 ++ m = if_dequeue(ifp); ++#else + IFQ_DRV_DEQUEUE(&ifp->if_snd, m); ++#endif + BPF_MTAP(ifp, m); + m_freem(m); + } ++#if __FreeBSD_version >= 1500000 ++ if_setdrvflagbits(ifp, 0, IFF_DRV_OACTIVE); ++#else + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; ++#endif + } + + /** +@@ -257,6 +282,18 @@ static int VBoxNetAdpFreeBSDNetioctl(struct ifnet *ifp + switch (cmd) + { + case SIOCSIFFLAGS: ++#if __FreeBSD_version >= 1500000 ++ if (if_getflags(ifp) & IFF_UP) ++ { ++ if (!(if_getdrvflags(ifp) & IFF_DRV_RUNNING)) ++ if_init(ifp, if_getsoftc(ifp)); ++ } ++ else ++ { ++ if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) ++ if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING); ++ } ++#else + if (ifp->if_flags & IFF_UP) + { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) +@@ -267,6 +304,7 @@ static int VBoxNetAdpFreeBSDNetioctl(struct ifnet *ifp + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + } ++#endif + break; + case SIOCGIFMEDIA: + { +@@ -301,7 +339,11 @@ int vboxNetAdpOsCreate(PVBOXNETADP pThis, PCRTMAC pMac + + int vboxNetAdpOsCreate(PVBOXNETADP pThis, PCRTMAC pMac) + { ++#if __FreeBSD_version >= 1500000 ++ if_t ifp; ++#else + struct ifnet *ifp; ++#endif + + VBOXCURVNET_SET_FROM_UCRED(); + ifp = if_alloc(IFT_ETHER); +@@ -309,6 +351,16 @@ int vboxNetAdpOsCreate(PVBOXNETADP pThis, PCRTMAC pMac + return VERR_NO_MEMORY; + + if_initname(ifp, VBOXNETADP_NAME, pThis->iUnit); ++#if __FreeBSD_version >= 1500000 ++ if_setsoftc(ifp, pThis); ++ if_setmtu(ifp, ETHERMTU); ++ if_setflagbits(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST, 0); ++ if_setioctlfn(ifp, VBoxNetAdpFreeBSDNetioctl); ++ if_setstartfn(ifp, VBoxNetAdpFreeBSDNetstart); ++ if_setinitfn(ifp, VBoxNetAdpFreeBSDNetinit); ++ if_setsendqlen(ifp, IFQ_MAXLEN); ++ if_setsendqready(ifp); ++#else + ifp->if_softc = pThis; + ifp->if_mtu = ETHERMTU; + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; +@@ -318,10 +370,17 @@ int vboxNetAdpOsCreate(PVBOXNETADP pThis, PCRTMAC pMac + IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); + ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_READY(&ifp->if_snd); ++#endif + ether_ifattach(ifp, (void *)pMac); ++#if __FreeBSD_version >= 1500000 ++ (void)if_setbaudrate(ifp, 0); ++ ++ strncpy(pThis->szName, if_name(ifp), VBOXNETADP_MAX_NAME_LEN); ++#else + ifp->if_baudrate = 0; + + strncpy(pThis->szName, ifp->if_xname, VBOXNETADP_MAX_NAME_LEN); ++#endif + pThis->u.s.ifp = ifp; + VBOXCURVNET_RESTORE(); + return 0; +@@ -332,7 +391,11 @@ void vboxNetAdpOsDestroy(PVBOXNETADP pThis) + struct ifnet *ifp; + + ifp = pThis->u.s.ifp; ++#if __FreeBSD_version >= 1500000 ++ VBOXCURVNET_SET(if_getvnet(ifp)); ++#else + VBOXCURVNET_SET(ifp->if_vnet); ++#endif + ether_ifdetach(ifp); + if_free(ifp); + VBOXCURVNET_RESTORE(); diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_VBoxNetFlt_Makefile.kmk b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_VBoxNetFlt_Makefile.kmk new file mode 100644 index 000000000000..1bf366252bc2 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_VBoxNetFlt_Makefile.kmk @@ -0,0 +1,11 @@ +--- src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk.orig 2025-08-13 19:51:11 UTC ++++ src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk +@@ -337,7 +337,7 @@ ifeq ($(KBUILD_TARGET),freebsd) + $(QUIET)$(RM) -f -- $@ + $(QUIET)$(CP) -f $< $@ + ifndef VBOX_WITH_HARDENING +- $(QUIET)$(SED) -e "s;VBOX_WITH_HARDENING;;g" --output $@.tmp $@ ++ $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@.tmp $@ + ${QUIET}$(MV) -f $@.tmp $@ + endif + ifndef VBOX_WITH_NETFLT_VIMAGE diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_VBoxNetFlt_freebsd_Makefile b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_VBoxNetFlt_freebsd_Makefile new file mode 100644 index 000000000000..e1db154e2347 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_VBoxNetFlt_freebsd_Makefile @@ -0,0 +1,11 @@ +--- src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile.orig 2025-08-13 19:51:11 UTC ++++ src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile +@@ -36,7 +36,7 @@ KMOD = vboxnetflt + + KMOD = vboxnetflt + +-CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -Iinclude -I. -Ir0drv -w -DVBOX_WITH_HARDENING -DVIMAGE ++CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING -DVBOX_WITH_64_BITS_GUESTS -DVIMAGE -Iinclude -I. -Ir0drv -w + + .if (${MACHINE_ARCH} == "i386") + CFLAGS += -DRT_ARCH_X86 diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_VBoxNetFlt_freebsd_VBoxNetFlt-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_VBoxNetFlt_freebsd_VBoxNetFlt-freebsd.c new file mode 100644 index 000000000000..6e3d40a42e43 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_VBoxNetFlt_freebsd_VBoxNetFlt-freebsd.c @@ -0,0 +1,471 @@ +--- src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c.orig 2024-01-11 12:25:08 UTC ++++ src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c +@@ -52,6 +52,7 @@ + #include <net/if_dl.h> + #include <net/if_types.h> + #include <net/ethernet.h> ++#include <net/if_vlan_var.h> + + #include <netgraph/ng_message.h> + #include <netgraph/netgraph.h> +@@ -73,6 +74,7 @@ + + #define VBOXNETFLT_OS_SPECFIC 1 + #include "../VBoxNetFltInternal.h" ++#include "freebsd/the-freebsd-kernel.h" + + static int vboxnetflt_modevent(struct module *, int, void *); + static ng_constructor_t ng_vboxnetflt_constructor; +@@ -149,6 +151,7 @@ MODULE_DEPEND(ng_vboxnetflt, vboxdrv, 1, 1, 1); + */ + MODULE_VERSION(vboxnetflt, 1); + MODULE_DEPEND(ng_vboxnetflt, vboxdrv, 1, 1, 1); ++MODULE_DEPEND(ng_vboxnetflt, ng_ether, 1, 1, 1); + + /** + * The (common) global data. +@@ -181,8 +184,6 @@ static int vboxnetflt_modevent(struct module *pMod, in + printf("vboxNetFltInitGlobalsAndIdc failed %d\n", rc); + return RTErrConvertToErrno(rc); + } +- /* No MODULE_VERSION in ng_ether so we can't MODULE_DEPEND it */ +- kern_kldload(curthread, "ng_ether", NULL); + break; + + case MOD_UNLOAD: +@@ -334,12 +335,20 @@ static int ng_vboxnetflt_rcvdata(hook_p hook, item_p i + { + const node_p node = NG_HOOK_NODE(hook); + PVBOXNETFLTINS pThis = NG_NODE_PRIVATE(node); ++#if __FreeBSD_version >= 1500000 ++ if_t ifp = pThis->u.s.ifp; ++#else + struct ifnet *ifp = pThis->u.s.ifp; ++#endif + struct mbuf *m; + struct m_tag *mtag; + bool fActive; + ++#if __FreeBSD_version >= 1500000 ++ VBOXCURVNET_SET(if_getvnet(ifp)); ++#else + VBOXCURVNET_SET(ifp->if_vnet); ++#endif + fActive = vboxNetFltTryRetainBusyActive(pThis); + + NGI_GET_M(item, m); +@@ -361,7 +370,14 @@ static int ng_vboxnetflt_rcvdata(hook_p hook, item_p i + { + if (mtag != NULL || !fActive) + { ++#if __FreeBSD_version >= 1300049 ++ struct epoch_tracker et; ++ NET_EPOCH_ENTER(et); ++#endif + ether_demux(ifp, m); ++#if __FreeBSD_version >= 1300049 ++ NET_EPOCH_EXIT(et); ++#endif + if (fActive) + vboxNetFltRelease(pThis, true /*fBusy*/); + VBOXCURVNET_RESTORE(); +@@ -433,12 +449,22 @@ static void vboxNetFltFreeBSDinput(void *arg, int pend + { + PVBOXNETFLTINS pThis = (PVBOXNETFLTINS)arg; + struct mbuf *m, *m0; ++#if __FreeBSD_version >= 1500000 ++ if_t ifp = pThis->u.s.ifp; ++#else + struct ifnet *ifp = pThis->u.s.ifp; ++#endif + unsigned int cSegs = 0; + bool fDropIt = false, fActive; ++ bool is_vl_tagged = false; ++ uint16_t vl_tag; + PINTNETSG pSG; + ++#if __FreeBSD_version >= 1500000 ++ VBOXCURVNET_SET(if_getvnet(ifp)); ++#else + VBOXCURVNET_SET(ifp->if_vnet); ++#endif + vboxNetFltRetain(pThis, true /* fBusy */); + for (;;) + { +@@ -448,6 +474,19 @@ static void vboxNetFltFreeBSDinput(void *arg, int pend + if (m == NULL) + break; + ++ /* Prepend a VLAN header for consumption by the virtual switch */ ++ if (m->m_flags & M_VLANTAG) { ++ vl_tag = m->m_pkthdr.ether_vtag; ++ is_vl_tagged = true; ++ ++ m = ether_vlanencap(m, m->m_pkthdr.ether_vtag); ++ if (m == NULL) { ++ printf("vboxflt: unable to prepend VLAN header\n"); ++ break; ++ } ++ m->m_flags &= ~M_VLANTAG; ++ } ++ + for (m0 = m; m0 != NULL; m0 = m0->m_next) + if (m0->m_len > 0) + cSegs++; +@@ -462,10 +501,39 @@ static void vboxNetFltFreeBSDinput(void *arg, int pend + vboxNetFltFreeBSDMBufToSG(pThis, m, pSG, cSegs, 0); + fDropIt = pThis->pSwitchPort->pfnRecv(pThis->pSwitchPort, NULL /* pvIf */, pSG, INTNETTRUNKDIR_WIRE); + RTMemTmpFree(pSG); ++ ++ /* Restore the VLAN flags before re-injecting the packet */ ++ if (is_vl_tagged && !fDropIt) { ++ struct ether_vlan_header *vl_hdr; ++ ++ /* This shouldn't fail, as the header was just prepended */ ++ if (m->m_len < sizeof(*vl_hdr) && (m = m_pullup(m, sizeof(*vl_hdr))) == NULL) { ++ printf("vboxflt: unable to pullup VLAN header\n"); ++ m_freem(m); ++ break; ++ } ++ ++ /* Copy the MAC dhost/shost over the 802.1q field */ ++ vl_hdr = mtod(m, struct ether_vlan_header *); ++ bcopy((char *)vl_hdr, (char *)vl_hdr + ETHER_VLAN_ENCAP_LEN, ETHER_HDR_LEN - ETHER_TYPE_LEN); ++ m_adj(m, ETHER_VLAN_ENCAP_LEN); ++ ++ m->m_pkthdr.ether_vtag = vl_tag; ++ m->m_flags |= M_VLANTAG; ++ } ++ + if (fDropIt) + m_freem(m); +- else ++ else { ++#if __FreeBSD_version >= 1300049 ++ struct epoch_tracker et; ++ NET_EPOCH_ENTER(et); ++#endif + ether_demux(ifp, m); ++#if __FreeBSD_version >= 1300049 ++ NET_EPOCH_EXIT(et); ++#endif ++ } + } + vboxNetFltRelease(pThis, true /* fBusy */); + VBOXCURVNET_RESTORE(); +@@ -478,12 +546,20 @@ static void vboxNetFltFreeBSDoutput(void *arg, int pen + { + PVBOXNETFLTINS pThis = (PVBOXNETFLTINS)arg; + struct mbuf *m, *m0; ++#if __FreeBSD_version >= 1500000 ++ if_t ifp = pThis->u.s.ifp; ++#else + struct ifnet *ifp = pThis->u.s.ifp; ++#endif + unsigned int cSegs = 0; + bool fDropIt = false, fActive; + PINTNETSG pSG; + ++#if __FreeBSD_version >= 1500000 ++ VBOXCURVNET_SET(if_getvnet(ifp)); ++#else + VBOXCURVNET_SET(ifp->if_vnet); ++#endif + vboxNetFltRetain(pThis, true /* fBusy */); + for (;;) + { +@@ -521,26 +597,41 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p + */ + int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *pvIfData, PINTNETSG pSG, uint32_t fDst) + { ++ IPRT_FREEBSD_SAVE_EFL_AC(); + NOREF(pvIfData); + + void (*input_f)(struct ifnet *, struct mbuf *); ++#if __FreeBSD_version >= 1500000 ++ if_t ifp; ++#else + struct ifnet *ifp; ++#endif + struct mbuf *m; + struct m_tag *mtag; + bool fActive; + int error; + + ifp = ASMAtomicUoReadPtrT(&pThis->u.s.ifp, struct ifnet *); ++#if __FreeBSD_version >= 1500000 ++ VBOXCURVNET_SET(if_getvnet(ifp)); ++#else + VBOXCURVNET_SET(ifp->if_vnet); ++#endif + + if (fDst & INTNETTRUNKDIR_WIRE) + { + m = vboxNetFltFreeBSDSGMBufFromSG(pThis, pSG); + if (m == NULL) ++ { ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VERR_NO_MEMORY; ++ } + m = m_pullup(m, ETHER_HDR_LEN); + if (m == NULL) ++ { ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VERR_NO_MEMORY; ++ } + + m->m_flags |= M_PKTHDR; + ether_output_frame(ifp, m); +@@ -550,10 +641,16 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p + { + m = vboxNetFltFreeBSDSGMBufFromSG(pThis, pSG); + if (m == NULL) ++ { ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VERR_NO_MEMORY; ++ } + m = m_pullup(m, ETHER_HDR_LEN); + if (m == NULL) ++ { ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VERR_NO_MEMORY; ++ } + /* + * Delivering packets to the host will be captured by the + * input hook. Tag the packet with a mbuf tag so that we +@@ -564,6 +661,7 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p + if (mtag == NULL) + { + m_freem(m); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VERR_NO_MEMORY; + } + +@@ -571,9 +669,21 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p + m_tag_prepend(m, mtag); + m->m_flags |= M_PKTHDR; + m->m_pkthdr.rcvif = ifp; ++#if __FreeBSD_version >= 1300049 ++ struct epoch_tracker et; ++ NET_EPOCH_ENTER(et); ++#endif ++#if __FreeBSD_version >= 1500000 ++ if_input(ifp, m); ++#else + ifp->if_input(ifp, m); ++#endif ++#if __FreeBSD_version >= 1300049 ++ NET_EPOCH_EXIT(et); ++#endif + } + VBOXCURVNET_RESTORE(); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VINF_SUCCESS; + } + +@@ -586,15 +696,23 @@ int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, voi + + int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, void *pvContext) + { ++ IPRT_FREEBSD_SAVE_EFL_AC(); + char nam[NG_NODESIZ]; ++#if __FreeBSD_version >= 1500000 ++ if_t ifp; ++#else + struct ifnet *ifp; ++#endif + node_p node; + + VBOXCURVNET_SET_FROM_UCRED(); + NOREF(pvContext); + ifp = ifunit(pThis->szName); + if (ifp == NULL) ++ { ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VERR_INTNET_FLT_IF_NOT_FOUND; ++ } + + /* Create a new netgraph node for this instance */ + if (ng_make_node_common(&ng_vboxnetflt_typestruct, &node) != 0) +@@ -604,7 +722,11 @@ int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, voi + + ASMAtomicUoWritePtr(&pThis->u.s.ifp, ifp); + pThis->u.s.node = node; ++#if __FreeBSD_version >= 1500000 ++ bcopy(if_getlladdr(ifp), &pThis->u.s.MacAddr, ETHER_ADDR_LEN); ++#else + bcopy(IF_LLADDR(ifp), &pThis->u.s.MacAddr, ETHER_ADDR_LEN); ++#endif + ASMAtomicUoWriteBool(&pThis->fDisconnectedFromHost, false); + + /* Initialize deferred input queue */ +@@ -638,16 +760,26 @@ int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, voi + vboxNetFltRelease(pThis, true /*fBusy*/); + } + VBOXCURVNET_RESTORE(); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + + return VINF_SUCCESS; + } + + bool vboxNetFltOsMaybeRediscovered(PVBOXNETFLTINS pThis) + { ++ IPRT_FREEBSD_SAVE_EFL_AC(); ++#if __FreeBSD_version >= 1500000 ++ if_t ifp, ifp0; ++#else + struct ifnet *ifp, *ifp0; ++#endif + + ifp = ASMAtomicUoReadPtrT(&pThis->u.s.ifp, struct ifnet *); ++#if __FreeBSD_version >= 1500000 ++ VBOXCURVNET_SET(if_getvnet(ifp)); ++#else + VBOXCURVNET_SET(ifp->if_vnet); ++#endif + /* + * Attempt to check if the interface is still there and re-initialize if + * something has changed. +@@ -660,6 +792,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOXNETFLTINS pThi + pThis->u.s.node = NULL; + } + VBOXCURVNET_RESTORE(); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + + if (ifp0 != NULL) + { +@@ -672,6 +805,7 @@ void vboxNetFltOsDeleteInstance(PVBOXNETFLTINS pThis) + + void vboxNetFltOsDeleteInstance(PVBOXNETFLTINS pThis) + { ++ IPRT_FREEBSD_SAVE_EFL_AC(); + + taskqueue_drain(taskqueue_fast, &pThis->u.s.tskin); + taskqueue_drain(taskqueue_fast, &pThis->u.s.tskout); +@@ -684,6 +818,7 @@ void vboxNetFltOsDeleteInstance(PVBOXNETFLTINS pThis) + ng_rmnode_self(pThis->u.s.node); + VBOXCURVNET_RESTORE(); + pThis->u.s.node = NULL; ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + } + + int vboxNetFltOsPreInitInstance(PVBOXNETFLTINS pThis) +@@ -697,7 +832,12 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b + + void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, bool fActive) + { ++ IPRT_FREEBSD_SAVE_EFL_AC(); ++#if __FreeBSD_version >= 1500000 ++ if_t ifp; ++#else + struct ifnet *ifp; ++#endif + struct ifreq ifreq; + int error; + node_p node; +@@ -709,18 +849,30 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b + Log(("%s: fActive:%d\n", __func__, fActive)); + + ifp = ASMAtomicUoReadPtrT(&pThis->u.s.ifp, struct ifnet *); ++#if __FreeBSD_version >= 1500000 ++ VBOXCURVNET_SET(if_getvnet(ifp)); ++#else + VBOXCURVNET_SET(ifp->if_vnet); ++#endif + node = ASMAtomicUoReadPtrT(&pThis->u.s.node, node_p); + + memset(&ifreq, 0, sizeof(struct ifreq)); + /* Activate interface */ + if (fActive) + { ++#if __FreeBSD_version >= 1500000 ++ pThis->u.s.flags = if_getflags(ifp); ++#else + pThis->u.s.flags = ifp->if_flags; ++#endif + ifpromisc(ifp, 1); + + /* ng_ether nodes are named after the interface name */ ++#if __FreeBSD_version >= 1500000 ++ snprintf(path, sizeof(path), "%s:", if_name(ifp)); ++#else + snprintf(path, sizeof(path), "%s:", ifp->if_xname); ++#endif + + /* + * Send a netgraph connect message to the ng_ether node +@@ -730,9 +882,16 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b + NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_CONNECT, + sizeof(struct ngm_connect), M_NOWAIT); + if (msg == NULL) ++ { ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return; ++ } + con = (struct ngm_connect *)msg->data; ++#if __FreeBSD_version >= 1500000 ++ snprintf(con->path, NG_PATHSIZ, "vboxnetflt_%s:", if_name(ifp)); ++#else + snprintf(con->path, NG_PATHSIZ, "vboxnetflt_%s:", ifp->if_xname); ++#endif + strlcpy(con->ourhook, "lower", NG_HOOKSIZ); + strlcpy(con->peerhook, "input", NG_HOOKSIZ); + NG_SEND_MSG_PATH(error, node, msg, path, 0); +@@ -744,10 +903,17 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b + NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_CONNECT, + sizeof(struct ngm_connect), M_NOWAIT); + if (msg == NULL) ++ { ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return; ++ } + con = (struct ngm_connect *)msg->data; + snprintf(con->path, NG_PATHSIZ, "vboxnetflt_%s:", ++#if __FreeBSD_version >= 1500000 ++ if_name(ifp)); ++#else + ifp->if_xname); ++#endif + strlcpy(con->ourhook, "upper", sizeof(con->ourhook)); + strlcpy(con->peerhook, "output", sizeof(con->peerhook)); + NG_SEND_MSG_PATH(error, node, msg, path, 0); +@@ -759,7 +925,11 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b + ifpromisc(ifp, 0); + + /* Disconnect msgs are addressed to ourself */ ++#if __FreeBSD_version >= 1500000 ++ snprintf(path, sizeof(path), "vboxnetflt_%s:", if_name(ifp)); ++#else + snprintf(path, sizeof(path), "vboxnetflt_%s:", ifp->if_xname); ++#endif + + /* + * Send a netgraph message to disconnect our 'input' hook +@@ -767,7 +937,10 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b + NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_RMHOOK, + sizeof(struct ngm_rmhook), M_NOWAIT); + if (msg == NULL) ++ { ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return; ++ } + rm = (struct ngm_rmhook *)msg->data; + strlcpy(rm->ourhook, "input", NG_HOOKSIZ); + NG_SEND_MSG_PATH(error, node, msg, path, 0); +@@ -778,12 +951,16 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b + NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_RMHOOK, + sizeof(struct ngm_rmhook), M_NOWAIT); + if (msg == NULL) ++ { ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return; ++ } + rm = (struct ngm_rmhook *)msg->data; + strlcpy(rm->ourhook, "output", NG_HOOKSIZ); + NG_SEND_MSG_PATH(error, node, msg, path, 0); + } + VBOXCURVNET_RESTORE(); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + } + + int vboxNetFltOsDisconnectIt(PVBOXNETFLTINS pThis) diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_adpctl_VBoxNetAdpCtl.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_adpctl_VBoxNetAdpCtl.cpp new file mode 100644 index 000000000000..2c13b666afaf --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_adpctl_VBoxNetAdpCtl.cpp @@ -0,0 +1,11 @@ +--- src/VBox/HostDrivers/adpctl/VBoxNetAdpCtl.cpp.orig 2025-08-13 19:51:12 UTC ++++ src/VBox/HostDrivers/adpctl/VBoxNetAdpCtl.cpp +@@ -759,7 +759,7 @@ int Adapter::doIOCtl(unsigned long iCmd, VBOXNETADPREQ + * Global config file implementation * + *********************************************************************************************************************************/ + +-#define VBOX_GLOBAL_NETWORK_CONFIG_PATH "/etc/vbox/networks.conf" ++#define VBOX_GLOBAL_NETWORK_CONFIG_PATH "%%VBOX_ETC%%/networks.conf" + #define VBOXNET_DEFAULT_IPV4MASK "255.255.255.0" + + class NetworkAddress diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Main_Makefile.kmk b/emulators/virtualbox-ose-72/files/patch-src_VBox_Main_Makefile.kmk new file mode 100644 index 000000000000..48ced38ac98c --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Main_Makefile.kmk @@ -0,0 +1,10 @@ +--- src/VBox/Main/Makefile.kmk.orig 2025-08-13 19:51:19 UTC ++++ src/VBox/Main/Makefile.kmk +@@ -771,6 +771,7 @@ if !defined(VBOX_ONLY_SDK) && !defined(VBOX_ONLY_EXTPA + + VBoxSVC_SOURCES.freebsd = \ + src-server/freebsd/HostHardwareFreeBSD.cpp \ ++ $(if $(VBOX_WITH_DBUS),src-server/linux/HostPowerLinux.cpp) \ + src-server/HostDnsServiceResolvConf.cpp + + VBoxSVC_LDFLAGS.freebsd += -lcam diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Main_include_HostPower.h b/emulators/virtualbox-ose-72/files/patch-src_VBox_Main_include_HostPower.h new file mode 100644 index 000000000000..90bd737f000d --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Main_include_HostPower.h @@ -0,0 +1,20 @@ +--- src/VBox/Main/include/HostPower.h.orig 2025-08-13 19:51:21 UTC ++++ src/VBox/Main/include/HostPower.h +@@ -41,7 +41,7 @@ + + #include <vector> + +-#ifdef RT_OS_LINUX ++#if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) + # include <VBox/dbus.h> + #endif + +@@ -77,7 +77,7 @@ class HostPowerServiceWin : public HostPowerService (p + RTTHREAD mThread; + }; + # endif +-# if defined(RT_OS_LINUX) || defined(DOXYGEN_RUNNING) ++# if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) || defined(DOXYGEN_RUNNING) + /** + * The Linux hosted Power Service. + */ diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Main_src-server_HostImpl.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_Main_src-server_HostImpl.cpp new file mode 100644 index 000000000000..3327edf47c79 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Main_src-server_HostImpl.cpp @@ -0,0 +1,11 @@ +--- src/VBox/Main/src-server/HostImpl.cpp.orig 2025-08-13 19:51:26 UTC ++++ src/VBox/Main/src-server/HostImpl.cpp +@@ -339,7 +339,7 @@ HRESULT Host::init(VirtualBox *aParent) + + #if defined(RT_OS_WINDOWS) + m->pHostPowerService = new HostPowerServiceWin(m->pParent); +-#elif defined(RT_OS_LINUX) && defined(VBOX_WITH_DBUS) ++#elif (defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD)) && defined(VBOX_WITH_DBUS) + m->pHostPowerService = new HostPowerServiceLinux(m->pParent); + #elif defined(RT_OS_DARWIN) + m->pHostPowerService = new HostPowerServiceDarwin(m->pParent); diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Main_src-server_freebsd_PerformanceFreeBSD.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_Main_src-server_freebsd_PerformanceFreeBSD.cpp new file mode 100644 index 000000000000..ec8a2226f1c9 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Main_src-server_freebsd_PerformanceFreeBSD.cpp @@ -0,0 +1,24 @@ +--- src/VBox/Main/src-server/freebsd/PerformanceFreeBSD.cpp.orig 2025-08-13 19:51:28 UTC ++++ src/VBox/Main/src-server/freebsd/PerformanceFreeBSD.cpp +@@ -90,8 +90,10 @@ int CollectorFreeBSD::getHostMemoryUsage(ULONG *total, + cbParameter = sizeof(cPagesMemInactive); + if (!sysctlbyname("vm.stats.vm.v_inactive_count", &cPagesMemInactive, &cbParameter, NULL, 0)) + cProcessed++; ++#if __FreeBSD_version < 1200016 + cbParameter = sizeof(cPagesMemCached); + if (!sysctlbyname("vm.stats.vm.v_cache_count", &cPagesMemCached, &cbParameter, NULL, 0)) ++#endif + cProcessed++; + cbParameter = sizeof(cbPage); + if (!sysctlbyname("hw.pagesize", &cbPage, &cbParameter, NULL, 0)) +@@ -100,8 +102,8 @@ int CollectorFreeBSD::getHostMemoryUsage(ULONG *total, + if (cProcessed == 6) + { + *total = cbMemPhys / _1K; +- *used = cPagesMemUsed * (cbPage / _1K); +- *available = (cPagesMemFree + cPagesMemInactive + cPagesMemCached ) * (cbPage / _1K); ++ *used = (uint64_t)cPagesMemUsed * (cbPage / _1K); ++ *available = ((uint64_t)cPagesMemFree + cPagesMemInactive + cPagesMemCached) * (cbPage / _1K); + } + else + vrc = VERR_NOT_SUPPORTED; diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_Makefile.kmk b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_Makefile.kmk new file mode 100644 index 000000000000..7d80c20cb908 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_Makefile.kmk @@ -0,0 +1,29 @@ +--- src/VBox/Runtime/Makefile.kmk.orig 2025-08-28 22:09:24 UTC ++++ src/VBox/Runtime/Makefile.kmk +@@ -233,6 +233,9 @@ $(IPRT_OUT_DIR)/oiddb.h.ts +| $(IPRT_OUT_DIR)/oiddb.h: + $(QUIET)$(oiddb2c_1_TARGET) "$@" $(filter %.cfg,$^) + $(QUIET)$(CP) --changed -fv "$@" "$(IPRT_OUT_DIR)/oiddb.h" + ++# Set the defines that utf8-posix.cpp needs. It's used by several targets. ++# ++r3/posix/utf8-posix.cpp_DEFS.freebsd = $(VBOX_ICONV_DEFS) + + # + # Unicode Specification reader used to regenerate unidata-*.cpp. +@@ -1516,6 +1519,7 @@ RuntimeBaseR3_SOURCES.freebsd = \ + generic/RTProcDaemonize-generic.cpp \ + generic/RTProcIsRunningByName-generic.cpp \ + generic/RTThreadGetNativeState-generic.cpp \ ++ generic/system-page-size-generic.cpp \ + r3/freebsd/fileaio-freebsd.cpp \ + r3/freebsd/RTFileQuerySectorSize-freebsd.cpp \ + r3/freebsd/mp-freebsd.cpp \ +@@ -3072,6 +3076,8 @@ VBoxRT_LDFLAGS.win = /MANIFEST \ + /delayload:ole32.dll \ + /delayload:oleaut32.dll \ + /delayload:advapi32.dll ++VBoxRT_LDFLAGS.freebsd = \ ++ -Wl,--allow-multiple-definition + + if1of (VBoxRT, $(DLLS)) + $(call VBOX_SET_VER_INFO_DLL,VBoxRT,VirtualBox Runtime) diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_alloc-r0drv-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_alloc-r0drv-freebsd.c new file mode 100644 index 000000000000..564b70a0f108 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_alloc-r0drv-freebsd.c @@ -0,0 +1,58 @@ +--- src/VBox/Runtime/r0drv/freebsd/alloc-r0drv-freebsd.c.orig 2025-08-13 19:51:51 UTC ++++ src/VBox/Runtime/r0drv/freebsd/alloc-r0drv-freebsd.c +@@ -88,6 +88,7 @@ DECLHIDDEN(int) rtR0MemAllocEx(size_t cb, uint32_t fFl + + DECLHIDDEN(int) rtR0MemAllocEx(size_t cb, uint32_t fFlags, PRTMEMHDR *ppHdr) + { ++ IPRT_FREEBSD_SAVE_EFL_AC(); + size_t cbAllocated = cb; + PRTMEMHDR pHdr = (PRTMEMHDR)malloc(cb + sizeof(RTMEMHDR), M_IPRTHEAP, + fFlags & RTMEMHDR_FLAG_ZEROED ? M_NOWAIT | M_ZERO : M_NOWAIT); +@@ -99,21 +100,28 @@ DECLHIDDEN(int) rtR0MemAllocEx(size_t cb, uint32_t fFl + pHdr->cbReq = cb; + + *ppHdr = pHdr; ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VINF_SUCCESS; +- } ++ } ++ ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VERR_NO_MEMORY; + } + + + DECLHIDDEN(void) rtR0MemFree(PRTMEMHDR pHdr) + { ++ IPRT_FREEBSD_SAVE_EFL_AC(); ++ + pHdr->u32Magic += 1; + free(pHdr, M_IPRTHEAP); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + } + + + RTR0DECL(void *) RTMemContAlloc(PRTCCPHYS pPhys, size_t cb) + { ++ IPRT_FREEBSD_SAVE_EFL_AC(); + void *pv; + + /* +@@ -138,6 +146,7 @@ RTR0DECL(void *) RTMemContAlloc(PRTCCPHYS pPhys, size_ + *pPhys = vtophys(pv); + Assert(!(*pPhys & PAGE_OFFSET_MASK)); + } ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return pv; + } + +@@ -147,7 +156,9 @@ RTR0DECL(void) RTMemContFree(void *pv, size_t cb) + if (pv) + { + AssertMsg(!((uintptr_t)pv & PAGE_OFFSET_MASK), ("pv=%p\n", pv)); ++ IPRT_FREEBSD_SAVE_EFL_AC(); + contigfree(pv, cb, M_IPRTCONT); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + } + } + diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_assert-r0drv-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_assert-r0drv-freebsd.c new file mode 100644 index 000000000000..53f7659961b2 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_assert-r0drv-freebsd.c @@ -0,0 +1,29 @@ +--- src/VBox/Runtime/r0drv/freebsd/assert-r0drv-freebsd.c.orig 2025-08-13 19:51:51 UTC ++++ src/VBox/Runtime/r0drv/freebsd/assert-r0drv-freebsd.c +@@ -78,15 +78,18 @@ DECLHIDDEN(void) rtR0AssertNativeMsg1(const char *pszE + + DECLHIDDEN(void) rtR0AssertNativeMsg1(const char *pszExpr, unsigned uLine, const char *pszFile, const char *pszFunction) + { ++ IPRT_FREEBSD_SAVE_EFL_AC(); + printf("\r\n!!Assertion Failed!!\r\n" + "Expression: %s\r\n" + "Location : %s(%d) %s\r\n", + pszExpr, pszFile, uLine, pszFunction); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + } + + + DECLHIDDEN(void) rtR0AssertNativeMsg2V(bool fInitial, const char *pszFormat, va_list va) + { ++ IPRT_FREEBSD_SAVE_EFL_AC(); + char szMsg[256]; + + RTStrPrintfV(szMsg, sizeof(szMsg) - 1, pszFormat, va); +@@ -94,6 +97,7 @@ DECLHIDDEN(void) rtR0AssertNativeMsg2V(bool fInitial, + printf("%s", szMsg); + + NOREF(fInitial); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + } + + diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_memobj-r0drv-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_memobj-r0drv-freebsd.c new file mode 100644 index 000000000000..4c0ed355709c --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_memobj-r0drv-freebsd.c @@ -0,0 +1,408 @@ +--- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig 2025-04-14 17:59:13 UTC ++++ src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c +@@ -140,8 +140,10 @@ DECLHIDDEN(int) rtR0MemObjNativeFree(RTR0MEMOBJ pMem) + + DECLHIDDEN(int) rtR0MemObjNativeFree(RTR0MEMOBJ pMem) + { ++ IPRT_FREEBSD_SAVE_EFL_AC(); + PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)pMem; + int rc; ++ vm_map_t pMap; + + switch (pMemFreeBSD->Core.enmType) + { +@@ -156,8 +158,6 @@ DECLHIDDEN(int) rtR0MemObjNativeFree(RTR0MEMOBJ pMem) + + case RTR0MEMOBJTYPE_LOCK: + { +- vm_map_t pMap = kernel_map; +- + if (pMemFreeBSD->Core.u.Lock.R0Process != NIL_RTR0PROCESS) + pMap = &((struct proc *)pMemFreeBSD->Core.u.Lock.R0Process)->p_vmspace->vm_map; + +@@ -198,6 +198,7 @@ DECLHIDDEN(int) rtR0MemObjNativeFree(RTR0MEMOBJ pMem) + case RTR0MEMOBJTYPE_PHYS_NC: + { + VM_OBJECT_WLOCK(pMemFreeBSD->pObject); ++#if __FreeBSD_version < 1500038 + vm_page_t pPage = vm_page_find_least(pMemFreeBSD->pObject, 0); + #if __FreeBSD_version < 1000000 + vm_page_lock_queues(); +@@ -211,6 +212,14 @@ DECLHIDDEN(int) rtR0MemObjNativeFree(RTR0MEMOBJ pMem) + #if __FreeBSD_version < 1000000 + vm_page_unlock_queues(); + #endif ++#else /* __FreeBSD_version >= 1500038 */ ++ struct pctrie_iter pages; ++ vm_page_t page; ++ ++ vm_page_iter_init(&pages, pMemFreeBSD->pObject); ++ VM_RADIX_FORALL(page, &pages) ++ (void)vm_page_unwire_noq(page); ++#endif + VM_OBJECT_WUNLOCK(pMemFreeBSD->pObject); + vm_object_deallocate(pMemFreeBSD->pObject); + break; +@@ -221,6 +230,7 @@ DECLHIDDEN(int) rtR0MemObjNativeFree(RTR0MEMOBJ pMem) + return VERR_INTERNAL_ERROR; + } + ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VINF_SUCCESS; + } + +@@ -330,7 +340,8 @@ static int rtR0MemObjFreeBSDAllocHelper(PRTR0MEMOBJFRE + size_t cPages = atop(pMemFreeBSD->Core.cb); + int rc; + +- pMemFreeBSD->pObject = vm_object_allocate(OBJT_PHYS, cPages); ++ pMemFreeBSD->pObject = vm_pager_allocate(OBJT_PHYS, NULL, ++ pMemFreeBSD->Core.cb, VM_PROT_ALL, 0, curthread->td_ucred); + + /* No additional object reference for auto-deallocation upon unmapping. */ + #if __FreeBSD_version >= 1000055 +@@ -372,6 +383,7 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocPage(PPRTR0MEMOBJ + + DECLHIDDEN(int) rtR0MemObjNativeAllocPage(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable, const char *pszTag) + { ++ IPRT_FREEBSD_SAVE_EFL_AC(); + PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)rtR0MemObjNew(sizeof(*pMemFreeBSD), RTR0MEMOBJTYPE_PAGE, + NULL, cb, pszTag); + if (pMemFreeBSD) +@@ -381,8 +393,10 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocPage(PPRTR0MEMOBJ + *ppMem = &pMemFreeBSD->Core; + else + rtR0MemObjDelete(&pMemFreeBSD->Core); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return rc; + } ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VERR_NO_MEMORY; + } + +@@ -396,6 +410,7 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocLow(PPRTR0MEMOBJI + + DECLHIDDEN(int) rtR0MemObjNativeAllocLow(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable, const char *pszTag) + { ++ IPRT_FREEBSD_SAVE_EFL_AC(); + PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)rtR0MemObjNew(sizeof(*pMemFreeBSD), RTR0MEMOBJTYPE_LOW, NULL, cb, pszTag); + if (pMemFreeBSD) + { +@@ -404,8 +419,10 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocLow(PPRTR0MEMOBJI + *ppMem = &pMemFreeBSD->Core; + else + rtR0MemObjDelete(&pMemFreeBSD->Core); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return rc; + } ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VERR_NO_MEMORY; + } + +@@ -413,6 +430,7 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocCont(PPRTR0MEMOBJ + DECLHIDDEN(int) rtR0MemObjNativeAllocCont(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHigest, + bool fExecutable, const char *pszTag) + { ++ IPRT_FREEBSD_SAVE_EFL_AC(); + PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)rtR0MemObjNew(sizeof(*pMemFreeBSD), RTR0MEMOBJTYPE_CONT, + NULL, cb, pszTag); + if (pMemFreeBSD) +@@ -425,8 +443,10 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocCont(PPRTR0MEMOBJ + } + else + rtR0MemObjDelete(&pMemFreeBSD->Core); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return rc; + } ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VERR_NO_MEMORY; + } + +@@ -434,6 +454,7 @@ static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOB + static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJTYPE enmType, size_t cb, RTHCPHYS PhysHighest, + size_t uAlignment, bool fContiguous, int rcNoMem, const char *pszTag) + { ++ IPRT_FREEBSD_SAVE_EFL_AC(); + /* create the object. */ + PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)rtR0MemObjNew(sizeof(*pMemFreeBSD), enmType, NULL, cb, pszTag); + if (pMemFreeBSD) +@@ -441,7 +462,8 @@ static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOB + vm_paddr_t const VmPhysAddrHigh = PhysHighest != NIL_RTHCPHYS ? PhysHighest : ~(vm_paddr_t)0; + u_long const cPages = atop(cb); + +- pMemFreeBSD->pObject = vm_object_allocate(OBJT_PHYS, cPages); ++ pMemFreeBSD->pObject = vm_pager_allocate(OBJT_PHYS, NULL, ++ pMemFreeBSD->Core.cb, VM_PROT_ALL, 0, curthread->td_ucred); + + int rc = rtR0MemObjFreeBSDPhysAllocHelper(pMemFreeBSD->pObject, cPages, VmPhysAddrHigh, + uAlignment, fContiguous, true, rcNoMem); +@@ -451,7 +473,7 @@ static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOB + { + Assert(enmType == RTR0MEMOBJTYPE_PHYS); + VM_OBJECT_WLOCK(pMemFreeBSD->pObject); +- pMemFreeBSD->Core.u.Phys.PhysBase = VM_PAGE_TO_PHYS(vm_page_find_least(pMemFreeBSD->pObject, 0)); ++ pMemFreeBSD->Core.u.Phys.PhysBase = VM_PAGE_TO_PHYS(vm_radix_lookup_ge(&pMemFreeBSD->pObject->rtree, 0)); + VM_OBJECT_WUNLOCK(pMemFreeBSD->pObject); + pMemFreeBSD->Core.u.Phys.fAllocated = true; + } +@@ -464,8 +486,10 @@ static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOB + vm_object_deallocate(pMemFreeBSD->pObject); + rtR0MemObjDelete(&pMemFreeBSD->Core); + } ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return rc; + } ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VERR_NO_MEMORY; + } + +@@ -488,6 +512,7 @@ DECLHIDDEN(int) rtR0MemObjNativeEnterPhys(PPRTR0MEMOBJ + const char *pszTag) + { + AssertReturn(uCachePolicy == RTMEM_CACHE_POLICY_DONT_CARE, VERR_NOT_SUPPORTED); ++ IPRT_FREEBSD_SAVE_EFL_AC(); + + /* create the object. */ + PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)rtR0MemObjNew(sizeof(*pMemFreeBSD), RTR0MEMOBJTYPE_PHYS, +@@ -499,8 +524,10 @@ DECLHIDDEN(int) rtR0MemObjNativeEnterPhys(PPRTR0MEMOBJ + pMemFreeBSD->Core.u.Phys.PhysBase = Phys; + pMemFreeBSD->Core.u.Phys.uCachePolicy = uCachePolicy; + *ppMem = &pMemFreeBSD->Core; ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VINF_SUCCESS; + } ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VERR_NO_MEMORY; + } + +@@ -512,6 +539,7 @@ static int rtR0MemObjNativeLockInMap(PPRTR0MEMOBJINTER + vm_offset_t AddrStart, size_t cb, uint32_t fAccess, + RTR0PROCESS R0Process, int fFlags, const char *pszTag) + { ++ IPRT_FREEBSD_SAVE_EFL_AC(); + int rc; + NOREF(fAccess); + +@@ -521,21 +549,28 @@ static int rtR0MemObjNativeLockInMap(PPRTR0MEMOBJINTER + if (!pMemFreeBSD) + return VERR_NO_MEMORY; + +- /* +- * We could've used vslock here, but we don't wish to be subject to +- * resource usage restrictions, so we'll call vm_map_wire directly. +- */ +- rc = vm_map_wire(pVmMap, /* the map */ +- AddrStart, /* start */ +- AddrStart + cb, /* end */ +- fFlags); /* flags */ ++ if (pVmMap != kernel_map) { ++ /* ++ * We could've used vslock here, but we don't wish to be subject to ++ * resource usage restrictions, so we'll call vm_map_wire directly. ++ */ ++ rc = vm_map_wire(pVmMap, /* the map */ ++ AddrStart, /* start */ ++ AddrStart + cb, /* end */ ++ fFlags); /* flags */ ++ } ++ else ++ rc = KERN_SUCCESS; ++ + if (rc == KERN_SUCCESS) + { + pMemFreeBSD->Core.u.Lock.R0Process = R0Process; + *ppMem = &pMemFreeBSD->Core; ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VINF_SUCCESS; + } + rtR0MemObjDelete(&pMemFreeBSD->Core); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VERR_NO_MEMORY;/** @todo fix mach -> vbox error conversion for freebsd. */ + } + +@@ -575,6 +610,7 @@ static int rtR0MemObjNativeReserveInMap(PPRTR0MEMOBJIN + static int rtR0MemObjNativeReserveInMap(PPRTR0MEMOBJINTERNAL ppMem, void *pvFixed, size_t cb, size_t uAlignment, + RTR0PROCESS R0Process, vm_map_t pMap, const char *pszTag) + { ++ IPRT_FREEBSD_SAVE_EFL_AC(); + int rc; + + /* +@@ -633,11 +669,13 @@ static int rtR0MemObjNativeReserveInMap(PPRTR0MEMOBJIN + pMemFreeBSD->Core.pv = (void *)MapAddress; + pMemFreeBSD->Core.u.ResVirt.R0Process = R0Process; + *ppMem = &pMemFreeBSD->Core; ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VINF_SUCCESS; + } + + rc = VERR_NO_MEMORY; /** @todo fix translation (borrow from darwin) */ + rtR0MemObjDelete(&pMemFreeBSD->Core); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return rc; + + } +@@ -661,6 +699,8 @@ DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJ + DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment, + unsigned fProt, size_t offSub, size_t cbSub, const char *pszTag) + { ++ IPRT_FREEBSD_SAVE_EFL_AC(); ++ + // AssertMsgReturn(!offSub && !cbSub, ("%#x %#x\n", offSub, cbSub), VERR_NOT_SUPPORTED); + AssertMsgReturn(pvFixed == (void *)-1, ("%p\n", pvFixed), VERR_NOT_SUPPORTED); + +@@ -715,6 +755,7 @@ DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJ + Assert((vm_offset_t)pMemFreeBSD->Core.pv == Addr); + pMemFreeBSD->Core.u.Mapping.R0Process = NIL_RTR0PROCESS; + *ppMem = &pMemFreeBSD->Core; ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VINF_SUCCESS; + } + rc = vm_map_remove(kernel_map, Addr, Addr + cbSub); +@@ -723,6 +764,7 @@ DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJ + else + vm_object_deallocate(pMemToMapFreeBSD->pObject); + ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VERR_NO_MEMORY; + } + +@@ -730,6 +772,8 @@ DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJIN + DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment, + unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub, const char *pszTag) + { ++ IPRT_FREEBSD_SAVE_EFL_AC(); ++ + /* + * Check for unsupported stuff. + */ +@@ -787,44 +831,50 @@ DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJIN + + if (rc == KERN_SUCCESS) + { +- rc = vm_map_wire(pProcMap, AddrR3, AddrR3 + pMemToMap->cb, VM_MAP_WIRE_USER|VM_MAP_WIRE_NOHOLES); ++ rc = vm_map_wire(pProcMap, AddrR3, AddrR3 + cbSub, VM_MAP_WIRE_USER|VM_MAP_WIRE_NOHOLES); + AssertMsg(rc == KERN_SUCCESS, ("%#x\n", rc)); + +- rc = vm_map_inherit(pProcMap, AddrR3, AddrR3 + pMemToMap->cb, VM_INHERIT_SHARE); ++ rc = vm_map_inherit(pProcMap, AddrR3, AddrR3 + cbSub, VM_INHERIT_SHARE); + AssertMsg(rc == KERN_SUCCESS, ("%#x\n", rc)); + + /* + * Create a mapping object for it. + */ + PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)rtR0MemObjNew(sizeof(RTR0MEMOBJFREEBSD), RTR0MEMOBJTYPE_MAPPING, +- (void *)AddrR3, pMemToMap->cb, pszTag); ++ (void *)AddrR3, cbSub, pszTag); + if (pMemFreeBSD) + { + Assert((vm_offset_t)pMemFreeBSD->Core.pv == AddrR3); + pMemFreeBSD->Core.u.Mapping.R0Process = R0Process; + *ppMem = &pMemFreeBSD->Core; ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VINF_SUCCESS; + } + +- rc = vm_map_remove(pProcMap, AddrR3, AddrR3 + pMemToMap->cb); ++ rc = vm_map_remove(pProcMap, AddrR3, AddrR3 + cbSub); + AssertMsg(rc == KERN_SUCCESS, ("Deleting mapping failed\n")); + } + else + vm_object_deallocate(pMemToMapFreeBSD->pObject); + ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VERR_NO_MEMORY; + } + + + DECLHIDDEN(int) rtR0MemObjNativeProtect(PRTR0MEMOBJINTERNAL pMem, size_t offSub, size_t cbSub, uint32_t fProt) + { ++ IPRT_FREEBSD_SAVE_EFL_AC(); + vm_prot_t ProtectionFlags = 0; + vm_offset_t AddrStart = (uintptr_t)pMem->pv + offSub; + vm_offset_t AddrEnd = AddrStart + cbSub; + vm_map_t pVmMap = rtR0MemObjFreeBSDGetMap(pMem); + + if (!pVmMap) ++ { ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VERR_NOT_SUPPORTED; ++ } + + if ((fProt & RTMEM_PROT_NONE) == RTMEM_PROT_NONE) + ProtectionFlags = VM_PROT_NONE; +@@ -835,7 +885,12 @@ DECLHIDDEN(int) rtR0MemObjNativeProtect(PRTR0MEMOBJINT + if ((fProt & RTMEM_PROT_EXEC) == RTMEM_PROT_EXEC) + ProtectionFlags |= VM_PROT_EXECUTE; + ++#if __FreeBSD_version >= 1300135 ++ int krc = vm_map_protect(pVmMap, AddrStart, AddrEnd, ProtectionFlags, 0, VM_MAP_PROTECT_SET_PROT); ++#else + int krc = vm_map_protect(pVmMap, AddrStart, AddrEnd, ProtectionFlags, FALSE); ++#endif ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + if (krc == KERN_SUCCESS) + return VINF_SUCCESS; + +@@ -860,11 +915,19 @@ DECLHIDDEN(RTHCPHYS) rtR0MemObjNativeGetPagePhysAddr(P + + vm_offset_t pb = (vm_offset_t)pMemFreeBSD->Core.pv + ptoa(iPage); + +- struct proc *pProc = (struct proc *)pMemFreeBSD->Core.u.Lock.R0Process; +- struct vm_map *pProcMap = &pProc->p_vmspace->vm_map; +- pmap_t pPhysicalMap = vm_map_pmap(pProcMap); ++ if (pMemFreeBSD->Core.u.Mapping.R0Process != NIL_RTR0PROCESS) ++ { ++ RTHCPHYS addr; ++ IPRT_FREEBSD_SAVE_EFL_AC(); ++ struct proc *pProc = (struct proc *)pMemFreeBSD->Core.u.Lock.R0Process; ++ struct vm_map *pProcMap = &pProc->p_vmspace->vm_map; ++ pmap_t pPhysicalMap = vm_map_pmap(pProcMap); + +- return pmap_extract(pPhysicalMap, pb); ++ addr = pmap_extract(pPhysicalMap, pb); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); ++ return addr; ++ } ++ return vtophys(pb); + } + + case RTR0MEMOBJTYPE_MAPPING: +@@ -873,11 +936,15 @@ DECLHIDDEN(RTHCPHYS) rtR0MemObjNativeGetPagePhysAddr(P + + if (pMemFreeBSD->Core.u.Mapping.R0Process != NIL_RTR0PROCESS) + { ++ RTHCPHYS addr; ++ IPRT_FREEBSD_SAVE_EFL_AC(); + struct proc *pProc = (struct proc *)pMemFreeBSD->Core.u.Mapping.R0Process; + struct vm_map *pProcMap = &pProc->p_vmspace->vm_map; + pmap_t pPhysicalMap = vm_map_pmap(pProcMap); + +- return pmap_extract(pPhysicalMap, pb); ++ addr = pmap_extract(pPhysicalMap, pb); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); ++ return addr; + } + return vtophys(pb); + } +@@ -888,9 +955,11 @@ DECLHIDDEN(RTHCPHYS) rtR0MemObjNativeGetPagePhysAddr(P + { + RTHCPHYS addr; + ++ IPRT_FREEBSD_SAVE_EFL_AC(); + VM_OBJECT_WLOCK(pMemFreeBSD->pObject); + addr = VM_PAGE_TO_PHYS(vm_page_lookup(pMemFreeBSD->pObject, iPage)); + VM_OBJECT_WUNLOCK(pMemFreeBSD->pObject); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return addr; + } + +@@ -910,7 +979,7 @@ DECLHIDDEN(int) rtR0MemObjNativeZeroInitWithoutMapping + DECLHIDDEN(int) rtR0MemObjNativeZeroInitWithoutMapping(PRTR0MEMOBJINTERNAL pMem) + { + PRTR0MEMOBJFREEBSD const pMemFreeBsd = (PRTR0MEMOBJFREEBSD)pMem; +- size_t const cPages = pMemSolaris->Core.cb >> PAGE_SHIFT; ++ size_t const cPages = atop(pMemFreeBsd->Core.cb); + size_t iPage; + for (iPage = 0; iPage < cPages; iPage++) + { diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_memuserkernel-r0drv-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_memuserkernel-r0drv-freebsd.c new file mode 100644 index 000000000000..637f67bbe59a --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_memuserkernel-r0drv-freebsd.c @@ -0,0 +1,22 @@ +--- src/VBox/Runtime/r0drv/freebsd/memuserkernel-r0drv-freebsd.c.orig 2025-08-13 19:51:51 UTC ++++ src/VBox/Runtime/r0drv/freebsd/memuserkernel-r0drv-freebsd.c +@@ -46,7 +46,9 @@ RTR0DECL(int) RTR0MemUserCopyFrom(void *pvDst, RTR3PTR + + RTR0DECL(int) RTR0MemUserCopyFrom(void *pvDst, RTR3PTR R3PtrSrc, size_t cb) + { ++ IPRT_FREEBSD_SAVE_EFL_AC(); + int rc = copyin((const void *)R3PtrSrc, pvDst, cb); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + if (RT_LIKELY(rc == 0)) + return VINF_SUCCESS; + return VERR_ACCESS_DENIED; +@@ -55,7 +57,9 @@ RTR0DECL(int) RTR0MemUserCopyTo(RTR3PTR R3PtrDst, void + + RTR0DECL(int) RTR0MemUserCopyTo(RTR3PTR R3PtrDst, void const *pvSrc, size_t cb) + { ++ IPRT_FREEBSD_SAVE_EFL_AC(); + int rc = copyout(pvSrc, (void *)R3PtrDst, cb); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + if (RT_LIKELY(rc == 0)) + return VINF_SUCCESS; + return VERR_ACCESS_DENIED; diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_mp-r0drv-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_mp-r0drv-freebsd.c new file mode 100644 index 000000000000..5548551e9ab5 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_mp-r0drv-freebsd.c @@ -0,0 +1,92 @@ +--- src/VBox/Runtime/r0drv/freebsd/mp-r0drv-freebsd.c.orig 2025-08-13 19:51:51 UTC ++++ src/VBox/Runtime/r0drv/freebsd/mp-r0drv-freebsd.c +@@ -157,7 +157,9 @@ static void rtmpOnAllFreeBSDWrapper(void *pvArg) + static void rtmpOnAllFreeBSDWrapper(void *pvArg) + { + PRTMPARGS pArgs = (PRTMPARGS)pvArg; ++ IPRT_FREEBSD_SAVE_EFL_AC(); + pArgs->pfnWorker(curcpu, pArgs->pvUser1, pArgs->pvUser2); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + } + + +@@ -169,7 +171,9 @@ RTDECL(int) RTMpOnAll(PFNRTMPWORKER pfnWorker, void *p + Args.pvUser2 = pvUser2; + Args.idCpu = NIL_RTCPUID; + Args.cHits = 0; ++ IPRT_FREEBSD_SAVE_EFL_AC(); + smp_rendezvous(NULL, rtmpOnAllFreeBSDWrapper, smp_no_rendezvous_barrier, &Args); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VINF_SUCCESS; + } + +@@ -185,7 +189,11 @@ static void rtmpOnOthersFreeBSDWrapper(void *pvArg) + PRTMPARGS pArgs = (PRTMPARGS)pvArg; + RTCPUID idCpu = curcpu; + if (pArgs->idCpu != idCpu) ++ { ++ IPRT_FREEBSD_SAVE_EFL_AC(); + pArgs->pfnWorker(idCpu, pArgs->pvUser1, pArgs->pvUser2); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); ++ } + } + + +@@ -206,6 +214,7 @@ RTDECL(int) RTMpOnOthers(PFNRTMPWORKER pfnWorker, void + Args.pvUser2 = pvUser2; + Args.idCpu = RTMpCpuId(); + Args.cHits = 0; ++ IPRT_FREEBSD_SAVE_EFL_AC(); + #if __FreeBSD_version >= 700000 + # if __FreeBSD_version >= 900000 + Mask = all_cpus; +@@ -217,6 +226,7 @@ RTDECL(int) RTMpOnOthers(PFNRTMPWORKER pfnWorker, void + #else + smp_rendezvous(NULL, rtmpOnOthersFreeBSDWrapper, NULL, &Args); + #endif ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + } + return VINF_SUCCESS; + } +@@ -234,8 +244,10 @@ static void rtmpOnSpecificFreeBSDWrapper(void *pvArg) + RTCPUID idCpu = curcpu; + if (pArgs->idCpu == idCpu) + { ++ IPRT_FREEBSD_SAVE_EFL_AC(); + pArgs->pfnWorker(idCpu, pArgs->pvUser1, pArgs->pvUser2); + ASMAtomicIncU32(&pArgs->cHits); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + } + } + +@@ -258,6 +270,7 @@ RTDECL(int) RTMpOnSpecific(RTCPUID idCpu, PFNRTMPWORKE + Args.pvUser2 = pvUser2; + Args.idCpu = idCpu; + Args.cHits = 0; ++ IPRT_FREEBSD_SAVE_EFL_AC(); + #if __FreeBSD_version >= 700000 + # if __FreeBSD_version >= 900000 + CPU_SETOF(idCpu, &Mask); +@@ -268,6 +281,7 @@ RTDECL(int) RTMpOnSpecific(RTCPUID idCpu, PFNRTMPWORKE + #else + smp_rendezvous(NULL, rtmpOnSpecificFreeBSDWrapper, NULL, &Args); + #endif ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return Args.cHits == 1 + ? VINF_SUCCESS + : VERR_CPU_NOT_FOUND; +@@ -297,12 +311,14 @@ RTDECL(int) RTMpPokeCpu(RTCPUID idCpu) + if (!RTMpIsCpuOnline(idCpu)) + return VERR_CPU_NOT_FOUND; + ++ IPRT_FREEBSD_SAVE_EFL_AC(); + # if __FreeBSD_version >= 900000 + CPU_SETOF(idCpu, &Mask); + # else + Mask = (cpumask_t)1 << idCpu; + # endif + smp_rendezvous_cpus(Mask, NULL, rtmpFreeBSDPokeCallback, smp_no_rendezvous_barrier, NULL); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + + return VINF_SUCCESS; + } diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_semevent-r0drv-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_semevent-r0drv-freebsd.c new file mode 100644 index 000000000000..cb5deba5ce97 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_semevent-r0drv-freebsd.c @@ -0,0 +1,53 @@ +--- src/VBox/Runtime/r0drv/freebsd/semevent-r0drv-freebsd.c.orig 2025-08-13 19:51:51 UTC ++++ src/VBox/Runtime/r0drv/freebsd/semevent-r0drv-freebsd.c +@@ -111,7 +111,9 @@ RTDECL(int) RTSemEventCreateEx(PRTSEMEVENT phEventSem + Assert(!(fFlags & RTSEMEVENT_FLAGS_BOOTSTRAP_HACK) || (fFlags & RTSEMEVENT_FLAGS_NO_LOCK_VAL)); + AssertPtrReturn(phEventSem, VERR_INVALID_POINTER); + ++ IPRT_FREEBSD_SAVE_EFL_AC(); + PRTSEMEVENTINTERNAL pThis = (PRTSEMEVENTINTERNAL)RTMemAllocZ(sizeof(*pThis)); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + if (!pThis) + return VERR_NO_MEMORY; + +@@ -162,10 +164,12 @@ RTDECL(int) RTSemEventDestroy(RTSEMEVENT hEventSem) + /* + * Invalidate it and signal the object just in case. + */ ++ IPRT_FREEBSD_SAVE_EFL_AC(); + ASMAtomicWriteU32(&pThis->u32Magic, ~RTSEMEVENT_MAGIC); + ASMAtomicWriteU32(&pThis->fState, 0); + rtR0SemBsdBroadcast(pThis); + rtR0SemEventBsdRelease(pThis); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VINF_SUCCESS; + } + +@@ -183,9 +187,11 @@ RTDECL(int) RTSemEventSignal(RTSEMEVENT hEventSem) + /* + * Signal the event object. + */ ++ IPRT_FREEBSD_SAVE_EFL_AC(); + ASMAtomicWriteU32(&pThis->fState, 1); + rtR0SemBsdSignal(pThis); + rtR0SemEventBsdRelease(pThis); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VINF_SUCCESS; + } + +@@ -209,6 +215,7 @@ static int rtR0SemEventWait(PRTSEMEVENTINTERNAL pThis, + AssertPtrReturn(pThis, VERR_INVALID_PARAMETER); + AssertMsgReturn(pThis->u32Magic == RTSEMEVENT_MAGIC, ("%p u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_PARAMETER); + AssertReturn(RTSEMWAIT_FLAGS_ARE_VALID(fFlags), VERR_INVALID_PARAMETER); ++ IPRT_FREEBSD_SAVE_EFL_AC(); + rtR0SemEventBsdRetain(pThis); + + /* +@@ -258,6 +265,7 @@ static int rtR0SemEventWait(PRTSEMEVENTINTERNAL pThis, + } + + rtR0SemEventBsdRelease(pThis); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return rc; + } + diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_semeventmulti-r0drv-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_semeventmulti-r0drv-freebsd.c new file mode 100644 index 000000000000..dab1b22fcd36 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_semeventmulti-r0drv-freebsd.c @@ -0,0 +1,73 @@ +--- src/VBox/Runtime/r0drv/freebsd/semeventmulti-r0drv-freebsd.c.orig 2025-08-13 19:51:51 UTC ++++ src/VBox/Runtime/r0drv/freebsd/semeventmulti-r0drv-freebsd.c +@@ -130,7 +130,9 @@ RTDECL(int) RTSemEventMultiCreateEx(PRTSEMEVENTMULTI + PRTSEMEVENTMULTIINTERNAL pThis; + + AssertReturn(!(fFlags & ~RTSEMEVENTMULTI_FLAGS_NO_LOCK_VAL), VERR_INVALID_PARAMETER); ++ IPRT_FREEBSD_SAVE_EFL_AC(); + pThis = (PRTSEMEVENTMULTIINTERNAL)RTMemAlloc(sizeof(*pThis)); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + if (pThis) + { + pThis->u32Magic = RTSEMEVENTMULTI_MAGIC; +@@ -186,10 +188,12 @@ RTDECL(int) RTSemEventMultiDestroy(RTSEMEVENTMULTI hE + /* + * Invalidate it and signal the object just in case. + */ ++ IPRT_FREEBSD_SAVE_EFL_AC(); + ASMAtomicWriteU32(&pThis->u32Magic, ~RTSEMEVENTMULTI_MAGIC); + ASMAtomicAndU32(&pThis->fStateAndGen, RTSEMEVENTMULTIBSD_GEN_MASK); + rtR0SemBsdBroadcast(pThis); + rtR0SemEventMultiBsdRelease(pThis); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VINF_SUCCESS; + } + +@@ -198,6 +202,7 @@ RTDECL(int) RTSemEventMultiSignal(RTSEMEVENTMULTI hEv + { + uint32_t fNew; + uint32_t fOld; ++ IPRT_FREEBSD_SAVE_EFL_AC(); + + /* + * Validate input. +@@ -224,12 +229,15 @@ RTDECL(int) RTSemEventMultiSignal(RTSEMEVENTMULTI hEv + + rtR0SemBsdBroadcast(pThis); + rtR0SemEventMultiBsdRelease(pThis); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VINF_SUCCESS; + } + + + RTDECL(int) RTSemEventMultiReset(RTSEMEVENTMULTI hEventMultiSem) + { ++ IPRT_FREEBSD_SAVE_EFL_AC(); ++ + /* + * Validate input. + */ +@@ -246,6 +254,7 @@ RTDECL(int) RTSemEventMultiReset(RTSEMEVENTMULTI hEve + ASMAtomicAndU32(&pThis->fStateAndGen, ~RTSEMEVENTMULTIBSD_STATE_MASK); + + rtR0SemEventMultiBsdRelease(pThis); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VINF_SUCCESS; + } + +@@ -262,6 +271,7 @@ static int rtR0SemEventMultiBsdWait(PRTSEMEVENTMULTIIN + static int rtR0SemEventMultiBsdWait(PRTSEMEVENTMULTIINTERNAL pThis, uint32_t fFlags, uint64_t uTimeout, + PCRTLOCKVALSRCPOS pSrcPos) + { ++ IPRT_FREEBSD_SAVE_EFL_AC(); + uint32_t fOrgStateAndGen; + int rc; + +@@ -321,6 +331,7 @@ static int rtR0SemEventMultiBsdWait(PRTSEMEVENTMULTIIN + } + + rtR0SemEventMultiBsdRelease(pThis); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return rc; + } + diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_semfastmutex-r0drv-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_semfastmutex-r0drv-freebsd.c new file mode 100644 index 000000000000..21c03b87326e --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_semfastmutex-r0drv-freebsd.c @@ -0,0 +1,59 @@ +--- src/VBox/Runtime/r0drv/freebsd/semfastmutex-r0drv-freebsd.c.orig 2025-08-13 19:51:51 UTC ++++ src/VBox/Runtime/r0drv/freebsd/semfastmutex-r0drv-freebsd.c +@@ -96,6 +96,7 @@ RTDECL(int) RTSemFastMutexCreate(PRTSEMFASTMUTEX phFa + { + AssertCompile(sizeof(RTSEMFASTMUTEXINTERNAL) > sizeof(void *)); + AssertPtrReturn(phFastMtx, VERR_INVALID_POINTER); ++ IPRT_FREEBSD_SAVE_EFL_AC(); + + PRTSEMFASTMUTEXINTERNAL pThis = (PRTSEMFASTMUTEXINTERNAL)RTMemAllocZ(sizeof(*pThis)); + if (pThis) +@@ -104,8 +105,10 @@ RTDECL(int) RTSemFastMutexCreate(PRTSEMFASTMUTEX phFa + sx_init_flags(&pThis->SxLock, "IPRT Fast Mutex Semaphore", SX_DUPOK); + + *phFastMtx = pThis; ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VINF_SUCCESS; + } ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VERR_NO_MEMORY; + } + +@@ -117,11 +120,13 @@ RTDECL(int) RTSemFastMutexDestroy(RTSEMFASTMUTEX hFas + return VINF_SUCCESS; + AssertPtrReturn(pThis, VERR_INVALID_HANDLE); + AssertMsgReturn(pThis->u32Magic == RTSEMFASTMUTEX_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE); ++ IPRT_FREEBSD_SAVE_EFL_AC(); + + ASMAtomicWriteU32(&pThis->u32Magic, RTSEMFASTMUTEX_MAGIC_DEAD); + sx_destroy(&pThis->SxLock); + RTMemFree(pThis); + ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VINF_SUCCESS; + } + +@@ -131,8 +136,11 @@ RTDECL(int) RTSemFastMutexRequest(RTSEMFASTMUTEX hFas + PRTSEMFASTMUTEXINTERNAL pThis = hFastMtx; + AssertPtrReturn(pThis, VERR_INVALID_HANDLE); + AssertMsgReturn(pThis->u32Magic == RTSEMFASTMUTEX_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE); ++ IPRT_FREEBSD_SAVE_EFL_AC(); + + sx_xlock(&pThis->SxLock); ++ ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VINF_SUCCESS; + } + +@@ -142,8 +150,11 @@ RTDECL(int) RTSemFastMutexRelease(RTSEMFASTMUTEX hFas + PRTSEMFASTMUTEXINTERNAL pThis = hFastMtx; + AssertPtrReturn(pThis, VERR_INVALID_HANDLE); + AssertMsgReturn(pThis->u32Magic == RTSEMFASTMUTEX_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE); ++ IPRT_FREEBSD_SAVE_EFL_AC(); + + sx_xunlock(&pThis->SxLock); ++ ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VINF_SUCCESS; + } + diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_semmutex-r0drv-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_semmutex-r0drv-freebsd.c new file mode 100644 index 000000000000..048d345398eb --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_semmutex-r0drv-freebsd.c @@ -0,0 +1,80 @@ +--- src/VBox/Runtime/r0drv/freebsd/semmutex-r0drv-freebsd.c.orig 2025-08-13 19:51:51 UTC ++++ src/VBox/Runtime/r0drv/freebsd/semmutex-r0drv-freebsd.c +@@ -72,6 +72,7 @@ RTDECL(int) RTSemMutexCreate(PRTSEMMUTEX phMutexSem) + { + AssertCompile(sizeof(RTSEMMUTEXINTERNAL) > sizeof(void *)); + AssertPtrReturn(phMutexSem, VERR_INVALID_POINTER); ++ IPRT_FREEBSD_SAVE_EFL_AC(); + + PRTSEMMUTEXINTERNAL pThis = (PRTSEMMUTEXINTERNAL)RTMemAllocZ(sizeof(*pThis)); + if (pThis) +@@ -80,8 +81,10 @@ RTDECL(int) RTSemMutexCreate(PRTSEMMUTEX phMutexSem) + sx_init_flags(&pThis->SxLock, "IPRT Mutex Semaphore", SX_RECURSE); + + *phMutexSem = pThis; ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VINF_SUCCESS; + } ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VERR_NO_MEMORY; + } + +@@ -93,12 +96,14 @@ RTDECL(int) RTSemMutexDestroy(RTSEMMUTEX hMutexSem) + return VINF_SUCCESS; + AssertPtrReturn(pThis, VERR_INVALID_HANDLE); + AssertMsgReturn(pThis->u32Magic == RTSEMMUTEX_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE); ++ IPRT_FREEBSD_SAVE_EFL_AC(); + + AssertReturn(ASMAtomicCmpXchgU32(&pThis->u32Magic, RTSEMMUTEX_MAGIC_DEAD, RTSEMMUTEX_MAGIC), VERR_INVALID_HANDLE); + + sx_destroy(&pThis->SxLock); + RTMemFree(pThis); + ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VINF_SUCCESS; + } + +@@ -109,6 +114,7 @@ RTDECL(int) RTSemMutexRequest(RTSEMMUTEX hMutexSem, R + int rc; + AssertPtrReturn(pThis, VERR_INVALID_HANDLE); + AssertMsgReturn(pThis->u32Magic == RTSEMMUTEX_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE); ++ IPRT_FREEBSD_SAVE_EFL_AC(); + + if (cMillies == RT_INDEFINITE_WAIT) + { +@@ -143,6 +149,7 @@ RTDECL(int) RTSemMutexRequest(RTSEMMUTEX hMutexSem, R + } while (RTTimeSystemMilliTS() - StartTS < cMillies); + } + ++ IPRT_FREEBSD_RESTORE_EFL_ONLY_AC(); + return VINF_SUCCESS; + } + +@@ -159,6 +166,7 @@ RTDECL(int) RTSemMutexRequestNoResume(RTSEMMUTEX hMut + int rc; + AssertPtrReturn(pThis, VERR_INVALID_HANDLE); + AssertMsgReturn(pThis->u32Magic == RTSEMMUTEX_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE); ++ IPRT_FREEBSD_SAVE_EFL_AC(); + + if (cMillies == RT_INDEFINITE_WAIT) + { +@@ -196,6 +204,7 @@ RTDECL(int) RTSemMutexRequestNoResume(RTSEMMUTEX hMut + } while (RTTimeSystemMilliTS() - StartTS < cMillies); + } + ++ IPRT_FREEBSD_RESTORE_EFL_ONLY_AC(); + return VINF_SUCCESS; + } + +@@ -211,8 +220,11 @@ RTDECL(int) RTSemMutexRelease(RTSEMMUTEX hMutexSem) + PRTSEMMUTEXINTERNAL pThis = hMutexSem; + AssertPtrReturn(pThis, VERR_INVALID_HANDLE); + AssertMsgReturn(pThis->u32Magic == RTSEMMUTEX_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE); ++ IPRT_FREEBSD_SAVE_EFL_AC(); + + sx_xunlock(&pThis->SxLock); ++ ++ IPRT_FREEBSD_RESTORE_EFL_ONLY_AC(); + return VINF_SUCCESS; + } + diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_spinlock-r0drv-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_spinlock-r0drv-freebsd.c new file mode 100644 index 000000000000..442c6e1c243d --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_spinlock-r0drv-freebsd.c @@ -0,0 +1,30 @@ +--- src/VBox/Runtime/r0drv/freebsd/spinlock-r0drv-freebsd.c.orig 2025-08-13 19:51:51 UTC ++++ src/VBox/Runtime/r0drv/freebsd/spinlock-r0drv-freebsd.c +@@ -116,7 +116,9 @@ RTDECL(int) RTSpinlockCreate(PRTSPINLOCK pSpinlock, u + * Allocate. + */ + AssertCompile(sizeof(RTSPINLOCKINTERNAL) > sizeof(void *)); ++ IPRT_FREEBSD_SAVE_EFL_AC(); + PRTSPINLOCKINTERNAL pThis = (PRTSPINLOCKINTERNAL)RTMemAllocZ(sizeof(*pThis)); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + if (!pThis) + return VERR_NO_MEMORY; + +@@ -150,7 +152,9 @@ RTDECL(int) RTSpinlockDestroy(RTSPINLOCK Spinlock) + * Make the lock invalid and release the memory. + */ + ASMAtomicIncU32(&pThis->u32Magic); ++ IPRT_FREEBSD_SAVE_EFL_AC(); + RTMemFree(pThis); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VINF_SUCCESS; + } + +@@ -176,6 +180,7 @@ RTDECL(void) RTSpinlockAcquire(RTSPINLOCK Spinlock) + { + RT_ASSERT_PREEMPT_CPUID_SPIN_ACQUIRED(pThis); + pThis->fIntSaved = fIntSaved; ++ IPRT_FREEBSD_RESTORE_EFL_ONLY_AC_EX(fIntSaved); + return; + } + if (--c <= 0) diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_the-freebsd-kernel.h b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_the-freebsd-kernel.h new file mode 100644 index 000000000000..c783814425f5 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_the-freebsd-kernel.h @@ -0,0 +1,48 @@ +--- src/VBox/Runtime/r0drv/freebsd/the-freebsd-kernel.h.orig 2025-04-14 17:59:14 UTC ++++ src/VBox/Runtime/r0drv/freebsd/the-freebsd-kernel.h +@@ -97,6 +97,7 @@ + #include <sys/smp.h> + #include <sys/sleepqueue.h> + #include <sys/sx.h> ++#include <sys/vmmeter.h> /* vm_cnt */ + #include <vm/vm.h> + #include <vm/pmap.h> /* for vtophys */ + #include <vm/vm_map.h> +@@ -104,10 +105,11 @@ + #include <vm/vm_kern.h> + #include <vm/vm_param.h> /* KERN_SUCCESS ++ */ + #include <vm/vm_page.h> ++#include <vm/vm_pager.h> + #include <vm/vm_phys.h> /* vm_phys_alloc_* */ + #include <vm/vm_extern.h> /* kmem_alloc_attr */ + #include <vm/vm_pageout.h> /* vm_contig_grow_cache */ +-#include <sys/vmmeter.h> /* cnt */ ++#include <vm/vm_radix.h> + #include <sys/resourcevar.h> + #include <machine/cpu.h> + +@@ -165,6 +167,24 @@ + */ + #if 0 /** @todo Not available yet. */ + # define USE_KMEM_ALLOC_PROT ++#endif ++ ++/** ++ * Macros for preserving EFLAGS.AC (despair / paranoid) ++ */ ++#if __FreeBSD_version >= 1200076 && defined(RT_ARCH_AMD64) ++# include <iprt/asm-amd64-x86.h> ++# include <iprt/x86.h> ++# define IPRT_FREEBSD_SAVE_EFL_AC() RTCCUINTREG const fSavedEfl = ASMGetFlags() ++# define IPRT_FREEBSD_RESTORE_EFL_AC() ASMSetFlags(fSavedEfl) ++# define IPRT_FREEBSD_RESTORE_EFL_ONLY_AC() ASMChangeFlags(~X86_EFL_AC, fSavedEfl & X86_EFL_AC) ++# define IPRT_FREEBSD_RESTORE_EFL_ONLY_AC_EX(f) ASMChangeFlags(~X86_EFL_AC, (f) & X86_EFL_AC) ++# define VBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV ++#else ++# define IPRT_FREEBSD_SAVE_EFL_AC() do { } while (0) ++# define IPRT_FREEBSD_RESTORE_EFL_AC() do { } while (0) ++# define IPRT_FREEBSD_RESTORE_EFL_ONLY_AC() do { } while (0) ++# define IPRT_FREEBSD_RESTORE_EFL_ONLY_AC_EX(f) do { } while (0) + #endif + + #endif /* !IPRT_INCLUDED_SRC_r0drv_freebsd_the_freebsd_kernel_h */ diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_thread-r0drv-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_thread-r0drv-freebsd.c new file mode 100644 index 000000000000..73a0eab649ad --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_thread-r0drv-freebsd.c @@ -0,0 +1,91 @@ +--- src/VBox/Runtime/r0drv/freebsd/thread-r0drv-freebsd.c.orig 2025-08-13 19:51:51 UTC ++++ src/VBox/Runtime/r0drv/freebsd/thread-r0drv-freebsd.c +@@ -59,7 +59,6 @@ static int rtR0ThreadFbsdSleepCommon(RTMSINTERVAL cMil + static int rtR0ThreadFbsdSleepCommon(RTMSINTERVAL cMillies) + { + int rc; +- int cTicks; + + /* + * 0 ms sleep -> yield. +@@ -70,30 +69,34 @@ static int rtR0ThreadFbsdSleepCommon(RTMSINTERVAL cMil + return VINF_SUCCESS; + } + ++ IPRT_FREEBSD_SAVE_EFL_AC(); ++ + /* + * Translate milliseconds into ticks and go to sleep. + */ + if (cMillies != RT_INDEFINITE_WAIT) + { +- if (hz == 1000) +- cTicks = cMillies; +- else if (hz == 100) +- cTicks = cMillies / 10; +- else +- { +- int64_t cTicks64 = ((uint64_t)cMillies * hz) / 1000; +- cTicks = (int)cTicks64; +- if (cTicks != cTicks64) +- cTicks = INT_MAX; +- } ++ struct timeval tv; ++ ++ tv.tv_sec = cMillies / 1000; ++ tv.tv_usec = cMillies * 1000; ++ ++ rc = tsleep_sbt((void *)RTThreadSleep, ++ PZERO | PCATCH, ++ "iprtsl", /* max 6 chars */ ++ tvtosbt(tv), ++ 0, ++ C_ABSOLUTE); + } + else +- cTicks = 0; /* requires giant lock! */ +- +- rc = tsleep((void *)RTThreadSleep, +- PZERO | PCATCH, +- "iprtsl", /* max 6 chars */ +- cTicks); ++ { ++ /* requires giant lock! */ ++ rc = tsleep((void *)RTThreadSleep, ++ PZERO | PCATCH, ++ "iprts0", /* max 6 chars */ ++ 0); ++ } ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + switch (rc) + { + case 0: +@@ -124,11 +127,13 @@ RTDECL(bool) RTThreadYield(void) + + RTDECL(bool) RTThreadYield(void) + { ++ IPRT_FREEBSD_SAVE_EFL_AC(); + #if __FreeBSD_version >= 900032 + kern_yield(curthread->td_user_pri); + #else + uio_yield(); + #endif ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return false; /** @todo figure this one ... */ + } + +@@ -177,12 +182,14 @@ RTDECL(void) RTThreadPreemptRestore(PRTTHREADPREEMPTST + + RTDECL(void) RTThreadPreemptRestore(PRTTHREADPREEMPTSTATE pState) + { ++ IPRT_FREEBSD_SAVE_EFL_AC(); /* paranoia */ + AssertPtr(pState); + Assert(pState->u32Reserved == 42); + pState->u32Reserved = 0; + + RT_ASSERT_PREEMPT_CPUID_RESTORE(pState); + critical_exit(); ++ IPRT_FREEBSD_RESTORE_EFL_ONLY_AC(); /* paranoia */ + } + + diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_thread2-r0drv-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_thread2-r0drv-freebsd.c new file mode 100644 index 000000000000..2af30cf1e27a --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_thread2-r0drv-freebsd.c @@ -0,0 +1,35 @@ +--- src/VBox/Runtime/r0drv/freebsd/thread2-r0drv-freebsd.c.orig 2025-08-13 19:51:51 UTC ++++ src/VBox/Runtime/r0drv/freebsd/thread2-r0drv-freebsd.c +@@ -104,6 +104,8 @@ DECLHIDDEN(int) rtThreadNativeSetPriority(PRTTHREADINT + return VERR_INVALID_PARAMETER; + } + ++ IPRT_FREEBSD_SAVE_EFL_AC(); ++ + #if __FreeBSD_version < 700000 + /* Do like they're doing in subr_ntoskrnl.c... */ + mtx_lock_spin(&sched_lock); +@@ -120,6 +122,7 @@ DECLHIDDEN(int) rtThreadNativeSetPriority(PRTTHREADINT + thread_unlock(curthread); + #endif + ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VINF_SUCCESS; + } + +@@ -169,6 +172,7 @@ DECLHIDDEN(int) rtThreadNativeCreate(PRTTHREADINT pThr + + DECLHIDDEN(int) rtThreadNativeCreate(PRTTHREADINT pThreadInt, PRTNATIVETHREAD pNativeThread) + { ++ IPRT_FREEBSD_SAVE_EFL_AC(); + int rc; + struct proc *pProc; + +@@ -184,6 +188,7 @@ DECLHIDDEN(int) rtThreadNativeCreate(PRTTHREADINT pThr + } + else + rc = RTErrConvertFromErrno(rc); ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return rc; + } + diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_time-r0drv-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_time-r0drv-freebsd.c new file mode 100644 index 000000000000..cf453e69a1f9 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_time-r0drv-freebsd.c @@ -0,0 +1,43 @@ +--- src/VBox/Runtime/r0drv/freebsd/time-r0drv-freebsd.c.orig 2025-08-13 19:51:51 UTC ++++ src/VBox/Runtime/r0drv/freebsd/time-r0drv-freebsd.c +@@ -74,16 +74,23 @@ RTDECL(uint64_t) RTTimeNanoTS(void) + + RTDECL(uint64_t) RTTimeNanoTS(void) + { +- struct timespec tsp; +- nanouptime(&tsp); +- return tsp.tv_sec * RT_NS_1SEC_64 +- + tsp.tv_nsec; ++ struct bintime bt; ++ uint64_t ns; ++ binuptime(&bt); ++ ns = RT_NS_1SEC_64 * bt.sec; ++ ns += (RT_NS_1SEC_64 * (uint32_t)(bt.frac >> 32)) >> 32; ++ return ns; + } + + + RTDECL(uint64_t) RTTimeMilliTS(void) + { +- return RTTimeNanoTS() / RT_NS_1MS; ++ struct bintime bt; ++ uint64_t ms; ++ binuptime(&bt); ++ ms = RT_MS_1SEC_64 * bt.sec; ++ ms += (RT_MS_1SEC_64 * (uint32_t)(bt.frac >> 32)) >> 32; ++ return ms; + } + + +@@ -101,8 +108,7 @@ RTDECL(PRTTIMESPEC) RTTimeNow(PRTTIMESPEC pTime) + + RTDECL(PRTTIMESPEC) RTTimeNow(PRTTIMESPEC pTime) + { +- struct timespec tsp; +- nanotime(&tsp); +- return RTTimeSpecSetTimespec(pTime, &tsp); ++ struct timespec ts; ++ nanotime(&ts); ++ return RTTimeSpecSetTimespec(pTime, &ts); + } +- diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_timer-r0drv-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_timer-r0drv-freebsd.c new file mode 100644 index 000000000000..537199743da8 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_timer-r0drv-freebsd.c @@ -0,0 +1,68 @@ +--- src/VBox/Runtime/r0drv/freebsd/timer-r0drv-freebsd.c.orig 2025-08-13 19:51:51 UTC ++++ src/VBox/Runtime/r0drv/freebsd/timer-r0drv-freebsd.c +@@ -126,6 +126,7 @@ RTDECL(int) RTTimerCreateEx(PRTTIMER *ppTimer, uint64_ + RTDECL(int) RTTimerCreateEx(PRTTIMER *ppTimer, uint64_t u64NanoInterval, uint32_t fFlags, PFNRTTIMER pfnTimer, void *pvUser) + { + *ppTimer = NULL; ++ IPRT_FREEBSD_SAVE_EFL_AC(); + + /* + * Validate flags. +@@ -155,6 +156,7 @@ RTDECL(int) RTTimerCreateEx(PRTTIMER *ppTimer, uint64_ + callout_init(&pTimer->Callout, CALLOUT_MPSAFE); + + *ppTimer = pTimer; ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VINF_SUCCESS; + } + +@@ -175,6 +177,8 @@ RTDECL(int) RTTimerDestroy(PRTTIMER pTimer) + + RTDECL(int) RTTimerDestroy(PRTTIMER pTimer) + { ++ IPRT_FREEBSD_SAVE_EFL_AC(); ++ + /* It's ok to pass NULL pointer. */ + if (pTimer == /*NIL_RTTIMER*/ NULL) + return VINF_SUCCESS; +@@ -187,6 +191,8 @@ RTDECL(int) RTTimerDestroy(PRTTIMER pTimer) + pTimer->u32Magic++; + callout_stop(&pTimer->Callout); + RTMemFree(pTimer); ++ ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VINF_SUCCESS; + } + +@@ -194,6 +200,7 @@ RTDECL(int) RTTimerStart(PRTTIMER pTimer, uint64_t u64 + RTDECL(int) RTTimerStart(PRTTIMER pTimer, uint64_t u64First) + { + struct timeval tv; ++ IPRT_FREEBSD_SAVE_EFL_AC(); + + if (!rtTimerIsValid(pTimer)) + return VERR_INVALID_HANDLE; +@@ -217,12 +224,15 @@ RTDECL(int) RTTimerStart(PRTTIMER pTimer, uint64_t u64 + tv.tv_usec = (u64First % 1000000000) / 1000; + callout_reset(&pTimer->Callout, tvtohz(&tv), rtTimerFreeBSDCallback, pTimer); + ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VINF_SUCCESS; + } + + + RTDECL(int) RTTimerStop(PRTTIMER pTimer) + { ++ IPRT_FREEBSD_SAVE_EFL_AC(); ++ + if (!rtTimerIsValid(pTimer)) + return VERR_INVALID_HANDLE; + if (pTimer->fSuspended) +@@ -234,6 +244,7 @@ RTDECL(int) RTTimerStop(PRTTIMER pTimer) + pTimer->fSuspended = true; + callout_stop(&pTimer->Callout); + ++ IPRT_FREEBSD_RESTORE_EFL_AC(); + return VINF_SUCCESS; + } + diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r3_freebsd_systemmem-freebsd.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r3_freebsd_systemmem-freebsd.cpp new file mode 100644 index 000000000000..87ae993446a3 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r3_freebsd_systemmem-freebsd.cpp @@ -0,0 +1,39 @@ +--- src/VBox/Runtime/r3/freebsd/systemmem-freebsd.cpp.orig 2025-04-14 17:59:18 UTC ++++ src/VBox/Runtime/r3/freebsd/systemmem-freebsd.cpp +@@ -75,7 +75,6 @@ RTDECL(int) RTSystemQueryAvailableRam(uint64_t *pcb) + u_int cPagesMemFree = 0; + u_int cPagesMemInactive = 0; + u_int cPagesMemCached = 0; +- u_int cPagesMemUsed = 0; + int cbPage = 0; + size_t cbParameter; + int cProcessed = 0; +@@ -83,25 +82,23 @@ RTDECL(int) RTSystemQueryAvailableRam(uint64_t *pcb) + cbParameter = sizeof(cPagesMemFree); + if (sysctlbyname("vm.stats.vm.v_free_count", &cPagesMemFree, &cbParameter, NULL, 0)) + rc = RTErrConvertFromErrno(errno); +- cbParameter = sizeof(cPagesMemUsed); +- if ( RT_SUCCESS(rc) +- && sysctlbyname("vm.stats.vm.v_active_count", &cPagesMemUsed, &cbParameter, NULL, 0)) +- rc = RTErrConvertFromErrno(errno); + cbParameter = sizeof(cPagesMemInactive); + if ( RT_SUCCESS(rc) + && sysctlbyname("vm.stats.vm.v_inactive_count", &cPagesMemInactive, &cbParameter, NULL, 0)) + rc = RTErrConvertFromErrno(errno); ++#if __FreeBSD_version < 1200016 + cbParameter = sizeof(cPagesMemCached); + if ( RT_SUCCESS(rc) + && sysctlbyname("vm.stats.vm.v_cache_count", &cPagesMemCached, &cbParameter, NULL, 0)) + rc = RTErrConvertFromErrno(errno); ++#endif + cbParameter = sizeof(cbPage); + if ( RT_SUCCESS(rc) + && sysctlbyname("hw.pagesize", &cbPage, &cbParameter, NULL, 0)) + rc = RTErrConvertFromErrno(errno); + + if (RT_SUCCESS(rc)) +- *pcb = (cPagesMemFree + cPagesMemInactive + cPagesMemCached ) * cbPage; ++ *pcb = ((uint64_t)cPagesMemFree + cPagesMemInactive + cPagesMemCached) * cbPage; + + return rc; + } diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r3_posix_process-creation-posix.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r3_posix_process-creation-posix.cpp new file mode 100644 index 000000000000..06bfba5d3dac --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r3_posix_process-creation-posix.cpp @@ -0,0 +1,38 @@ +--- src/VBox/Runtime/r3/posix/process-creation-posix.cpp.orig 2025-08-13 19:51:58 UTC ++++ src/VBox/Runtime/r3/posix/process-creation-posix.cpp +@@ -40,7 +40,7 @@ + *********************************************************************************************************************************/ + #define LOG_GROUP RTLOGGROUP_PROCESS + #include <iprt/cdefs.h> +-#ifdef RT_OS_LINUX ++#if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) + # define IPRT_WITH_DYNAMIC_CRYPT_R + #endif + #if (defined(RT_OS_LINUX) || defined(RT_OS_OS2)) && !defined(_GNU_SOURCE) +@@ -85,7 +85,7 @@ + # include <xlocale.h> /* for newlocale() */ + #endif + +-#if defined(RT_OS_LINUX) || defined(RT_OS_OS2) ++#if defined(RT_OS_LINUX) || defined(RT_OS_OS2) || defined(RT_OS_FREEBSD) + /* While Solaris has posix_spawn() of course we don't want to use it as + * we need to have the child in a different process contract, no matter + * whether it is started detached or not. */ +@@ -174,7 +174,7 @@ + # define IPRT_LIBPAM_FILE_3 "libpam.1.dylib" + # define IPRT_LIBPAM_FILE_3_FIRST_VER 0 + # define IPRT_LIBPAM_FILE_3_END_VER 0 +-# elif RT_OS_LINUX ++# elif RT_OS_LINUX || RT_OS_FREEBSD + # define IPRT_LIBPAM_FILE_1 "libpam.so.0" + # define IPRT_LIBPAM_FILE_1_FIRST_VER 0 + # define IPRT_LIBPAM_FILE_1_END_VER 0 +@@ -681,7 +681,7 @@ static int rtCheckCredentials(const char *pszUser, con + if (pPw->pw_passwd && *pPw->pw_passwd) + # endif + { +-# if defined(RT_OS_LINUX) || defined(RT_OS_OS2) ++# if defined(RT_OS_LINUX) || defined(RT_OS_OS2) || defined(RT_OS_FREEBSD) + # ifdef IPRT_WITH_DYNAMIC_CRYPT_R + size_t const cbCryptData = RT_MAX(sizeof(struct crypt_data) * 2, _256K); + # else diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_VMM_Config.kmk b/emulators/virtualbox-ose-72/files/patch-src_VBox_VMM_Config.kmk new file mode 100644 index 000000000000..cb294d7cd898 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_VMM_Config.kmk @@ -0,0 +1,11 @@ +--- src/VBox/VMM/Config.kmk.orig 2025-08-13 19:52:06 UTC ++++ src/VBox/VMM/Config.kmk +@@ -133,7 +133,7 @@ endif + VMM_COMMON_DEFS += VBOX_WITH_NATIVE_NEM VBOX_WITH_NEM_R0 + endif + endif +-if1of ($(KBUILD_TARGET), freebsd linux solaris) # Hosts that implements SUPR0HCPhysToVirt. ++if1of ($(KBUILD_TARGET), linux solaris) # Hosts that implements SUPR0HCPhysToVirt. + VMM_COMMON_DEFS += VBOX_WITH_LINEAR_HOST_PHYS_MEM + endif + diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_VMM_VMMR3_PDMAsyncCompletionFileNormal.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_VMM_VMMR3_PDMAsyncCompletionFileNormal.cpp new file mode 100644 index 000000000000..b460847d13f0 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_VMM_VMMR3_PDMAsyncCompletionFileNormal.cpp @@ -0,0 +1,59 @@ +--- src/VBox/VMM/VMMR3/PDMAsyncCompletionFileNormal.cpp.orig 2025-08-13 19:52:13 UTC ++++ src/VBox/VMM/VMMR3/PDMAsyncCompletionFileNormal.cpp +@@ -37,6 +37,13 @@ + #include <iprt/string.h> + #include <iprt/assert.h> + #include <VBox/log.h> ++/* TBR: we need a complicated crawl through the data structure to get the AIO system limits ++ to check when considering growing the number of active AIO requests.... */ ++/* We need the PDMInternal *before* the UVM, or it isn't visible afterwards. (src/VBox/VMM/include/PDMInternal.h) */ ++#include <PDMInternal.h> ++#include <VBox/vmm/uvm.h> ++#include <VBox/vmm/vm.h> ++/* TBR: end of extra includes. */ + + #include "PDMAsyncCompletionFileInternal.h" + +@@ -1119,8 +1126,40 @@ static int pdmacFileAioMgrNormalProcessTaskList(PPDMAC + */ + pdmacFileAioMgrNormalBalanceLoad(pAioMgr); + #else +- /* Grow the I/O manager */ +- pAioMgr->enmState = PDMACEPFILEMGRSTATE_GROWING; ++ /* TBR: Check the global AIO system limit before growing. ++ This is the complicateds crawl through the data structure mentioned ++ near the start of this file. ++ There HAS to be a better way and better time to get this limit! */ ++ PPDMASYNCCOMPLETIONEPCLASS pEpClass = NULL; ++ PCPDMASYNCCOMPLETIONEPCLASSOPS pEndpointOps = NULL; ++ PDMASYNCCOMPLETIONEPCLASSTYPE enmClassType; ++ PPDMASYNCCOMPLETIONEPCLASSFILE pEpClassFile = NULL; ++ PVM pVM = NULL; ++ PUVM pUVM = NULL; ++ unsigned int aio_system_reqests_max = RTFILEAIO_UNLIMITED_REQS; ++ pEpClass = pEndpoint->Core.pEpClass; ++ AssertMsg((NULL != pEpClass),("ep->class is NULL")); ++ pEndpointOps = pEpClass->pEndpointOps; ++ AssertMsg((NULL != pEndpointOps),("ep->class->ops is NULL")); ++ enmClassType = pEndpointOps->enmClassType; ++ AssertMsg((PDMASYNCCOMPLETIONEPCLASSTYPE_FILE == enmClassType), ++ ("ep->class->ops->type != PDMASYNCCOMPLETIONEPCLASSTYPE_FILE")); ++ pVM = pEpClass->pVM; ++ AssertMsg((NULL != pVM),("ep->class->VM is NULL")); ++ pUVM = pVM->pUVM; ++ AssertMsg((NULL != pUVM),("ep->class->VM->UVM is NULL")); ++ pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE) (pUVM->pdm.s.apAsyncCompletionEndpointClass[enmClassType]); ++ AssertMsg((NULL != pEpClassFile),("ep->class->VM->UVM->pdn[globals] is NULL")); ++ aio_system_reqests_max = pEpClassFile->cReqsOutstandingMax; ++#if 0 ++ /* A one time check during development to verify getting the right number. */ ++ AssertMsg((256 != aio_system_reqests_max), ++ ("aio_system_reqests_max != 256 (val=%u)",aio_system_reqests_max)); ++#endif ++ if (RT_UNLIKELY( aio_system_reqests_max == RTFILEAIO_UNLIMITED_REQS ++ || (pAioMgr->cRequestsActiveMax+PDMACEPFILEMGR_REQS_STEP) <= aio_system_reqests_max)) ++ /* Grow the I/O manager */ ++ pAioMgr->enmState = PDMACEPFILEMGRSTATE_GROWING; + #endif + } + } diff --git a/emulators/virtualbox-ose-72/files/patch-src_libs_xpcom18a4_Makefile.kmk b/emulators/virtualbox-ose-72/files/patch-src_libs_xpcom18a4_Makefile.kmk new file mode 100644 index 000000000000..95f5972ce7f8 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_libs_xpcom18a4_Makefile.kmk @@ -0,0 +1,11 @@ +--- src/libs/xpcom18a4/Makefile.kmk.orig 2025-08-13 19:56:45 UTC ++++ src/libs/xpcom18a4/Makefile.kmk +@@ -601,6 +601,8 @@ VBoxXPCOM_LIBS = \ + $(VBox-xpcom-proxy_1_TARGET) \ + $(VBox-xpcom-nspr_1_TARGET) \ + $(VBoxXPCOMGlue_s_1_TARGET) ++VBoxXPCOM_LIBS.freebsd = \ ++ pthread + VBoxXPCOM_LIBS.linux = \ + pthread dl + diff --git a/emulators/virtualbox-ose-72/files/patch-src_libs_xpcom18a4_nsprpub_pr_src_pthreads_ptsynch.c b/emulators/virtualbox-ose-72/files/patch-src_libs_xpcom18a4_nsprpub_pr_src_pthreads_ptsynch.c new file mode 100644 index 000000000000..6bd41290d6ee --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_libs_xpcom18a4_nsprpub_pr_src_pthreads_ptsynch.c @@ -0,0 +1,13 @@ +--- src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptsynch.c.orig 2025-08-13 19:56:47 UTC ++++ src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptsynch.c +@@ -45,6 +45,10 @@ + #include <string.h> + #include <pthread.h> + #include <sys/time.h> ++#ifdef FREEBSD ++#include <sys/param.h> ++#endif ++ + #include <errno.h> + + #include <iprt/asm.h> diff --git a/emulators/virtualbox-ose-72/files/patch-src_libs_xpcom18a4_xpcom_io_nsLocalFileUnix.h b/emulators/virtualbox-ose-72/files/patch-src_libs_xpcom18a4_xpcom_io_nsLocalFileUnix.h new file mode 100644 index 000000000000..50f117437106 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_libs_xpcom18a4_xpcom_io_nsLocalFileUnix.h @@ -0,0 +1,17 @@ +--- src/libs/xpcom18a4/xpcom/io/nsLocalFileUnix.h.orig 2025-08-13 19:56:51 UTC ++++ src/libs/xpcom18a4/xpcom/io/nsLocalFileUnix.h +@@ -74,14 +74,6 @@ + #define STATFS statfs + #endif + +-// so we can statfs on freebsd +-#if defined(__FreeBSD__) +- #define HAVE_SYS_STATFS_H +- #define STATFS statfs +- #include <sys/param.h> +- #include <sys/mount.h> +-#endif +- + class NS_COM nsLocalFile : public nsILocalFile + { + public: diff --git a/emulators/virtualbox-ose-72/files/pkg-message.in b/emulators/virtualbox-ose-72/files/pkg-message.in new file mode 100644 index 000000000000..27c14e0a2e2a --- /dev/null +++ b/emulators/virtualbox-ose-72/files/pkg-message.in @@ -0,0 +1,120 @@ +[ +{ type: install + message: <<EOM +VirtualBox was installed. + +You need to load the vboxdrv kernel module via /boot/loader.conf: + +vboxdrv_load="YES" + +You also have to add all users to your vboxusers group in order to use vbox. + +% pw groupmod vboxusers -m jerry + +Reboot the machine to load the needed kernel modules. + + +Bridging Support: +================= + +For bridged networking please add the following line to your /etc/rc.conf: + +vboxnet_enable="YES" + + +USB Support: +============ + +For USB support your user needs to be in the operator group and needs read +and write permissions to the USB device. + +% pw groupmod operator -m jerry + +Add the following to /etc/devfs.rules (create if it doesn't exist): + +[system=10] +add path 'usb/*' mode 0660 group operator + +To load these new rule add the following to /etc/rc.conf: + +devfs_system_ruleset="system" + +Then restart devfs to load the new rules: + +% /etc/rc.d/devfs restart + + +Troubleshooting: +================ + +Running VirtualBox as non-root user may fail with a fatal error +NS_ERROR_FACTORY_NOT_REGISTERED. In this case delete /tmp/.vbox-*-ipc file. + +If you experience "Network: write Failed: Cannot allocate memory" errors +try to increase net.graph.maxdata in /boot/loader.conf + +If you are using AIO, then increase these limits (https://bugs.freebsd.org/168298): +vfs.aio.max_buf_aio=8192 +vfs.aio.max_aio_queue_per_proc=65536 +vfs.aio.max_aio_per_proc=8192 +vfs.aio.max_aio_queue=65536 +To check if AIO is used use: kldstat -v | grep aio + +If you are experiencing VMs freezes with an error in VBox.log such as: +" +00:01:29.590192 AssertLogRel /usr/ports/emulators/virtualbox-ose/work/VirtualBox-6.1.44 +/src/VBox/VMM/VMMR3/PGMPhys.cpp(5148) int PGMR3PhysAllocateHandyPages(PVM): RT_SUCCESS(rc) +00:01:29.590221 87/128: idPage=0x3d400 HCPhysGCPhys=000000027eaed000 rc=VERR_NO_MEMORY +00:01:29.590247 Changing the VM state from 'RUNNING' to 'GURU_MEDITATION' +00:01:29.590261 Console: Machine state changed to 'GuruMeditation' +00:01:29.590695 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +00:01:29.590696 !! +00:01:29.590697 !! VCPU0: Guru Meditation -8 (VERR_NO_MEMORY) +" +and see a lot of free RAM, then increase sysctl vm.max_user_wired +(https://bugs.freebsd.org/252227). +For dedicated VM servers, a good start is: +("RAM in GB" - max(1, "RAM in GB" / 32)) * 1024*1024*1024 / PAGE_SIZE +PAGE_SIZE on x86 is 4096. +Examples with different RAM sizes in GB: + 16: ( 16-max(1, 16/32)*1024*1024*1024/4096 = 3932160 => 15GB + 32: ( 32-max(1, 32/32)*1024*1024*1024/4096 = 8126464 => 31GB + 48: ( 48-max(1, 48/32)*1024*1024*1024/4096 = 12189696 => 46.5GB + 64: ( 64-max(1, 64/32)*1024*1024*1024/4096 = 16252928 => 62GB +128: (128-max(1,128/32)*1024*1024*1024/4096 = 32505856 => 124GB +256: (256-max(1,256/32)*1024*1024*1024/4096 = 65011712 => 248GB + +When assigning IP addresses in host-only mode from ranges outside +of VirtualBox's defaults, the respective ranges need to be listed +in %%VBOX_ETC%%/networks.conf (https://bugs.freebsd.org/259399). + +Check the wiki page for known issues and troubleshooting: +https://wiki.freebsd.org/VirtualBox + +Please report any problems to emulation@. Thanks! +EOM +} +{ type: upgrade + maximum_version: 6.1.22 + message: <<EOM +The PULSEAUDIO option has been forcibly disabled since VirtualBox +version 6.1.24 due to a bug in it preventing virtual machines +configured to use it from starting. + +When upgrading from a previous version please reconfigure any virtual +machines using the Pulseaudio host audio driver to use another +supported one. +EOM +} +{ type: upgrade + minimum_version: 6.1.26 + maximum_version: 6.1.32_1 + message: <<EOM +To comply to hier(7) requirements, networks.conf's location changed +to %%VBOX_ETC%%/networks.conf. + +In case /etc/vbox/networks.conf exists, it needs to be moved to +%%VBOX_ETC%% and /etc/vbox should be deleted. +EOM +} +] diff --git a/emulators/virtualbox-ose-72/files/vboxheadless.in b/emulators/virtualbox-ose-72/files/vboxheadless.in new file mode 100644 index 000000000000..5ddc5fc21d6c --- /dev/null +++ b/emulators/virtualbox-ose-72/files/vboxheadless.in @@ -0,0 +1,140 @@ +#!/bin/sh + +# PROVIDE: vboxheadless +# REQUIRE: LOGIN vboxnet +# KEYWORD: shutdown +# +# Add the following line to /etc/rc.conf[.local] to enable vboxheadless +# +# vboxheadless_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable vboxheadless. +# vboxheadless_machines (str): Space separated list of machines +# vboxheadless_user (str): Default user account to run with. +# (default: %%VBOXUSER%%) +# vboxheadless_stop (str): Default stop cmd for VBoxManage controlvm. +# (default: savestate) +# vboxheadless_delay (int): Default startup/shutdown delay in seconds. +# (default: 0) +# vboxheadless_<machine>_name (str): Virtualbox machine name or UUID. +# vboxheadless_<machine>_user (str): User account to run with. +# vboxheadless_<machine>_flags (str): Additional flags for VBoxHeadless. +# vboxheadless_<machine>_stop (str): Stop command for VBoxManage controlvm. +# vboxheadless_<machine>_delay (int): Startup and shutdown delay in seconds. + +. /etc/rc.subr + +name="vboxheadless" +rcvar=vboxheadless_enable +rc_fast="YES" + +command="%%VBOXDIR%%/VBoxHeadless" +pidbase="/var/run/${name}" + +start_cmd="${name}_start" +stop_cmd="${name}_stop" +status_cmd="${name}_status" + +vboxheadless_start() +{ + local machine mpidfile pid vmname vmuser vmflags vmdelay + + echo "Starting Virtual Machines:" + for machine in ${vboxheadless_machines}; do + mpidfile="${pidbase}_${machine}.pid" + pid=$(check_pidfile $mpidfile $command) + eval vmname="\${vboxheadless_${machine}_name:-${machine}}" + eval vmuser="\${vboxheadless_${machine}_user:-${vboxheadless_user}}" + eval vmflags="\${vboxheadless_${machine}_flags:-}" + eval vmdelay="\${vboxheadless_${machine}_delay:-${vboxheadless_delay}}" + + HOME=$(/usr/sbin/pw usershow -7 -n "${vmuser}" | /usr/bin/cut -d: -f6) + + /usr/bin/printf "%25s " "${vmname}" + + /usr/bin/su ${vmuser} -c "%%VBOXDIR%%/VBoxManage showvminfo '${vmname}' >/dev/null" 2>/dev/null + + if [ $? != 0 ]; then + echo "Unknown machine" + continue + fi + + if [ -n "${pid}" ]; then + echo "Already running? (pid=${pid})" + continue + fi + + /bin/sleep ${vmdelay} + /usr/bin/install -o ${vmuser} -g %%VBOXGROUP%% -m 644 /dev/null ${mpidfile} + /usr/sbin/daemon -f -p ${mpidfile} -u ${vmuser} ${command} --startvm "${vmname}" ${vmflags} + echo "Started" + done +} + +vboxheadless_stop() +{ + local machine mpidfile pid pids vmname vmuser vmstop vmdelay + + echo "Saving states for Virtual Machines:" + for machine in ${vboxheadless_machines}; do + mpidfile="${pidbase}_${machine}.pid" + pid=$(check_pidfile $mpidfile $command) + eval vmname="\${vboxheadless_${machine}_name:-${machine}}" + eval vmuser="\${vboxheadless_${machine}_user:-${vboxheadless_user}}" + eval vmstop="\${vboxheadless_${machine}_stop:-${vboxheadless_stop}}" + eval vmdelay="\${vboxheadless_${machine}_delay:-${vboxheadless_delay}}" + + /usr/bin/printf "%25s " "${vmname}" + + if [ -n "${pid}" ]; then + pids="${pids} ${pid}" + /bin/sleep ${vmdelay} + /usr/bin/su ${vmuser} -c "%%VBOXDIR%%/VBoxManage controlvm '${vmname}' ${vmstop} >/dev/null &" 2>/dev/null + fi + done + if [ -n "${pids}" ]; then + wait_for_pids $pids >/dev/null + echo "Stopped" + else + echo "Not running?" + fi +} + +vboxheadless_status() +{ + local machine mpidfile pid vmname vmuser + + /usr/bin/printf "%25s %s\n" "Machine" "Status" + /usr/bin/printf "%25s %s\n" "-------------------------" "------------" + + for machine in ${vboxheadless_machines}; do + mpidfile="${pidbase}_${machine}.pid" + pid=$(check_pidfile $mpidfile $command) + eval vmname="\${vboxheadless_${machine}_name:-${machine}}" + eval vmuser="\${vboxheadless_${machine}_user:-${vboxheadless_user}}" + + /usr/bin/su ${vmuser} -c "%%VBOXDIR%%/VBoxManage showvminfo '${vmname}' >/dev/null" 2>/dev/null + + if [ $? != 0 ]; then + /usr/bin/printf "%20s %s\n" "${vmname}" "Unknown Machine" + elif [ -n "${pid}" ]; then + /usr/bin/printf "%25s %s\n" "${vmname}" "Running" + else + /usr/bin/printf "%25s %s\n" "${vmname}" "Powered Off" + fi + done +} + +load_rc_config $name + +: ${vboxheadless_enable="NO"} +: ${vboxheadless_user="%%VBOXUSER%%"} +: ${vboxheadless_stop="savestate"} +: ${vboxheadless_delay="0"} + +cmd_arg="$1" ; shift + +if [ -n "$*" ]; then + vboxheadless_machines="$*" +fi + +run_rc_command "${cmd_arg}" diff --git a/emulators/virtualbox-ose-72/files/vboxinit.in b/emulators/virtualbox-ose-72/files/vboxinit.in new file mode 100644 index 000000000000..9895da9e362e --- /dev/null +++ b/emulators/virtualbox-ose-72/files/vboxinit.in @@ -0,0 +1,91 @@ +#!/bin/sh + +# PROVIDE: vboxinit +# REQUIRE: LOGIN vboxnet vboxwebsrv sshd +# KEYWORD: shutdown +# +# Add the following line to /etc/rc.conf[.local] to enable vboxinit +# +# vboxinit_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable vboxinit. +# stop and faststop are always enabled. +# vboxinit_user (str): Default user account to run with. +# (default: %%VBOXUSER%%) +# vboxinit_home (str): Default home directory to run with. +# (default: home of user ${vboxinit_user} +# vboxinit_stop (str): Default stop cmd for VBoxManage controlvm. +# (default: savestate) +# vboxinit_start_delay (int): Default startup delay in seconds. +# (default: 0) +# vboxinit_stop_delay (int): Default shutdown delay in seconds. +# (default: 0) +# +# Set the "Startup Mode" to "Automatic" for the virtual machine in +# phpvirtualbox to automatically start the virtual machine during OS boot. +# + +. /etc/rc.subr + +name="vboxinit" +rcvar="${name}_enable" + +start_cmd="${name}_start" +stop_cmd="${name}_stop" +status_cmd="${name}_status" +restart_cmd="${name}_restart" + +vboxinit_start() +{ + # Get a list of all machines with autorun enabled in phpvirtualbox + ${su_command} "${command} list vms | /usr/bin/tr -d '{}\"'" | /usr/bin/sort | while read VMNAME UUID; do + STARTUP=$(${su_command} "${command} getextradata ${UUID} 'pvbx/startupMode'" | /usr/bin/cut -d' ' -f2) + if [ "${STARTUP}" == "auto" ]; then + echo "${name}: starting machine ${VMNAME} ..." + ${su_command} "${command} startvm ${UUID} --type headless" + sleep "${vboxinit_start_delay}" + fi + done +} + +vboxinit_stop() +{ + # Get all running machines + ${su_command} "${command} list runningvms | /usr/bin/tr -d '{}\"'" | /usr/bin/sort -r | while read VMNAME UUID; do + echo "${name}: stopping machine ${VMNAME} with action '${vboxinit_stop}' ..." + ${su_command} "${command} controlvm ${UUID} ${vboxinit_stop}" + sleep "${vboxinit_stop_delay}" + done +} + +vboxinit_status() +{ + # List all running machines + ${su_command} "${command} list runningvms" +} + +vboxinit_restart() +{ + vboxinit_stop + vboxinit_start +} + +load_rc_config $name + +: ${vboxinit_enable="NO"} +: ${vboxinit_user="%%VBOXUSER%%"} +: ${vboxinit_home=$(/usr/sbin/pw usershow -7 -n "${vboxinit_user}" | /usr/bin/cut -d: -f6)} +: ${vboxinit_stop="savestate"} +: ${vboxinit_start_delay="1"} +: ${vboxinit_stop_delay="0"} +HOME=${vboxinit_home} +USER=${vboxinit_user} +export HOME USER + +command="%%VBOXDIR%%/VBoxManage" +su_command="/usr/bin/su -m ${vboxinit_user} -c" + +if [ "x$1" = "xstop" ] || [ "x$1" = "xfaststop" ]; then + vboxinit_enable="YES" +fi + +run_rc_command "$1" diff --git a/emulators/virtualbox-ose-72/files/vboxwatchdog.in b/emulators/virtualbox-ose-72/files/vboxwatchdog.in new file mode 100644 index 000000000000..c21bc03b3523 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/vboxwatchdog.in @@ -0,0 +1,51 @@ +#!/bin/sh + +# PROVIDE: vboxwatchdog +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add the following line to /etc/rc.conf[.local] to enable vboxwatchdog +# +# vboxwatchdog_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable vboxwatchdog. +# vboxwatchdog_user (str): User account to run with. +# vboxwatchdog_flags (str): Custom flags for VBoxWatchdog. + +. /etc/rc.subr + +name=vboxwatchdog +rcvar=vboxwatchdog_enable + +command="%%VBOXDIR%%/VBoxBalloonCtrl" +pidfile="/var/run/${name}.pid" + +start_cmd="${name}_start" + +vboxwatchdog_start() +{ + local pid + + HOME=$(/usr/sbin/pw usershow -7 -n "${vboxwatchdog_user}" | /usr/bin/cut -d: -f6) + pid=$(check_pidfile $pidfile $command) + + if [ -n "${pid}" ]; then + echo "${name} already running? (pid=${pid})." + return 1 + fi + + # prevent inheriting this setting to VBoxSVC + unset VBOX_RELEASE_LOG_DEST + + echo -n "Starting ${name}" + /usr/bin/install -o ${vboxwatchdog_user} -g %%VBOXGROUP%% -m 644 /dev/null ${pidfile} + /usr/sbin/daemon -f -p ${pidfile} -u ${vboxwatchdog_user} ${command} ${vboxwatchdog_flags} + echo '.' +} + +load_rc_config $name + +: ${vboxwatchdog_enable="NO"} +: ${vboxwatchdog_user="%%VBOXUSER%%"} +: ${vboxwatchdog_flags=""} + +run_rc_command "$1" diff --git a/emulators/virtualbox-ose-72/files/vboxwebsrv.in b/emulators/virtualbox-ose-72/files/vboxwebsrv.in new file mode 100644 index 000000000000..a7e1e38e3090 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/vboxwebsrv.in @@ -0,0 +1,47 @@ +#!/bin/sh + +# PROVIDE: vboxwebsrv +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add the following line to /etc/rc.conf[.local] to enable vboxwebsrv +# +# vboxwebsrv_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable vboxwebsrv. +# vboxwebsrv_user (str): User account to run with. +# vboxwebsrv_flags (str): Custom flags for vboxwebsrv. + +. /etc/rc.subr + +name=vboxwebsrv +rcvar=vboxwebsrv_enable + +command="%%VBOXDIR%%/vboxwebsrv" +pidfile="/var/run/${name}.pid" + +start_cmd="${name}_start" + +vboxwebsrv_start() +{ + local pid + + HOME=$(/usr/sbin/pw usershow -7 -n "${vboxwebsrv_user}" | /usr/bin/cut -d: -f6) + pid=$(check_pidfile $pidfile $command) + + if [ -n "${pid}" ]; then + echo "${name} already running? (pid=${pid})." + return 1 + fi + + echo -n "Starting ${name}" + /usr/bin/install -o ${vboxwebsrv_user} -g %%VBOXGROUP%% -m 644 /dev/null ${pidfile} + /usr/sbin/daemon -f -p ${pidfile} -u ${vboxwebsrv_user} ${command} ${vboxwebsrv_flags} + echo '.' +} + +load_rc_config $name + +: ${vboxwebsrv_enable="NO"} +: ${vboxwebsrv_user="%%VBOXWSUSER%%"} + +run_rc_command "$1" diff --git a/emulators/virtualbox-ose-72/files/virtualbox.desktop b/emulators/virtualbox-ose-72/files/virtualbox.desktop new file mode 100644 index 000000000000..b0d09e2128b7 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/virtualbox.desktop @@ -0,0 +1,17 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Name=Oracle VM VirtualBox +GenericName=Virtual Machine +Type=Application +Exec=VirtualBox +TryExec=VirtualBox +Icon=VBox +Categories=Emulator;System; +Comment=Run several virtual systems on a single host computer +Comment[de]=Windows und andere Betriebssysteme unter FreeBSD ausführen +Comment[it]=Esegui più macchine virtuali su un singolo computer +Comment[ko]=가상 머신 +Comment[pl]=Uruchamianie wielu systemów wirtualnych na jednym komputerze gospodarza +Comment[ru]=Запуск нескольких виртуальных машин на одном компьютере +Comment[sv]=Kör flera virtuella system på en enda värddator diff --git a/emulators/virtualbox-ose-72/pkg-descr b/emulators/virtualbox-ose-72/pkg-descr new file mode 100644 index 000000000000..1ba975e84e68 --- /dev/null +++ b/emulators/virtualbox-ose-72/pkg-descr @@ -0,0 +1,8 @@ +Oracle VM VirtualBox is a hosted hypervisor for x86 virtualisation. +Supported guests include BSD, Haiku, Linux, OS/2, ReactOS, Solaris and +Windows. + +Guest Additions are available from: emulators/virtualbox-ose-additions + +For the Extension Pack: FreeBSD is not a supported host platform. +Installation of the Pack will not extend the feature set. diff --git a/emulators/virtualbox-ose-72/pkg-plist b/emulators/virtualbox-ose-72/pkg-plist new file mode 100644 index 000000000000..d2dfcb82d4d5 --- /dev/null +++ b/emulators/virtualbox-ose-72/pkg-plist @@ -0,0 +1,452 @@ +bin/VBoxAutostart +bin/VBoxBalloonCtrl +bin/VBoxBugReport +bin/VBoxHeadless +bin/VBoxManage +bin/VBoxVRDP +%%QT%%bin/VirtualBox +%%QT%%bin/VirtualBoxVM +bin/vboxautostart +bin/vboxballoonctrl +bin/vboxbugreport +bin/vboxheadless +%%VBOXIMG%%bin/vboximg-mount +bin/vboxmanage +%%WEBSERVICE%%bin/vboxwebsrv +%%QT%%bin/virtualbox +%%QT%%bin/virtualboxvm +include/virtualbox/VirtualBox_XPCOM.h +include/virtualbox/ipcIClientObserver.h +include/virtualbox/ipcIDConnectService.h +include/virtualbox/ipcIMessageObserver.h +include/virtualbox/ipcIService.h +include/virtualbox/ipcd/ipcCID.h +include/virtualbox/ipcd/ipcdclient.h +include/virtualbox/nsIArray.h +include/virtualbox/nsIAtom.h +include/virtualbox/nsIAtomService.h +include/virtualbox/nsIBinaryInputStream.h +include/virtualbox/nsIBinaryOutputStream.h +include/virtualbox/nsICategoryManager.h +include/virtualbox/nsIClassInfo.h +include/virtualbox/nsICollection.h +include/virtualbox/nsIComponentLoader.h +include/virtualbox/nsIComponentLoaderManager.h +include/virtualbox/nsIComponentManager.h +include/virtualbox/nsIComponentManagerObsolete.h +include/virtualbox/nsIComponentRegistrar.h +include/virtualbox/nsIDebug.h +include/virtualbox/nsIDirectoryEnumerator.h +include/virtualbox/nsIDirectoryService.h +include/virtualbox/nsIEnumerator.h +include/virtualbox/nsIErrorService.h +include/virtualbox/nsIEventQueue.h +include/virtualbox/nsIEventQueueService.h +include/virtualbox/nsIEventTarget.h +include/virtualbox/nsIException.h +include/virtualbox/nsIExceptionService.h +include/virtualbox/nsIFactory.h +include/virtualbox/nsIFile.h +include/virtualbox/nsIHashable.h +include/virtualbox/nsIInputStream.h +include/virtualbox/nsIInterfaceInfo.h +include/virtualbox/nsIInterfaceInfoManager.h +include/virtualbox/nsIInterfaceRequestor.h +include/virtualbox/nsILocalFile.h +include/virtualbox/nsILocalFileMac.h +include/virtualbox/nsIModule.h +include/virtualbox/nsINativeComponentLoader.h +include/virtualbox/nsIObjectInputStream.h +include/virtualbox/nsIObjectOutputStream.h +include/virtualbox/nsIObserver.h +include/virtualbox/nsIObserverService.h +include/virtualbox/nsIOutputStream.h +include/virtualbox/nsIProgrammingLanguage.h +include/virtualbox/nsIProperties.h +include/virtualbox/nsIProxyObjectManager.h +include/virtualbox/nsIRunnable.h +include/virtualbox/nsISerializable.h +include/virtualbox/nsIServiceManager.h +include/virtualbox/nsISimpleEnumerator.h +include/virtualbox/nsIStringEnumerator.h +include/virtualbox/nsISupports.h +include/virtualbox/nsISupportsArray.h +include/virtualbox/nsISupportsIterators.h +include/virtualbox/nsISupportsPrimitives.h +include/virtualbox/nsITraceRefcnt.h +include/virtualbox/nsIVariant.h +include/virtualbox/nsIWeakReference.h +include/virtualbox/nsIXPTLoader.h +include/virtualbox/nsprpub/nspr.h +include/virtualbox/nsprpub/plarena.h +include/virtualbox/nsprpub/plarenas.h +include/virtualbox/nsprpub/plhash.h +include/virtualbox/nsprpub/prbit.h +include/virtualbox/nsprpub/prcpucfg.h +include/virtualbox/nsprpub/prlong.h +include/virtualbox/nsprpub/prmem.h +include/virtualbox/nsprpub/prmon.h +include/virtualbox/nsprpub/prtime.h +include/virtualbox/nsprpub/prtypes.h +include/virtualbox/nsrootidl.h +include/virtualbox/string/nsAString.h +include/virtualbox/string/nsAlgorithm.h +include/virtualbox/string/nsCharTraits.h +include/virtualbox/string/nsDependentString.h +include/virtualbox/string/nsDependentSubstring.h +include/virtualbox/string/nsEmbedString.h +include/virtualbox/string/nsLiteralString.h +include/virtualbox/string/nsObsoleteAString.h +include/virtualbox/string/nsPrintfCString.h +include/virtualbox/string/nsPromiseFlatString.h +include/virtualbox/string/nsReadableUtils.h +include/virtualbox/string/nsString.h +include/virtualbox/string/nsStringAPI.h +include/virtualbox/string/nsStringFwd.h +include/virtualbox/string/nsStringIterator.h +include/virtualbox/string/nsSubstring.h +include/virtualbox/string/nsSubstringTuple.h +include/virtualbox/string/nsTAString.h +include/virtualbox/string/nsTDependentString.h +include/virtualbox/string/nsTDependentSubstring.h +include/virtualbox/string/nsTObsoleteAString.h +include/virtualbox/string/nsTPromiseFlatString.h +include/virtualbox/string/nsTString.h +include/virtualbox/string/nsTSubstring.h +include/virtualbox/string/nsTSubstringTuple.h +include/virtualbox/string/nsUTF8Utils.h +include/virtualbox/string/nsXPIDLString.h +include/virtualbox/string/string-template-def-char.h +include/virtualbox/string/string-template-def-unichar.h +include/virtualbox/string/string-template-undef.h +include/virtualbox/xpcom/nsAgg.h +include/virtualbox/xpcom/nsAppDirectoryServiceDefs.h +include/virtualbox/xpcom/nsArray.h +include/virtualbox/xpcom/nsArrayEnumerator.h +include/virtualbox/xpcom/nsAtomService.h +include/virtualbox/xpcom/nsAutoLock.h +include/virtualbox/xpcom/nsAutoPtr.h +include/virtualbox/xpcom/nsBaseHashtable.h +include/virtualbox/xpcom/nsCOMArray.h +include/virtualbox/xpcom/nsCOMPtr.h +include/virtualbox/xpcom/nsCRT.h +include/virtualbox/xpcom/nsCategoryManagerUtils.h +include/virtualbox/xpcom/nsClassHashtable.h +include/virtualbox/xpcom/nsComponentManagerObsolete.h +include/virtualbox/xpcom/nsComponentManagerUtils.h +include/virtualbox/xpcom/nsDataHashtable.h +include/virtualbox/xpcom/nsDebug.h +include/virtualbox/xpcom/nsDebugImpl.h +include/virtualbox/xpcom/nsDeque.h +include/virtualbox/xpcom/nsDirectoryService.h +include/virtualbox/xpcom/nsDirectoryServiceDefs.h +include/virtualbox/xpcom/nsDirectoryServiceUtils.h +include/virtualbox/xpcom/nsDoubleHashtable.h +include/virtualbox/xpcom/nsEnumeratorUtils.h +include/virtualbox/xpcom/nsError.h +include/virtualbox/xpcom/nsEventQueueUtils.h +include/virtualbox/xpcom/nsGenericFactory.h +include/virtualbox/xpcom/nsHashKeys.h +include/virtualbox/xpcom/nsHashSets.h +include/virtualbox/xpcom/nsHashtable.h +include/virtualbox/xpcom/nsID.h +include/virtualbox/xpcom/nsIGenericFactory.h +include/virtualbox/xpcom/nsIID.h +include/virtualbox/xpcom/nsIInterfaceRequestorUtils.h +include/virtualbox/xpcom/nsIServiceManagerObsolete.h +include/virtualbox/xpcom/nsIServiceManagerUtils.h +include/virtualbox/xpcom/nsISupportsBase.h +include/virtualbox/xpcom/nsISupportsImpl.h +include/virtualbox/xpcom/nsISupportsUtils.h +include/virtualbox/xpcom/nsIWeakReferenceUtils.h +include/virtualbox/xpcom/nsInt64.h +include/virtualbox/xpcom/nsInterfaceHashtable.h +include/virtualbox/xpcom/nsLocalFile.h +include/virtualbox/xpcom/nsLocalFileUnix.h +include/virtualbox/xpcom/nsMemory.h +include/virtualbox/xpcom/nsModule.h +include/virtualbox/xpcom/nsNativeCharsetUtils.h +include/virtualbox/xpcom/nsNativeComponentLoader.h +include/virtualbox/xpcom/nsObserverService.h +include/virtualbox/xpcom/nsObsoleteModuleLoading.h +include/virtualbox/xpcom/nsProxiedService.h +include/virtualbox/xpcom/nsProxyEvent.h +include/virtualbox/xpcom/nsProxyRelease.h +include/virtualbox/xpcom/nsRefPtrHashtable.h +include/virtualbox/xpcom/nsStaticAtom.h +include/virtualbox/xpcom/nsStaticComponent.h +include/virtualbox/xpcom/nsStringEnumerator.h +include/virtualbox/xpcom/nsStringIO.h +include/virtualbox/xpcom/nsSupportsArray.h +include/virtualbox/xpcom/nsSupportsPrimitives.h +include/virtualbox/xpcom/nsTHashtable.h +include/virtualbox/xpcom/nsTraceRefcnt.h +include/virtualbox/xpcom/nsTraceRefcntImpl.h +include/virtualbox/xpcom/nsVariant.h +include/virtualbox/xpcom/nsVoidArray.h +include/virtualbox/xpcom/nsWeakPtr.h +include/virtualbox/xpcom/nsWeakReference.h +include/virtualbox/xpcom/nsXPCOM.h +include/virtualbox/xpcom/nsXPCOMCID.h +include/virtualbox/xpcom/nsXPCOMGlue.h +include/virtualbox/xpcom/nscore.h +include/virtualbox/xpcom/pldhash.h +include/virtualbox/xpcom/plevent.h +include/virtualbox/xpcom/xcDll.h +include/virtualbox/xpcom/xpcom-config.h +include/virtualbox/xpcom/xpt_arena.h +include/virtualbox/xpcom/xpt_struct.h +include/virtualbox/xpcom/xpt_xdr.h +include/virtualbox/xpcom/xptcall.h +include/virtualbox/xpcom/xptcstubsdecl.inc +include/virtualbox/xpcom/xptcstubsdef.inc +include/virtualbox/xpcom/xptinfo.h +%%PYTHON%%%%PYTHON_SITELIBDIR%%/vboxapi-1-py%%PYTHON_VER%%.egg-info/PKG-INFO +%%PYTHON%%%%PYTHON_SITELIBDIR%%/vboxapi-1-py%%PYTHON_VER%%.egg-info/SOURCES.txt +%%PYTHON%%%%PYTHON_SITELIBDIR%%/vboxapi-1-py%%PYTHON_VER%%.egg-info/dependency_links.txt +%%PYTHON%%%%PYTHON_SITELIBDIR%%/vboxapi-1-py%%PYTHON_VER%%.egg-info/requires.txt +%%PYTHON%%%%PYTHON_SITELIBDIR%%/vboxapi-1-py%%PYTHON_VER%%.egg-info/top_level.txt +%%PYTHON%%%%PYTHON_SITELIBDIR%%/vboxapi/VirtualBox_constants.py +%%PYTHON%%%%PYTHON_SITELIBDIR%%/vboxapi%%PYTHON_PYCDIR%%VirtualBox_constants%%PYTHON_PYCEXT%% +%%PYTHON%%%%PYTHON_SITELIBDIR%%/vboxapi/__init__.py +%%PYTHON%%%%PYTHON_SITELIBDIR%%/vboxapi%%PYTHON_PYCDIR%%__init__%%PYTHON_PYCEXT%% +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/__init__.py +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom%%PYTHON_PYCDIR%%__init__%%PYTHON_PYCEXT%% +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/components.py +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom%%PYTHON_PYCDIR%%components%%PYTHON_PYCEXT%% +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/nsError.py +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom%%PYTHON_PYCDIR%%nsError%%PYTHON_PYCEXT%% +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/primitives.py +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom%%PYTHON_PYCDIR%%primitives%%PYTHON_PYCEXT%% +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/vboxxpcom.py +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom%%PYTHON_PYCDIR%%vboxxpcom%%PYTHON_PYCEXT%% +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/xpcom_consts.py +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom%%PYTHON_PYCDIR%%xpcom_consts%%PYTHON_PYCEXT%% +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/xpt.py +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom%%PYTHON_PYCDIR%%xpt%%PYTHON_PYCEXT%% +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/client/__init__.py +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/client%%PYTHON_PYCDIR%%__init__%%PYTHON_PYCEXT%% +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server/__init__.py +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server%%PYTHON_PYCDIR%%__init__%%PYTHON_PYCEXT%% +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server/enumerator.py +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server%%PYTHON_PYCDIR%%enumerator%%PYTHON_PYCEXT%% +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server/factory.py +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server%%PYTHON_PYCDIR%%factory%%PYTHON_PYCEXT%% +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server/loader.py +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server%%PYTHON_PYCDIR%%loader%%PYTHON_PYCEXT%% +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server/module.py +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server%%PYTHON_PYCDIR%%module%%PYTHON_PYCEXT%% +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server/policy.py +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server%%PYTHON_PYCDIR%%policy%%PYTHON_PYCEXT%% +%%QT%%lib/virtualbox/DbgPlugInDiggers.so +lib/virtualbox/VBox.sh +lib/virtualbox/VBoxAuth.so +lib/virtualbox/VBoxAuthSimple.so +lib/virtualbox/VBoxAutostart +lib/virtualbox/VBoxBalloonCtrl +lib/virtualbox/VBoxBugReport +lib/virtualbox/VBoxDD.so +lib/virtualbox/VBoxDD2.so +lib/virtualbox/VBoxDDR0.r0 +lib/virtualbox/VBoxDDU.so +%%QT%%lib/virtualbox/UICommon.so +%%QT%%lib/virtualbox/VBoxDbg.so +%%QT%%lib/virtualbox/VBoxDragAndDropSvc.so +lib/virtualbox/VBoxEFI-amd64.fd +lib/virtualbox/VBoxEFI-arm32.fd +lib/virtualbox/VBoxEFI-arm64.fd +lib/virtualbox/VBoxEFI-x86.fd +lib/virtualbox/VBoxExtPackHelperApp +lib/virtualbox/VBoxGuestControlSvc.so +lib/virtualbox/VBoxGuestPropSvc.so +@(root,%%VBOXGROUP%%,4510) lib/virtualbox/VBoxHeadless +lib/virtualbox/VBoxHeadless.so +lib/virtualbox/VBoxHostChannel.so +%%QT%%lib/virtualbox/VBoxKeyboard.so +lib/virtualbox/VBoxManage +@(root,%%VBOXGROUP%%,4510) lib/virtualbox/VBoxNetAdpCtl +@(root,%%VBOXGROUP%%,4510) lib/virtualbox/VBoxNetDHCP +lib/virtualbox/VBoxNetDHCP.so +@(root,%%VBOXGROUP%%,4510) lib/virtualbox/VBoxNetNAT +lib/virtualbox/VBoxNetNAT.so +%%PYTHON%%lib/virtualbox/VBoxPython3.so +%%PYTHON%%lib/virtualbox/VBoxPython3m.so +lib/virtualbox/VBoxRT.so +lib/virtualbox/VBoxSVC +%%X11%%lib/virtualbox/VBoxSVGA3D.so +lib/virtualbox/VBoxSharedClipboard.so +lib/virtualbox/VBoxSharedFolders.so +lib/virtualbox/VBoxTraceLogDecoders.so +lib/virtualbox/VBoxVMM.so +lib/virtualbox/VBoxVMMArm.so +lib/virtualbox/VBoxVMMPreload.so +lib/virtualbox/VBoxXPCOM.so +lib/virtualbox/VBoxXPCOMC.so +lib/virtualbox/VBoxXPCOMIPCD.so +lib/virtualbox/VMMR0.r0 +%%QT%%lib/virtualbox/VirtualBox +%%QT%%@(root,%%VBOXGROUP%%,4510) lib/virtualbox/VirtualBoxVM +%%QT%%lib/virtualbox/VirtualBoxVM.so +%%SDK%%lib/virtualbox/sdk +%%VBOXIMG%%lib/virtualbox/vboximg-mount +%%WEBSERVICE%%lib/virtualbox/vboxwebsrv +%%WEBSERVICE%%lib/virtualbox/webtest +%%VNC%%lib/virtualbox/ExtensionPacks/VNC/ExtPack-license.html +%%VNC%%lib/virtualbox/ExtensionPacks/VNC/ExtPack-license.rtf +%%VNC%%lib/virtualbox/ExtensionPacks/VNC/ExtPack-license.txt +%%VNC%%lib/virtualbox/ExtensionPacks/VNC/ExtPack.xml +%%VNC%%lib/virtualbox/ExtensionPacks/VNC/%%ARCH%%/VBoxVNC.so +%%VNC%%lib/virtualbox/ExtensionPacks/VNC/%%ARCH%%/VBoxVNCMain.so +%%GUESTADDITIONS%%lib/virtualbox/additions/VBoxGuestAdditions.iso +%%GUESTADDITIONS%%lib/virtualbox/additions/VBoxGuestAdditions_%%GUEST_VER%%.iso +lib/virtualbox/components/VBoxC.so +lib/virtualbox/components/VBoxSVCM.so +lib/virtualbox/components/VBoxXPCOMBase.xpt +lib/virtualbox/components/VBoxXPCOMIPCC.so +lib/virtualbox/components/VirtualBox_XPCOM.xpt +%%QT%%share/applications/virtualbox.desktop +%%DOCS%%%%DOCSDIR%%/UserManual.pdf +%%QT%%share/pixmaps/VBox.png +%%DATADIR%%/idl/VirtualBox_XPCOM.idl +%%DATADIR%%/idl/ipcIClientObserver.idl +%%DATADIR%%/idl/ipcIDConnectService.idl +%%DATADIR%%/idl/ipcIMessageObserver.idl +%%DATADIR%%/idl/ipcIService.idl +%%DATADIR%%/idl/nsIArray.idl +%%DATADIR%%/idl/nsIAtom.idl +%%DATADIR%%/idl/nsIAtomService.idl +%%DATADIR%%/idl/nsIBinaryInputStream.idl +%%DATADIR%%/idl/nsIBinaryOutputStream.idl +%%DATADIR%%/idl/nsICategoryManager.idl +%%DATADIR%%/idl/nsIClassInfo.idl +%%DATADIR%%/idl/nsICollection.idl +%%DATADIR%%/idl/nsIComponentLoader.idl +%%DATADIR%%/idl/nsIComponentLoaderManager.idl +%%DATADIR%%/idl/nsIComponentManager.idl +%%DATADIR%%/idl/nsIComponentManagerObsolete.idl +%%DATADIR%%/idl/nsIComponentRegistrar.idl +%%DATADIR%%/idl/nsIDebug.idl +%%DATADIR%%/idl/nsIDirectoryEnumerator.idl +%%DATADIR%%/idl/nsIDirectoryService.idl +%%DATADIR%%/idl/nsIEnumerator.idl +%%DATADIR%%/idl/nsIErrorService.idl +%%DATADIR%%/idl/nsIEventQueue.idl +%%DATADIR%%/idl/nsIEventQueueService.idl +%%DATADIR%%/idl/nsIEventTarget.idl +%%DATADIR%%/idl/nsIException.idl +%%DATADIR%%/idl/nsIExceptionService.idl +%%DATADIR%%/idl/nsIFactory.idl +%%DATADIR%%/idl/nsIFile.idl +%%DATADIR%%/idl/nsIHashable.idl +%%DATADIR%%/idl/nsIInputStream.idl +%%DATADIR%%/idl/nsIInterfaceInfo.idl +%%DATADIR%%/idl/nsIInterfaceInfoManager.idl +%%DATADIR%%/idl/nsIInterfaceRequestor.idl +%%DATADIR%%/idl/nsILocalFile.idl +%%DATADIR%%/idl/nsILocalFileMac.idl +%%DATADIR%%/idl/nsIModule.idl +%%DATADIR%%/idl/nsINativeComponentLoader.idl +%%DATADIR%%/idl/nsIObjectInputStream.idl +%%DATADIR%%/idl/nsIObjectOutputStream.idl +%%DATADIR%%/idl/nsIObserver.idl +%%DATADIR%%/idl/nsIObserverService.idl +%%DATADIR%%/idl/nsIOutputStream.idl +%%DATADIR%%/idl/nsIProgrammingLanguage.idl +%%DATADIR%%/idl/nsIProperties.idl +%%DATADIR%%/idl/nsIProxyObjectManager.idl +%%DATADIR%%/idl/nsIRunnable.idl +%%DATADIR%%/idl/nsISerializable.idl +%%DATADIR%%/idl/nsIServiceManager.idl +%%DATADIR%%/idl/nsISimpleEnumerator.idl +%%DATADIR%%/idl/nsIStringEnumerator.idl +%%DATADIR%%/idl/nsISupports.idl +%%DATADIR%%/idl/nsISupportsArray.idl +%%DATADIR%%/idl/nsISupportsIterators.idl +%%DATADIR%%/idl/nsISupportsPrimitives.idl +%%DATADIR%%/idl/nsITraceRefcnt.idl +%%DATADIR%%/idl/nsIVariant.idl +%%DATADIR%%/idl/nsIWeakReference.idl +%%DATADIR%%/idl/nsIXPTLoader.idl +%%DATADIR%%/idl/nsrootidl.idl +%%NLS%%%%DATADIR%%/nls/VirtualBox_bg.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_ca.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_ca_VA.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_cs.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_da.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_de.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_el.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_en.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_es.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_eu.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_fa.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_fi.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_fr.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_gl.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_he.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_hr_HR.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_hu.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_id.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_it.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_ja.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_ka.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_km_KH.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_ko.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_lt.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_nl.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_pl.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_pt.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_pt_BR.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_ro.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_ru.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_sk.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_sl.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_sr.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_sv.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_th.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_tr.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_uk.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_zh_CN.qm +%%NLS%%%%DATADIR%%/nls/VirtualBox_zh_TW.qm +%%NLS%%%%DATADIR%%/nls/qt_bg.qm +%%NLS%%%%DATADIR%%/nls/qt_ca.qm +%%NLS%%%%DATADIR%%/nls/qt_ca_VA.qm +%%NLS%%%%DATADIR%%/nls/qt_cs.qm +%%NLS%%%%DATADIR%%/nls/qt_da.qm +%%NLS%%%%DATADIR%%/nls/qt_de.qm +%%NLS%%%%DATADIR%%/nls/qt_el.qm +%%NLS%%%%DATADIR%%/nls/qt_en.qm +%%NLS%%%%DATADIR%%/nls/qt_es.qm +%%NLS%%%%DATADIR%%/nls/qt_eu.qm +%%NLS%%%%DATADIR%%/nls/qt_fa.qm +%%NLS%%%%DATADIR%%/nls/qt_fi.qm +%%NLS%%%%DATADIR%%/nls/qt_fr.qm +%%NLS%%%%DATADIR%%/nls/qt_gl.qm +%%NLS%%%%DATADIR%%/nls/qt_he.qm +%%NLS%%%%DATADIR%%/nls/qt_hr_HR.qm +%%NLS%%%%DATADIR%%/nls/qt_hu.qm +%%NLS%%%%DATADIR%%/nls/qt_id.qm +%%NLS%%%%DATADIR%%/nls/qt_it.qm +%%NLS%%%%DATADIR%%/nls/qt_ja.qm +%%NLS%%%%DATADIR%%/nls/qt_ka.qm +%%NLS%%%%DATADIR%%/nls/qt_km_KH.qm +%%NLS%%%%DATADIR%%/nls/qt_ko.qm +%%NLS%%%%DATADIR%%/nls/qt_lt.qm +%%NLS%%%%DATADIR%%/nls/qt_nl.qm +%%NLS%%%%DATADIR%%/nls/qt_pl.qm +%%NLS%%%%DATADIR%%/nls/qt_pt.qm +%%NLS%%%%DATADIR%%/nls/qt_pt_BR.qm +%%NLS%%%%DATADIR%%/nls/qt_ro.qm +%%NLS%%%%DATADIR%%/nls/qt_ru.qm +%%NLS%%%%DATADIR%%/nls/qt_sk.qm +%%NLS%%%%DATADIR%%/nls/qt_sl.qm +%%NLS%%%%DATADIR%%/nls/qt_sr.qm +%%NLS%%%%DATADIR%%/nls/qt_sv.qm +%%NLS%%%%DATADIR%%/nls/qt_th.qm +%%NLS%%%%DATADIR%%/nls/qt_tr.qm +%%NLS%%%%DATADIR%%/nls/qt_uk.qm +%%NLS%%%%DATADIR%%/nls/qt_zh_CN.qm +%%NLS%%%%DATADIR%%/nls/qt_zh_TW.qm +%%DATADIR%%/samples/Makefile +%%DATADIR%%/samples/tstVBoxAPIXPCOM.cpp +%%WEBSERVICE%%%%DATADIR%%/sdk/bindings/webservice/vboxweb.wsdl +%%PYTHON%%%%DATADIR%%/sdk/bindings/xpcom/python/xpcom diff --git a/emulators/virtualbox-ose-additions-legacy/Makefile b/emulators/virtualbox-ose-additions-legacy/Makefile index 36da35e3c79c..e9067d5fd9b4 100644 --- a/emulators/virtualbox-ose-additions-legacy/Makefile +++ b/emulators/virtualbox-ose-additions-legacy/Makefile @@ -42,7 +42,9 @@ CONFLICTS_INSTALL= virtualbox-ose-additions \ virtualbox-ose-additions-70 \ virtualbox-ose-additions-nox11-70 \ virtualbox-ose-additions-71 \ - virtualbox-ose-additions-nox11-71 + virtualbox-ose-additions-nox11-71 \ + virtualbox-ose-additions-72 \ + virtualbox-ose-additions-nox11-72 PATCHDIR= ${.CURDIR}/../${PORTNAME}-legacy/files EXTRACT_AFTER_ARGS= --exclude tools/*.x86 --exclude tools/*.amd64 --exclude Firmware diff --git a/emulators/virtualbox-ose-additions/Makefile b/emulators/virtualbox-ose-additions/Makefile index 58ad514e9a9b..2e5c8cc62bf2 100644 --- a/emulators/virtualbox-ose-additions/Makefile +++ b/emulators/virtualbox-ose-additions/Makefile @@ -42,7 +42,9 @@ CONFLICTS_INSTALL= virtualbox-ose-additions-legacy \ virtualbox-ose-additions-70 \ virtualbox-ose-additions-nox11-70 \ virtualbox-ose-additions-71 \ - virtualbox-ose-additions-nox11-71 + virtualbox-ose-additions-nox11-71 \ + virtualbox-ose-additions-72 \ + virtualbox-ose-additions-nox11-72 PATCHDIR= ${.CURDIR}/../${PORTNAME}/files EXTRACT_AFTER_ARGS= --exclude tools/*.x86 --exclude tools/*.amd64 --exclude Firmware diff --git a/emulators/virtualbox-ose-kmod-70/Makefile b/emulators/virtualbox-ose-kmod-70/Makefile index aecfea40859f..88de93b5d54a 100644 --- a/emulators/virtualbox-ose-kmod-70/Makefile +++ b/emulators/virtualbox-ose-kmod-70/Makefile @@ -35,7 +35,8 @@ CONFIGURE_ARGS+= --nofatal --with-gcc="${CC}" --with-g++="${CXX}" CONFLICTS_INSTALL= virtualbox-ose-kmod-legacy \ virtualbox-ose-kmod \ - virtualbox-ose-kmod-71 + virtualbox-ose-kmod-71 \ + virtualbox-ose-kmod-72 PATCHDIR= ${.CURDIR}/../${PORTNAME}-70/files PORTSCOUT= limit:^7\.0\. diff --git a/emulators/virtualbox-ose-kmod-71/Makefile b/emulators/virtualbox-ose-kmod-71/Makefile index 804952dba81b..75f20dc887fc 100644 --- a/emulators/virtualbox-ose-kmod-71/Makefile +++ b/emulators/virtualbox-ose-kmod-71/Makefile @@ -1,5 +1,5 @@ PORTNAME= virtualbox-ose -DISTVERSION= 7.1.10 +DISTVERSION= 7.1.12 CATEGORIES= emulators MASTER_SITES= https://download.virtualbox.org/virtualbox/${DISTVERSION}/ PKGNAMESUFFIX= -kmod-71 @@ -35,7 +35,8 @@ CONFIGURE_ARGS+= --nofatal --with-gcc="${CC}" --with-g++="${CXX}" CONFLICTS_INSTALL= virtualbox-ose-kmod-legacy \ virtualbox-ose-kmod \ - virtualbox-ose-kmod-70 + virtualbox-ose-kmod-70 \ + virtualbox-ose-kmod-72 PATCHDIR= ${.CURDIR}/../${PORTNAME}-71/files PORTSCOUT= limit:^7\.1\. diff --git a/emulators/virtualbox-ose-kmod-71/distinfo b/emulators/virtualbox-ose-kmod-71/distinfo index 51307e08d320..fb7394d7745c 100644 --- a/emulators/virtualbox-ose-kmod-71/distinfo +++ b/emulators/virtualbox-ose-kmod-71/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1749033863 -SHA256 (VirtualBox-7.1.10.tar.bz2) = 7d60010a4c9102613554b46f61d17b825c30ee59d8be071e52d8aac664ca9869 -SIZE (VirtualBox-7.1.10.tar.bz2) = 233395034 +TIMESTAMP = 1752700000 +SHA256 (VirtualBox-7.1.12.tar.bz2) = 6f9618f39168898134975f51df7c2d6d5129c0aa82b6ae11cf47f920c70df276 +SIZE (VirtualBox-7.1.12.tar.bz2) = 214691769 diff --git a/emulators/virtualbox-ose-kmod-72/Makefile b/emulators/virtualbox-ose-kmod-72/Makefile new file mode 100644 index 000000000000..0990aebfbc08 --- /dev/null +++ b/emulators/virtualbox-ose-kmod-72/Makefile @@ -0,0 +1,114 @@ +PORTNAME= virtualbox-ose +DISTVERSION= 7.2.0 +CATEGORIES= emulators +MASTER_SITES= https://download.virtualbox.org/virtualbox/${DISTVERSION}/ +PKGNAMESUFFIX= -kmod-72 +DISTNAME= VirtualBox-${DISTVERSION} + +MAINTAINER= vbox@FreeBSD.org +COMMENT= VirtualBox kernel module for FreeBSD +WWW= https://www.virtualbox.org/ + +LICENSE= GPLv2 +LICENSE_FILE= ${WRKSRC}/COPYING + +ONLY_FOR_ARCHS= amd64 + +BUILD_DEPENDS= kmk:devel/kBuild + +USES= cpe compiler:c++17-lang kmod tar:bzip2 +CPE_VENDOR= oracle +CPE_PRODUCT= vm_virtualbox +USE_RC_SUBR= vboxnet + +HAS_CONFIGURE= yes +CONFIGURE_ARGS+= --build-headless +CONFIGURE_ARGS+= --disable-alsa \ + --disable-dbus \ + --disable-docs \ + --disable-libvpx \ + --disable-pulse \ + --disable-python \ + --disable-sdl-ttf \ + --disable-xpcom +CONFIGURE_ARGS+= --nofatal --with-gcc="${CC}" --with-g++="${CXX}" + +CONFLICTS_INSTALL= virtualbox-ose-kmod-legacy \ + virtualbox-ose-kmod \ + virtualbox-ose-kmod-70 + +PATCHDIR= ${.CURDIR}/../${PORTNAME}-72/files +PORTSCOUT= limit:^7\.2\. +SUB_FILES= pkg-message +SUB_LIST= OPSYS=${OPSYS} OSREL=${OSREL} + +WRKSRC= ${WRKDIR}/VirtualBox-${DISTVERSION} + +OPTIONS_DEFINE= DEBUG INVARIANTS VIMAGE +OPTIONS_DEFAULT= VIMAGE +OPTIONS_SUB= yes +DEBUG_DESC= Debug symbols, additional logs and assertions +INVARIANTS_DESC= Use if kernel is compiled with INVARIANTS option +VIMAGE_DESC= VIMAGE virtual networking support +INVARIANTS_CFLAGS= -DINVARIANTS + +.include <bsd.port.options.mk> + +VBOX_BIN= ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE}/bin/src +VBOX_KMODS= vboxdrv \ + vboxnetadp \ + vboxnetflt + +BUILD_WRKSRC= ${VBOX_BIN} + +KMK_BUILDTYPE= release +KMK_CONFIG= VBOX_LIBPATH_X11=${LOCALBASE} VBOX_FREEBSD_SRC=${SRC_BASE}/sys +KMK_FLAGS= HostDrivers-scripts vboxdrv-src VBoxNetFlt-src VBoxNetAdp-src + +.if ${PORT_OPTIONS:MDEBUG} +KMK_FLAGS+= BUILD_TYPE=debug +KMK_BUILDTYPE= debug +EXTRA_PATCHES+= ${PATCHDIR}/extrapatch-Config.kmk \ + ${PATCHDIR}/extrapatch-src-VBox-HostDrivers-Support-freebsd-Makefile +MAKE_ARGS+= DEBUG_FLAGS="-O1 -g" +.endif + +.if ${ARCH} == i386 +KMK_ARCH= freebsd.x86 +.else +KMK_ARCH= freebsd.${ARCH} +.endif + +.include <bsd.port.pre.mk> + +SYMBOLSUFFIX= debug +PLIST_SUB+= SYMBOLSUFFIX=${SYMBOLSUFFIX} + +post-patch: + @${ECHO_CMD} 'VBOX_WITH_VBOXDRV = 1' > ${WRKSRC}/LocalConfig.kmk + @${ECHO_CMD} 'VBOX_WITH_NETFLT = 1' >> ${WRKSRC}/LocalConfig.kmk + @${ECHO_CMD} 'VBOX_WITH_NETADP = 1' >> ${WRKSRC}/LocalConfig.kmk + @${ECHO_CMD} 'VBOX_WITH_ADDITIONS =' >> ${WRKSRC}/LocalConfig.kmk +.if ${PORT_OPTIONS:MVIMAGE} + @${ECHO_CMD} 'VBOX_WITH_NETFLT_VIMAGE = 1' >> ${WRKSRC}/LocalConfig.kmk +.endif + @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g; s|which \$$\*|which \$$1|g' \ + ${WRKSRC}/Config.kmk ${WRKSRC}/configure + @${REINPLACE_CMD} \ + -e 's|\$$KBUILDDIR_BIN/kmk_sed|${LOCALBASE}/bin/kmk_sed|g' \ + ${WRKSRC}/configure + +pre-build: + cd ${WRKSRC}/src/VBox/HostDrivers && ${SH} -c \ + '. ${WRKSRC}/env.sh && ${KMK_CONFIG} ${LOCALBASE}/bin/kmk ${KMK_FLAGS}' + +do-install: + ${MKDIR} ${STAGEDIR}${KMODDIR} +.for i in ${VBOX_KMODS} + ${INSTALL_KLD} ${VBOX_BIN}/${i}/${i}.ko ${STAGEDIR}${KMODDIR} +.if ${PORT_OPTIONS:MDEBUG} + ${INSTALL_KLD} ${VBOX_BIN}/${i}/${i}.ko.${SYMBOLSUFFIX} ${STAGEDIR}${KMODDIR} +.endif +.endfor + +.include <bsd.port.post.mk> diff --git a/emulators/virtualbox-ose-kmod-72/distinfo b/emulators/virtualbox-ose-kmod-72/distinfo new file mode 100644 index 000000000000..c67534681918 --- /dev/null +++ b/emulators/virtualbox-ose-kmod-72/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1755276527 +SHA256 (VirtualBox-7.2.0.tar.bz2) = 4f2804ff27848ea772aee6b637bb1e10ee74ec2da117c257413e2d2c4f670ba0 +SIZE (VirtualBox-7.2.0.tar.bz2) = 206755781 diff --git a/emulators/virtualbox-ose-kmod-72/files/pkg-message.in b/emulators/virtualbox-ose-kmod-72/files/pkg-message.in new file mode 100644 index 000000000000..4e03cc0b5ec7 --- /dev/null +++ b/emulators/virtualbox-ose-kmod-72/files/pkg-message.in @@ -0,0 +1,10 @@ +[ +{ type: install + message: <<EOM +The vboxdrv kernel module uses internal kernel APIs. + +To avoid crashes due to kernel incompatibility, this module will only +load on %%OPSYS%% %%OSREL%% kernels. +EOM +} +] diff --git a/emulators/virtualbox-ose-kmod-72/files/vboxnet.in b/emulators/virtualbox-ose-kmod-72/files/vboxnet.in new file mode 100644 index 000000000000..af3d18884273 --- /dev/null +++ b/emulators/virtualbox-ose-kmod-72/files/vboxnet.in @@ -0,0 +1,67 @@ +#!/bin/sh + +# PROVIDE: vboxnet +# BEFORE: NETWORKING +# REQUIRE: FILESYSTEMS +# KEYWORD: nojail + +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# vboxnet_enable (bool): Set to NO by default. +# Set it to YES to load network related kernel modules on startup + +. /etc/rc.subr + +name="vboxnet" +rcvar=vboxnet_enable +start_cmd="vboxnet_start" +stop_cmd="vboxnet_stop" + +vboxnet_modules="vboxdrv vboxnetflt:ng_vboxnetflt vboxnetadp" + +vboxnet_start() +{ + local _k _m + + for _m in ${vboxnet_modules}; do + _k=${_m%:*} + _m=${_m#*:} + if ! kldstat -q -m ${_m}; then + if ! kldload ${_k} > /dev/null 2>&1; then + warn "Can't load ${_k} module." + return 1 + fi + fi + done + + # initialize configured host-only interfaces + LD_LIBRARY_PATH=%%PREFIX%%/lib %%PREFIX%%/bin/VBoxManage list hostonlyifs >/dev/null +} + +vboxnet_stop() +{ + local _k _m _r + + _r= + for _m in ${vboxnet_modules}; do + _r="${_m} ${_r}" + done + for _m in ${_r}; do + _k=${_m%:*} + _m=${_m#*:} + if kldstat -q -m ${_m}; then + if ! kldunload ${_k} > /dev/null 2>&1; then + warn "Can't unload ${_k} module." + return 1 + fi + fi + done +} + +load_rc_config $name + +: ${vboxnet_enable="NO"} + +run_rc_command "$1" diff --git a/emulators/virtualbox-ose-kmod-72/pkg-descr b/emulators/virtualbox-ose-kmod-72/pkg-descr new file mode 100644 index 000000000000..d11d42a81c78 --- /dev/null +++ b/emulators/virtualbox-ose-kmod-72/pkg-descr @@ -0,0 +1,5 @@ +VirtualBox is a family of powerful x86 virtualization products for +enterprise as well as home use. Not only is VirtualBox an extremely +feature rich, high performance product for enterprise customers, it +is also the only professional solution that is freely available as +Open Source Software under the terms of the GNU General Public License. diff --git a/emulators/virtualbox-ose-kmod-72/pkg-plist b/emulators/virtualbox-ose-kmod-72/pkg-plist new file mode 100644 index 000000000000..b08a5706a028 --- /dev/null +++ b/emulators/virtualbox-ose-kmod-72/pkg-plist @@ -0,0 +1,6 @@ +/%%KMODDIR%%/vboxdrv.ko +%%DEBUG%%/%%KMODDIR%%/vboxdrv.ko.%%SYMBOLSUFFIX%% +/%%KMODDIR%%/vboxnetadp.ko +%%DEBUG%%/%%KMODDIR%%/vboxnetadp.ko.%%SYMBOLSUFFIX%% +/%%KMODDIR%%/vboxnetflt.ko +%%DEBUG%%/%%KMODDIR%%/vboxnetflt.ko.%%SYMBOLSUFFIX%% diff --git a/emulators/virtualbox-ose-kmod-legacy/Makefile b/emulators/virtualbox-ose-kmod-legacy/Makefile index 15eb47c2a4a1..ba05f9a005aa 100644 --- a/emulators/virtualbox-ose-kmod-legacy/Makefile +++ b/emulators/virtualbox-ose-kmod-legacy/Makefile @@ -36,7 +36,8 @@ CONFIGURE_ARGS+= --nofatal --with-gcc="${CC}" --with-g++="${CXX}" CONFLICTS_INSTALL= virtualbox-ose-kmod \ virtualbox-ose-kmod-70 \ - virtualbox-ose-kmod-71 + virtualbox-ose-kmod-71 \ + virtualbox-ose-kmod-72 PATCHDIR= ${.CURDIR}/../${PORTNAME}-legacy/files PORTSCOUT= limit:^5\. diff --git a/emulators/virtualbox-ose-kmod/Makefile b/emulators/virtualbox-ose-kmod/Makefile index dd7d18bbdde5..1b0835a4d70c 100644 --- a/emulators/virtualbox-ose-kmod/Makefile +++ b/emulators/virtualbox-ose-kmod/Makefile @@ -36,7 +36,8 @@ CONFIGURE_ARGS+= --nofatal --with-gcc="${CC}" --with-g++="${CXX}" CONFLICTS_INSTALL= virtualbox-ose-kmod-legacy \ virtualbox-ose-kmod-70 \ - virtualbox-ose-kmod-71 + virtualbox-ose-kmod-71 \ + virtualbox-ose-kmod-72 PATCHDIR= ${.CURDIR}/../${PORTNAME}/files PORTSCOUT= limit:^6\. diff --git a/emulators/virtualbox-ose-legacy/Makefile b/emulators/virtualbox-ose-legacy/Makefile index 0c88e2ffe41b..77ed9000a262 100644 --- a/emulators/virtualbox-ose-legacy/Makefile +++ b/emulators/virtualbox-ose-legacy/Makefile @@ -44,7 +44,9 @@ CONFLICTS_INSTALL= virtualbox-ose \ virtualbox-ose-70 \ virtualbox-ose-nox11-70 \ virtualbox-ose-71 \ - virtualbox-ose-nox11-71 + virtualbox-ose-nox11-71 \ + virtualbox-ose-72 \ + virtualbox-ose-nox11-72 PORTSCOUT= limit:^5\. SUB_LIST= VBOXDIR=${VBOX_DIR} \ diff --git a/emulators/virtualbox-ose-nox11-71/Makefile b/emulators/virtualbox-ose-nox11-71/Makefile index 8c75dc172337..bd1a0035d424 100644 --- a/emulators/virtualbox-ose-nox11-71/Makefile +++ b/emulators/virtualbox-ose-nox11-71/Makefile @@ -1,4 +1,4 @@ -PORTREVISION= 2 +PORTREVISION= 0 PKGNAMESUFFIX= -nox11-71 MASTERDIR= ${.CURDIR}/../virtualbox-ose-71 diff --git a/emulators/virtualbox-ose-nox11-72/Makefile b/emulators/virtualbox-ose-nox11-72/Makefile new file mode 100644 index 000000000000..d415932ea096 --- /dev/null +++ b/emulators/virtualbox-ose-nox11-72/Makefile @@ -0,0 +1,11 @@ +PORTREVISION= 0 +PKGNAMESUFFIX= -nox11-72 + +MASTERDIR= ${.CURDIR}/../virtualbox-ose-72 + +OPTIONS_EXCLUDE= ALSA DBUS DEBUG GUESTADDITIONS DOCS NLS OGG PULSEAUDIO \ + QT6 VORBIS VPX X11 + +SLAVE_PORT= yes + +.include "${MASTERDIR}/Makefile" diff --git a/emulators/virtualbox-ose/Makefile b/emulators/virtualbox-ose/Makefile index 0dab90413e05..3bb9bd477162 100644 --- a/emulators/virtualbox-ose/Makefile +++ b/emulators/virtualbox-ose/Makefile @@ -42,7 +42,9 @@ CONFLICTS_INSTALL= virtualbox-ose-legacy \ virtualbox-ose-70 \ virtualbox-ose-nox11-70 \ virtualbox-ose-71 \ - virtualbox-ose-nox11-71 + virtualbox-ose-nox11-71 \ + virtualbox-ose-72 \ + virtualbox-ose-nox11-72 PORTSCOUT= limit:^6\. SUB_FILES= pkg-message diff --git a/emulators/visualboyadvance-m/Makefile b/emulators/visualboyadvance-m/Makefile index d15e80c07fef..c20867fd409d 100644 --- a/emulators/visualboyadvance-m/Makefile +++ b/emulators/visualboyadvance-m/Makefile @@ -58,6 +58,7 @@ GVBAM_USE= GNOME=gtkmm24,pangox-compat GVBAM_CMAKE_BOOL= ENABLE_GTK LINK_LIB_DEPENDS= libsfml-system.so:devel/sfml LINK_CMAKE_BOOL= ENABLE_LINK +LINK_BROKEN= Does not build LIRC_LIB_DEPENDS= liblirc_client.so:comms/lirc LIRC_RUN_DEPENDS= lircd:comms/lirc LIRC_CMAKE_BOOL= ENABLE_LIRC diff --git a/emulators/wine-devel/Makefile b/emulators/wine-devel/Makefile index d98676b38c45..40a86f0e2c72 100644 --- a/emulators/wine-devel/Makefile +++ b/emulators/wine-devel/Makefile @@ -1,5 +1,5 @@ PORTNAME= wine -DISTVERSION= 10.10 +DISTVERSION= 10.13 PORTEPOCH= 1 CATEGORIES= emulators MASTER_SITES= https://dl.winehq.org/wine/source/10.x/ diff --git a/emulators/wine-devel/distinfo b/emulators/wine-devel/distinfo index 261fa76cdef2..1edbe79f2454 100644 --- a/emulators/wine-devel/distinfo +++ b/emulators/wine-devel/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1749898973 -SHA256 (wine-10.10.tar.xz) = e76466a5ca3197f399ddf8069b0a79e5eb2dffe5b3b7db9eb7272288330c8596 -SIZE (wine-10.10.tar.xz) = 32528748 +TIMESTAMP = 1755295581 +SHA256 (wine-10.13.tar.xz) = f1f38df2055bdafa46b44c1edf8641e683330e3a146e09fd5219cfe93e33c531 +SIZE (wine-10.13.tar.xz) = 32681280 diff --git a/emulators/wine-devel/files/pkg32.sh b/emulators/wine-devel/files/pkg32.sh index 64d82459c219..04595f6c104c 100644 --- a/emulators/wine-devel/files/pkg32.sh +++ b/emulators/wine-devel/files/pkg32.sh @@ -1,19 +1,23 @@ #!/bin/sh -e -if [ "$(id -u)" = 0 ] -then +if [ "$(id -u)" = 0 ]; then echo "Don't run this script as root!" exit 1 fi I386_ROOT="${WINE_i386_ROOT:-$HOME/.i386-wine-pkg}" +ABI_FILE=/usr/lib32/libc.so.7 -if [ ! -d "$I386_ROOT/usr/share/keys/pkg" ] -then +if [ ! -f $ABI_FILE ]; then + echo "\"$ABI_FILE\" not found; exiting." + exit 1 +fi + +if [ ! -d "$I386_ROOT/usr/share/keys/pkg" ]; then mkdir -p "$I386_ROOT/usr/share/keys" ln -s /usr/share/keys/pkg "$I386_ROOT/usr/share/keys/pkg" fi # Show what we're going to do, then do it. -echo pkg -o ABI_FILE=/usr/lib32/libc.so.7 -o INSTALL_AS_USER=true -o RUN_SCRIPTS=false --rootdir "$I386_ROOT" "$@" -exec pkg -o ABI_FILE=/usr/lib32/libc.so.7 -o INSTALL_AS_USER=true -o RUN_SCRIPTS=false --rootdir "$I386_ROOT" "$@" +echo pkg -o ABI_FILE=$ABI_FILE -o INSTALL_AS_USER=true -o RUN_SCRIPTS=false --rootdir "$I386_ROOT" "$@" +exec pkg -o ABI_FILE=$ABI_FILE -o INSTALL_AS_USER=true -o RUN_SCRIPTS=false --rootdir "$I386_ROOT" "$@" diff --git a/emulators/wine-devel/pkg-plist b/emulators/wine-devel/pkg-plist index 90a35cde7ec4..cda30c39f38c 100644 --- a/emulators/wine-devel/pkg-plist +++ b/emulators/wine-devel/pkg-plist @@ -115,6 +115,7 @@ include/wine/windows/adserr.h include/wine/windows/adshlp.h include/wine/windows/advpub.h include/wine/windows/af_irda.h +include/wine/windows/afunix.h include/wine/windows/amaudio.h include/wine/windows/amsi.h include/wine/windows/amsi.idl @@ -177,8 +178,10 @@ include/wine/windows/bits5_0.h include/wine/windows/bits5_0.idl include/wine/windows/bitsmsg.h include/wine/windows/bluetoothapis.h +include/wine/windows/bluetoothleapis.h include/wine/windows/bthdef.h include/wine/windows/bthioctl.h +include/wine/windows/bthledef.h include/wine/windows/bthsdpdef.h include/wine/windows/cderr.h include/wine/windows/cdosys.h @@ -356,6 +359,7 @@ include/wine/windows/dcomptypes.idl include/wine/windows/dde.h include/wine/windows/dde.rh include/wine/windows/ddeml.h +include/wine/windows/ddk/bthguid.h include/wine/windows/ddk/compstui.h include/wine/windows/ddk/csq.h include/wine/windows/ddk/d3dkmthk.h @@ -391,11 +395,14 @@ include/wine/windows/ddstream.h include/wine/windows/ddstream.idl include/wine/windows/delayloadhandler.h include/wine/windows/devenum.idl +include/wine/windows/devfiltertypes.h include/wine/windows/devguid.h include/wine/windows/devicetopology.h include/wine/windows/devicetopology.idl include/wine/windows/devpkey.h include/wine/windows/devpropdef.h +include/wine/windows/devquery.h +include/wine/windows/devquerydef.h include/wine/windows/dhcpcsdk.h include/wine/windows/dhtmldid.h include/wine/windows/dhtmled.h @@ -504,6 +511,7 @@ include/wine/windows/dyngraph.idl include/wine/windows/endpointvolume.h include/wine/windows/endpointvolume.idl include/wine/windows/errhandlingapi.h +include/wine/windows/errlup.idl include/wine/windows/errorrep.h include/wine/windows/errors.h include/wine/windows/errrec.idl @@ -1129,6 +1137,10 @@ include/wine/windows/windows.data.json.h include/wine/windows/windows.data.json.idl include/wine/windows/windows.data.xml.dom.h include/wine/windows/windows.data.xml.dom.idl +include/wine/windows/windows.devices.bluetooth.advertisement.h +include/wine/windows/windows.devices.bluetooth.advertisement.idl +include/wine/windows/windows.devices.bluetooth.genericattributeprofile.h +include/wine/windows/windows.devices.bluetooth.genericattributeprofile.idl include/wine/windows/windows.devices.bluetooth.h include/wine/windows/windows.devices.bluetooth.idl include/wine/windows/windows.devices.bluetooth.rfcomm.h @@ -1188,6 +1200,8 @@ include/wine/windows/windows.media.capture.h include/wine/windows/windows.media.capture.idl include/wine/windows/windows.media.closedcaptioning.h include/wine/windows/windows.media.closedcaptioning.idl +include/wine/windows/windows.media.core.h +include/wine/windows/windows.media.core.idl include/wine/windows/windows.media.devices.h include/wine/windows/windows.media.devices.idl include/wine/windows/windows.media.effects.h @@ -1196,12 +1210,16 @@ include/wine/windows/windows.media.faceanalysis.h include/wine/windows/windows.media.faceanalysis.idl include/wine/windows/windows.media.h include/wine/windows/windows.media.idl +include/wine/windows/windows.media.mediaproperties.h +include/wine/windows/windows.media.mediaproperties.idl include/wine/windows/windows.media.render.h include/wine/windows/windows.media.render.idl include/wine/windows/windows.media.speechrecognition.h include/wine/windows/windows.media.speechrecognition.idl include/wine/windows/windows.media.speechsynthesis.h include/wine/windows/windows.media.speechsynthesis.idl +include/wine/windows/windows.media.transcoding.h +include/wine/windows/windows.media.transcoding.idl include/wine/windows/windows.networking.connectivity.h include/wine/windows/windows.networking.connectivity.idl include/wine/windows/windows.networking.h @@ -1264,6 +1282,8 @@ include/wine/windows/windows.ui.viewmanagement.core.h include/wine/windows/windows.ui.viewmanagement.core.idl include/wine/windows/windows.ui.viewmanagement.h include/wine/windows/windows.ui.viewmanagement.idl +include/wine/windows/windows.ui.windowmanagement.h +include/wine/windows/windows.ui.windowmanagement.idl include/wine/windows/windows.ui.xaml.h include/wine/windows/windows.ui.xaml.hosting.desktopwindowxamlsource.h include/wine/windows/windows.ui.xaml.hosting.desktopwindowxamlsource.idl @@ -2533,6 +2553,7 @@ lib/wine/%%WINEARCH%%-windows/usp10.dll lib/wine/%%WINEARCH%%-windows/utildll.dll lib/wine/%%WINEARCH%%-windows/uxtheme.dll lib/wine/%%WINEARCH%%-windows/vbscript.dll +lib/wine/%%WINEARCH%%-windows/vccorlib140.dll lib/wine/%%WINEARCH%%-windows/vcomp.dll lib/wine/%%WINEARCH%%-windows/vcomp100.dll lib/wine/%%WINEARCH%%-windows/vcomp110.dll diff --git a/emulators/wine-mono-devel/Makefile b/emulators/wine-mono-devel/Makefile index f42c32b0d9d7..961040290d8a 100644 --- a/emulators/wine-mono-devel/Makefile +++ b/emulators/wine-mono-devel/Makefile @@ -1,5 +1,5 @@ PORTNAME= wine-mono -DISTVERSION= 10.1.0 +DISTVERSION= 10.2.0 DISTVERSIONSUFFIX=-x86 CATEGORIES= emulators MASTER_SITES= http://dl.winehq.org/wine/wine-mono/${DISTVERSION}/ diff --git a/emulators/wine-mono-devel/distinfo b/emulators/wine-mono-devel/distinfo index 661b7fcc3160..c473cd4bba39 100644 --- a/emulators/wine-mono-devel/distinfo +++ b/emulators/wine-mono-devel/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1749978328 -SHA256 (wine-mono-10.1.0-x86.msi) = c88c2431890bc32cacec8d7ea70e53a5ae4b95c8c55ca6e75ef8db0e4ccf1070 -SIZE (wine-mono-10.1.0-x86.msi) = 85491712 +TIMESTAMP = 1755797604 +SHA256 (wine-mono-10.2.0-x86.msi) = 4e1ed3f02e92d053133d03ddfbefcf6db4a4dc231a9aed3367b17117a88847d8 +SIZE (wine-mono-10.2.0-x86.msi) = 85497856 diff --git a/emulators/wine/Makefile b/emulators/wine/Makefile index 13b3d6e84b7c..013bd97963f6 100644 --- a/emulators/wine/Makefile +++ b/emulators/wine/Makefile @@ -1,6 +1,6 @@ PORTNAME= wine DISTVERSION= 10.0 -PORTREVISION= 1 +PORTREVISION= 2 PORTEPOCH= 1 CATEGORIES= emulators MASTER_SITES= https://dl.winehq.org/wine/source/10.0/ @@ -35,6 +35,7 @@ CONFIGURE_ARGS+=--verbose \ --without-capi \ --without-coreaudio \ --without-dbus \ + --without-ffmpeg \ --without-gettext --without-gettextpo \ --without-gphoto \ --without-gssapi \ diff --git a/emulators/wine/files/pkg32.sh b/emulators/wine/files/pkg32.sh index 64d82459c219..04595f6c104c 100644 --- a/emulators/wine/files/pkg32.sh +++ b/emulators/wine/files/pkg32.sh @@ -1,19 +1,23 @@ #!/bin/sh -e -if [ "$(id -u)" = 0 ] -then +if [ "$(id -u)" = 0 ]; then echo "Don't run this script as root!" exit 1 fi I386_ROOT="${WINE_i386_ROOT:-$HOME/.i386-wine-pkg}" +ABI_FILE=/usr/lib32/libc.so.7 -if [ ! -d "$I386_ROOT/usr/share/keys/pkg" ] -then +if [ ! -f $ABI_FILE ]; then + echo "\"$ABI_FILE\" not found; exiting." + exit 1 +fi + +if [ ! -d "$I386_ROOT/usr/share/keys/pkg" ]; then mkdir -p "$I386_ROOT/usr/share/keys" ln -s /usr/share/keys/pkg "$I386_ROOT/usr/share/keys/pkg" fi # Show what we're going to do, then do it. -echo pkg -o ABI_FILE=/usr/lib32/libc.so.7 -o INSTALL_AS_USER=true -o RUN_SCRIPTS=false --rootdir "$I386_ROOT" "$@" -exec pkg -o ABI_FILE=/usr/lib32/libc.so.7 -o INSTALL_AS_USER=true -o RUN_SCRIPTS=false --rootdir "$I386_ROOT" "$@" +echo pkg -o ABI_FILE=$ABI_FILE -o INSTALL_AS_USER=true -o RUN_SCRIPTS=false --rootdir "$I386_ROOT" "$@" +exec pkg -o ABI_FILE=$ABI_FILE -o INSTALL_AS_USER=true -o RUN_SCRIPTS=false --rootdir "$I386_ROOT" "$@" diff --git a/emulators/yuzu/Makefile b/emulators/yuzu/Makefile index bfdeabf39138..4d6c9dadcb8a 100644 --- a/emulators/yuzu/Makefile +++ b/emulators/yuzu/Makefile @@ -1,6 +1,6 @@ PORTNAME= yuzu PORTVERSION= s20240301 -PORTREVISION= 8 +PORTREVISION= 9 CATEGORIES= emulators wayland .if make(makesum) MASTER_SITES= https://api.yuzu-emu.org/gamedb/?dummy=/:gamedb @@ -136,7 +136,7 @@ WEBENGINE_CMAKE_BOOL= YUZU_USE_QT_WEB_ENGINE WEBENGINE_IMPLIES= GUI post-extract: - @${CP} ${DISTFILES:M*\:gamedb:C/\:.*//:S,^,${_DISTDIR},} \ + @${CP} ${DISTFILES:M*\:gamedb:C/\:.*//:S,^,${DISTDIR}/,} \ ${WRKSRC}/dist/compatibility_list/ post-patch: |