Gentoo Archives: gentoo-user

From: Ozgur <mueddib@××××××××.org>
To: "gentoo-user@l.g.o" <gentoo-user@l.g.o>, Jude DaShiell <jdashiel@×××××.com>
Subject: Re: [gentoo-user] gentoo and kickstart files
Date: Sun, 22 Nov 2020 08:32:27
Message-Id: 1445841606033792@mail.yandex.com
In Reply to: Re: [gentoo-user] gentoo and kickstart files by Dan Egli
1
�� �� 22.11.2020, 11:12, "Dan Egli" <dan@×××××××××××.site>:

On 11/21/2020 2:26 PM, Jude DaShiell wrote:

��Does gentoo know about kickstart files and can it use them?

��

��

�� Hello, �� Also you can see similar sample bash script files for Gentoo installation. �� https://github.com/tashrifsanil/Gentoo-Install-Scripts https://github.com/sormy/gentoo-quick-installer �� Regards ��

I'm hardly a Gentoo expert, but I'm going to say no on both. Kickstart
files are designed for the particular installer you're using. I know
that a Kickstart file for Fedora won't work on Ubuntu, or even CentOS.
The issue here is that Gentoo doesn't HAVE an installer. Not like SUSe's
YaST or Fedora's anaconda. So there is no program to feed a kickstart
file to. The best thing you can do to make things similiar between hosts
is to create your own script that partitions the disks, formats them,
mounts them, then proceeds to copy custom files across. Just off the top
of my head, it would look something like this, assuming you are using
GPT partitions on a single drive with separate /home partition, with /
and /home formatted as ext4:

#!/bin/sh
echo -e "g\nn\n1\n\n+1G\nn\n2\n\n+64G\nn\n\n\nt\n1\n1\nw" | fdisk /dev/sda
mkfs.vfat -F32 /dev/sda1
mkfs.ext4 /dev/sda2
mkfs.ext4 /dev/sda3
mount /dev/sda3 /mnt/gentoo
cd /mnt/gentoo
tar xvfJ /mnt/cdrom/stage3*.xz
for D in proc sys dev tmp; do
������ mount --rbind /$D $D
������ mount --make-rslave $D;
done
cp /mnt/cdrom/use/* /etc/portage/package.use
cp /mnt/cdrom/world /mnt/cdrom/chrooted .
cp /mnt/cdrom/make.conf etc/portage
cp /etc/resolv.conf etc
chroot . chrooted


And then chrooted would look like this:
. /etc/profile
PKGS=$(cat /world)emerge-webrsync
emerge -f $PKGS
emerge $PKGS
if [ -d /etc/systemd/system ] ; then
# using systemd, so let's use systemctl to set the boot programs
������ systemctl daemon-reload
������ systemctl enable <packages to load on boot> ;
else
# using openrc instead
���� for P in <packages to load on boot>; do rc-update add $P default; done ;
fi
genkernel --menuconfig all
grub2-config -o /boot/grub/grub.cfg



And of course, world is what you want listed in the world file. The
easiest way to do that part is to copy the /var/lib/portage/world file
to the install media (that's where "world" came from above"). If you're
not familiar with fdisk commands, what happens is this:
1) make new gpt partition label on the drive
2) make a new 1G partition (this will be /boot/EFI)
3) make a new 64GB partition (this will be /)
4) make a partition using all remaining space (/home)
5) flag partition 1 as an ESP (EFI System Partition). Probably not
needed, but better safe than sorry.
6) write the changes to disk and exit

The following files are assumed to be in /root of the install media
(automatically mounted on /mnt/cdrom):
world - the world file containing the base packages you want. We will
let portage sort out any dependancies
stage3*.xz - wild card to represent your stage3 tarball.
chrooted - script to run in the chrooted environment
make.conf - the make.conf you want to have.

Also, the directory use should exist on the media. This directory will
contain the files that automatically get copied to
/etc/portage/package.use in the first script.

That's off the top of my head, and may very well be missing some steps,
but you get the idea.

��

--

Dan Egli
��From my Test Server


--
This email has been checked for viruses by AVG.
https://www.avg.com

��