]> git.ipfire.org Git - thirdparty/mkosi.git/log
thirdparty/mkosi.git
7 years agoAdd "ExtraSearchPaths=" and --extra-search-paths 229/head
Caio Marcelo de Oliveira Filho [Wed, 31 Jan 2018 22:33:29 +0000 (14:33 -0800)] 
Add "ExtraSearchPaths=" and --extra-search-paths

This variable keeps a colon-delimited list of paths to be prepended to
PATH in the context of mkosi execution. Unlike shell variable
expansion, if any path refers to an unset variable, that path will be
ignored.

Besides the environment variables, the variable SUDO_HOME can be used
to refer to the home directory of the user calling mkosi with
sudo. This allows settings like

    ExtraSearchPaths=$SUDO_HOME/go/bin

7 years agoGeneralize PackageAction to ListAction
Caio Marcelo de Oliveira Filho [Tue, 6 Feb 2018 19:29:52 +0000 (11:29 -0800)] 
Generalize PackageAction to ListAction

Use delimiter as parameter. ListAction with a different delimiter will
be used later for colon delimited lists.

Opted to make a CommaDelimitedListAction instead of making "," the
default delimiter so that the lines adding arguments will be more
explicitly about what kind of list they are using.

7 years agoMerge pull request #226 from cmarcelo/clearlinux
Lennart Poettering [Wed, 31 Jan 2018 19:35:52 +0000 (20:35 +0100)] 
Merge pull request #226 from cmarcelo/clearlinux

Clear Linux support

7 years agoAdd Clear Linux support 226/head
Caio Marcelo de Oliveira Filho [Thu, 25 Jan 2018 01:31:09 +0000 (17:31 -0800)] 
Add Clear Linux support

7 years agoPass loopdev to install_boot_loader
Caio Marcelo de Oliveira Filho [Thu, 25 Jan 2018 01:27:31 +0000 (17:27 -0800)] 
Pass loopdev to install_boot_loader

It will be used later to allow clr-boot-manager interact with the loop
device of the image to query about UUID and related parameters.

7 years agoDon't fail deleting non-existent /etc/machine-id
Caio Marcelo de Oliveira Filho [Thu, 25 Jan 2018 01:24:10 +0000 (17:24 -0800)] 
Don't fail deleting non-existent /etc/machine-id

When resetting machine-id and it doesn't exist, don't fail, just
proceed to create a new one. The basic filesystem of Clear Linux we
will be using for bootstrap doesn't have a /etc/machine-id
out-of-the-box.

7 years agoAllow passing params to nspawn in run_workspace_command
Caio Marcelo de Oliveira Filho [Thu, 25 Jan 2018 01:23:30 +0000 (17:23 -0800)] 
Allow passing params to nspawn in run_workspace_command

This will be used when executing the install bootloader for Clear
Linux, to let it access /dev (via a bind) and allow it read the loop
devices.

7 years ago[mkosi] Imports reordered (#225)
Batuhan Osman Taşkaya [Wed, 31 Jan 2018 18:02:57 +0000 (21:02 +0300)] 
[mkosi] Imports reordered (#225)

- Files: mk-osi
- Changes: Imports reordered with pep8 importing rules

7 years agoMerge pull request #228 from cmarcelo/firmware-location-in-clear
Lucas De Marchi [Wed, 31 Jan 2018 17:49:24 +0000 (09:49 -0800)] 
Merge pull request #228 from cmarcelo/firmware-location-in-clear

Add qemu firmware location in Clear Linux

7 years agoAdd qemu firmware location in Clear Linux 228/head
Caio Marcelo de Oliveira Filho [Thu, 25 Jan 2018 01:29:12 +0000 (17:29 -0800)] 
Add qemu firmware location in Clear Linux

Make sure mkosi find OVMF_CODE.fd when running on Clear Linux.

7 years agoMerge pull request #213 from L3n41c/arch_networkd
Lucas De Marchi [Fri, 19 Jan 2018 18:08:16 +0000 (10:08 -0800)] 
Merge pull request #213 from L3n41c/arch_networkd

Stop patching nsswitch.conf and make resolv.conf points to stub-resolv.conf on Arch Linux

7 years agoFix Arch Linux boot when the root FS is encrypted (#217)
Lénaïc Huard [Mon, 15 Jan 2018 13:44:31 +0000 (14:44 +0100)] 
Fix Arch Linux boot when the root FS is encrypted (#217)

When the root FS is encrypted, mkinitcpio needs to be instructed to put in
the initrd what is needed to open the LUKS volume.

https://wiki.archlinux.org/index.php/mkinitcpio#Common_hooks

7 years agoAdd the path where the UEFI firmware blob stands on Arch Linux
Lénaïc Huard [Sun, 7 Jan 2018 23:15:19 +0000 (00:15 +0100)] 
Add the path where the UEFI firmware blob stands on Arch Linux

as shipped with the `ovmf` package.

7 years agoUse an UTF-8 locale on Arch Linux (#214)
Lénaïc Huard [Mon, 8 Jan 2018 08:37:34 +0000 (09:37 +0100)] 
Use an UTF-8 locale on Arch Linux (#214)

Commit 0dc40f40 introduced the generation of an UTF-8 locale at build time.
This commit makes it used.

For example, before this commit, we still had:
```
[root@archlinux ~]# systemctl status
* archlinux
    State: running
     Jobs: 0 queued
   Failed: 0 units
    Since: Sun 2018-01-07 22:13:47 CET; 32min ago
   CGroup: /
           |-user.slice
           | `-user-0.slice
           |   |-session-c1.scope
           |   | |-125 login -- root
```
whereas with this commit, we now have a prettier printed:
```
[root@archlinux ~]# systemctl status
● archlinux
    State: running
     Jobs: 0 queued
   Failed: 0 units
    Since: Sun 2018-01-07 22:13:47 CET; 33min ago
   CGroup: /
           ├─user.slice
           │ └─user-0.slice
           │   ├─session-c1.scope
           │   │ ├─125 login -- root
```

7 years agoStop patching nsswitch.conf and make resolv.conf points to stub-resolv.conf on Arch... 213/head
Lénaïc Huard [Sun, 7 Jan 2018 21:27:51 +0000 (22:27 +0100)] 
Stop patching nsswitch.conf and make resolv.conf points to stub-resolv.conf on Arch Linux

The `nsswitch.conf` file that comes by default on Arch Linux is now fully systemd-resolved compatible.
Its `hosts:` line is now:
```
hosts: files mymachines resolve [!UNAVAIL=return] dns myhostname
```
So, there is no need to patch this file when enabling systemd-resolved on Arch Linux anymore.

Also make `/etc/resolv.conf` points to the new dynamic `/run/systemd/resolve/stub-resolv.conf` rather than the older static `/usr/lib/systemd/resolv.conf`.

7 years agoMerge pull request #206 from poettering/incremental-reflink
Lucas Werkmeister [Fri, 5 Jan 2018 23:24:04 +0000 (00:24 +0100)] 
Merge pull request #206 from poettering/incremental-reflink

mkosi: make -i mode snappier on reflink-capable file systems

7 years agoRe-enable kernel install scripts (#211)
Lucas De Marchi [Fri, 5 Jan 2018 19:12:35 +0000 (11:12 -0800)] 
Re-enable kernel install scripts (#211)

After doing the distro installation we'd better re-enable the install
scripts from the distro so we can continue to support scripts that
install kernels following the Bootloader Spec (even though we prefer
a unified image here).

7 years agoMerge pull request #192 from lucasdemarchi/pr-skeleton
Lennart Poettering [Fri, 5 Jan 2018 19:11:36 +0000 (20:11 +0100)] 
Merge pull request #192 from lucasdemarchi/pr-skeleton

Add support to skeleton trees

7 years agomkosi: make -i mode snappier on reflink-capable file systems 206/head
Lennart Poettering [Wed, 29 Nov 2017 11:20:24 +0000 (12:20 +0100)] 
mkosi: make -i mode snappier on reflink-capable file systems

Let's start out with a reflink copy, even if we don't actually want CoW
for disk images ultimately.

7 years agomkosi: rename _copy_file() → copy_fd()
Lennart Poettering [Fri, 5 Jan 2018 19:00:16 +0000 (20:00 +0100)] 
mkosi: rename _copy_file() → copy_fd()

We have so many similarly named functions, let's clarify that this one
is about fds.

7 years agoAdd tar archive support for extra and skeleton trees 192/head
Lucas De Marchi [Thu, 4 Jan 2018 22:45:34 +0000 (14:45 -0800)] 
Add tar archive support for extra and skeleton trees

Like documentation here says, it allows one to preseve file ownership
when adding files to the final image. This may be particularly useful if
you are adding configuration files for a daemon that is not supposed to
run as root, but as a pre-defined user.

7 years agoOnly add mkosi.{extra,skeleton} if they are directories
Lucas De Marchi [Thu, 4 Jan 2018 22:29:08 +0000 (14:29 -0800)] 
Only add mkosi.{extra,skeleton} if they are directories

This follows the documentation more closely.

7 years agoSimplify assignments by using empty lists as default
Lucas De Marchi [Thu, 4 Jan 2018 22:23:40 +0000 (14:23 -0800)] 
Simplify assignments by using empty lists as default

Make argparse use empty lists as default rather than None
for arguments that receive lists. This allows us to simplify all the
conditional assign or extend throught the code.

This is done for packages, build_packages, extra_trees and
skeleton_trees, removing the conditional assignments and leaving only
a call to extend() that can handle the case the list is empty. Also
checks for `if X is None` need to be converted to `if not X`.

7 years agoAdd support to skeleton trees
Lucas De Marchi [Wed, 8 Nov 2017 16:09:32 +0000 (08:09 -0800)] 
Add support to skeleton trees

It's already possible to pass extra trees to copy over the final tree
after installing all packages. However in some cases it is desirable to
copy the tree before installing packages or running anything in the
image.  One of the cases is if we want to enable additional repositories
for the package manager or want to configure it in a particular way.

Now mkosi can use a mkosi.skeleton directory (or by passing a
--skeleton-tree argument) in the same way it currently supports extra
trees, however copying them before running the "install_distro" phase.

To allow changing the package manager configuration distros may need
more tweaks to point the package manager to the right files. Right now
this has been tested with Fedora 27 by adding
`mkosi.skeleton/etc/yum.repos.d/rpmfusion-free.repo` and installing a
package from that repo.

7 years agoAdd 'References' section to README (#209)
Adam Hunt [Tue, 12 Dec 2017 13:41:47 +0000 (05:41 -0800)] 
Add 'References' section to README (#209)

Created 'Reference' section including a few links to the README.

7 years agoMerge pull request #205 from keszybz/spdx
Lennart Poettering [Mon, 27 Nov 2017 10:57:05 +0000 (11:57 +0100)] 
Merge pull request #205 from keszybz/spdx

Add SPDX license identifiers

7 years agoAdd SPDX license identifiers 205/head
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 07:07:03 +0000 (08:07 +0100)] 
Add SPDX license identifiers

7 years agoChange opensuse zypper pattern to a form that works everywhere (#109)
Sebastian [Mon, 27 Nov 2017 07:04:49 +0000 (08:04 +0100)] 
Change opensuse zypper pattern to a form that works everywhere (#109)

[zj: The pattern "lost visibility" at some point. This is fixed in tumbleweed, but
not in some other versions, so let's use the form that works everywhere for now.

See https://bugzilla.opensuse.org/show_bug.cgi?id=1049997.]

7 years agoMerge pull request #201 from keszybz/copystat
Lennart Poettering [Fri, 17 Nov 2017 17:50:26 +0000 (18:50 +0100)] 
Merge pull request #201 from keszybz/copystat

Use shutil.copystat in more places and other cleanups

7 years agoApply shutil.copystat in more places 201/head
Zbigniew Jędrzejewski-Szmek [Fri, 17 Nov 2017 16:25:37 +0000 (17:25 +0100)] 
Apply shutil.copystat in more places

7 years agoUse universal_newlines instead of explicit decodes
Zbigniew Jędrzejewski-Szmek [Fri, 17 Nov 2017 16:16:30 +0000 (17:16 +0100)] 
Use universal_newlines instead of explicit decodes

It's not shorter, but feels cleaner.

7 years agoImport run/PIPE/DEVNULL names from subprocess
Zbigniew Jędrzejewski-Szmek [Fri, 17 Nov 2017 16:13:07 +0000 (17:13 +0100)] 
Import run/PIPE/DEVNULL names from subprocess

... instead of using subprocess.run etc. We use those in some many places it makes
sense to economize a bit. It makes the long lines much shorter and more readable.

7 years agoRemove unused import
Zbigniew Jędrzejewski-Szmek [Fri, 17 Nov 2017 16:02:44 +0000 (17:02 +0100)] 
Remove unused import

7 years agoFix name of variable
Zbigniew Jędrzejewski-Szmek [Fri, 17 Nov 2017 16:02:38 +0000 (17:02 +0100)] 
Fix name of variable

7 years agomkosi: Recursively delete btrfs subvolumes (#177)
Georges Discry [Fri, 17 Nov 2017 15:52:59 +0000 (16:52 +0100)] 
mkosi: Recursively delete btrfs subvolumes (#177)

`btrfs subvol delete` can only delete a subvolume if it is not read-only
and if it does not contain another subvolume.

`btrfs subvol list -o` prints the subvolumes below a certain path, but
only gives the paths relative to the filesystem mount point for those
subvolumes. To compute the paths of the children, we need the relative
path of the parent subvolume given by `btrfs subvol show`.

Read-only subvolumes also have to be writeable again before being
deleted. We unconditionally unset the readonly property on a subvolume
before deletion.

7 years agoUse host resolver with host network for build script (#193)
Lucas Werkmeister [Fri, 17 Nov 2017 15:50:07 +0000 (16:50 +0100)] 
Use host resolver with host network for build script (#193)

This is essentially a copy of f4ee420a00, but for the build script,
since @juaningan pointed out in a comment in #188 that we need it there
as well.

7 years agoMerge pull request #200 from keszybz/fedora
Lennart Poettering [Fri, 17 Nov 2017 15:26:38 +0000 (16:26 +0100)] 
Merge pull request #200 from keszybz/fedora

Make installing Fedora a bit nicer

7 years agoOutput a nice error message when "--release rawhide" is used 200/head
Zbigniew Jędrzejewski-Szmek [Fri, 17 Nov 2017 15:08:28 +0000 (16:08 +0100)] 
Output a nice error message when "--release rawhide" is used

7 years agoAdd keys for Fedora 27 and 28
Zbigniew Jędrzejewski-Szmek [Fri, 17 Nov 2017 14:55:04 +0000 (15:55 +0100)] 
Add keys for Fedora 27 and 28

7 years agoMerge pull request #180 from poettering/qemu
Zbigniew Jędrzejewski-Szmek [Fri, 17 Nov 2017 12:31:20 +0000 (13:31 +0100)] 
Merge pull request #180 from poettering/qemu

add "mkosi qemu" verb

7 years agomkosi: add "qemu" verb 180/head
Lennart Poettering [Wed, 25 Oct 2017 10:40:28 +0000 (12:40 +0200)] 
mkosi: add "qemu" verb

This adds a new "mkosi qemu" verb that is like "mkosi boot" but invokes
things in a QEMU environment.

This tries to find the native qemu implementation, with a couple of
fallbacks if none is found, always opting for KVM acceleration.

This also tries to automatically discover the UEFI firmware blobs. For
now only the location where the files are on Fedora is encoded in the
search path, but this can be updated for other distributions easily
later on.

Fixes: #179
7 years agomkosi: rework "mkosi shell"/"mkosi boot" to use os.execvp()
Lennart Poettering [Fri, 17 Nov 2017 11:22:15 +0000 (12:22 +0100)] 
mkosi: rework "mkosi shell"/"mkosi boot" to use os.execvp()

When invoked this way we are just preparators for the final nspawn
command, hence it makes a lot of sense to simply replace our process
with nspawn, hence don't fork off nspawn, but simply invoke os.execvp().

7 years agodracut: explicitly enable "qemu" dracut module
Lennart Poettering [Wed, 25 Oct 2017 09:39:48 +0000 (11:39 +0200)] 
dracut: explicitly enable "qemu" dracut module

Dracut really should imply that the "qemu" module is used when
"nohostonly" mode is selected (which we select), but it currently does
not, so deal with that.

Fixes: #56
7 years agomkosi: make sure when copying files we unlink existing matching files first (#198)
Lennart Poettering [Thu, 16 Nov 2017 20:11:23 +0000 (21:11 +0100)] 
mkosi: make sure when copying files we unlink existing matching files first (#198)

Previously, if a file already existed before, we'd open it for write and
write the new file into the same file. If the old file was larger than
the new file we'd not truncate it, so that in that case the resulting
file was a combination of the new small file plus the old suffix.

This one confused the hell out of me...

7 years agoMerge pull request #196 from keszybz/allow-loose-permissions
Lennart Poettering [Thu, 16 Nov 2017 18:53:38 +0000 (19:53 +0100)] 
Merge pull request #196 from keszybz/allow-loose-permissions

Allow loose permissions on password file

7 years agorework image cache logic so that it works without the presence of a build script...
Florent Thiery [Tue, 14 Nov 2017 09:56:56 +0000 (10:56 +0100)] 
rework image cache logic so that it works without the presence of a build script (#155)

In that case, pre-dev and dev images are not generated at all anymore, so that cache images are
not generated every time; note that this means that pre-dev and pre-inst images currently need to
be manually removed to be re-generated.

Fixes #143.

I my build-less case i used the mkosi.postinst to perform the actual customizations, and in that case
the image caching was not used and it took way longer. With these patches the postinst is applied to
the mediacoder-image.raw.cache-pre-inst cache image, speeding up the process.

I use the postinst script to create users, enable/disable services, setup locale, install custom prebuilt
packages. Rebuilding the base image is pretty slow, so i think it is still useful to support -i without
caching (ex: for producing distro spins).

[zj: add commit message based on comments in the PR]

7 years agoMinor prettification 196/head
Zbigniew Jędrzejewski-Szmek [Tue, 14 Nov 2017 09:42:15 +0000 (10:42 +0100)] 
Minor prettification

7 years agomkosi: generate default UTF-8 locale for Arch Linux (#187)
John Lin [Tue, 14 Nov 2017 09:38:05 +0000 (17:38 +0800)] 
mkosi: generate default UTF-8 locale for Arch Linux (#187)

Fixes: #186
7 years agoDrop redundant args to open()
Zbigniew Jędrzejewski-Szmek [Tue, 14 Nov 2017 09:25:04 +0000 (10:25 +0100)] 
Drop redundant args to open()

UTF-8 and text read mode are the default.

7 years agoDowngrade fatal permissions error to warning
Zbigniew Jędrzejewski-Szmek [Tue, 14 Nov 2017 09:11:44 +0000 (10:11 +0100)] 
Downgrade fatal permissions error to warning

There are various circumstances in which it is OK to have permissions
mask which goes above 0o700:
- when the user has own group
- when the file is shared with others using a special group
- when doing QA and the password should be set but is not secret
- when the access is limited through other means

So let's not be too strict here.

Also, let's use plain octal mask instead of the stat.S_* macros. This
is way more legible! This is inspired by a recent comment from Linus
Torvalds:
https://github.com/torvalds/linux/commit/277642dcca765a1955d4c753a5a315ff7f2eb09d.
In Python we have the advantage that we have an unambigous notation
for octal numbers, so let's just use them.

7 years agoAdd warn() helper similar to die()
Zbigniew Jędrzejewski-Szmek [Tue, 14 Nov 2017 09:10:19 +0000 (10:10 +0100)] 
Add warn() helper similar to die()

7 years agoFix breakage when generating image without bmap (#195)
Lucas De Marchi [Tue, 14 Nov 2017 08:36:59 +0000 (00:36 -0800)] 
Fix breakage when generating image without bmap (#195)

When generating an image without bmap it was failing with:

       ‣ Creating BMAP file...
        Traceback (most recent call last):
          File "/usr/bin/mkosi", line 3304, in <module>
            main()
          File "/usr/bin/mkosi", line 3297, in main
            build_stuff(args)
          File "/usr/bin/mkosi", line 3231, in build_stuff
            bmap = calculate_bmap(args, raw)
          File "/usr/bin/mkosi", line 1995, in calculate_bmap
            dir=os.path.dirname(args.output_bmap))
        AttributeError: 'Namespace' object has no attribute 'output_bmap'

Fix it by doing the same as we do in other functions, checking if
bmap is actually enabled.

7 years agoAdd support to bmap-tools (#190)
Lucas De Marchi [Sun, 12 Nov 2017 21:47:59 +0000 (13:47 -0800)] 
Add support to bmap-tools (#190)

bmap-tools (https://github.com/intel/bmap-tools) allows us to write
images to physical disks like USB drives without having to write the
entire image. It rather writes only the used blocks.  With this we
reduce the time to write to a disk when we manually set the size of the
partitions.

7 years agoMerge pull request #188 from NeilW/master
Lennart Poettering [Wed, 8 Nov 2017 16:46:45 +0000 (17:46 +0100)] 
Merge pull request #188 from NeilW/master

Fix ubuntu builds

7 years agoUpdate default to current Ubuntu release (#191)
bit [Wed, 8 Nov 2017 16:45:29 +0000 (16:45 +0000)] 
Update default to current Ubuntu release (#191)

7 years agoMerge pull request #183 from keszybz/copy-tree
Lennart Poettering [Wed, 8 Nov 2017 16:43:04 +0000 (17:43 +0100)] 
Merge pull request #183 from keszybz/copy-tree

Copy tree

7 years agomkosi: update default ubuntu distribution 188/head
Neil Wilson [Fri, 3 Nov 2017 11:15:31 +0000 (11:15 +0000)] 
mkosi: update default ubuntu distribution

Update default to a currently supported version

7 years agomkosi: use Host resolver config with Host network
Neil Wilson [Fri, 3 Nov 2017 11:11:34 +0000 (11:11 +0000)] 
mkosi: use Host resolver config with Host network

If we're running a sub-command in the Host network namespace
use the resolver from the Host namespace to avoid name resolution
errors.

Bind as read-only so we get errors if anything tries to update it
while we're using the Host network.

Fixes #185

7 years agoAdd an internal tree copy implementation 183/head
Zbigniew Jędrzejewski-Szmek [Fri, 27 Oct 2017 15:26:10 +0000 (17:26 +0200)] 
Add an internal tree copy implementation

The general idea is to copy everything, preserving access mode, times,
xattrs on files. An attempt to create the new object is first made,
followed by an unlink and a repeated attempt. This optimizes for the
case where the output tree is empty, which seems to be the common
thing in our case.

Reflink is attempted for normal files.

Symlinks are not adjusted: if they pointed outside of the tree being
copied, they might be dangling now.

Block and character device nodes and any other special files are not
copied.

7 years agoAdd mkdir_last helper
Zbigniew Jędrzejewski-Szmek [Sun, 29 Oct 2017 16:11:08 +0000 (17:11 +0100)] 
Add mkdir_last helper

7 years agofedora: install F27 by default
Zbigniew Jędrzejewski-Szmek [Mon, 30 Oct 2017 08:20:46 +0000 (09:20 +0100)] 
fedora: install F27 by default

It'll become stable in a week or two.

7 years agomkosi: create builddir if configured but missing (#181)
Lennart Poettering [Thu, 26 Oct 2017 19:51:22 +0000 (21:51 +0200)] 
mkosi: create builddir if configured but missing (#181)

If a builddir is explicitly configured but missing, automatically create
it.

This follows the logic already implemented for mkosi.output/ and
mkosi.cache/.

This is particularly useful when storing mkosi settings in a git repo,
as git normally doesn't allow us to store empty directories, and hence
we cannot make use of auto-discovery of mkosi.output/ and mkosi.cache/.
By configuring these paths explicitly in mkosi.default however, we can
work around this, as in that case we'll create the directories if
needed.

7 years agoMerge pull request #165 from poettering/output-dir
Zbigniew Jędrzejewski-Szmek [Wed, 25 Oct 2017 14:00:50 +0000 (16:00 +0200)] 
Merge pull request #165 from poettering/output-dir

mkosi.output/ directory support

7 years agoREADME: document mkosi.output/ and why and how to use it 165/head
Lennart Poettering [Tue, 10 Oct 2017 16:35:26 +0000 (18:35 +0200)] 
README: document mkosi.output/ and why and how to use it

7 years agomkosi: exclude all cache and output directories from the copied build sources
Lennart Poettering [Tue, 10 Oct 2017 16:34:04 +0000 (18:34 +0200)] 
mkosi: exclude all cache and output directories from the copied build sources

We should exclude mkosi.builddir/, mkosi.output/, mkosi.cache/ when
preparing the build image, as they aren't really part of the sources,
but contain artifacts of previous mkosi invocations.

7 years agomkosi: add "mkosi.output/" directory concept
Lennart Poettering [Tue, 10 Oct 2017 16:33:14 +0000 (18:33 +0200)] 
mkosi: add "mkosi.output/" directory concept

This adds support for an "mkosi.output/" directory where all built
artifacts are places by default.

See discussion around #151.

7 years agoExtract require_private_file function (#175)
Lucas Werkmeister [Sun, 15 Oct 2017 11:52:00 +0000 (13:52 +0200)] 
Extract require_private_file function (#175)

The code for mkosi.rootpw was clearly copied from mkosi.passphrase, so
let’s just extract it into a function shared between the two.

7 years agoMerge pull request #173 from fbuihuu/opensuse-use-http
Lucas Werkmeister [Thu, 12 Oct 2017 21:36:01 +0000 (23:36 +0200)] 
Merge pull request #173 from fbuihuu/opensuse-use-http

openSUSE: don't use https to access mirrors for now

7 years agoMerge pull request #122 from poettering/boot-verb
Lucas Werkmeister [Thu, 12 Oct 2017 20:39:24 +0000 (22:39 +0200)] 
Merge pull request #122 from poettering/boot-verb

Some assorted additions, including new "mkosi shell" and "mkosi boot" commands

7 years agoopenSUSE: don't use https to access mirrors for the time being 173/head
Franck Bui [Thu, 12 Oct 2017 15:08:11 +0000 (17:08 +0200)] 
openSUSE: don't use https to access mirrors for the time being

Some openSUSE mirrors redirect https to http and this seems to make
curl(1) unhappy now.

There's a request to fix that on mirror side:
https://github.com/openSUSE/mirrorbrain/issues/3 but for the time
being switch to http to access all mirrors.

There seems to be no additional values in https:// as the rpms are
signed by gpg keys already, so is the repodata anyways.

Fixes: #137
Fixes: #159
7 years agoMerge pull request #168 from UbiCastTeam/167-fix-vmlinuz-detection
Lucas Werkmeister [Thu, 12 Oct 2017 09:42:06 +0000 (11:42 +0200)] 
Merge pull request #168 from UbiCastTeam/167-fix-vmlinuz-detection

fix unreliable vmlinuz file detection

7 years agoMerge pull request #170 from UbiCastTeam/fix-crash-arch-nopackages
Lucas Werkmeister [Thu, 12 Oct 2017 09:40:33 +0000 (11:40 +0200)] 
Merge pull request #170 from UbiCastTeam/fix-crash-arch-nopackages

Fix building base Arch image if no additional package was requested

7 years agofix building base Arch image if no additional package was requested 170/head
Florent Thiéry [Wed, 11 Oct 2017 15:48:57 +0000 (17:48 +0200)] 
fix building base Arch image if no additional package was requested

7 years agofix detecting vmlinuz file which was unreliably detected due to improper use of lstri... 168/head
Florent Thiéry [Wed, 11 Oct 2017 08:28:55 +0000 (10:28 +0200)] 
fix detecting vmlinuz file which was unreliably detected due to improper use of lstrip, refs #167

7 years agosupport other arch support kernels if specified in package list (only keep base kerne...
Florent Thiery [Tue, 10 Oct 2017 16:47:46 +0000 (18:47 +0200)] 
support other arch support kernels if specified in package list (only keep base kernel if explicitly requested by the user in the packages) (#158)

7 years agoREADME: on debian, the ubuntu keyring is named ubuntu-archive-keyring (#164)
Felipe Sateler [Tue, 10 Oct 2017 13:45:49 +0000 (10:45 -0300)] 
README: on debian, the ubuntu keyring is named ubuntu-archive-keyring (#164)

7 years agoREADME: document the debian/ubuntu keyring situation explicitly (#163)
Lennart Poettering [Tue, 10 Oct 2017 13:07:35 +0000 (15:07 +0200)] 
README: document the debian/ubuntu keyring situation explicitly (#163)

I figure the mkosi distro packages should add both deps explicitly to
avoid any confusion.

Fixes: #139
7 years agoMerge pull request #161 from poettering/rootpw
Lennart Poettering [Tue, 10 Oct 2017 08:43:26 +0000 (10:43 +0200)] 
Merge pull request #161 from poettering/rootpw

add support for reading the root password to use from "mkosi.rootpw"

7 years agomkosi: minor prettification 161/head
Lennart Poettering [Fri, 6 Oct 2017 18:08:06 +0000 (20:08 +0200)] 
mkosi: minor prettification

There's no need to append an empty string if we have to conditionalize
things anyway.

7 years agomkosi: read root pw to set from "mkosi.rootpw"
Lennart Poettering [Fri, 6 Oct 2017 18:04:43 +0000 (20:04 +0200)] 
mkosi: read root pw to set from "mkosi.rootpw"

Let's add a way to store the root pw in a separate file, outside of
mkosi.default. That way it's easy for people to build images locally of
an upstream project without having to modify the mkosi.default file,
simply by dropping their own file.

7 years agomkosi: unbreak the squashfs mode, when used together with build trees (#160)
Lennart Poettering [Tue, 10 Oct 2017 08:33:25 +0000 (10:33 +0200)] 
mkosi: unbreak the squashfs mode, when used together with build trees (#160)

We need to create the mount point for the build tree early on, so that
it is included in the read-only squashfs image, and we can mount the
host's builddir into it.

Without this patch squashfs builds with builddir usage fail.

7 years agomkosi: drop redundant \n in die()
Lennart Poettering [Fri, 6 Oct 2017 18:01:10 +0000 (20:01 +0200)] 
mkosi: drop redundant \n in die()

7 years agomkosi: don't show root password on screen
Lennart Poettering [Fri, 6 Oct 2017 18:00:28 +0000 (20:00 +0200)] 
mkosi: don't show root password on screen

It's probably not a good idea to show passwords on screen needlessly.
Hence let's just show whether one is set, instead of its actual
contents.

7 years agoDo not setup systemd-networkd and systemd-resolved if networkmanager is in the packag...
Florent Thiery [Fri, 6 Oct 2017 18:12:18 +0000 (20:12 +0200)] 
Do not setup systemd-networkd and systemd-resolved if networkmanager is in the packages list on Arch, fixes #153 (#154)

7 years agoSupport package cache on arch despite have no Release defined (#148)
Florent Thiery [Fri, 6 Oct 2017 17:42:27 +0000 (19:42 +0200)] 
Support package cache on arch despite have no Release defined (#148)

Support package cache on arch (or it crashes when trying to use a package cache), fixes #146

7 years agoMerge pull request #134 from DanielG/fix-tree-copy
Lennart Poettering [Fri, 6 Oct 2017 17:39:29 +0000 (19:39 +0200)] 
Merge pull request #134 from DanielG/fix-tree-copy

Use 'cp' instead of python shutil to copy tees

7 years agomkosi: add new switch --without-tests/-T for running the build script without running... 122/head
Lennart Poettering [Mon, 17 Jul 2017 17:10:29 +0000 (19:10 +0200)] 
mkosi: add new switch --without-tests/-T for running the build script without running tests

This new option simply controls the $WITH_TESTS environment variable
(which defaults to 1), that is supposed to be honoured by the build
script the same way as $WITH_DOCS is honoured. If set to 0 the build script
should avoid unit running tests during the build process.

This is useful for speeding up the build process, in particular when
combining this with incremental mode, as it brings build-times for mkosi
much closer to build-times on the host, when developing software.

Note that this new switch changes exactly nothing in the way mkosi puts
together image, it only controls the value of $WITH_TESTS, and it is
exclusively up to the build script to honour this or not.

My new favourite command is now:

        # mkosi -ifT shell

This command will build a new image, avoid running tests and quickly
give me a shell in it.

7 years agomkosi: avoid running "dracut" needlessly during the first (development) image building
Lennart Poettering [Mon, 17 Jul 2017 17:05:04 +0000 (19:05 +0200)] 
mkosi: avoid running "dracut" needlessly during the first (development) image building

We won't boot up the development system via qemu anyway, hence let's
avoid making it bootable, given that Dracut is awfully slow.

7 years agomkosi: make package cache path absolute too
Lennart Poettering [Mon, 17 Jul 2017 16:16:24 +0000 (18:16 +0200)] 
mkosi: make package cache path absolute too

all other paths (such as the builddir or build script path) we make
absolute, but we forgot the package cache path. Fix that.

7 years agomkosi: also clear out the package cache on "mkosi -ff clean"
Lennart Poettering [Mon, 17 Jul 2017 16:15:32 +0000 (18:15 +0200)] 
mkosi: also clear out the package cache on "mkosi -ff clean"

We already clear out the build dir and the incremental images, hence
let's clean out the package cache too, in order to avoid surprises and
confusion, but do so only if the use specifies at least two "--force"
parameters on "mkosi clean" or three on "mkosi build"

7 years agomkosi: add two new verbs "boot" and "shell"
Lennart Poettering [Mon, 17 Jul 2017 15:59:49 +0000 (17:59 +0200)] 
mkosi: add two new verbs "boot" and "shell"

Both verbs are very similar: they build the image similar to "mkosi
build" (except if it exists already) and then invoke "systemd-nspawn"
interactively on the output image. "boot" will pass "--boot" to nspawn,
while "shell" doesn't.

The command may be combined with "-f" as usual, to force a rebuild
before invoking nspawn on the result.

With this in place getting to a test shell from a current git checkout
of a project like systemd is as easy as typing "mkosi shell".

In a later PR we should really add a "mkosi vm" command or so, which
permits booting up the image in qemu properly finding UEFI and kvm
support for it, and so on.

7 years agomkosi: add support for doing CentOS images (#119)
Lennart Poettering [Fri, 6 Oct 2017 17:22:57 +0000 (19:22 +0200)] 
mkosi: add support for doing CentOS images (#119)

This is very similar to Fedora/Mageia support, but uses yum rather than
dnf, as CentOS doesn't have that by default.

7 years agoimprove doc about config file syntax, fixes #149 (#150)
Florent Thiery [Thu, 21 Sep 2017 15:49:35 +0000 (17:49 +0200)] 
improve doc about config file syntax, fixes #149 (#150)

7 years agoMerge pull request #144 from EdwardBetts/spelling
Lucas Werkmeister [Sat, 2 Sep 2017 11:03:20 +0000 (13:03 +0200)] 
Merge pull request #144 from EdwardBetts/spelling

Correct spelling mistake

7 years agocorrect spelling mistake 144/head
Edward Betts [Fri, 1 Sep 2017 18:37:06 +0000 (19:37 +0100)] 
correct spelling mistake

8 years agoChange debian default mirror to deb.debian.org (#141)
kBite [Tue, 22 Aug 2017 18:05:42 +0000 (20:05 +0200)] 
Change debian default mirror to deb.debian.org (#141)

httpredir.debian.org is discontinued since 2017-02-17; see:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=817155

8 years agoAdded optional hostname assignment (#105)
Alexey Slaykovsky [Thu, 10 Aug 2017 09:51:43 +0000 (11:51 +0200)] 
Added optional hostname assignment (#105)

8 years agoIgnore '*.cache-pre-{dev,inst} when copying build sources without git 134/head
Daniel Gröber [Wed, 2 Aug 2017 10:51:48 +0000 (12:51 +0200)] 
Ignore '*.cache-pre-{dev,inst} when copying build sources without git

8 years agoUse 'cp' instead of python shutil to copy tees
Daniel Gröber [Tue, 1 Aug 2017 14:06:06 +0000 (16:06 +0200)] 
Use 'cp' instead of python shutil to copy tees

8 years agoAllow specifying mirror in mkosi.default (#126)
Felipe Sateler [Fri, 21 Jul 2017 12:03:10 +0000 (08:03 -0400)] 
Allow specifying mirror in mkosi.default (#126)