From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id MHl6MXLjo2B5bQAAgWs5BA (envelope-from ) for ; Tue, 18 May 2021 17:55:30 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 4CUsLXLjo2BXZgAAB5/wlQ (envelope-from ) for ; Tue, 18 May 2021 15:55:30 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 920C715A57 for ; Tue, 18 May 2021 17:55:29 +0200 (CEST) Received: from localhost ([::1]:46144 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lj247-0005yT-Gv for larch@yhetil.org; Tue, 18 May 2021 11:55:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48154) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1livB5-0002g5-Su for help-guix@gnu.org; Tue, 18 May 2021 04:34:11 -0400 Received: from out162-62-57-137.mail.qq.com ([162.62.57.137]:45479) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1livAu-00018e-MG for help-guix@gnu.org; Tue, 18 May 2021 04:34:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1621326824; bh=/b0RXqVHkIacTdMSTQ5AzihQyClfWUnGtJSINa77Bgs=; h=References:From:To:Cc:Subject:In-reply-to:Date; b=tARIYbxSL79rJJ3IDZS4HTjkX7PrlqCO7RcJc5h/uwK0S2PKZppL6Zn8PzNmib5u1 mN9Zevx9p/G4zl+nj1qZWrZZF0ok5+kr7RoLsvyY6F1EE7cnvml+REWeVw/1p3Efdm AZPoKqaoC1OIwRL21XZzR5MI5T6+xG9bgHMT9T2c= Received: from Workstation ([117.136.87.204]) by newxmesmtplogicsvrsza6.qq.com (NewEsmtp) with SMTP id 86B1A02E; Tue, 18 May 2021 16:33:43 +0800 X-QQ-mid: xmsmtpt1621326823tym7kw0i8 Message-ID: X-QQ-XMAILINFO: N1O1zHC9g3+v8mKmlwwMIFkatIv8eHYDRZf8WFMlD5twPfMQwybb4tGZDyHFRw iwvjt5K7PSE8CfID23ZpodbiIVWJj8TUWWO3vSrETBG5PzQgB6UtbsN9gymL8dIgnKUfur6chqr0 XznfrmrO+dRduWPHlGZC3TUZgGv9vmLFtmzubfOzfPZh2SgycLiiv3j94k3ugFNGMVYYyXsbcwej WeqHdoQjCtodCAFF+Xw3bTMM3uI/aGtw3DScyCFa7gpOTCdl4BKWFMlqHaVvP71R4Hy2Iz0Z1n4Y WR9l+CRdAqYD6uKsGi2TBafcY3yA8FLrO74DmaMeRpAw7yJykIQ5cY5XcDIryhgtq8lyITh4Gefq B2B+2D7SporlG+Iu/5E2KwBexroS4qU7TUFXfWEj795gK+gsxJ+6pftUerE1WBg/ACwub5csjMVv qjEk4KgAXHUPfd4t2Cj0TwPuiS3aczURJREFIhBPMUluU6RD6TsrjujtrzWDhtxlXgNhkIaZXneE O2EQebch62Zs/MotObxgZTakUP3e7E4SUWJxqT6eueHwMP4BmhFoh2m5fT5jrbOWc5YW0eARP/TQ hAozQDGKKVeu0T49GpS0uFCilp1R+zVRb4uKZc88zPJ7VDBAmIY3LDnDx5XGYXNaZD0bNtz6u88n 2VRXRf1yMULgiGqgGfn1hDj5/uhoGusr5/lY0mB5+FiY/r5P/h6zp38Pm/iJpeVgOwH7oSV2EJX3 IbLdcHpo6pFxjALXnrUhIhH99dQVnw1llQxrAHDkmAseAL0zkYT5UftD80j2RHx+BDlf8AmKIE7h EiBaNhONuMNUcl8G7ZjKum References: <20210517023829.13248200@tachikoma.lepiller.eu> User-agent: mu4e 1.4.15; emacs 27.2 From: c4droid To: Julien Lepiller Subject: Re: Using bootstrap seeds write package definitions In-reply-to: <20210517023829.13248200@tachikoma.lepiller.eu> Date: Tue, 18 May 2021 16:33:41 +0800 X-OQ-MSGID: <87k0nwqw4a.fsf@foxmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=162.62.57.137; envelope-from=c4droid@foxmail.com; helo=out162-62-57-137.mail.qq.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HELO_DYNAMIC_IPADDR=1.951, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RDNS_DYNAMIC=0.982, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 18 May 2021 11:53:01 -0400 X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: help-guix Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1621353330; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=/b0RXqVHkIacTdMSTQ5AzihQyClfWUnGtJSINa77Bgs=; b=dxurPGMPFg/fTt8AVLlsHyALq4K7DC3GNUtEhbna4/2dS9i8w3K9QtVYNOa+ElOpvzUBDs nzSzoYRj//U9rWe1ou0bZsshsYUi86lsr9qaz4JcS3SHKaUJCWBqKQqKIsORQpfuyKSXLd 8avRR5FSNzIDtLz/9LSGvy1zBKjjky1U5GZ09DnWQ+kRR3TTfrVnEhWDY78MBb/TLbqBHq meBha3r5swhvv4vfh5CNYnq/UC6kuWvYaODAoSnNLsK65EMsLqHRmFGsM03TxqWWSpAnBq jaNwqCOYFr2M1o1herOs2phg01YdMm0aLrbRtr/sMkzUHuFq3x3ojMuEBWIoOg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1621353330; a=rsa-sha256; cv=none; b=tvln5IK1uUjri3hgcvKfAa1rUbgRzh+S5yzLkiwJOxvkjgIjG/pKsnx77aPfiAwT9mOyXP AnhOZnVfVYIrmBIz9cEIK9lBlN4GSqoVtiX2iJROb4vhXIFqbq+cjFmLOsk7JDNVZUQ9rX MAFl0egPrUCJhMf7TLRCGCfiW8tToYVtOzvZ20oZvkHmEbfuWqeD4O59wBSknAQEtDciKZ lSt5QB1E7MTxyxEua2lKlrzQa1g7EZQ3Q/2wk5PhI4Xy+z392k76lsdgsFXbEwli9jCx26 72rSrPeIYGl80v2IJ9tKamV+sc2M5esI+U3MzmIGk5MM63uB3C/NIXEL5i5m0Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=foxmail.com header.s=s201512 header.b=tARIYbxS; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Spam-Score: 4.86 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=foxmail.com header.s=s201512 header.b=tARIYbxS; dmarc=pass (policy=none) header.from=foxmail.com; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Queue-Id: 920C715A57 X-Spam-Score: 4.86 X-Migadu-Scanner: scn0.migadu.com X-TUID: YbiWNHAama6I Julien Lepiller writes: > Hi c4droid, > > Le Sun, 16 May 2021 10:50:36 +0800, > "c4droid" a =C3=A9crit : > >> Hello guix! >> I was using the Linux From Scratch for a while as my mainly linux >> distro, use soft link as package management. when I heard guix, I >> think I found solution for my LFS package management. I tried guix >> and guix system few month, Is time for switch my LFS package manager >> to guix. > > I've been using LFS (and my own LFS-based "distro") for some years, so > I completely understand why you'd want to use guix. Actually I based my > "distro" on what I understood from Guix and the package manager from > Haiku. When I understood I implemented that badly, I switched to Guix > and Guix System entirely, no more LFS :D. > >> When I watched the manual talk about bootstrapping guix, I don't know >> how to writing some package definitions with bootstrap-seeds, I was >> searching on the google and ask questions on irc, because building >> the LFS, want build the cross toolchain (stage 1) then build final >> system (stage 2), last is kernel and initramfs (stage 3). after that >> is build Beyond LFS (stage 4). I stuck with using bootstrap seeds >> writing stage 1 package definitions. So I ask for help on community, >> because the power of community is great. :) > > So Guix comes with a set of packages, which are just recipes to build > them from source. There are two things you might want to do: you can > either use the existing packages or create your own recipes for the > whole system. > > If you choose to use our packages, then there are again two options. > You can use the existing binary bootstrap (the only thing you wouldn't > build yourself), or build it yourself and replace the binaries used in > Guix by your own. Note that the bootstrap binaries are different from > the binaries built for the first chroot of LFS (the cross-compiler). We > do not use a binary GCC, but we instead start from mescc, a small C > compiler, and use it to build tcc, then gcc, with the goal of reducing > that down to stage0, which is only a few hundred bytes of binary, plus > sources of other packages. > > # Using our recipes and bootstrap binaries > > If you want to use our bootstrap binaries, there is nothing to do, > because Guix itself will be able to get the binary bootstrap and build > everything from it. Do not enable substitutes if you want to build > everything yourself. > > # Providing your own bootstrap binaries > > If you prefer to provide your own bootstrap, you'll have to build and > provide binaries for the bootstrap seeds we currently have in Guix, > that you see in the manual. > > # Building your own packages > > If you decide not to use our recipes, you must write your own. The set > of packages is rooted in the bootstrap seeds, as you noticed. However, > if you want to provide your own recipes, you are basically free to > provide any bootstrap and further packages you want. What you could do > is to build stage1 (cross toolchain), use that as your binary seed, and > build the other stages as guix packages. Note that for that, you'll > need to have guix already installed on the host system. > > If you have never used Guix, or never written a package definition, you > might want to have a look at our short packaging tutorial at > https://guix.gnu.org/en/cookbook/en/html_node/Packaging-Tutorial.html#Pac= kaging-Tutorial > (French and German are also available if you prefer one of these > languages). > > There is some code in gnu/packages/bootstrap.scm that you might be > interested in. It has some interesting bits: first there are a few > binary seeds with hashes: they are statically linked binaries that are > needed to decompress other seeds. Then, we define a few special > procedures that replace the normal packaging procedures > (bootstrap-origin, package-from-tarball). You probably want to use them > or get inspiration from them to create your own bootstrap recipes > (packages that simply decompress a tarball containing a prebuilt > binary). The rest of the file lists these packages. > > Then gnu/packages/commencement.scm is the very beginning of the package > graph. These packages use the binary seeds to build up to gcc, that we > later use in the gnu-build-system, etc. You will be interested in the > comments in this file too :) > I watched gnu/packages/bootstrap.scm and gnu/packages/commencement.scm, I decide use mes tools and busybox utilities make bootstrap recipes and my own bootstrap seeds, then follow the gnu/packages/commencement.scm graph build cross toolchain and so on. But the way, the bootstrap and commencement module give some inspiration for my idea. > # My own experience with my package manager (not guix) > > If I recall correctly, what I did when I had my own "distro" (and > package manager), is that I first built the cross-toolchain and base > system from LFS (it was pre-10.0, and we built the cross-compiler and > use it firts outside the chroot to build the base build toolchain we > could then chroot to). I would first manually create a package from the > chroot, and install a first system with only that package, then chroot > to it. Then, from this system and the chroot package, I was able to > build the base system with my package manager. Once I had the base LFS > system (stage 2), that system had a dependency on the chroot package, > which was not acceptable for me, so I replaced all the recipes to > depend on the previously built version, turning stage2 into a set of > bootstrap binaries. I rebuilt stage2 from the new bootstrap, and > continued to write packages for other packages. > > Once I had my packages, I also wrote some code to create and install > the initramfs and kernel (stage3). > > At this point, I could boot the new system, and continue with stage 4 :) > > Note that, in order to use Guix, you'll need Guix in the chroot > package and all its dependencies, which is bigger than what LFS makes > you build initially. > > Hope this is useful! Before I can help you further, I think I need to > know which route you want to follow, as they are very different. > >> p.s.: Sorry for my poor english > > Hehe, don't worry. You can use your mother tongue if you prefer on this > mailing list, although I can only help in English or French. > >> ------ >> Best reguards c4droid