Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

Commit

Permalink
Merge branch 'release/0.0.11'
Browse files Browse the repository at this point in the history
Release: com.io7m.waxmill 0.0.11
Change: (Backwards incompatible) Require partition names for BSD booting (Ticket: #35)
  • Loading branch information
io7m committed Jul 30, 2020
2 parents 4e7732f + a82df67 commit e8366f4
Show file tree
Hide file tree
Showing 36 changed files with 81 additions and 30 deletions.
13 changes: 11 additions & 2 deletions README-CHANGES.xml
Expand Up @@ -90,15 +90,24 @@
<c:release date="2020-07-30T00:00:00+00:00" ticket-system="com.github.io7m.waxmill" version="0.0.9">
<c:changes/>
</c:release>
<c:release date="2020-07-30T17:02:53+00:00" ticket-system="com.github.io7m.waxmill" version="0.0.10">
<c:release date="2020-07-30T00:00:00+00:00" ticket-system="com.github.io7m.waxmill" version="0.0.10">
<c:changes>
<c:change date="2020-07-30T17:02:53+00:00" summary="Ensure grub-bhyve invocations are passed console devices">
<c:change date="2020-07-30T00:00:00+00:00" summary="Ensure grub-bhyve invocations are passed console devices">
<c:tickets>
<c:ticket id="34"/>
</c:tickets>
</c:change>
</c:changes>
</c:release>
<c:release date="2020-07-30T19:01:35+00:00" ticket-system="com.github.io7m.waxmill" version="0.0.11">
<c:changes>
<c:change compatible="false" date="2020-07-30T19:01:35+00:00" summary="Require partition names for BSD booting">
<c:tickets>
<c:ticket id="35"/>
</c:tickets>
</c:change>
</c:changes>
</c:release>
</c:releases>
<c:ticket-systems>
<c:ticket-system default="true" id="com.github.io7m.waxmill" url="https://www.github.com/io7m/waxmill/issues/"/>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.waxmill.boot/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.waxmill</artifactId>
<groupId>com.io7m.waxmill</groupId>
<version>0.0.10</version>
<version>0.0.11</version>
</parent>

<artifactId>com.io7m.waxmill.boot</artifactId>
Expand Down
Expand Up @@ -251,9 +251,10 @@ private static ArrayList<String> generateGRUBConfigLinesOpenBSD(
bootHD.ifPresent(index -> {
configLines.add(
String.format(
"kopenbsd -h com0 -r sd%da (hd%d)%s",
"kopenbsd -h com0 -r sd%da (hd%d,%s)%s",
index,
index,
openBSD.partition(),
openBSD.kernelPath()
)
);
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.waxmill.client.api/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.waxmill</artifactId>
<groupId>com.io7m.waxmill</groupId>
<version>0.0.10</version>
<version>0.0.11</version>
</parent>

<artifactId>com.io7m.waxmill.client.api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.waxmill.client.vanilla/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.waxmill</artifactId>
<groupId>com.io7m.waxmill</groupId>
<version>0.0.10</version>
<version>0.0.11</version>
</parent>

<artifactId>com.io7m.waxmill.client.vanilla</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.waxmill.cmdline/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.waxmill</artifactId>
<groupId>com.io7m.waxmill</groupId>
<version>0.0.10</version>
<version>0.0.11</version>
</parent>

<artifactId>com.io7m.waxmill.cmdline</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.waxmill.database.api/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.waxmill</artifactId>
<groupId>com.io7m.waxmill</groupId>
<version>0.0.10</version>
<version>0.0.11</version>
</parent>

<artifactId>com.io7m.waxmill.database.api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.waxmill.database.vanilla/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.waxmill</artifactId>
<groupId>com.io7m.waxmill</groupId>
<version>0.0.10</version>
<version>0.0.11</version>
</parent>

<artifactId>com.io7m.waxmill.database.vanilla</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.waxmill.documentation/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.waxmill</artifactId>
<groupId>com.io7m.waxmill</groupId>
<version>0.0.10</version>
<version>0.0.11</version>
</parent>

<artifactId>com.io7m.waxmill.documentation</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.waxmill.exceptions/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.waxmill</artifactId>
<groupId>com.io7m.waxmill</groupId>
<version>0.0.10</version>
<version>0.0.11</version>
</parent>

<artifactId>com.io7m.waxmill.exceptions</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.waxmill.locks/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.waxmill</artifactId>
<groupId>com.io7m.waxmill</groupId>
<version>0.0.10</version>
<version>0.0.11</version>
</parent>

<artifactId>com.io7m.waxmill.locks</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.waxmill.machines/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.waxmill</artifactId>
<groupId>com.io7m.waxmill</groupId>
<version>0.0.10</version>
<version>0.0.11</version>
</parent>

<artifactId>com.io7m.waxmill.machines</artifactId>
Expand Down
Expand Up @@ -278,6 +278,16 @@ default Kind kind()

WXMDeviceSlot bootDevice();

/**
* The name of the partition within which to find the kernel. This
* is typically {@code openbsd1} if the defaults are picked in the OpenBSD
* installer.
*
* @return The name of the partition
*/

String partition();

/**
* @return The path to the kernel on the guest filesystem
*/
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.waxmill.parser.api/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.waxmill</artifactId>
<groupId>com.io7m.waxmill</groupId>
<version>0.0.10</version>
<version>0.0.11</version>
</parent>

<artifactId>com.io7m.waxmill.parser.api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.waxmill.process.api/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.waxmill</artifactId>
<groupId>com.io7m.waxmill</groupId>
<version>0.0.10</version>
<version>0.0.11</version>
</parent>

<artifactId>com.io7m.waxmill.process.api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.waxmill.process.posix/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.waxmill</artifactId>
<groupId>com.io7m.waxmill</groupId>
<version>0.0.10</version>
<version>0.0.11</version>
</parent>

<artifactId>com.io7m.waxmill.process.posix</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.waxmill.realize/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.waxmill</artifactId>
<groupId>com.io7m.waxmill</groupId>
<version>0.0.10</version>
<version>0.0.11</version>
</parent>

<artifactId>com.io7m.waxmill.realize</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.waxmill.serializer.api/pom.xml
Expand Up @@ -8,7 +8,7 @@
<parent>
<artifactId>com.io7m.waxmill</artifactId>
<groupId>com.io7m.waxmill</groupId>
<version>0.0.10</version>
<version>0.0.11</version>
</parent>

<artifactId>com.io7m.waxmill.serializer.api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.waxmill.strings.api/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.waxmill</artifactId>
<groupId>com.io7m.waxmill</groupId>
<version>0.0.10</version>
<version>0.0.11</version>
</parent>

<artifactId>com.io7m.waxmill.strings.api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.waxmill.tests/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.waxmill</artifactId>
<groupId>com.io7m.waxmill</groupId>
<version>0.0.10</version>
<version>0.0.11</version>
</parent>

<artifactId>com.io7m.waxmill.tests</artifactId>
Expand Down
Expand Up @@ -98,7 +98,7 @@ public final class WXMEqualsTest
"kernelArguments")),
new WXMClassUnderTest(
WXMGRUBKernelOpenBSD.class,
Set.of("bootDevice", "kernelPath")),
Set.of("bootDevice", "kernelPath", "partition")),
new WXMClassUnderTest(
WXMParseError.class,
Set.of("lexical", "severity", "message")),
Expand Down
Expand Up @@ -212,6 +212,7 @@ public void exampleParses()
final var installK = (WXMGRUBKernelOpenBSD) install.kernelInstructions();
assertEquals("install", install.name().value());
assertEquals("0:4:0", installK.bootDevice().toString());
assertEquals("openbsd1", installK.partition());
assertEquals("/6.6/amd64/bsd.rd", installK.kernelPath().toString());

final var installUEFI = (WXMBootConfigurationUEFI) boots.get(1);
Expand Down
Expand Up @@ -144,6 +144,7 @@ public void openbsdSimpleAHCIHD()
WXMGRUBKernelOpenBSD.builder()
.setBootDevice(convert("0:0:0"))
.setKernelPath(Paths.get("/bsd"))
.setPartition("openbsd1")
.build())
.build()
)
Expand Down Expand Up @@ -179,7 +180,7 @@ public void openbsdSimpleAHCIHD()
assertEquals(1, mapLines.size());

final var grub = evaluated.grubConfiguration();
assertEquals("kopenbsd -h com0 -r sd0a (hd0)/bsd", grub.get(0));
assertEquals("kopenbsd -h com0 -r sd0a (hd0,openbsd1)/bsd", grub.get(0));
assertEquals("boot", grub.get(1));
assertEquals(2, grub.size());

Expand Down Expand Up @@ -214,6 +215,7 @@ public void openbsdSimpleHD()
WXMGRUBKernelOpenBSD.builder()
.setBootDevice(convert("0:0:0"))
.setKernelPath(Paths.get("/bsd"))
.setPartition("openbsd1")
.build())
.build()
)
Expand Down Expand Up @@ -244,7 +246,7 @@ public void openbsdSimpleHD()
assertEquals(1, mapLines.size());

final var grub = evaluated.grubConfiguration();
assertEquals("kopenbsd -h com0 -r sd0a (hd0)/bsd", grub.get(0));
assertEquals("kopenbsd -h com0 -r sd0a (hd0,openbsd1)/bsd", grub.get(0));
assertEquals("boot", grub.get(1));
assertEquals(2, grub.size());

Expand Down Expand Up @@ -286,6 +288,7 @@ public void openbsdSimpleCD()
WXMGRUBKernelOpenBSD.builder()
.setBootDevice(convert("0:1:0"))
.setKernelPath(Paths.get("/bsd"))
.setPartition("openbsd1")
.build())
.build()
)
Expand Down Expand Up @@ -363,6 +366,7 @@ public void openbsdSimpleCDUnused()
WXMGRUBKernelOpenBSD.builder()
.setBootDevice(convert("0:1:0"))
.setKernelPath(Paths.get("/bsd"))
.setPartition("openbsd1")
.build())
.build()
)
Expand Down Expand Up @@ -438,6 +442,7 @@ public void openbsdSimpleCDMissingAttachment()
WXMGRUBKernelOpenBSD.builder()
.setBootDevice(convert("0:1:0"))
.setKernelPath(Paths.get("/bsd"))
.setPartition("openbsd1")
.build())
.build()
)
Expand Down
Expand Up @@ -128,6 +128,7 @@ public void deleteOK()
.setKernelInstructions(
WXMGRUBKernelOpenBSD.builder()
.setKernelPath(Paths.get("/bsd"))
.setPartition("openbsd1")
.setBootDevice(
WXMDeviceSlot.builder()
.setBusID(0)
Expand Down
Expand Up @@ -273,6 +273,7 @@ public void deleteBootReferenced()
.setKernelInstructions(
WXMGRUBKernelOpenBSD.builder()
.setKernelPath(Paths.get("/bsd"))
.setPartition("openbsd1")
.setBootDevice(
WXMDeviceSlot.builder()
.setBusID(0)
Expand Down
Expand Up @@ -129,6 +129,7 @@ public void addOK()
.setKernelInstructions(
WXMGRUBKernelOpenBSD.builder()
.setKernelPath(Paths.get("/bsd"))
.setPartition("openbsd1")
.setBootDevice(
WXMDeviceSlot.builder()
.setBusID(0)
Expand Down Expand Up @@ -226,6 +227,7 @@ public void addConflict()
.setKernelInstructions(
WXMGRUBKernelOpenBSD.builder()
.setKernelPath(Paths.get("/bsd"))
.setPartition("openbsd1")
.setBootDevice(
WXMDeviceSlot.builder()
.setBusID(0)
Expand Down Expand Up @@ -325,6 +327,7 @@ public void replaceOK()
.setKernelInstructions(
WXMGRUBKernelOpenBSD.builder()
.setKernelPath(Paths.get("/bsd"))
.setPartition("openbsd1")
.setBootDevice(
WXMDeviceSlot.builder()
.setBusID(0)
Expand Down
Expand Up @@ -137,7 +137,7 @@
</BootDiskAttachment>
</BootDiskAttachments>
<GRUBBhyveKernelOpenBSD>
<BSDBootDevice kernelPath="/6.6/amd64/bsd.rd">
<BSDBootDevice kernelPath="/6.6/amd64/bsd.rd" partition="openbsd1">
<DeviceSlot bus="0"
slot="4"
function="0"/>
Expand Down
Expand Up @@ -137,7 +137,7 @@
</BootDiskAttachment>
</BootDiskAttachments>
<GRUBBhyveKernelOpenBSD>
<BSDBootDevice kernelPath="/6.6/amd64/bsd.rd">
<BSDBootDevice kernelPath="/6.6/amd64/bsd.rd" partition="openbsd1">
<DeviceSlot bus="0"
slot="4"
function="0"/>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.waxmill.xml/pom.xml
Expand Up @@ -8,7 +8,7 @@
<parent>
<artifactId>com.io7m.waxmill</artifactId>
<groupId>com.io7m.waxmill</groupId>
<version>0.0.10</version>
<version>0.0.11</version>
</parent>

<artifactId>com.io7m.waxmill.xml</artifactId>
Expand Down
Expand Up @@ -81,6 +81,7 @@ public void onElementStart(
this.builder.setKernelPath(
this.fileSystem.getPath(attributes.getValue("kernelPath"))
);
this.builder.setPartition(attributes.getValue("partition"));
} catch (final Exception e) {
throw context.parseException(e);
}
Expand Down
Expand Up @@ -28,5 +28,7 @@ public interface WXM1BSDBootDeviceType
{
WXMDeviceSlot deviceSlot();

String partition();

Path kernelPath();
}
Expand Up @@ -148,19 +148,26 @@ private static void serializeGRUBKernelOpenBSD(
{
final var namespaceURI = WXMSchemas.vmSchemaV1p0NamespaceText();
writer.writeStartElement(namespaceURI, "GRUBBhyveKernelOpenBSD");
serializeBSDBootDevice(kernel.kernelPath(), kernel.bootDevice(), writer);
serializeBSDBootDevice(
kernel.kernelPath(),
kernel.partition(),
kernel.bootDevice(),
writer
);
writer.writeEndElement();
}

private static void serializeBSDBootDevice(
final Path kernelPath,
final String partition,
final WXMDeviceSlot bootDevice,
final XMLStreamWriter writer)
throws XMLStreamException
{
final var namespaceURI = WXMSchemas.vmSchemaV1p0NamespaceText();
writer.writeStartElement(namespaceURI, "BSDBootDevice");
writer.writeAttribute("kernelPath", kernelPath.toString());
writer.writeAttribute("partition", partition);
WXM1DeviceSlots.serializeDeviceSlot(bootDevice, GUEST, writer);
writer.writeEndElement();
}
Expand Down

0 comments on commit e8366f4

Please sign in to comment.