Move from CD-ROM images to Hard Disk images.
This involves a new img/ folder, a new program called mkbootimg, the accompanying chroma.json file that instructs mkbootimg how to create the image. An extra Powershell script is included for brevity.
This commit is contained in:
parent
9d539287a7
commit
5498f1f923
BIN
boot_hybrid.img
Normal file
BIN
boot_hybrid.img
Normal file
Binary file not shown.
64
buildImage.ps1
Normal file
64
buildImage.ps1
Normal file
|
@ -0,0 +1,64 @@
|
||||||
|
#requires -RunAsAdministrator
|
||||||
|
param ([uint64]$diskSize=256MB, $driveLetter='Z')
|
||||||
|
# Thanks https://github.com/VoidNV/ZenithOS/blob/master/make.ps1!
|
||||||
|
|
||||||
|
$vhdPath = ".\Chroma.vhd"
|
||||||
|
|
||||||
|
if((Get-WindowsEdition -Online).Edition -eq "Home") {
|
||||||
|
Write-Host -ForegroundColor Red `
|
||||||
|
"Windows 10 Home does not support Hyper-V. This install requires Professional or higher."
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (-not (Get-Module -ListAvailable -Name "Hyper-V"))
|
||||||
|
{
|
||||||
|
Write-Host -ForegroundColor Red "`nError: Hyper-V module not installed.`n"
|
||||||
|
Write-Host "The following Windows Features need to be enabled under " -NoNewLine
|
||||||
|
Write-Host -ForegroundColor Yellow "Hyper-V" -NoNewLine
|
||||||
|
Write-Host ":`n"
|
||||||
|
Write-Host -ForegroundColor Black -BackgroundColor Yellow "Hyper-V Module for Windows PowerShell" -NoNewLine
|
||||||
|
Write-Host " " -NoNewLine
|
||||||
|
Write-Host -ForegroundColor Black -BackgroundColor Yellow "Hyper-V Services"
|
||||||
|
|
||||||
|
$yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes", "Launch the Windows Features dialog and exit."
|
||||||
|
$no = New-Object System.Management.Automation.Host.ChoiceDescription "&No", "Exit. You can launch the Windows Features dialog yourself later."
|
||||||
|
$options = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no)
|
||||||
|
if ($Host.UI.PromptForChoice("", "`nLaunch the Windows Features dialog to enable them?", $options, 0) -eq 0)
|
||||||
|
{
|
||||||
|
Start-Process "OptionalFeatures"
|
||||||
|
}
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
|
||||||
|
function New-FAT32VHD {
|
||||||
|
$uuid = $null;
|
||||||
|
if(Test-Path $vhdPath) {
|
||||||
|
Remove-Item $vhdPath
|
||||||
|
}
|
||||||
|
|
||||||
|
Hyper-V\New-VHD $vhdPath -SizeBytes $diskSize -Fixed |
|
||||||
|
Mount-VHD -Passthru -NoDriveLetter |
|
||||||
|
Initialize-Disk -PartitionStyle GPT -PassThru |
|
||||||
|
New-Partition -UseMaximumSize |
|
||||||
|
Format-Volume -FileSystem FAT32 -Force |
|
||||||
|
Get-Partition |
|
||||||
|
Set-Partition -NewDriveLetter $driveLetter
|
||||||
|
|
||||||
|
Write-Host "Created disk of size" ($diskSize / 1MB) MiB.
|
||||||
|
|
||||||
|
Copy-Item -Recurse -Force img\* ${driveLetter}:\
|
||||||
|
|
||||||
|
Dismount-VHD $vhdPath
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function Update-VHD {
|
||||||
|
Mount-VHD $vhdPath -NoDriveLetter -PassThru |
|
||||||
|
Get-Partition |
|
||||||
|
Set-Partition -NewDriveLetter $driveLetter
|
||||||
|
|
||||||
|
Copy-Item -Recurse -Force img\* ${driveLetter}:\
|
||||||
|
|
||||||
|
Dismount-VHD $vhdPath
|
||||||
|
}
|
BIN
chroma.img
Normal file
BIN
chroma.img
Normal file
Binary file not shown.
19
chroma.json
Normal file
19
chroma.json
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
"disksize": 80,
|
||||||
|
"config": "img/boot/config",
|
||||||
|
"initrd": {
|
||||||
|
"type": "tar",
|
||||||
|
"directory": "img/boot"
|
||||||
|
},
|
||||||
|
"partitions": [
|
||||||
|
{
|
||||||
|
"type": "boot",
|
||||||
|
"size": 4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Microsoft basic data",
|
||||||
|
"size": 76,
|
||||||
|
"name": "Chroma Data"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
BIN
img/boot/bootloader
Normal file
BIN
img/boot/bootloader
Normal file
Binary file not shown.
1
img/boot/config
Normal file
1
img/boot/config
Normal file
|
@ -0,0 +1 @@
|
||||||
|
kernel=exe
|
BIN
img/boot/exe
Normal file
BIN
img/boot/exe
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user