all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex Kost <alezost@gmail.com>
To: Mark H Weaver <mhw@netris.org>
Cc: guix-devel@gnu.org
Subject: Re: Initializing a 64bit system using guix on a 32bit OS
Date: Sat, 23 May 2015 12:24:58 +0300	[thread overview]
Message-ID: <874mn3bq8l.fsf@gmail.com> (raw)
In-Reply-To: <87a8wwo6wl.fsf@netris.org> (Mark H. Weaver's message of "Fri, 22 May 2015 13:31:54 -0400")

[-- Attachment #1: Type: text/plain, Size: 2432 bytes --]

Mark H Weaver (2015-05-22 20:31 +0300) wrote:

> ludo@gnu.org (Ludovic Courtès) writes:
>
>> Alex Kost <alezost@gmail.com> skribis:
[...]
>>> So I'm wondering is there a way to init a 64-bit system from a 32-bit
>>> one or perhaps it's just not possible?
>>
>> It actually is possible, but a little bit trickier.  Mark did it a few
>> weeks ago, though in a slightly different context.  The following should
>> work:
>>
>>   1. Install an i686 GuixSD, simply with ‘guix system init’, but use an
>>      x86_64 kernel.  To do that, you need to explicitly ask for an
>>      x86_64 kernel and Guix (so that the daemon accepts to build x86_64
>>      things) in the OS config:
>>
>>        (define linux-libre-x86_64
>>          (package (inherit linux-libre)
>>            (arguments `(#:system "x86_64-linux"
>>                         ,@(package-arguments linux-libre)))))
>
> I think this is not sufficient, because it would still use the kernel
> config for i686.  Here's what I used for the kernel:
[...]
> diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
> index 26e9aa9..c42919d 100644
> --- a/gnu/packages/linux.scm
> +++ b/gnu/packages/linux.scm
> @@ -64,6 +64,7 @@
>    #:use-module (guix build-system cmake)
>    #:use-module (guix build-system python)
>    #:use-module (guix build-system trivial)
> +  #:use-module ((guix build utils) #:select (alist-replace))
>    #:use-module (srfi srfi-26)
>    #:use-module (ice-9 match))
>  
> @@ -308,6 +309,15 @@ It has been modified to remove all non-free binary blobs.")
>      (license gpl2)
>      (home-page "http://www.gnu.org/software/linux-libre/"))))
>  
> +(define linux-libre-64
> +  (package (inherit linux-libre)
> +    (arguments
> +     `(#:system "x86_64-linux"
> +       ,@(package-arguments linux-libre)))
> +    (native-inputs
> +     (alist-replace "kconfig" (list (kernel-config "x86_64-linux"))
> +                    (package-native-inputs linux-libre)))))
> +

Thanks Ludovic and Mark!  I tried to follow your advices but eventually
I got the same error:

  guix system: error: build failed: a `x86_64-linux' is required to build `/gnu/store/zh42mbm0wvbsz05zr798nchyd3bc7fh6-guix-0.8.2.c2ee19e.drv', but I am a `i686-linux'

I used the following command:

  guix system init --no-grub config-64-simple.scm /mnt/guix

I'm attaching the OS config I used.  Did I miss anything?


[-- Attachment #2: config-64-simple.scm --]
[-- Type: text/plain, Size: 1837 bytes --]

(use-modules
 (gnu)
 (guix monads)
 (guix store)
 ((guix build utils) #:select (alist-replace))
 (guix packages)
 (gnu packages linux)
 (gnu packages package-management)
 (gnu services base))

(define linux-libre-x86_64
  (package
    (inherit linux-libre)
    (arguments `(#:system "x86_64-linux"
                 #:tests? #f
                 ,@(package-arguments linux-libre)))
    (native-inputs
     (alist-replace "kconfig" (list "/mnt/storage/src/guix/gnu/packages/linux-libre-x86_64.conf")
                    (package-native-inputs linux-libre)))))

(define guix-x86_64
  (package
    (inherit guix)
    (arguments `(#:system "x86_64-linux"
                 #:tests? #f
                 ,@(package-arguments guix)))))

(define %services
  ;; Make sure the ‘guix-daemon’ services uses ‘guix-x86_64’.
  (map (lambda (mservice)
         (mlet %store-monad ((service mservice))
               (if (memq 'guix-daemon (service-provision service))
                   (guix-service #:guix guix-x86_64)
                   (return service))))
       %base-services))

(operating-system
  (host-name "host")
  (timezone "Europe/Moscow")

  (kernel linux-libre-x86_64)

  (bootloader
   (grub-configuration (device "/dev/sda")))

  (file-systems
   (cons* (file-system
            (device "guix")
            (title 'label)
            (mount-point "/")
            (type "ext4"))
          %base-file-systems))

  (users
   (list (user-account
          (name "al")
          (uid 1000)
          (home-directory "/home/al")
          (group "users")
          (supplementary-groups
           '("wheel" "audio" "video")))))

  (packages
   (cons* iproute
          %base-packages))

  (services
   (cons* (console-keymap-service "dvorak")
          %services)))

  reply	other threads:[~2015-05-23  9:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-21 20:04 Initializing a 64bit system using guix on a 32bit OS Alex Kost
2015-05-22 13:28 ` Ludovic Courtès
2015-05-22 17:31   ` Mark H Weaver
2015-05-23  9:24     ` Alex Kost [this message]
2015-05-23 14:54       ` Mark H Weaver
2015-05-23 17:53         ` Alex Kost
2015-05-24 18:46   ` Alex Kost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874mn3bq8l.fsf@gmail.com \
    --to=alezost@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=mhw@netris.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.