unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* How do I control which guix 'system vm-image' puts into the image?
@ 2016-07-21 19:45 myglc2
  2016-07-21 20:32 ` myglc2
  2016-07-22 12:47 ` Ludovic Courtès
  0 siblings, 2 replies; 3+ messages in thread
From: myglc2 @ 2016-07-21 19:45 UTC (permalink / raw)
  To: help-guix

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

Running GuixSD I am using git checkout 'b006ba5 [behind 15] pull: Update
the version string.' with ‘/home/g1/.config/guix/latest’ ->
‘../../src/guix’

When I do 'guix system vm-image'; run the image; and do 'M-x
guix-installed-system-packages' I see a bunch of packages with a "-"
showing in the Synopsis column and "(This package is obsolete)" shows
in the "Outputs" field.

In an earlier exchange, Alex explained that this means that the version
of the package found in the store _does not match_ the package version
specified by the version of guix in use by emacs. I hope I got that
right :-0

'guix system reconfigure system.scm' seems to be using my git checkout
just fine because with ...

(with-eval-after-load 'geiser-guile
  (add-to-list 'geiser-guile-load-path "~/src/guix"))

... in my emacs init file, I don't see any "obsolete" packages when I do
'M-x guix-installed-system-packages'.

So... I developed the theory that 'guix system vm-image' was using a
obsolete version of guix from the store instead of the version in my my
git checkout (confused yet?).

So I add guix to 'system.scm' to put it in the store in hopes that 'guix
system vm_image' would pick it up from there. I still have "obsolete"
packages showing in my vm-image.

So... heeeeeere is the question:

How do I control which version of guix is built into an image?

TIA - George

Attached: script (img) used to make and run the vm-image and referenced configs.


[-- Attachment #2: img --]
[-- Type: application/octet-stream, Size: 1153 bytes --]

#!/run/current-system/profile/bin/bash
set -xe

# guix vm examples

# usage
# $ <scriptname> mk  [vm#] - mak image
# $ <scriptname> run [vm#] - run image

CMD=`basename "$0"`
VMNUM=${2:-""}
TMPDIR=$PWD/tmp/$CMD$VMNUM
mkdir -p $TMPDIR
cp $CMD $TMPDIR/$CMD

case $1 in
    mk)
	# save the vm config
	cp v1.scm $TMPDIR
	# save guix version 
	(stat $HOME/.config/guix/latest | grep File:) > $TMPDIR/guix-version
	# save guix config
	git -C ~/.config/guix/latest branch -av | grep '* master' >> $TMPDIR/guix-version
	# be sure the version of guix we have checked out is the one we are using
	make -C $HOME/.config/guix/latest -s > $TMPDIR/guix-make.log
	# make vm & copy image from of store
	cp -n $(guix system vm-image $TMPDIR/v1.scm --image-size=4GB) $TMPDIR/vm.img
	# make writeable
	chmod u+w $TMPDIR/vm.img
	;;

    run)
	# run the image
	# Note: '-k en-us' is a hack to get Mac XQuartz keys to "sort of work"
	qemu-system-x86_64 \
	    -net user \
	    -net nic,model=virtio \
	    -enable-kvm \
	    -m 4096 \
	    -k en-us \
	    $TMPDIR/vm.img
	;;

    *)

	echo ERROR: you typed: \"$CMD $*\" which has missing arguments or invalid arguments

esac

[-- Attachment #3: g1.scm --]
[-- Type: application/octet-stream, Size: 269 bytes --]

(use-package-modules
 base
 aspell ; aspell-dict-en
 emacs  ; geiser-next
 scheme ; sicp
 )
(packages->manifest
 (list
  aspell-dict-en ; because emacs doesn't find system install
  geiser-next    ; temporary for 'C-c C-d C-d' to work
  sicp           ; SICP Info
  ))

[-- Attachment #4: system.scm --]
[-- Type: application/octet-stream, Size: 1659 bytes --]

;;; g1 system config
(use-modules (gnu))
(use-service-modules networking ssh)
(use-package-modules
 base
 admin
 disk
 linux                 ; mdadm
 package-management    ; guix
 screen
 ghostscript           ; gs-fonts
 fonts                 ; font-dejavu font-gnu-freefont-ttf
 curl                  ;lpaste
 ssh
 rsync
 wget
 version-control       ; git
 aspell
 emacs
 autotools             ; automake
 texinfo
 gettext
 xorg certs
 graphviz
 qemu
 )
(operating-system
  (host-name "g1")
  (timezone "America/New_York")
  (locale "en_US.utf8")
  (bootloader (grub-configuration (device "/dev/sda")))
  (file-systems (cons (file-system
			(device "g1sd")
			(title 'label)
			(mount-point "/")
			(type "ext4"))
		      %base-file-systems))
  (users (cons* (user-account
		 (name "glc")
		 (group "users")
		 (supplementary-groups '("wheel"))
		 (home-directory "/home/glc"))
		(user-account
		 (name "g1")
		 (group "users")
		 (supplementary-groups '("wheel" "kvm"))
		 (home-directory "/home/g1"))
		(user-account
		 (name "g1x")
		 (group "users")
		 (supplementary-groups '("wheel" "kvm"))
		 (home-directory "/home/g1x"))
		%base-user-accounts))
  (packages
   (cons*
    glibc-utf8-locales
    parted
    mdadm
    qemu
    guix
    screen
    openssh nss-certs xauth
    rsync wget
    curl ;lpaste
    git git-manpages
    gs-fonts font-dejavu font-gnu-freefont-ttf
    aspell
    emacs
    flycheck paredit magit
    emacs-zenburn-theme emacs-markdown-mode emacs-web-mode 
    gnu-make
    texinfo
    automake
    graphviz
    %base-packages))
  (services (cons* (dhcp-client-service)
		   (lsh-service #:port-number 22)
		   %base-services)))

[-- Attachment #5: v1.scm --]
[-- Type: application/octet-stream, Size: 1659 bytes --]

;;; v1 system config
(use-modules (gnu))
(use-service-modules networking ssh)
(use-package-modules
 base
 admin
 disk
 linux                 ; mdadm
 package-management    ; guix
 screen
 ghostscript           ; gs-fonts
 fonts                 ; font-dejavu font-gnu-freefont-ttf
 curl                  ;lpaste
 ssh
 rsync
 wget
 version-control       ; git
 aspell
 emacs
 autotools             ; automake
 texinfo
 gettext
 xorg certs
 graphviz
 qemu
 )
(operating-system
  (host-name "g1")
  (timezone "America/New_York")
  (locale "en_US.utf8")
  (bootloader (grub-configuration (device "/dev/sda")))
  (file-systems (cons (file-system
			(device "g1sd")
			(title 'label)
			(mount-point "/")
			(type "ext4"))
		      %base-file-systems))
  (users (cons* (user-account
		 (name "glc")
		 (group "users")
		 (supplementary-groups '("wheel"))
		 (home-directory "/home/glc"))
		(user-account
		 (name "g1")
		 (group "users")
		 (supplementary-groups '("wheel" "kvm"))
		 (home-directory "/home/g1"))
		(user-account
		 (name "g1x")
		 (group "users")
		 (supplementary-groups '("wheel" "kvm"))
		 (home-directory "/home/g1x"))
		%base-user-accounts))
  (packages
   (cons*
    glibc-utf8-locales
    parted
    mdadm
    qemu
    guix
    screen
    openssh nss-certs xauth
    rsync wget
    curl ;lpaste
    git git-manpages
    gs-fonts font-dejavu font-gnu-freefont-ttf
    aspell
    emacs
    flycheck paredit magit
    emacs-zenburn-theme emacs-markdown-mode emacs-web-mode 
    gnu-make
    texinfo
    automake
    graphviz
    %base-packages))
  (services (cons* (dhcp-client-service)
		   (lsh-service #:root-login? #t)
		   %base-services)))

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How do I control which guix 'system vm-image' puts into the image?
  2016-07-21 19:45 How do I control which guix 'system vm-image' puts into the image? myglc2
@ 2016-07-21 20:32 ` myglc2
  2016-07-22 12:47 ` Ludovic Courtès
  1 sibling, 0 replies; 3+ messages in thread
From: myglc2 @ 2016-07-21 20:32 UTC (permalink / raw)
  To: help-guix

myglc2 <myglc2@gmail.com> writes:

Please note clarifications ...

> Running GuixSD I am using git checkout 'b006ba5 [behind 15] pull: Update
> the version string.' with ‘/home/g1/.config/guix/latest’ ->
> ‘../../src/guix’
>
> When I do 'guix system vm-image'; run the image; and do 'M-x
> guix-installed-system-packages' I see a bunch of packages with a "-"
> showing in the Synopsis column and "(This package is obsolete)" shows
> in the "Outputs" field.
>
> In an earlier exchange, Alex explained that this means that the version
> of the package found in the store _does not match_ the package version
> specified by the version of guix in use by emacs. I hope I got that
> right :-0
>
> 'guix system reconfigure system.scm' seems to be using my git checkout
> just fine because with ...
>
> (with-eval-after-load 'geiser-guile
>   (add-to-list 'geiser-guile-load-path "~/src/guix"))
>
> ... in my emacs init file, I don't see any "obsolete" packages when I do
> 'M-x guix-installed-system-packages'

... on the "builder" machine on which I created the image.
>
> So... I developed the theory that 'guix system vm-image' was using a
> obsolete version of guix from the store instead of the version in my my
> git checkout (confused yet?).
>
> So I add guix to 'system.scm'

... and used 'guix system reconfigure system.scm' on the "builder"
machine ...

> to put it in the store in hopes that 'guix
> system vm_image' would pick it up from there. I still have "obsolete"
> packages showing in my vm-image.
>
> So... heeeeeere is the question:
>
> How do I control which version of guix is built into an image?
>
> TIA - George
>
> Attached: script (img) used to make and run the vm-image and referenced configs.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How do I control which guix 'system vm-image' puts into the image?
  2016-07-21 19:45 How do I control which guix 'system vm-image' puts into the image? myglc2
  2016-07-21 20:32 ` myglc2
@ 2016-07-22 12:47 ` Ludovic Courtès
  1 sibling, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2016-07-22 12:47 UTC (permalink / raw)
  To: myglc2; +Cc: help-guix

Hello!

myglc2 <myglc2@gmail.com> skribis:

> How do I control which version of guix is built into an image?

The image contains the ‘guix’ package indirectly specified in the
‘operating-system’ configuration.

Namely, the ‘services’ fields of your ‘operating-system’ declaration is
(very likely) a superset of ‘%base-services’.  ‘%base-services’ includes
‘guix-service’, which automatically adds the ‘guix’ package provided by
(gnu packages package-management) to /run/current-system/profile.

As you can see in (gnu packages package-management), the ‘guix’ package
is a Git snapshot dating back to May 14th.

HTH!

Ludo’.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-07-22 12:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-21 19:45 How do I control which guix 'system vm-image' puts into the image? myglc2
2016-07-21 20:32 ` myglc2
2016-07-22 12:47 ` Ludovic Courtès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).