]> git.ipfire.org Git - thirdparty/mkosi.git/log
thirdparty/mkosi.git
8 years agomkosi: update TODO 51/head
Lennart Poettering [Fri, 16 Dec 2016 20:26:35 +0000 (21:26 +0100)] 
mkosi: update TODO

8 years agomkosi: show kernel command line in summary
Lennart Poettering [Mon, 19 Dec 2016 16:17:31 +0000 (17:17 +0100)] 
mkosi: show kernel command line in summary

This also moves the "Bootable" information away from the "Partitions"
section, and into the "Output" section, as "Bootable" is hardly a
specific type of partition, but more general information about the
output.

8 years agomkosi: generate a unified UEFI kernel+initrd binary as last step of the build
Lennart Poettering [Fri, 16 Dec 2016 19:55:03 +0000 (20:55 +0100)] 
mkosi: generate a unified UEFI kernel+initrd binary as last step of the build

On verity-enabled builds we want to embedd the root hash of the root
file system in the kernel command line, and want to package the kernel,
the initrd, a kernel command line as a single EFI executable that later
may be signed.

This adds an aditional step to the build process: after the verity data
has been generated, invoke "dracut --uefi" in the image to generate the
unified image, and place it in /EFI/Linux in the ESP. sd-boot already
knows how to deal with these single-file boot items, hence this is
sufficient to make a boot image appear in its menu.

This also disables ESP kernel installation during the usual RPM process,
as we aren't interested in the images generated that way.

This patch makes the necessary changes for all of this only for Fedora.
Other distributions using dracut should be able to make the similar
logic work, but that's left for a later commit.

(the roothash= related bits in this PR will only be honoured by systemd
at boot-time with https://github.com/systemd/systemd/pull/4879 in place)

8 years agomkosi: tweak the default fedora package list in some conditions
Lennart Poettering [Fri, 16 Dec 2016 19:52:35 +0000 (20:52 +0100)] 
mkosi: tweak the default fedora package list in some conditions

When we generate a bootable ext4 image, include the e2fsck in the image. Similar for btrfs. This way we can properly fsck all devices during boot.

The Arch Linux code already had a similar tweak, let's copy that.

Also, install "cryptsetup" if encryption is requested. Strictly speaking
nothing will call the tool, however Dracut uses it has condition when to
pack DM rules into the initrd. Hence let's add it for now, even though
we can eventually drop this, when Dracut gets fixed.

8 years agomkosi: mount /var/tmp outside of the image while building
Lennart Poettering [Fri, 16 Dec 2016 19:50:02 +0000 (20:50 +0100)] 
mkosi: mount /var/tmp outside of the image while building

This way during a --read-only build (i.e. where the root directory is
read-only while the build script runs) temporary files in /var/tmp still
work.

8 years agomkosi: fix parsing of sfdisk --dump output if partition names contain ":"
Lennart Poettering [Fri, 16 Dec 2016 16:31:33 +0000 (17:31 +0100)] 
mkosi: fix parsing of sfdisk --dump output if partition names contain ":"

8 years agomkosi: set GPT read-only flags properly
Lennart Poettering [Fri, 16 Dec 2016 16:29:35 +0000 (17:29 +0100)] 
mkosi: set GPT read-only flags properly

This makes sure the --read-only setting has an effect on the GPT
read-only flags of the root partition.

Note that we generate the sfdisk lines in a format that works around an
sfdisk bug with older version: we place the partition name last in each
line, as we need to enclose it in "", but the sfdisk parser is confused
by it otherwise. (See: https://github.com/karelzak/util-linux/issues/380)

8 years agoMerge pull request #50 from systemd/improvements
Lennart Poettering [Thu, 15 Dec 2016 17:21:52 +0000 (18:21 +0100)] 
Merge pull request #50 from systemd/improvements

Some small improvements

8 years agoExtract die() function to print message and exit 50/head
Lucas Werkmeister [Thu, 15 Dec 2016 17:01:43 +0000 (18:01 +0100)] 
Extract die() function to print message and exit

It also takes an additional, optional argument for a custom exit status,
though none of the current call sites use it.

8 years agoAdd missing line break
Lucas Werkmeister [Thu, 15 Dec 2016 16:57:34 +0000 (17:57 +0100)] 
Add missing line break

8 years agoFix spelling of Arch Linux (two words)
Lucas Werkmeister [Thu, 15 Dec 2016 16:56:20 +0000 (17:56 +0100)] 
Fix spelling of Arch Linux (two words)

8 years agoadded basic luks support (#49)
Lennart Poettering [Thu, 15 Dec 2016 12:13:41 +0000 (13:13 +0100)] 
added basic luks support (#49)

8 years agoMerge pull request #46 from poettering/postinst
Lucas Werkmeister [Tue, 13 Dec 2016 17:05:42 +0000 (18:05 +0100)] 
Merge pull request #46 from poettering/postinst

mkosi: add support for running postinst scripts and other fixes

8 years agomkosi: shorten umount commands a bit 46/head
Lennart Poettering [Fri, 9 Dec 2016 16:27:31 +0000 (17:27 +0100)] 
mkosi: shorten umount commands a bit

8 years agomkosi: optionally run a post-installation script
Lennart Poettering [Fri, 9 Dec 2016 14:41:07 +0000 (15:41 +0100)] 
mkosi: optionally run a post-installation script

This adds an additional scripting hook to the build script. We look for
"mkosi.postinst". If it exists the script will be run as last step of the
each build. The script will be passed one parameter: either "build" or
"final", depending if it is invoked on the first iteration of the image
creation (the "build phase") or the second iteration (the "final
phase").

8 years agomkosi: drop a spurious newline
Lennart Poettering [Fri, 9 Dec 2016 14:40:38 +0000 (15:40 +0100)] 
mkosi: drop a spurious newline

8 years agomkosi: mount /proc, /dev, /sys only for "dnf"
Lennart Poettering [Fri, 9 Dec 2016 14:36:49 +0000 (15:36 +0100)] 
mkosi: mount /proc, /dev, /sys only for "dnf"

There's no point in running it for any of the other commands, and as it
conflicts with using nspawn on the directory as is let's just mount them
for the shortest possible time.

8 years agomkosi: always use /efi for the boot loader logic
Lennart Poettering [Fri, 9 Dec 2016 11:55:16 +0000 (12:55 +0100)] 
mkosi: always use /efi for the boot loader logic

This way the GPT auto-discovery logic in nspawn and the initrd can work,
and we leave /boot for compatibility symlinks.

8 years agomkosi: pass the same uuid to all nspawn invocations
Lennart Poettering [Fri, 9 Dec 2016 11:52:47 +0000 (12:52 +0100)] 
mkosi: pass the same uuid to all nspawn invocations

This is useful so that tools that need one have always the same. This is
particularly useful for dracut which uses the machine ID for creating
directories in the ESP.

8 years agomkosi: fix passing of the --image= parameter to nspawn
Lennart Poettering [Fri, 9 Dec 2016 11:51:52 +0000 (12:51 +0100)] 
mkosi: fix passing of the --image= parameter to nspawn

8 years agomkosi: let's remove if checks from build_image() a bit
Lennart Poettering [Fri, 9 Dec 2016 11:41:58 +0000 (12:41 +0100)] 
mkosi: let's remove if checks from build_image() a bit

Let's move most remaining if conditions into the functions we are about
to call. This way the flow of control of build_image() is easier to
follow as the exceptions are hidden and the common flow of control
emphasised.

8 years agoMerge pull request #48 from keszybz/fixes
Lucas Werkmeister [Sun, 11 Dec 2016 16:03:15 +0000 (17:03 +0100)] 
Merge pull request #48 from keszybz/fixes

Two unrelated fixes

8 years agomkosi: fix overriding of boolean arguments 48/head
Zbigniew Jędrzejewski-Szmek [Sun, 11 Dec 2016 03:46:42 +0000 (22:46 -0500)] 
mkosi: fix overriding of boolean arguments

The command line should have higher priority then the configuration file,
but this wouldn't work when the config file said yes and command line no.

8 years agomkosi: create cache in world-readable mode
Zbigniew Jędrzejewski-Szmek [Sun, 11 Dec 2016 03:10:45 +0000 (22:10 -0500)] 
mkosi: create cache in world-readable mode

There's really nothing to hide here, and installation might fail
if the cache is not readable:
W: Can't drop privileges for downloading as file '/var/cache/apt/archives/partial/libexpat1_2.2.0-1_amd64.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)

8 years agoMerge pull request #45 from keszybz/complete-step-cm
Lennart Poettering [Fri, 9 Dec 2016 11:05:02 +0000 (12:05 +0100)] 
Merge pull request #45 from keszybz/complete-step-cm

Add a context manager / decorator to wrap stuff with print_step pairs

8 years agomkosi: increase buffer size when hashing files 45/head
Zbigniew Jędrzejewski-Szmek [Thu, 8 Dec 2016 15:16:21 +0000 (10:16 -0500)] 
mkosi: increase buffer size when hashing files

We need to do some buffering here, because the files we are hashing can be gigabytes
in size, but Python loops are slow, so it's better to use a larger buffer.

8 years agomkosi: use a single read/write call pair to copy nspawn settings
Zbigniew Jędrzejewski-Szmek [Thu, 8 Dec 2016 15:06:42 +0000 (10:06 -0500)] 
mkosi: use a single read/write call pair to copy nspawn settings

With Python, a loop is usually slower than using native calls. nspawn settings
files are not too large, so just copy then in one fell swoop.

8 years agogitignore: add .roothash
Zbigniew Jędrzejewski-Szmek [Thu, 8 Dec 2016 14:56:53 +0000 (09:56 -0500)] 
gitignore: add .roothash

8 years agomkosi: extend complete_step with customizable end message
Zbigniew Jędrzejewski-Szmek [Thu, 8 Dec 2016 14:56:17 +0000 (09:56 -0500)] 
mkosi: extend complete_step with customizable end message

A context manager cannot see any values from the block directly, so
a mutable object (list) is used to pass the state to format the final message.
This isn't entirely elegant, but I think it is worth it, because it allows
the opening and closing messages to be specified next to one another and makes
things a bit more concise and consistent.

8 years agomkosi: remove unnecessary str and int casts
Zbigniew Jędrzejewski-Szmek [Thu, 8 Dec 2016 01:54:19 +0000 (20:54 -0500)] 
mkosi: remove unnecessary str and int casts

// returns an integer, format converts to str automatically.

8 years agomkosi: add context manager / decorator for print_step pairs
Zbigniew Jędrzejewski-Szmek [Thu, 8 Dec 2016 01:31:40 +0000 (20:31 -0500)] 
mkosi: add context manager / decorator for print_step pairs

8 years agomkosi: automatically reset /etc/machine-id to the empty file 39/head
Lennart Poettering [Wed, 7 Dec 2016 11:59:36 +0000 (12:59 +0100)] 
mkosi: automatically reset /etc/machine-id to the empty file

8 years agomkosi: remove debug output of build script command line
Lennart Poettering [Wed, 7 Dec 2016 11:49:35 +0000 (12:49 +0100)] 
mkosi: remove debug output of build script command line

This was accidentally added in bfc0738632a79f4261601d61af18866bb38fe35a,
and really shouldn't be there.

8 years agomkosi: set bit 60 of the GPT partition flags if the root disk shall be read-only
Lennart Poettering [Wed, 7 Dec 2016 11:48:16 +0000 (12:48 +0100)] 
mkosi: set bit 60 of the GPT partition flags if the root disk shall be read-only

the systemd dissector looks for this, hence set it.

8 years agomkosi: add support writing out verity partitions
Lennart Poettering [Wed, 7 Dec 2016 11:43:08 +0000 (12:43 +0100)] 
mkosi: add support writing out verity partitions

This adds a new switch --verity. When passed the root partition will be
complemented by a dm-verity partition, and the root hash is written to a
<image>.roothash file, as well as printed to the status output.

If this mode is enabled the partition UUID of the root partition is
changed to the first 128bit of the top-level hash, and the partition
UUID of the verity partition is changed to the second (and final) 128bit
of the top-level hash (assuming sha256 is used as hash algorithm, which
is the default). This means the two partitions can be easily determined
from the specification of the roothash alone. Since both the root
partition and the verity partition in this case are read-only and the
roothash describes both it's a good candidate for using as partition
UUID.

The partition type UUID of the verity partition is initialized to a new
set of UUIDs that match the existing per-architecture root partition
type UUIDs, that I generated randomly.

8 years agomkosi: use the usual indentation depths also for dictionaries
Lennart Poettering [Wed, 7 Dec 2016 10:27:12 +0000 (11:27 +0100)] 
mkosi: use the usual indentation depths also for dictionaries

8 years agobuild-sys: add a mkosi.default
Lennart Poettering [Thu, 1 Dec 2016 00:31:14 +0000 (01:31 +0100)] 
build-sys: add a mkosi.default

Let's add a simple mkosi.default file, that is sufficient to build an
image for mkosi itself.

8 years agomkosi: if we build a read-only image, use nspawn's --overlay= switch to make /root...
Lennart Poettering [Wed, 30 Nov 2016 23:48:43 +0000 (00:48 +0100)] 
mkosi: if we build a read-only image, use nspawn's --overlay= switch to make /root/src writable

This way, we can build on the source tree even if the disk image is
read-only. This primarily useful for squashfs where the file system
can#t be made writable even if we wanted to. We turn this on for all
kind of read-only images however, to keep the codepaths similar, and to
isolate the build artifacts from the disk image we build from.

This makes use of the new nspawn --overlay=+/root/src::/root/src syntax
added by #4694.

8 years agomkosi: explicitly remove root dir between the two builds
Lennart Poettering [Wed, 30 Nov 2016 23:48:16 +0000 (00:48 +0100)] 
mkosi: explicitly remove root dir between the two builds

Let's make sure nothing survives from the first build.

8 years agomkosi: remove a spurious double newline
Lennart Poettering [Wed, 30 Nov 2016 23:48:05 +0000 (00:48 +0100)] 
mkosi: remove a spurious double newline

8 years agomkosi: Do not redirect brtfs output to /dev/null
Zbigniew Jędrzejewski-Szmek [Tue, 29 Nov 2016 17:19:47 +0000 (12:19 -0500)] 
mkosi: Do not redirect brtfs output to /dev/null

When the commands fail, it is useful to see the their error output.
In the normal case they don't print anything, so it should be OK
to just remove the redirection.

8 years agomkosi: automatically make use of cache if "mkosi.cache" is found in workdir
Lennart Poettering [Wed, 30 Nov 2016 18:07:14 +0000 (19:07 +0100)] 
mkosi: automatically make use of cache if "mkosi.cache" is found in workdir

Let's make cache management nicer: if there's a mkosi.cache/ dir in the
working directory automatically use it as package cache.

8 years agoupdate TODO a bit
Lennart Poettering [Tue, 22 Nov 2016 13:41:29 +0000 (14:41 +0100)] 
update TODO a bit

8 years agomkosi: add support for creating squashfs images
Lennart Poettering [Tue, 22 Nov 2016 13:36:50 +0000 (14:36 +0100)] 
mkosi: add support for creating squashfs images

THis adds a new type raw_squashfs that refers to a GPT disk image with a
compressed root file system as squashfs. Note that directories such as
/home and /srv are left ext4, as they generally are supposed to be
writable, if configured.

Images made like this are particularly useful with nspawn's --volatile=
switch which permits ready-only root images, with writable /var.

8 years agomkosi: make sure to create /root/dest when prepping image
Lennart Poettering [Tue, 22 Nov 2016 13:34:56 +0000 (14:34 +0100)] 
mkosi: make sure to create /root/dest when prepping image

if we create a read-only image we might not be able to rely on nspawn's
automatic creation of the dir due to --bind=. Hence, let's create the
dir early on, so that --bind= can just mount things there, and doesn't
have to create the dir explicitly.

8 years agomkosi: change access mode on right file
Lennart Poettering [Tue, 22 Nov 2016 00:11:25 +0000 (01:11 +0100)] 
mkosi: change access mode on right file

Fixes a typo

8 years agomkosi: make sure /run and /tmp are empty in the disk image
Lennart Poettering [Tue, 22 Nov 2016 00:10:25 +0000 (01:10 +0100)] 
mkosi: make sure /run and /tmp are empty in the disk image

Let's mount a tmpfs to /run and /tmp while we put together the image, so
that anything the install scripts install there does not end up in the
disk image.

8 years agoMerge pull request #40 from zaro/master
Lennart Poettering [Mon, 28 Nov 2016 18:39:05 +0000 (19:39 +0100)] 
Merge pull request #40 from zaro/master

Several improvements over Debian/Ubuntu image creation and support for multiple mkosi.defaults files

8 years agobump fedora version to 25 (#41)
Reverend Homer [Mon, 28 Nov 2016 18:34:38 +0000 (21:34 +0300)] 
bump fedora version to 25 (#41)

8 years agoUse noninteractive debconf frontend in apt-get. 40/head
Svetlozar Argirov [Fri, 25 Nov 2016 20:19:28 +0000 (20:19 +0000)] 
Use noninteractive debconf frontend  in apt-get.

8 years agoAdd --repositories configuration option.
Svetlozar Argirov [Fri, 25 Nov 2016 13:10:43 +0000 (13:10 +0000)] 
Add --repositories configuration option.

This configures the repositories to be used by dnf/debootstrap/apt.
Only supported for Fedora/Debian/Ubuntu.

8 years agoImplement --with-docs for Debian/Ubuntu installation.
Svetlozar Argirov [Fri, 25 Nov 2016 12:32:58 +0000 (12:32 +0000)] 
Implement --with-docs for Debian/Ubuntu installation.

8 years agoAdd support for mkosi.default.d
Svetlozar Argirov [Fri, 25 Nov 2016 08:49:26 +0000 (08:49 +0000)] 
Add support for mkosi.default.d

Read files fron mkosi.default.d directory in addition to mkosi.default, overrding/adding options.

8 years agoUse correct Ubuntu mirror for arm64
Svetlozar Argirov [Fri, 25 Nov 2016 08:15:43 +0000 (08:15 +0000)] 
Use correct Ubuntu mirror for arm64

8 years agoIgnore chattr +C failure (#38)
Lucas Werkmeister [Wed, 16 Nov 2016 23:35:56 +0000 (00:35 +0100)] 
Ignore chattr +C failure (#38)

Disabling copy-on-write behavior is an optimization, so failure of this
command should not cause problems.

This makes it possible to run mkosi in a tmpfs file system.

8 years agofix mirror for Fedora 25, improve keys handling (#37)
Davide Cavalca [Fri, 11 Nov 2016 18:53:45 +0000 (10:53 -0800)] 
fix mirror for Fedora 25, improve keys handling (#37)

8 years agoOncy check for root if necessary (#36)
Lucas Werkmeister [Thu, 10 Nov 2016 19:19:20 +0000 (20:19 +0100)] 
Oncy check for root if necessary (#36)

In particular, non-root summary mode should be useful to check what
mkosi intends to do without actually giving it the permissions to do
anything yet.

8 years agoAdd --version switch (#35)
Felipe Sateler [Mon, 7 Nov 2016 06:00:12 +0000 (03:00 -0300)] 
Add --version switch (#35)

8 years agoAdd MANIFEST.in file 34/head v1
Zbigniew Jędrzejewski-Szmek [Thu, 3 Nov 2016 15:27:11 +0000 (11:27 -0400)] 
Add MANIFEST.in file

Without that, python setup.py sdist does not incldue the license file.

8 years agosetup.py: replace author field with maintainer field
Zbigniew Jędrzejewski-Szmek [Thu, 3 Nov 2016 15:23:11 +0000 (11:23 -0400)] 
setup.py: replace author field with maintainer field

As requested by the author himself ;)

8 years agoAdd symlink README → README.md
Zbigniew Jędrzejewski-Szmek [Thu, 3 Nov 2016 15:18:54 +0000 (11:18 -0400)] 
Add symlink README → README.md

This way "python3 setup.py sdist" correctly packages README.md and doesn't warn
about missing README.

8 years agoREADME: add note about various distro packages
Zbigniew Jędrzejewski-Szmek [Thu, 3 Nov 2016 15:11:17 +0000 (11:11 -0400)] 
README: add note about various distro packages

8 years agoAdd __version__ tag
Zbigniew Jędrzejewski-Szmek [Thu, 3 Nov 2016 15:01:40 +0000 (11:01 -0400)] 
Add __version__ tag

8 years agosetup.py: correct license field
Zbigniew Jędrzejewski-Szmek [Thu, 3 Nov 2016 15:01:32 +0000 (11:01 -0400)] 
setup.py: correct license field

It should contain the license moniker, not the file name.

8 years agoREADME: ensure fedora is distro used in directory example (#33)
Jonathan Groth [Tue, 25 Oct 2016 23:45:36 +0000 (19:45 -0400)] 
README: ensure fedora is distro used in directory example (#33)

If "-d" is not used, distribution is autodetected. This line was supposed to install Fedora though,
so add "-d Fedora" so no autodetection is performed.

8 years agoMerge pull request #32 from bricewge/master
Lennart Poettering [Mon, 24 Oct 2016 18:10:48 +0000 (20:10 +0200)] 
Merge pull request #32 from bricewge/master

fix some typos and options

8 years agofix args parsing: checksum read_only distribution 32/head
Brice Waegeneire [Tue, 18 Oct 2016 19:00:24 +0000 (21:00 +0200)] 
fix args parsing: checksum read_only distribution

8 years agoset password from mkosi.default
Brice Waegeneire [Tue, 18 Oct 2016 18:56:15 +0000 (20:56 +0200)] 
set password from mkosi.default

8 years agoAllow running workspace commands with network
Felipe Sateler [Wed, 12 Oct 2016 15:11:37 +0000 (12:11 -0300)] 
Allow running workspace commands with network

Fixes: #30
8 years agodebian: use policy-rc.d to force not-starting of daemons
Felipe Sateler [Wed, 12 Oct 2016 14:23:03 +0000 (11:23 -0300)] 
debian: use policy-rc.d to force not-starting of daemons

8 years agodebian: Use apt for installing extra packages
Felipe Sateler [Wed, 12 Oct 2016 13:58:02 +0000 (10:58 -0300)] 
debian: Use apt for installing extra packages

Debootstrap does not have a proper dependency resolver, so installing
extra stuff with it will cause conflicts. For example, installing
libpam-systemd will bring in systemd-shim as first preference, which
conflicts with systemd-sysv. Instead, only install the base system with
debootstrap, and then use apt to install the extra packages.

8 years agoMerge pull request #29 from keszybz/fixes
Lennart Poettering [Sun, 9 Oct 2016 10:20:08 +0000 (12:20 +0200)] 
Merge pull request #29 from keszybz/fixes

Three unrelated fixes

8 years agoFix argument parsing for --boolean and --use-git-files 29/head
Zbigniew Jędrzejewski-Szmek [Sat, 8 Oct 2016 19:15:33 +0000 (15:15 -0400)] 
Fix argument parsing for --boolean and --use-git-files

bool('0') evaluates to True, so type=bool does not work as expected.
It is necessary to use a helper function which converts strings to
True/False as expected.

Also, fix parse_boolean().

8 years agoCreate /efi dir on Fedora
Zbigniew Jędrzejewski-Szmek [Fri, 7 Oct 2016 20:20:40 +0000 (16:20 -0400)] 
Create /efi dir on Fedora

This makes bootctl work in images again.

8 years agoREADME: tweak qemu invocation to avoid warning, recommend edk2-ovmf
Zbigniew Jędrzejewski-Szmek [Fri, 7 Oct 2016 20:07:47 +0000 (16:07 -0400)] 
README: tweak qemu invocation to avoid warning, recommend edk2-ovmf

WARNING: Image format was not specified for 'image.raw' and probing
         guessed raw. Automatically detecting the format is dangerous
         for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.

8 years agoFix run_workspace_command usage blunder (#27)
Nikita Puzyryov [Fri, 7 Oct 2016 10:43:02 +0000 (13:43 +0300)] 
Fix run_workspace_command usage blunder (#27)

8 years agoAllow setting root password in the image (#26)
Zbigniew Jędrzejewski-Szmek [Thu, 6 Oct 2016 18:17:23 +0000 (14:17 -0400)] 
Allow setting root password in the image (#26)

Those images are supposed to be used locally for testing, so it
should be as easy to log in as possible.

As a special case, --password= completely deletes the password.
In other words, it's not possible to set an empty password.

Note: the obvious thing of calling /bin/passwd does not work because
audit or some other thing trips it up.

Thanks to Lucas Werkmeister for the crypt.crypt() line!

8 years agoMerge pull request #25 from keszybz/git-ls-and-other-bits
Lennart Poettering [Thu, 6 Oct 2016 16:04:24 +0000 (18:04 +0200)] 
Merge pull request #25 from keszybz/git-ls-and-other-bits

Git ls and other bits

8 years agoDefine a helper function to run workspace commands 25/head
Zbigniew Jędrzejewski-Szmek [Thu, 6 Oct 2016 14:27:56 +0000 (10:27 -0400)] 
Define a helper function to run workspace commands

8 years agoMount/unmount with a context manager
Zbigniew Jędrzejewski-Szmek [Thu, 6 Oct 2016 14:18:47 +0000 (10:18 -0400)] 
Mount/unmount with a context manager

8 years agoAttach/detach loop device with a context manager
Zbigniew Jędrzejewski-Szmek [Thu, 6 Oct 2016 14:12:56 +0000 (10:12 -0400)] 
Attach/detach loop device with a context manager

8 years agoDrop some add_argument options which repeat the default
Zbigniew Jędrzejewski-Szmek [Wed, 5 Oct 2016 20:28:06 +0000 (16:28 -0400)] 
Drop some add_argument options which repeat the default

8 years agoUse systemd-nspawn --quiet
Zbigniew Jędrzejewski-Szmek [Wed, 5 Oct 2016 20:23:18 +0000 (16:23 -0400)] 
Use systemd-nspawn --quiet

With recent change to nspawn, this will not print the hint about ^]^]^].

8 years agoIn a git repo, do not copy files that git itself would ignore
Zbigniew Jędrzejewski-Szmek [Tue, 4 Oct 2016 16:57:45 +0000 (12:57 -0400)] 
In a git repo, do not copy files that git itself would ignore

The file list to copy is generated using git ls-files --other --cached,
i.e. anything in git ignore lists is ignored.

Without that, mkosi chokes on the test/sys directory in systemd source
tree that is generated as part of tests. I think the new behaviour is
a good default, since most of the times people are going to be running
this from a git tree anyway.

Also skip .git directory by default.

This requires mkosi.build to be updated to remove 'git clean …'.

Fixes #22.

8 years agoUse metalink for Fedora repos
Zbigniew Jędrzejewski-Szmek [Tue, 4 Oct 2016 15:19:42 +0000 (11:19 -0400)] 
Use metalink for Fedora repos

This allows dnf to get a geographically close and up-to-date mirror,
and also fixes installation of unreleased Fedora (currently 25).

If mirror is specified, use it, as before.

8 years agoConvert writes to a slightly more readable format
Zbigniew Jędrzejewski-Szmek [Tue, 4 Oct 2016 15:10:17 +0000 (11:10 -0400)] 
Convert writes to a slightly more readable format

8 years agoAdd basic support for ARM64 (#24)
Stefan Schweter [Thu, 6 Oct 2016 14:26:08 +0000 (16:26 +0200)] 
Add basic support for ARM64 (#24)

8 years agoFixed color output on arch linux (#23)
Zeal Jagannatha [Tue, 4 Oct 2016 10:36:57 +0000 (12:36 +0200)] 
Fixed color output on arch linux (#23)

Before:

    [1m[32m==>[m[1m Appending keys from archlinux.gpg...[m
    [1m[32m==>[m[1m Locally signing trusted keys in keyring...[m
    [1m[34m  ->[m[1m Locally signing key 0E8B644079F599DFC1DDC3973348882F6AC6A4C2...[m
    [1m[34m  ->[m[1m Locally signing key 684148BB25B49E986A4944C55184252D824B18E8...[m
    [1m[34m  ->[m[1m Locally signing key 91FFE0700E80619CEB73235CA88E23E377514E00...[m
    [1m[34m  ->[m[1m Locally signing key 44D4A033AC140143927397D47EFD567D4C7EA887...[m
    [1m[34m  ->[m[1m Locally signing key 27FFC4769E19F096D41D9265A04F9397CDFD6BB0...[m
    [1m[34m  ->[m[1m Locally signing key AB19265E5D7D20687D303246BA1DFB64FFF979E7...[m

After:

    ==> Appending keys from archlinux.gpg...
    ==> Locally signing trusted keys in keyring...
      -> Locally signing key 0E8B644079F599DFC1DDC3973348882F6AC6A4C2...
      -> Locally signing key 684148BB25B49E986A4944C55184252D824B18E8...
      -> Locally signing key 91FFE0700E80619CEB73235CA88E23E377514E00...
      -> Locally signing key 44D4A033AC140143927397D47EFD567D4C7EA887...
      -> Locally signing key 27FFC4769E19F096D41D9265A04F9397CDFD6BB0...
      -> Locally signing key AB19265E5D7D20687D303246BA1DFB64FFF979E7...

8 years agoMerge pull request #21 from keszybz/style-enhancement
Lennart Poettering [Sat, 1 Oct 2016 08:43:05 +0000 (10:43 +0200)] 
Merge pull request #21 from keszybz/style-enhancement

Make the code more pythonic

8 years agoFix infinite loop on symlinks (#20)
Zbigniew Jędrzejewski-Szmek [Sat, 1 Oct 2016 08:39:40 +0000 (10:39 +0200)] 
Fix infinite loop on symlinks (#20)

Fixes #9.

8 years ago… is not None is the preferred form 21/head
Zbigniew Jędrzejewski-Szmek [Thu, 29 Sep 2016 09:07:11 +0000 (05:07 -0400)] 
… is not None is the preferred form

Also try to put None as the "else" argument instead of the "if" one
in ternary expressions.

8 years agoSome trivial style fixes
Zbigniew Jędrzejewski-Szmek [Thu, 29 Sep 2016 08:59:56 +0000 (04:59 -0400)] 
Some trivial style fixes

- no spaces around parameter assignment in function calls
- avoid unneeded concatenation in subprocess.run calls
- division operator always uses floats, no need to cast
- use os.makedirs(…, exist_ok=True) instead of catching exception
- use .get instead of catching exception

8 years agodebian: do not fail if root/etc/dracut.conf.d already exists (#19)
Felipe Sateler [Sat, 1 Oct 2016 07:10:43 +0000 (04:10 -0300)] 
debian: do not fail if root/etc/dracut.conf.d already exists (#19)

This can happen if dracut is asked to be installed by the user

8 years agoInstall dbus and libpam-systemd with debootstrap (#16)
Lucas Werkmeister [Thu, 29 Sep 2016 08:24:45 +0000 (10:24 +0200)] 
Install dbus and libpam-systemd with debootstrap (#16)

Both packages are recommended by the Debian systemd package, but
debootstrap does not install Recommends.

Installing dbus fixes #15; the addition of libpam-systemd was suggested
by @stefan-it in that same issue.

8 years agoAllow specifying kernel command line in bootable images (#18)
Felipe Sateler [Thu, 29 Sep 2016 08:22:11 +0000 (05:22 -0300)] 
Allow specifying kernel command line in bootable images (#18)

8 years agoDo not install usrmerge on Debian/Ubuntu images (#17)
Felipe Sateler [Thu, 22 Sep 2016 13:09:54 +0000 (10:09 -0300)] 
Do not install usrmerge on Debian/Ubuntu images (#17)

This reverts commit a7f5575b1a49cee812e3b4f6f105b2d8ce111bee

Turns out debootstrap now has native support for merged /usr, and will likely be default (for the supported targets) in the near future.

Thus disable explicitly installing usrmerge, unbreaking the generation of debian < stretch and ubuntu images.

8 years agoFix arch mirror selection (#13)
Davide Cavalca [Fri, 2 Sep 2016 21:52:39 +0000 (14:52 -0700)] 
Fix arch mirror selection (#13)

8 years agoMerge pull request #12 from davide125/mirror
Lennart Poettering [Thu, 1 Sep 2016 22:22:36 +0000 (00:22 +0200)] 
Merge pull request #12 from davide125/mirror

Mirror selection support and Fedora build improvements

8 years agoUse local gpg key if available 12/head
Davide Cavalca [Thu, 1 Sep 2016 18:15:14 +0000 (11:15 -0700)] 
Use local gpg key if available

8 years agoAdd option to use a custom mirror
Davide Cavalca [Thu, 1 Sep 2016 16:57:54 +0000 (09:57 -0700)] 
Add option to use a custom mirror