Commit graph

82 commits

Author SHA1 Message Date
Christian Kellner
e92b40952b samples: replace with symlink to test data
Instead of maintaining a separate set of samples that by now are very
much outdated (using Fedora 31 or older), make the samples directory
a symlink to the test data. Manifests in there are indeed tested and
maintained.
The error and noop samples are also covered in unit tests, so no need
for extra samples there either.

CI: remove the sample validation since all the test data manifests
    are actually built.
2021-07-12 18:44:50 +02:00
Christian Kellner
7e392f819e stages/noop: fix the schema to allow any props
The documentation states that the stage accepts any options and
dumps them but the schema was not allowing any. Fix that and also
change the sample to include a random option.
2020-07-16 19:02:25 +02:00
Martin Sehnoutka
cd0db46601 samples/ppc64le: change the URL to the RPM packages
The mirror used in f30-ppc64le example did contain the RPM packages but
there were two issues
 * f32 is not in development any more
 * ppc64le is available as a secondary arch

The patch also renames the file as it contains packages for fedora 32.
2020-07-02 12:39:16 +02:00
Martin Sehnoutka
a4bdf965e3 samples/s390: Modify the URL to the RPM packages
mirrors.kernel.org does include packages for s390 but they are available
in /fedora-secondary directory.
2020-07-02 12:39:16 +02:00
Christian Kellner
192430bd30 assemblers/ostree.commit: support archiving
Introduce a new `tar` option, which when given together with the
required `tar.filename` option, will result in the output of the
assembler being a tarball that contains the repo and the compose
information (`compose.json`).
Requires the `tar` command to be present in the build root. Modify
the sample to use that option and include the tar for the build
pipeline.
2020-05-20 14:47:40 +02:00
Christian Kellner
7b3ad0a540 samples: remove erroneous runner entry
Remove a misplaced "runner" item from the manifests.
2020-05-06 15:42:23 +02:00
Christian Kellner
b710c3c55a samples: fix fstab stage in base-qcow2.json
The freq and passno options have to be numbers not strings. Fix it.
2020-05-06 15:42:23 +02:00
David Rheinsberg
d5575edbc7 samples: fix grub2-legacy in base-qcow2
This fixes a typo: `386-pc` -> `i386-pc`
2020-04-20 18:58:53 +02:00
David Rheinsberg
6377d328c6 samples: convert links to kernel.org
This converts all fedora links in our samples to `mirrors.kernel.org`.
This mirror works best from around the world, so lets avoid the wild
mix of local mirrors and instead use kernel.org.

This mirror is also well-managed and properly funded, so we should not
run into too many problems with it.
2020-04-15 19:38:00 +02:00
Christian Kellner
ef3f601d05 samples/f31-ostree-image.json: enable hybrid boot
That was mostly prepared already, the one last missing piece was
to use the default grub2 stage (previous commit) and now, with
this commit, to actually install the grub2 legacy bootloader via
the qemu assembler.
2020-04-15 15:39:45 +02:00
Christian Kellner
9020a0b372 samples: add f31-ostree-image.json example
An example that takes an ostree commit and creates a qcow2 image
that is bootable. NB: the commit ids and the corresponding source
will need to be adjusted after having run the pipeline that will
create the ostree commit.
2020-04-15 15:39:45 +02:00
Christian Kellner
09d73066ed samples: add f31-ostree-commit.json example
This is a Fedora 31 based example that results in a ostree repo
with a ostree commit. The latter was composed from the file system
tree that was created via the given osbuild stages.
2020-04-15 15:39:45 +02:00
Tom Gundersen
7e80ca9bbe sources: drop unused sources.json
External sources are no longer supported by osbuild, and is no longer
used in any of the samples.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-04-15 15:29:52 +02:00
Tom Gundersen
e96f2a6a0b samples: convert from dnf- to rpm-based pipelines
Similarly to how the tests were converted in 26f5135a5f.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-04-15 15:29:52 +02:00
Tom Gundersen
89e549cc58 samples/rawfs: fix bug in dnf stage
The 'bl' is not a valid hash.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-04-15 15:29:52 +02:00
Tom Gundersen
fe95d9317c samples: replace base-qcow2.json with the rpm version
Going forward we only want rpm-based pipelines, so drop the
dnf-based one.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-04-15 15:29:52 +02:00
Tom Gundersen
9d79d5fcc3 stages/grub2: default to disabling legacy support
For the sake of backwards compatibility, legacy support was enabled
by default. Flip this around, so that leaving the parameter out
means disabling it.

This is more intuitive, and will pave the way for dropping support
for the value being a bool in the future.

`osbuild-composer` always passes the argumnet explicitly, though
still always as a boolean.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-04-14 23:47:08 +02:00
Martin Sehnoutka
b6d09a2502 samples: add aarch64 fedora 30 repository into the sources
The sources.json file contains repositories for x86_64 and s390,
this patch adds the same for aarch64 Fedora 30 so that the example
pipeline can be build easily.
2020-04-01 18:30:10 +02:00
Martin Sehnoutka
9acc0575ab samples: set legacy to false in f30 aarch64 sample
The "legacy" option in stages/org.osbuild.grub2 defaults to True:
`legacy = options.get("legacy", True)`
If both legacy and uefi is enable, the stage will try to create a hybrid
image, but that fails for aarch64. This patch makes sure we use uefi
mode only which fixed this issue.

I tested the patch by hand together with the fix from this PR:
https://github.com/osbuild/osbuild/pull/308
2020-04-01 18:29:43 +02:00
Christian Kellner
1614fb202d samples/f30-qcow2-gpt: add GPT partition UUIDs
Now that specifying UUIDs for GPT partitions is supported, do so
for both partitions used in that sample.
2020-04-01 14:37:25 +02:00
Christian Kellner
7525e5fd38 samples/f30-qcow2-gpt: convert to new input format
Convert the sample to the new manifest format, because the old
format is no longer supported.
2020-04-01 14:37:25 +02:00
David Rheinsberg
ad3a1a8a58 samples: bring base-rpm-qcow2.json up-to-date
We will mention this example in our man-page, so make sure it actually
works. This imports all sources into the pipeline definition and
adjusts the syntax to match what we expect.
2020-03-07 13:43:24 +01:00
Tom Gundersen
352024830c build-env: drop unnccessary ubuntu build env
Even on ubuntu we can build rpm-based pipelines without bootstrapping
via fedora 27. Drop the build env from the travis config and from our
samples directory.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-03-03 00:05:26 +01:00
Tom Gundersen
ff8fda9e53 tests/dnf: always specify platform_module_id
As long as this matches the build environment, this does not make
a differenece, but let us not depend on this.

This will be useful when automatically transforming dnf to rpm
pipelines, as the platform_module_id is needed as input to
osbuild-composer's dnf-json tool.

Performed using this script:

```

cat $1 | jq '(.stages[]? | select(.name == "org.osbuild.dnf") | .options.module_platform_id) |= . + "platform:f30"'  | sponge $1
cat $1 | jq '(.build.pipeline.stages[]? | select(.name == "org.osbuild.dnf") | .options.module_platform_id) |= . + "platform:f30"'  | sponge $1
```

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-03-03 00:05:26 +01:00
Christian Kellner
4cbbcdba87 samples: fix types for fstab.{freq, passno}
The schema demands that these are of type integer not string.
2020-01-29 18:03:24 +01:00
Christian Kellner
eab3414f00 samples: add hybrid boot with extra boot partition
Add a new sample that supports hybrid boot, i.e. legacy boot and
UEFI, like f30-hybrid-qcow2, but with a separate boot partition.
The latter means that 'fix-bls' as well as the 'grub2' stage need
to be adapted for it: 'fix-bls' needs have the prefix set to "/"
and grub2 needs to have a 'boot_fs_uuid' option pointing to the
uuid of the filesystem for the boot partition.
2020-01-19 23:01:36 +01:00
Christian Kellner
2d6fa9564c samples/f30-s390x: use new stlye sources for dnf
Instead of directly encoding the repo configuration make use of the
new sources api. The corresponding entry in samples/sources.json
which is referenced here ("sha256:450d4c0…") was added with the
previous commit ("92cfc57d720…").

    "it's the future! 🛸" - Lars Karlitski
2020-01-13 20:05:10 +01:00
Christian Kellner
8d7cd7c871 samples/sources: add f30 on s390x dnf repo
Add the repo source for the org.osbuild.dnf stage for fedora 30 on
s390x.
2020-01-13 20:05:10 +01:00
Christian Kellner
d53787be66 samples/f30-s390x.json: example for s390x
Bare bones example for image creation on s390x with MBR partition
layout and zipl bootloader. The kernel command line is configured
via the new org.osbuild.kernel-cmdline stage which needs to be run
before the dnf stage.
2020-01-13 20:05:10 +01:00
Christian Kellner
20399a57ee samples: add hybrid boot example
Add a example demonstrating hybrid boot. The main ingredients are:
 - grub2 stage has `uefi` and `legacy` options
 - GPT partition layout
 - BIOS boot partition so that core image for grub2 legacy can
   be stored (small, 1MB, type 21686148-6449-6E6F-744E-656564454649)
 - ESP partition so UEFI can load grub*.efi (via the shim)
2020-01-10 18:25:35 +01:00
Christian Kellner
b50193f289 assemblers/qemu: fix backward compat for grub2
With the introduction of the `bootloader` option, grub2 legacy
installation setting changed. Before, grub2 legacy installation
was dependent on the partition scheme, i.e. only when dos/mbr
layout was used grub2 got installed. After the change the default
is to install it unless `bootloader.type" is explicitly set, even
if the partition layout is GPT. But a legacy grub2 installation
on GPT requires a BIOS boot partition, so the new default is not
right for the case of pure (non-hyrid) UEFI images.
Therefore revert to the old behavior of only defaulting to grub2
legacy if the option is not explicitly set *and* the partition
layout is "dos"/"mbr".
Adapt the f30-qcow2-gpt sample, which is non-uefi grub2 legacy
but with GPT and a bios boot partition, to explicitly request
the grub2 bootloader.
2020-01-10 15:48:27 +01:00
Christian Kellner
ba0acf7ff8 samples: example for legacy boot but gpt partition
An example demonstrating the use of the BIOS boot partition to
enable legacy grub2 boot (i.e. non-efi boot) with a GPT partition
layout.
2020-01-09 01:43:56 +01:00
Christian Kellner
57b2c1e12d samples: include ppc64le sample
Include a example of a ppc64le (open firmware) pipeline based on
f30-s390x. It includes changes to the grub2 stage (selecting the
platform), the partition table contains the PReP partition needed
to store the grub2 core image.
2019-12-24 15:42:24 +01:00
Lars Karlitski
510e2b1e94 osbuild: introduce sources
Pipelines encode which source content they need in the form of
repository metadata checksums (or rpm checksums). In addition, they
encode where they fetch that source content from in the form of URLs.
This is overly specific and doesn't have to be in the pipeline's hash:
the checksum is enough to specify an image.

In practice, this precluded using alternative ways of getting at source
packages, such as local mirrors, which could speed up development.

Introduce a new osbuild API: sources. With it, a stage can query for a
way to fetch source content based on checksums.

The first such source is `org.osbuild.dnf`, which returns repository
configuration for a metadata checksum. Note that the dnf stage continues
to verify that the content it received matches the checksum it expects.

Sources are implemented as programs, living in a `sources` directory.
They are run on the host (i.e., uncontained) right now. Each source gets
passed options, which are taken from a new command line argument to
osbuild, and an array of checksums for which to return content.

This API is only available to stages right now.
2019-12-23 01:12:38 +01:00
Christian Kellner
83c3f9608d samples: add a simple error example
Uses the org.osbuild.error stage to test error behavior and handling.
2019-12-18 12:45:59 +01:00
Christian Kellner
c77313079b assembler/qemu: add filesystem label support
Add a (optional) property call `label` to the `filesystem` object to
support labeling the filesystem. Add the label for the ESP to both
UEFI examples.
2019-12-12 17:25:47 +01:00
Christian Kellner
5cae5283d7 samples/f30-aarch64: 64bit ARM examples
Based on the UEFI sample (f30-base-uefi.json). NB: the inclusion
of the dracut-config-generic is needed to disable "host-only" for
dracut so the initramfs will include the virtio_blk block device
driver that is needed to mount the root file system when running
the image in qemu.
2019-12-12 17:25:47 +01:00
Brian C. Lane
4a44fdf317 samples/f30-base-uefi.json: UEFI x86_64 example
Include a basic example to generate a x84_64 UEFI image.
2019-12-12 17:25:47 +01:00
Lars Karlitski
64713449ce Introduce runners
We've been using a generic `osbuild-run`, which sets up the build
environment (and works around bugs) for all build roots. It is already
getting unwieldy, because it tries to detect the OS for some things it
configures. It's also about to cause problems for RHEL, which doesn't
currently support a python3 shebang without having /etc around.

This patch changes the `build` key in a pipeline to not be a pipeline
itself, but an object with `runner` and `pipeline` keys. `pipeline` is
the build pipeline, as before. `runner` is the name of the runner to
use. Runners are programs in the `runners` subdirectory.

Three runners are included in this patch. They're copies of osbuild-run
for now (except some additions for rhel82). The idea is that each of
them only contains the minimal setup code necessary for an OS, and that
we can review what's needed when updating a build root.

Also modify the `--build-pipeline` command line switch to accept such a
build object (instead of a pipeline) and rename it accordingly, to
`--build-env`.

Correspondingly, `OSBUILD_TEST_BUILD_PIPELINE` → `OSBUILD_TEST_BUILD_ENV`.
2019-11-25 13:05:22 +01:00
Lars Karlitski
2b872bbbfb stages: add org.osbuild.rpm
A new stage that downloads a list of packages and installs them using
`rpm`.
2019-10-15 00:00:13 +02:00
Tom Gundersen
21df63ba31 stages/dnf: embed the gpgkey in the pipeline
Downloading the gpg key is fragile and kept causing our tests to fail.
In general, we want to limit the network access, so let's just embed
the gpg keys directly in the pipeline.

Fixes #133.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2019-10-12 14:59:01 +02:00
Martin Sehnoutka
0862722b03 Introduce cloud-base sample
It is similar to the official Fedora cloud base image except for few
minor differences. The reason for this divergence is that we don't want
to include all hacks that are currently present in the official
kickstart file. You can see it here as a reference:
https://pagure.io/fedora-kickstarts/blob/master/f/fedora-cloud-base.ks#_149
2019-10-07 21:25:18 +02:00
Lars Karlitski
9fbe80722b assemblers: add org.osbuild.rawfs
This assembler outputs an image file which only contains the file
system.
2019-10-07 10:10:51 +02:00
Lars Karlitski
c1dca86505 samples: remove base-from-yum.json
build-from-yum.json is the one that's being used for testing on Ubuntu.
Remove base-from-yum.json, because it's confusing to have two similarly
named pipelines like this.
2019-10-07 00:17:43 +02:00
Lars Karlitski
3e57f13380 stages/dnf: exclude-packages → exclude_packages 2019-10-03 12:53:01 +02:00
Tom Gundersen
f470c3f3a3 assemblers/qemu: fix the partition UUID in the pipeline
Otherwise, sfdik would pick one at random. We want our images to be
reproducible to the extent possible, so we must move all randomness
out of the assemblers when we can.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2019-10-02 15:10:37 +02:00
Tom Gundersen
8f9dd5ec7d stages/dnf: support --exclude
This allows given packages to be excluded from the transaction. This
is useful if you want to install a group with certain exceptions.

A common thing to do in kicktstart files is:
```
rm -f /boot/*-rescue*
```

By instead excluding the dracut-rescue-config package we end up
with:
```
"deleted_files": [
  "/etc/kernel/postinst.d",
  "/usr/lib/dracut/dracut.conf.d/02-rescue.conf",
  "/usr/lib/kernel/install.d/51-dracut-rescue.install",
  "/boot/initramfs-0-rescue-ffffffffffffffffffffffffffffffff.img",
  "/boot/vmlinuz-0-rescue-ffffffffffffffffffffffffffffffff"
],
```

Signed-off-by: Tom Gundersen <teg@jklm.no>
2019-10-02 13:34:14 +02:00
Tom Gundersen
6ed426773f stages/yum: don't name the repositories
See 840bfd580c.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2019-09-30 23:48:23 +02:00
Tom Gundersen
34098bf6c6 assembler: rename qcow2 to qemu and add support for more formats
Opt in to supporting the most common ones, if we want to support more
we can add support as the need arises.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2019-09-29 19:05:55 +02:00
Tom Gundersen
840bfd580c stages/dnf: don't name the repositories
The names carry no information, and do not affect the produced image.
Generate them instead.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2019-09-29 19:04:39 +02:00