From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d7l23-0003WE-02 for guix-patches@gnu.org; Mon, 08 May 2017 11:57:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d7l1y-0005Pf-QG for guix-patches@gnu.org; Mon, 08 May 2017 11:57:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:36389) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d7l1y-0005PW-NM for guix-patches@gnu.org; Mon, 08 May 2017 11:57:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d7l1y-0001gb-DK for guix-patches@gnu.org; Mon, 08 May 2017 11:57:02 -0400 Subject: bug#26815: [PATCH 1/3] vm: Add support for arbitrary partition flags. Resent-Message-ID: From: Maxim Cournoyer References: <20170507143505.20724-1-mbakke@fastmail.com> <20170507143647.21036-1-mbakke@fastmail.com> Date: Mon, 08 May 2017 08:55:56 -0700 In-Reply-To: <20170507143647.21036-1-mbakke@fastmail.com> (Marius Bakke's message of "Sun, 7 May 2017 16:36:45 +0200") Message-ID: <871srzz6k3.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Marius Bakke Cc: 26815@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello Marius, Marius Bakke writes: > * gnu/build/vm.scm (): Change BOOTABLE? to FLAGS. > (initialize-partition-table): Pass each flag to parted. > (initialize-hard-disk): Search for root partition by "boot" flag. > * gnu/system/vm.scm (qemu-image): Adjust partitions accordingly. > --- > gnu/build/vm.scm | 18 +++++++++++++----- > gnu/system/vm.scm | 2 +- > 2 files changed, 14 insertions(+), 6 deletions(-) > > diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm > index 440596a40..3286ffb02 100644 > --- a/gnu/build/vm.scm > +++ b/gnu/build/vm.scm > @@ -3,6 +3,7 @@ > ;;; Copyright =C2=A9 2016 Christopher Allan Webber > ;;; Copyright =C2=A9 2016 Leo Famulari > ;;; Copyright =C2=A9 2017 Mathieu Othacehe > +;;; Copyright =C2=A9 2017 Marius Bakke > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -41,7 +42,7 @@ > partition-size > partition-file-system > partition-label > - partition-bootable? > + partition-flags > partition-initializer >=20=20 > root-partition-initializer > @@ -141,7 +142,7 @@ the #:references-graphs parameter of 'derivation'." > (size partition-size) > (file-system partition-file-system (default "ext4")) > (label partition-label (default #f)) > - (bootable? partition-bootable? (default #f)) > + (flags partition-flags (default '())) > (initializer partition-initializer (default (const #t)))) >=20=20 > (define (fold2 proc seed1 seed2 lst) ;TODO: factorize > @@ -168,9 +169,11 @@ actual /dev name based on DEVICE." > (cons* "mkpart" "primary" "ext2" > (format #f "~aB" offset) > (format #f "~aB" (+ offset (partition-size part))) > - (if (partition-bootable? part) > - `("set" ,(number->string index) "boot" "on") > - '()))) > + (apply append (map (lambda (flag) I think you could replace the 'apply, append, map' by `map-append' here. > + (cons* "set" (number->string index) > + (symbol->string flag) > + "on" '())) > + (partition-flags part))))) Maxim --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEJ9WGpPiQCFQyn/CfEmDkZILmNWIFAlkQlQwACgkQEmDkZILm NWJNVA//X2Yq9D7UXxB0c1Ja/NeLS/x/Q5Q780Xg46jsr3GolA88FP/FkSyFzREB ooMcCtom3bTCKzxW/ZgMzx6TjwLksXGGY7NOvZ8ULQwrvFD2L5sDGbUSexEF+auj 5ypAZDtwMwztGRjBP1KrhHjhE964g2leEI14xWoSlnq+64/YQNE7pj1oVTC40k1S A+nmVnb3AaPuqNVqCprlmxq824CzD0w+F/DLZIZmOUXhP28I7e2p/wXyOVfGDhhL Itl90U5LFc77rkif/3G9rPoHOrBDJHiQQTwJAcx7EEHaf5P4l21uP20eitj6on2R peEwlO5/IKv9kf6dev4pjLwdKgiu0SK1kJ+/gf1u1O4Nq0YHDBsaNoDdvwcTaQQ9 26O6+/vjFeZgiToqpLKpHwiIUsoHbWLaiAq3A04FLi+LFCp9632EoPqW1OVBxwvJ 92tS0KLEMlm3gd4z5KprHq3MVz6LIWkbqezgjUrGg+bV39HxoVkJ+68PHg0lU/6F 1nmMC21JBwCjBHPwIYrXA04jn0hqtmHvJis9/pEY+3VNTgWvHAqnI013m7fDE7Tl lMiGk51TveYNCSJuAyUWdoDHSaARAYhPUiQ1frmHPe34xDaqHJ9PlF7koaKnZdqB loftvigWSvfMRP4rfhZGLIyqQ+o0TMBzVUWgH8tG70XpuJyIl6c= =YswM -----END PGP SIGNATURE----- --=-=-=--