Skip to content

Commit

Permalink
ahh**** DO NOT COMMIT!! -- Temp VBoxDbg bootcd ****
Browse files Browse the repository at this point in the history
** WIP ** Make it start again
[REACTOS] Introduce the experimental all-in-one ReactOS BootCD
*** [REACTOS] Re-enable reboot at the end of setup
  • Loading branch information
HBelusca authored and DarkFire01 committed Dec 7, 2024
1 parent 33bf734 commit f02e8d0
Show file tree
Hide file tree
Showing 24 changed files with 160 additions and 258 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
- name: Build
run: echo 'cmake --build ${{github.workspace}}/build -- -k0' | ${{github.workspace}}/RosBE-CI/RosBE.sh . 0 ${{matrix.arch}}
- name: Generate ISOs
run: echo 'cmake --build ${{github.workspace}}/build --target bootcd --target livecd' | ${{github.workspace}}/RosBE-CI/RosBE.sh . 0 ${{matrix.arch}}
run: echo 'cmake --build ${{github.workspace}}/build --target bootcd' | ${{github.workspace}}/RosBE-CI/RosBE.sh . 0 ${{matrix.arch}}
- name: Print ccache statistics
run: ccache -s
- name: Upload ISOs
Expand All @@ -79,7 +79,6 @@ jobs:
name: reactos-${{matrix.compiler}}-${{matrix.arch}}-${{matrix.config}}-${{matrix.dllver}}-${{github.sha}}
path: |
build/bootcd.iso
build/livecd.iso
build-msvc:
strategy:
Expand Down Expand Up @@ -127,14 +126,13 @@ jobs:
- name: Build
run: cmake --build build -- -k0
- name: Generate ISOs
run: cmake --build build --target bootcd --target livecd
run: cmake --build build --target bootcd
- name: Upload ISOs
uses: actions/upload-artifact@v4
with:
name: reactos-msvc${{matrix.toolset}}-${{matrix.arch}}-${{matrix.config}}-${{matrix.dllver}}-${{github.sha}}
path: |
build/bootcd.iso
build/livecd.iso
- name: Upload debug symbols
if: ${{ matrix.config == 'Debug' }}
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -268,14 +266,13 @@ jobs:
- name: Build
run: cmake --build build -- -k0
- name: Generate ISOs
run: cmake --build build --target bootcd --target livecd
run: cmake --build build --target bootcd
- name: Upload ISOs
uses: actions/upload-artifact@v4
with:
name: reactos-clang-cl-${{matrix.arch}}-${{matrix.config}}-${{github.sha}}
path: |
build/bootcd.iso
build/livecd.iso
- name: Upload debug symbols
if: ${{ matrix.config == 'Debug' }}
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -307,4 +304,4 @@ jobs:
cd build
cmake -G "Visual Studio 17 2022" -A Win32 -DCMAKE_TOOLCHAIN_FILE:FILEPATH=toolchain-msvc.cmake -DARCH:STRING=i386 -DENABLE_ROSTESTS=1 -DENABLE_ROSAPPS=1 ${{github.workspace}}\src
- name: Build
run: cmake --build ${{github.workspace}}\build --target bootcd --target livecd
run: cmake --build ${{github.workspace}}\build --target bootcd
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ output-*
modules/optional
modules/bootcd_extras
modules/livecd_extras
modules/hybridcd_extras
modules/3rdparty
modules/[Aa][Hh][Kk]_[Tt]ests
.cache
Expand Down
11 changes: 0 additions & 11 deletions .theia/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,6 @@
// Hover to view descriptions of existing attributes.
"version": "0.2.0",
"configurations": [
{
"type": "cppdbg",
"request": "launch",
"name": "livecd (qemu)",
"preLaunchTask": "launch livecd",
"miDebuggerServerAddress": "localhost:9091",
"miDebuggerArgs": "-l 15 -ex 'set sysroot ${workspaceRoot}/build/symbols'",
"program": "${workspaceRoot}/build/ntoskrnl/ntoskrnl.exe",
"cwd": "${workspaceRoot}/build",
"miDebuggerPath": "i686-w64-mingw32-gdb"
},
{
"type": "cppdbg",
"request": "launch",
Expand Down
50 changes: 7 additions & 43 deletions .theia/tasks.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build livecd",
"label": "build bootcd",
"type": "shell",
"command": "ninja livecd",
"command": "ninja bootcd",
"options": {
"cwd": "${workspaceFolder}/build"
},
"group": "build",
"problemMatcher": [
{
"base": "$gcc",
"owner": "cpp",
"fileLocation": ["relative", "${workspaceFolder}/build"],
"pattern": {
Expand All @@ -26,43 +27,6 @@
}
]
},
{
"label": "build bootcd",
"type": "shell",
"command": "ninja bootcd",
"options": {
"cwd": "${workspaceFolder}/build"
},
"group": "build",
"problemMatcher": [
{
"base": "$gcc",
"fileLocation": ["relative", "${workspaceFolder}/build"],
},
]
},
{
"label": "launch livecd",
"type": "process",
"options": {
"cwd": "${workspaceFolder}/build"
},
"dependsOn": [
"build livecd"
],
"dependsOrder": "sequence",
"command": "qemu-system-i386",
"args": [
"-cdrom", "livecd.iso",
"-chardev", "socket,port=9091,host=localhost,server,nowait,id=char0",
"-serial", "chardev:char0",
"-nic", "user,model=e1000",
"-boot", "d",
"-chardev", "socket,path=/tmp/livecd_dbg,server,nowait,id=char1", "-serial", "chardev:char1",
"-daemonize"
],
"problemMatcher": []
},
{
"label": "launch bootcd",
"type": "process",
Expand Down
2 changes: 1 addition & 1 deletion base/setup/reactos/reactos.c
Original file line number Diff line number Diff line change
Expand Up @@ -2996,7 +2996,7 @@ _tWinMain(HINSTANCE hInst,
/* Free the NT to Win32 path prefix mapping list */
FreeNtToWin32PathMappingList(&SetupData.MappingList);

#if 0 // NOTE: Disabled for testing purposes only!
#if 1
EnablePrivilege(SE_SHUTDOWN_NAME, TRUE);
ExitWindowsEx(EWX_REBOOT, 0);
EnablePrivilege(SE_SHUTDOWN_NAME, FALSE);
Expand Down
5 changes: 4 additions & 1 deletion base/setup/welcome/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,7 @@ if(ARCH STREQUAL "i386")
endif()
endif()

add_cd_file(TARGET welcome DESTINATION reactos NO_CAB FOR bootcd)
add_cd_file(TARGET welcome DESTINATION reactos FOR all)

# Welcome.exe renamed as Setup.exe for the BootCD
add_cd_file(TARGET welcome DESTINATION root NO_CAB NAME_ON_CD setup.exe FOR bootcd)
1 change: 1 addition & 0 deletions base/system/userinit/livecd.c
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,7 @@ StartDlgProc(
pState->NextPage = DONE;
pState->Run = INSTALLER;
EndDialog(hwndDlg, LOWORD(wParam));
// TODO: Just hide the dialog, and show it again in case the child process (setup) dies?
break;

case IDOK:
Expand Down
40 changes: 9 additions & 31 deletions boot/boot_images.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ add_custom_target(bootcd
-publisher ${ISO_MANUFACTURER} -preparer ${ISO_MANUFACTURER} -volid ${ISO_VOLNAME} -volset ${ISO_VOLNAME}
-eltorito-boot loader/isoboot.bin -no-emul-boot -boot-load-size 4 ${ISO_EFI_BOOT_PARAMS} -hide boot.catalog
-sort ${CMAKE_CURRENT_BINARY_DIR}/bootfiles.sort
-no-cache-inodes -graft-points -path-list ${CMAKE_CURRENT_BINARY_DIR}/bootcd.$<CONFIG>.lst
-duplicates-once -no-cache-inodes -graft-points -path-list ${CMAKE_CURRENT_BINARY_DIR}/bootcd.$<CONFIG>.lst
COMMAND native-isohybrid -b ${_isombr_file} -t 0x96 ${REACTOS_BINARY_DIR}/bootcd.iso
DEPENDS isombr native-isohybrid native-mkisofs
DEPENDS isombr native-isohybrid native-mkisofs livecd
VERBATIM)

## BootCDRegTest
Expand All @@ -131,12 +131,12 @@ add_custom_target(bootcdregtest
-publisher ${ISO_MANUFACTURER} -preparer ${ISO_MANUFACTURER} -volid ${ISO_VOLNAME} -volset ${ISO_VOLNAME}
-eltorito-boot loader/isobtrt.bin -no-emul-boot -boot-load-size 4 ${ISO_EFI_BOOT_PARAMS} -hide boot.catalog
-sort ${CMAKE_CURRENT_BINARY_DIR}/bootfiles.sort
-no-cache-inodes -graft-points -path-list ${CMAKE_CURRENT_BINARY_DIR}/bootcdregtest.$<CONFIG>.lst
-duplicates-once -no-cache-inodes -graft-points -path-list ${CMAKE_CURRENT_BINARY_DIR}/bootcdregtest.$<CONFIG>.lst
COMMAND native-isohybrid -b ${_isombr_file} -t 0x96 ${REACTOS_BINARY_DIR}/bootcdregtest.iso
DEPENDS isombr native-isohybrid native-mkisofs
VERBATIM)

## LiveCD
## LiveImage -- Constitutes a small RAMDISK ISO, and is also merged with the regular BootCD
# Create the file list
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "")
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "${CMAKE_CURRENT_BINARY_DIR}/empty\n")
Expand All @@ -149,42 +149,20 @@ add_allusers_profile_dirs(${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles
add_user_profile_dirs(${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles" "Default User")

add_custom_target(livecd
COMMAND native-mkisofs -quiet -o ${REACTOS_BINARY_DIR}/livecd.iso -iso-level 4
COMMAND native-mkisofs -quiet -o ${REACTOS_BINARY_DIR}/liveimg.iso -iso-level 4
-publisher ${ISO_MANUFACTURER} -preparer ${ISO_MANUFACTURER} -volid ${ISO_VOLNAME} -volset ${ISO_VOLNAME}
-eltorito-boot loader/isoboot.bin -no-emul-boot -boot-load-size 4 ${ISO_EFI_BOOT_PARAMS} -hide boot.catalog
-sort ${CMAKE_CURRENT_BINARY_DIR}/bootfiles.sort
-no-cache-inodes -graft-points -path-list ${CMAKE_CURRENT_BINARY_DIR}/livecd.$<CONFIG>.lst
COMMAND native-isohybrid -b ${_isombr_file} -t 0x96 ${REACTOS_BINARY_DIR}/livecd.iso
DEPENDS isombr native-isohybrid native-mkisofs
VERBATIM)

## HybridCD
# Create the file list
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "")
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "${CMAKE_CURRENT_BINARY_DIR}/empty\n")

# Create user profile directories
add_allusers_profile_dirs(${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "livecd/Profiles")
add_user_profile_dirs(${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "livecd/Profiles" "Default User")

add_custom_target(hybridcd
COMMAND native-mkisofs -quiet -o ${REACTOS_BINARY_DIR}/hybridcd.iso -iso-level 4
-publisher ${ISO_MANUFACTURER} -preparer ${ISO_MANUFACTURER} -volid ${ISO_VOLNAME} -volset ${ISO_VOLNAME}
-eltorito-boot loader/isoboot.bin -no-emul-boot -boot-load-size 4 ${ISO_EFI_BOOT_PARAMS} -hide boot.catalog
-sort ${CMAKE_CURRENT_BINARY_DIR}/bootfiles.sort
-duplicates-once -no-cache-inodes -graft-points -path-list ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.$<CONFIG>.lst
COMMAND native-isohybrid -b ${_isombr_file} -t 0x96 ${REACTOS_BINARY_DIR}/hybridcd.iso
DEPENDS bootcd livecd
-duplicates-once -no-cache-inodes -graft-points -path-list ${CMAKE_CURRENT_BINARY_DIR}/livecd.$<CONFIG>.lst
DEPENDS native-mkisofs
VERBATIM)

if(DEFINED EFI_PLATFORM_ID)
# For things like flashing USB drives, we also add the efi file into efi/boot.
add_cd_file(TARGET efisys FILE ${CMAKE_CURRENT_BINARY_DIR}/efisys.bin DESTINATION loader NO_CAB NOT_IN_HYBRIDCD FOR bootcd regtest livecd hybridcd)
add_cd_file(TARGET efisys FILE ${CMAKE_CURRENT_BINARY_DIR}/efisys.bin DESTINATION loader NO_CAB FOR bootcd regtest)

add_cd_file(
TARGET uefildr
DESTINATION efi/boot
NO_CAB
NAME_ON_CD boot${EFI_PLATFORM_ID}.efi
FOR livecd hybridcd)
FOR bootcd)
endif()
30 changes: 13 additions & 17 deletions boot/bootdata/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,41 +1,39 @@

add_subdirectory(packages)

# Common hives

# Setup settings file
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/txtsetup.sif DESTINATION reactos NO_CAB FOR bootcd regtest)

add_custom_target(converted_caroots_inf DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/caroots.inf)
utf16le_convert(${CMAKE_CURRENT_SOURCE_DIR}/caroots.inf ${CMAKE_CURRENT_BINARY_DIR}/caroots.inf)
add_cd_file(TARGET converted_caroots_inf FILE ${CMAKE_CURRENT_BINARY_DIR}/caroots.inf DESTINATION reactos NO_CAB FOR bootcd regtest)

# Common hives
add_registry_inf(
hivecls.inf
hivedef.inf
hivesft.inf
hivesys.inf
hivebcd.inf)


# Regtest
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/bootcdregtest/regtest.cmd DESTINATION reactos/bin FOR all)

# autorun.inf
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/autorun-bootcd.inf DESTINATION root NO_CAB NOT_IN_HYBRIDCD NAME_ON_CD autorun.inf FOR bootcd)
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/autorun-livecd.inf DESTINATION root NO_CAB NOT_IN_HYBRIDCD NAME_ON_CD autorun.inf FOR livecd)
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/autorun-hybridcd.inf DESTINATION root NO_CAB NOT_IN_HYBRIDCD NAME_ON_CD autorun.inf FOR hybridcd)
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/autorun.inf DESTINATION root NO_CAB FOR bootcd)

# icon.ico
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/icon.ico DESTINATION root NO_CAB NOT_IN_HYBRIDCD FOR all hybridcd)
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/icon.ico DESTINATION root NO_CAB FOR bootcd)

# readme.txt
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/readme.txt DESTINATION root NO_CAB NOT_IN_HYBRIDCD FOR all hybridcd)
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/readme.txt DESTINATION root NO_CAB FOR bootcd regtest)
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/readme.txt DESTINATION reactos FOR all)

# Welcome.exe optional custom configuration (only for HybridCD)
## NOTE: The root file Setup.exe is a renamed Welcome.exe for BootCD purposes.
# Welcome.exe optional custom configuration (only for LiveCD)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/welcome_config/)
# Copy the main configuration file
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/welcome_config/welcome.ini DESTINATION bootcd/reactos NO_CAB FOR hybridcd)
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/welcome_config/welcome.ini DESTINATION reactos NO_CAB FOR livecd)

# Convert the translation files (name format: xx-YY.ini) into UTF-16
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/welcome_config)
Expand All @@ -44,23 +42,21 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/welcome_config/)
set(_converted_file ${CMAKE_CURRENT_BINARY_DIR}/welcome_config/${_file})
set(_source_file ${CMAKE_CURRENT_SOURCE_DIR}/welcome_config/${_file})
utf16le_convert(${_source_file} ${_converted_file})
add_cd_file(TARGET converted_welcome_i18n_files FILE ${_converted_file} DESTINATION bootcd/reactos/welcome NO_CAB NAME_ON_CD ${_file} FOR hybridcd)
add_cd_file(TARGET converted_welcome_i18n_files FILE ${_converted_file} DESTINATION reactos/welcome NO_CAB NAME_ON_CD ${_file} FOR livecd)
list(APPEND _converted_welcome_i18n_files ${_converted_file})
endforeach(_file)
add_custom_target(converted_welcome_i18n_files DEPENDS ${_converted_welcome_i18n_files})
endif()

# freeldr.ini
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/bootcd.ini DESTINATION root NO_CAB NOT_IN_HYBRIDCD NAME_ON_CD freeldr.ini FOR bootcd regtest)
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/livecd.ini DESTINATION root NOT_IN_HYBRIDCD NAME_ON_CD freeldr.ini FOR livecd)
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/hybridcd.ini DESTINATION root NAME_ON_CD freeldr.ini FOR hybridcd)
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/bootcd.ini DESTINATION root NO_CAB NAME_ON_CD freeldr.ini FOR bootcd)
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/bootcd-regtest.ini DESTINATION root NO_CAB NAME_ON_CD freeldr.ini FOR regtest)

# Unattend
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/bootcdregtest/unattend.inf DESTINATION reactos NO_CAB FOR regtest)
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/bootcd/unattend.inf DESTINATION reactos NO_CAB FOR bootcd)
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/livecd/unattend.inf DESTINATION reactos NO_CAB FOR livecd)
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/bootcdregtest/unattend.inf DESTINATION reactos NO_CAB FOR regtest)

# LiveCD shortcuts
# LiveImage shortcuts
macro(add_livecd_shortcut name app dest)
add_link(NAME ${name} CMD_LINE_ARGS ${app} ICON ${app} PATH livecd_start.cmd GUID "{450D8FBA-AD25-11D0-98A8-0800361B1103}" MINIMIZE)
list(APPEND LIVECD_SHORTCUTS "${CMAKE_CURRENT_BINARY_DIR}/${name}.lnk")
Expand Down
3 changes: 0 additions & 3 deletions boot/bootdata/autorun-bootcd.inf

This file was deleted.

3 changes: 0 additions & 3 deletions boot/bootdata/autorun-hybridcd.inf

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[autorun]
shellexecute=readme.txt
open=setup.exe
icon=icon.ico
13 changes: 13 additions & 0 deletions boot/bootdata/bootcd-regtest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[FREELOADER]
DefaultOS=Setup
TimeOut=0

[Display]
TitleText=ReactOS Setup
MinimalUI=Yes

[Operating Systems]
Setup="Setup"

[Setup]
BootType=ReactOSSetup
Loading

0 comments on commit f02e8d0

Please sign in to comment.