/* GNU Guix --- Functional package management for GNU Copyright (C) 2020 Ludovic Courtès This file is part of GNU Guix. GNU Guix is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. GNU Guix 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 General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Guix. If not, see . */ /* This file implements part of the GNU ld.so audit interface. It is used by the "fakechroot" engine of the 'guix pack -RR' wrappers to make sure the loader looks for shared objects under the "fake" root directory. */ #define _GNU_SOURCE 1 #include #include #include #include #include /* The pseudo root directory and store that we are relocating to. */ static const char *root_directory; static char *store; /* The original store, "/gnu/store" by default. */ static const char original_store[] = "@STORE_DIRECTORY@"; /* Like 'malloc', but abort if 'malloc' returns NULL. */ static void * xmalloc (size_t size) { void *result = malloc (size); assert (result != NULL); return result; } unsigned int la_version (unsigned int v) { if (v != LAV_CURRENT) error (1, 0, "cannot handle interface version %u", v); root_directory = getenv ("FAKECHROOT_BASE"); if (root_directory == NULL) error (1, 0, "'FAKECHROOT_BASE' is not set"); store = xmalloc (strlen (root_directory) + sizeof original_store); strcpy (store, root_directory); strcat (store, original_store); return v; } /* Return NAME, a shared object file name, relocated under STORE. This function is called by the loader whenever it looks for a shared object. */ char * la_objsearch (const char *name, uintptr_t *cookie, unsigned int flag) { char *result; if (strncmp (name, original_store, sizeof original_store - 1) == 0) { size_t len = strlen (name) - sizeof original_store + strlen (store) + 1; result = xmalloc (len); strcpy (result, store); strcat (result, name + sizeof original_store - 1); } else result = strdup (name); return result; } 3de85b27909cc3f1a376c8640518346a9ca5&showmsg=1'>Expand)Author 2022-08-28tests: Add test for menu-entry roundtrips as sexps....* tests/boot-parameters.scm (%uuid-menu-entry, %file-system-label-menu-entry): New variables. ("menu-entry roundtrip, uuid", "menu-entry roundtrip, file-system-label"): New tests. Signed-off-by: Marius Bakke <marius@gnu.org> Josselin Poiret 2022-03-16system: Improve 'read-boot-parameters' incompatibility diagnostic....Previously, when reading an incompatible "parameters" file, 'guix system' would print a warning and then crash with a wrong-type-arg backtrace because code expects 'read-boot-parameters' to always return a <boot-parameters> record. * gnu/system.scm (read-boot-parameters): Upon incompatibility, raise an error instead of returning #f. Also raise a '&fix-hint' condition. * tests/boot-parameters.scm ("read, construction, mandatory fields"): Define 'test-read-boot-parameters' as a macro; expect 'formatted-message?' exceptions rather than #f returns. Ludovic Courtès 2022-03-01system: Add a version field to the <boot-parameters> record....This version field exposes the (already present) version information of a boot parameters file. * gnu/system.scm (%boot-parameters-version): New variable. (<boot-parameters>)[version]: New field. (read-boot-parameters): Use it. (operating-system-boot-parameters-file): Likewise. * tests/boot-parameters.scm (test-read-boot-parameters): Use %boot-parameters-version as the default version value in the template. Maxim Cournoyer 2021-08-29Migrate to the new 'targets' field of bootloader-configuration....The old 'target' field is deprecated; adjust the sources to use the new 'targets' one instead. * doc/guix-cookbook.texi<target>: Replace by 'targets'. * gnu/bootloader/grub.scm: Likewise. * gnu/installer/parted.scm: Likewise. * gnu/machine/digital-ocean.scm: Likewise. * gnu/system/examples/asus-c201.tmpl: Likewise * gnu/system/examples/bare-bones.tmpl: Likewise * gnu/system/examples/bare-hurd.tmpl: Likewise * gnu/system/examples/beaglebone-black.tmpl: Likewise * gnu/system/examples/desktop.tmpl: Likewise * gnu/system/examples/docker-image.tmpl: Likewise * gnu/system/examples/lightweight-desktop.tmpl: Likewise * gnu/system/examples/vm-image.tmpl: Likewise * gnu/system/examples/yggdrasil.tmpl: Likewise * gnu/system/hurd.scm: Likewise * gnu/system/images/hurd.scm: Likewise * gnu/system/images/novena.scm: Likewise * gnu/system/images/pine64.scm: Likewise * gnu/system/images/pinebook-pro.scm: Likewise * gnu/system/images/rock64.scm: Likewise * gnu/system/install.scm: Likewise * gnu/system/vm.scm: Likewise * gnu/tests.scm: Likewise * gnu/tests/ganeti.scm: Likewise * gnu/tests/install.scm: Likewise * gnu/tests/nfs.scm: Likewise * gnu/tests/telephony.scm: Likewise * tests/boot-parameters.scm: Likewise * tests/system.scm: Likewise Maxim Cournoyer