[MKISOFS]
[reactos.git] / reactos / boot / CMakeLists.txt
1 ## efisys.bin
2
3 # EFI platform ID, used in environ/CMakelists.txt for bootmgfw filename naming also.
4 if(ARCH STREQUAL "amd64")
5 set(EFI_PLATFORM_ID "x64")
6 elseif(ARCH STREQUAL "i386")
7 set(EFI_PLATFORM_ID "ia32")
8 elseif(ARCH STREQUAL "ia64")
9 set(EFI_PLATFORM_ID "ia64")
10 elseif(ARCH STREQUAL "arm")
11 set(EFI_PLATFORM_ID "arm")
12 elseif(ARCH STREQUAL "aarch64")
13 set(EFI_PLATFORM_ID "aa64")
14 else()
15 message(FATAL_ERROR "Unknown ARCH, can't generate a valid UEFI boot filename.")
16 endif()
17
18 add_custom_target(efisys
19 COMMAND native-fatten ${CMAKE_CURRENT_BINARY_DIR}/efisys.bin -format 2880 EFIBOOT -boot ${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/fat.bin -mkdir EFI -mkdir EFI/BOOT -add $<TARGET_FILE:bootmgfw> EFI/BOOT/boot${EFI_PLATFORM_ID}.efi
20 DEPENDS native-fatten fat bootmgfw bcd_hive
21 VERBATIM)
22
23 ##bootcd
24 #clear it out
25 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/bootcd.lst "")
26
27 if(USE_MKISOFS)
28 add_custom_target(bootcd
29 COMMAND native-mkisofs -o ${REACTOS_BINARY_DIR}/bootcd.iso -iso-level 4 -volid "ReactOS" -path-list ${CMAKE_CURRENT_BINARY_DIR}/bootcd.lst -graft-points -no-cache-inodes -eltorito-boot loader/isoboot.bin -no-emul-boot -boot-load-size 4 -eltorito-alt-boot -eltorito-platform efi -eltorito-boot loader/efisys.bin -hide boot.catalog -publisher "ReactOS Foundation" -preparer "ReactOS Foundation"
30 DEPENDS native-mkisofs
31 VERBATIM)
32 else()
33 add_custom_target(bootcd
34 COMMAND native-cdmake -j -m -bootdata:2\#p0,e,b${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/isoboot.bin\#pEF,e,b${CMAKE_CURRENT_BINARY_DIR}/efisys.bin @${CMAKE_CURRENT_BINARY_DIR}/bootcd.lst REACTOS ${REACTOS_BINARY_DIR}/bootcd.iso
35 DEPENDS native-cdmake efisys
36 VERBATIM)
37 endif()
38
39 ##bootcdregtest
40 #clear it out
41 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/bootcdregtest.lst "")
42
43 if(USE_MKISOFS)
44 add_custom_target(bootcdregtest
45 COMMAND native-mkisofs -o ${REACTOS_BINARY_DIR}/bootcdregtest.iso -iso-level 4 -volid "ReactOS" -path-list ${CMAKE_CURRENT_BINARY_DIR}/bootcdregtest.lst -graft-points -no-cache-inodes -eltorito-boot loader/isobtrt.bin -no-emul-boot -boot-load-size 4 -eltorito-alt-boot -eltorito-platform efi -eltorito-boot loader/efisys.bin -hide boot.catalog -publisher "ReactOS Foundation" -preparer "ReactOS Foundation"
46 DEPENDS native-mkisofs
47 VERBATIM)
48 else()
49 add_custom_target(bootcdregtest
50 COMMAND native-cdmake -j -m -bootdata:2\#p0,e,b${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/isobtrt.bin\#pEF,e,b${CMAKE_CURRENT_BINARY_DIR}/efisys.bin @${CMAKE_CURRENT_BINARY_DIR}/bootcdregtest.lst REACTOS ${REACTOS_BINARY_DIR}/bootcdregtest.iso
51 DEPENDS native-cdmake efisys
52 VERBATIM)
53 endif()
54
55 ##livecd
56 #clear it out
57 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/livecd.lst "")
58
59 if(USE_MKISOFS)
60 #create the empty Desktop, Favorites, and Start Menu folders
61 file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.lst "Profiles/Default User/Desktop=${REACTOS_SOURCE_DIR}/boot/bootdata/empty\n")
62 file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.lst "Profiles/Default User/Favorites=${REACTOS_SOURCE_DIR}/boot/bootdata/empty\n")
63 file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.lst "Profiles/Default User/Start Menu/Programs=${REACTOS_SOURCE_DIR}/boot/bootdata/empty\n")
64
65 add_custom_target(livecd
66 COMMAND native-mkisofs -o ${REACTOS_BINARY_DIR}/livecd.iso -iso-level 4 -volid "ReactOS" -path-list ${CMAKE_CURRENT_BINARY_DIR}/livecd.lst -graft-points -no-cache-inodes -eltorito-boot loader/isoboot.bin -no-emul-boot -boot-load-size 4 -eltorito-alt-boot -eltorito-platform efi -eltorito-boot loader/efisys.bin -hide boot.catalog -publisher "ReactOS Foundation" -preparer "ReactOS Foundation"
67 DEPENDS native-mkisofs
68 VERBATIM)
69 else()
70 #create the empty Desktop, Favorites, and Start Menu folders
71 file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.lst "Profiles/Default User/Desktop\n")
72 file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.lst "Profiles/Default User/Favorites\n")
73 file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.lst "Profiles/Default User/Start Menu/Programs\n")
74
75 add_custom_target(livecd
76 COMMAND native-cdmake -j -m -bootdata:2\#p0,e,b${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/isoboot.bin\#pEF,e,b${CMAKE_CURRENT_BINARY_DIR}/efisys.bin @${CMAKE_CURRENT_BINARY_DIR}/livecd.lst REACTOS ${REACTOS_BINARY_DIR}/livecd.iso
77 DEPENDS native-cdmake efisys
78 VERBATIM)
79 endif()
80
81 ##hybridcd
82 #clear it out
83 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "")
84
85 if(USE_MKISOFS)
86 #create the empty Desktop, Favorites, and Start Menu folders
87 file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/Desktop=${REACTOS_SOURCE_DIR}/boot/bootdata/empty\n")
88 file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/Favorites=${REACTOS_SOURCE_DIR}/boot/bootdata/empty\n")
89 file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/Start Menu/Programs=${REACTOS_SOURCE_DIR}/boot/bootdata/empty\n")
90
91 add_custom_target(hybridcd
92 COMMAND native-mkisofs -o ${REACTOS_BINARY_DIR}/hybridcd.iso -iso-level 4 -volid "ReactOS" -path-list ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst -graft-points -no-cache-inodes -eltorito-boot loader/isoboot.bin -no-emul-boot -boot-load-size 4 -eltorito-alt-boot -eltorito-platform efi -eltorito-boot loader/efisys.bin -hide boot.catalog -publisher "ReactOS Foundation" -preparer "ReactOS Foundation"
93 DEPENDS native-mkisofs bootcd livecd
94 VERBATIM)
95
96 add_cd_file(TARGET efisys FILE ${CMAKE_CURRENT_BINARY_DIR}/efisys.bin DESTINATION loader NO_CAB FOR bootcd regtest livecd hybridcd)
97 else()
98 #create the empty Desktop, Favorites, and Start Menu folders
99 file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/Desktop\n")
100 file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/Favorites\n")
101 file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/Start Menu/Programs\n")
102
103 add_custom_target(hybridcd
104 COMMAND native-cdmake -j -m -bootdata:2\#p0,e,b${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/isoboot.bin\#pEF,e,b${CMAKE_CURRENT_BINARY_DIR}/efisys.bin @${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst REACTOS ${REACTOS_BINARY_DIR}/hybridcd.iso
105 DEPENDS native-cdmake efisys bootcd livecd
106 VERBATIM)
107 endif()
108
109 add_subdirectory(freeldr)
110 add_subdirectory(bootdata)
111 add_subdirectory(environ)