diff options
-rw-r--r-- | .mkosi/mkosi.debian | 73 | ||||
-rw-r--r-- | .mkosi/mkosi.fedora | 1 | ||||
-rw-r--r-- | TODO | 4 | ||||
-rw-r--r-- | src/dissect/dissect.c | 14 | ||||
-rw-r--r-- | src/shared/dissect-image.h | 5 |
5 files changed, 91 insertions, 6 deletions
diff --git a/.mkosi/mkosi.debian b/.mkosi/mkosi.debian new file mode 100644 index 0000000000..f0cedbb90e --- /dev/null +++ b/.mkosi/mkosi.debian @@ -0,0 +1,73 @@ +# This file is part of systemd. +# +# Copyright 2016 Daniel Rusek +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# systemd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with systemd; If not, see <http://www.gnu.org/licenses/>. + +# This is a settings file for OS image generation using mkosi (https://github.com/systemd/mkosi). +# Simply invoke "mkosi" in the project directory to build an OS image. + +[Distribution] +Distribution=debian +Release=unstable + +[Output] +Format=raw_btrfs +Bootable=yes + +[Partitions] +RootSize=2G + +[Packages] +BuildPackages= + autoconf + automake + docbook-xml + docbook-xsl + gcc + git + gnu-efi + gperf + intltool + iptables-dev + libacl1-dev + libaudit-dev + libblkid-dev + libbz2-dev + libcap-dev + libcryptsetup-dev + libcurl4-gnutls-dev + libdbus-1-dev + libdw-dev + libfdisk-dev + libgcrypt20-dev + libgnutls28-dev + libidn11-dev + libkmod-dev + liblzma-dev + liblz4-dev + libmicrohttpd-dev + libmount-dev + libpam0g-dev + libqrencode-dev + libseccomp-dev + libsmartcols-dev + libtool + libxkbcommon-dev + make + pkg-config + python3 + python3-lxml + uuid-dev + xsltproc diff --git a/.mkosi/mkosi.fedora b/.mkosi/mkosi.fedora index 0af20c924a..478703c41a 100644 --- a/.mkosi/mkosi.fedora +++ b/.mkosi/mkosi.fedora @@ -63,6 +63,7 @@ BuildPackages= libxslt lz4-devel make + diffutils pam-devel pkgconfig python3-devel @@ -618,6 +618,10 @@ Features: - maybe make copying of /etc/resolv.conf optional, and skip it if --read-only is used +* dissect + - refuse mounting over a mount point + - automatically discover .roothash files in dissect, similarly to nspawn + * machined: - add an API so that libvirt-lxc can inform us about network interfaces being removed or added to an existing machine diff --git a/src/dissect/dissect.c b/src/dissect/dissect.c index e3c96b7407..f2f1e135ec 100644 --- a/src/dissect/dissect.c +++ b/src/dissect/dissect.c @@ -95,21 +95,25 @@ static int parse_argv(int argc, char *argv[]) { arg_flags |= DISSECT_IMAGE_READ_ONLY; break; - case ARG_DISCARD: + case ARG_DISCARD: { + DissectImageFlags flags; + if (streq(optarg, "disabled")) - arg_flags &= ~(DISSECT_IMAGE_DISCARD_ON_LOOP|DISSECT_IMAGE_DISCARD|DISSECT_IMAGE_DISCARD_ON_CRYPTO); + flags = 0; else if (streq(optarg, "loop")) - arg_flags = (arg_flags & ~(DISSECT_IMAGE_DISCARD|DISSECT_IMAGE_DISCARD_ON_CRYPTO)) | DISSECT_IMAGE_DISCARD_ON_LOOP; + flags = DISSECT_IMAGE_DISCARD_ON_LOOP; else if (streq(optarg, "all")) - arg_flags = (arg_flags & ~(DISSECT_IMAGE_DISCARD_ON_CRYPTO)) | DISSECT_IMAGE_DISCARD_ON_LOOP | DISSECT_IMAGE_DISCARD; + flags = DISSECT_IMAGE_DISCARD_ON_LOOP | DISSECT_IMAGE_DISCARD; else if (streq(optarg, "crypt")) - arg_flags |= DISSECT_IMAGE_DISCARD_ON_LOOP | DISSECT_IMAGE_DISCARD | DISSECT_IMAGE_DISCARD_ON_CRYPTO; + flags = DISSECT_IMAGE_DISCARD_ANY; else { log_error("Unknown --discard= parameter: %s", optarg); return -EINVAL; } + arg_flags = (arg_flags & ~DISSECT_IMAGE_DISCARD_ANY) | flags; break; + } case ARG_ROOT_HASH: { void *p; diff --git a/src/shared/dissect-image.h b/src/shared/dissect-image.h index 902c8d4a37..175ddd8ea0 100644 --- a/src/shared/dissect-image.h +++ b/src/shared/dissect-image.h @@ -61,9 +61,12 @@ static inline int PARTITION_VERITY_OF(int p) { typedef enum DissectImageFlags { DISSECT_IMAGE_READ_ONLY = 1, - DISSECT_IMAGE_DISCARD_ON_LOOP = 2, /* Turn on "discard" if on loop device and file system supports it */ + DISSECT_IMAGE_DISCARD_ON_LOOP = 2, /* Turn on "discard" if on a loop device and file system supports it */ DISSECT_IMAGE_DISCARD = 4, /* Turn on "discard" if file system supports it, on all block devices */ DISSECT_IMAGE_DISCARD_ON_CRYPTO = 8, /* Turn on "discard" also on crypto devices */ + DISSECT_IMAGE_DISCARD_ANY = DISSECT_IMAGE_DISCARD_ON_LOOP | + DISSECT_IMAGE_DISCARD | + DISSECT_IMAGE_DISCARD_ON_CRYPTO, } DissectImageFlags; struct DissectedImage { |