Gentoo Archives: gentoo-user

From: Dan Egli <dan@×××××××××××.site>
To: gentoo-user@l.g.o, Jude DaShiell <jdashiel@×××××.com>
Subject: Re: [gentoo-user] gentoo and kickstart files
Date: Sun, 22 Nov 2020 08:12:20
In Reply to: [gentoo-user] gentoo and kickstart files by Jude DaShiell
1 On 11/21/2020 2:26 PM, Jude DaShiell wrote:
2 > Does gentoo know about kickstart files and can it use them?
3 >
4 >
6 I'm hardly a Gentoo expert, but I'm going to say no on both. Kickstart
7 files are designed for the particular installer you're using. I know
8 that a Kickstart file for Fedora won't work on Ubuntu, or even CentOS.
9 The issue here is that Gentoo doesn't HAVE an installer. Not like SUSe's
10 YaST or Fedora's anaconda. So there is no program to feed a kickstart
11 file to. The best thing you can do to make things similiar between hosts
12 is to create your own script that partitions the disks, formats them,
13 mounts them, then proceeds to copy custom files across. Just off the top
14 of my head, it would look something like this, assuming you are using
15 GPT partitions on a single drive with separate /home partition, with /
16 and /home formatted as ext4:
18 #!/bin/sh
19 echo -e "g\nn\n1\n\n+1G\nn\n2\n\n+64G\nn\n\n\nt\n1\n1\nw" | fdisk /dev/sda
20 mkfs.vfat -F32 /dev/sda1
21 mkfs.ext4 /dev/sda2
22 mkfs.ext4 /dev/sda3
23 mount /dev/sda3 /mnt/gentoo
24 cd /mnt/gentoo
25 tar xvfJ /mnt/cdrom/stage3*.xz
26 for D in proc sys dev tmp; do
27    mount --rbind /$D $D
28    mount --make-rslave $D;
29 done
30 cp /mnt/cdrom/use/* /etc/portage/package.use
31 cp /mnt/cdrom/world /mnt/cdrom/chrooted .
32 cp /mnt/cdrom/make.conf etc/portage
33 cp /etc/resolv.conf etc
34 chroot . chrooted
37 And then chrooted would look like this:
38 . /etc/profile
39 PKGS=$(cat /world)emerge-webrsync
40 emerge -f $PKGS
41 emerge $PKGS
42 if [ -d /etc/systemd/system ] ; then
43 # using systemd, so let's use systemctl to set the boot programs
44    systemctl daemon-reload
45    systemctl enable <packages to load on boot> ;
46 else
47 # using openrc instead
48   for P in <packages to load on boot>; do rc-update add $P default; done ;
49 fi
50 genkernel --menuconfig all
51 grub2-config -o /boot/grub/grub.cfg
55 And of course, world is what you want listed in the world file. The
56 easiest way to do that part is to copy the /var/lib/portage/world file
57 to the install media (that's where "world" came from above"). If you're
58 not familiar with fdisk commands, what happens is this:
59 1) make new gpt partition label on the drive
60 2) make a new 1G partition (this will be /boot/EFI)
61 3) make a new 64GB partition (this will be /)
62 4) make a partition using all remaining space (/home)
63 5) flag partition 1 as an ESP (EFI System Partition). Probably not
64 needed, but better safe than sorry.
65 6) write the changes to disk and exit
67 The following files are assumed to be in /root of the install media
68 (automatically mounted on /mnt/cdrom):
69 world - the world file containing the base packages you want. We will
70 let portage sort out any dependancies
71 stage3*.xz - wild card to represent your stage3 tarball.
72 chrooted - script to run in the chrooted environment
73 make.conf - the make.conf you want to have.
75 Also, the directory use should exist on the media. This directory will
76 contain the files that automatically get copied to
77 /etc/portage/package.use in the first script.
79 That's off the top of my head, and may very well be missing some steps,
80 but you get the idea.
83 --
85 Dan Egli
86 From my Test Server
89 --
90 This email has been checked for viruses by AVG.


Subject Author
Re: [gentoo-user] gentoo and kickstart files Ozgur <mueddib@××××××××.org>
Re: [gentoo-user] gentoo and kickstart files Neil Bothwick <neil@××××××××××.uk>