Browse Source

Cleanup pass

master
jcmdln 2 years ago
parent
commit
d97fbd599f

+ 9
- 11
Readme.md View File

@@ -20,14 +20,14 @@ my ideal Gentoo Linux system. This repository contains the following:

## FAQ

### "How much about Gentoo will I need to know to use gein?"
#### "How much about Gentoo will I need to know to use gein?"
I would suggest reading the Gentoo Handbook and every file in this
project before proceeding.

### "I keep getting boot failures after installing in a VirtualBox VM?"
#### "I keep getting boot failures after installing in a VirtualBox VM?"
Remove the virtual disk drive from the boot order and restart.

### "The display is lagging when using LXQT on my Nvidia GPU?"
#### "The display is lagging when using LXQT on my Nvidia GPU?"
Run `eselect opengl set nvidia` as root.


@@ -54,16 +54,14 @@ MBR.
4. Download and run `gein.sh`

$ wget https://raw.githubusercontent.com/jcmdln/gein/master/gein.sh
$ sh ./gein.sh
$ sh gein.sh
gein: Linux-based derivative of Gentoo
-h, help Shows this output
-b, bootstrap Bootstrap the stage3 tarball
bootstrap Bootstrap the stage3 tarball

Post-bootstrap:
-m, minimal Perform a basic Gentoo installation
-d, desktop Install a gein desktop
i3wm A complete i3wm desktop
lxqt A complete LXQT desktop
base Basic headless server & development
minimal X, i3wm, and base packages
complete A complete LXQT Gentoo desktop

5. Uncomment and set the `PartitionBoot` & `VideoCards` variables. Both
MUST be set or `gein.sh` will exit. If you don't need any video support,
@@ -79,7 +77,7 @@ then set `VideoCards` to false.

7. Install the desired target:

$ sh ./gein.sh desktop i3wm
$ sh ./gein.sh minimal

8. Wait a few hours. You will be prompted as few times as possible, and
as close to the beginning or end of the process.

+ 2
- 8
etc/portage/sets/gein-base View File

@@ -1,21 +1,15 @@
# gein-base
# /etc/portage/sets/gein-base

app-admin/sudo
app-editors/emacs
app-editors/vim
app-misc/tmux
app-text/aspell
dev-vcs/git
media-fonts/noto
media-libs/alsa-lib
media-sound/alsa-utils
net-misc/dhcpcd
sys-apps/mlocate
sys-apps/pciutils
sys-boot/grub:2
sys-kernel/gentoo-sources
sys-kernel/linux-firmware
sys-process/htop
virtual/cron
x11-apps/xset
x11-apps/xsetroot
x11-misc/xclip

+ 26
- 0
etc/portage/sets/gein-complete View File

@@ -0,0 +1,26 @@
# /etc/portage/sets/gein-complete

## Desktop
app-office/libreoffice
media-fonts/noto
media-libs/alsa-lib
media-sound/alsa-utils
media-sound/pavucontrol
media-sound/pulseaudio
media-video/mpv
sys-apps/mlocate
www-client/chromium
x11-apps/xset
x11-apps/xsetroot
x11-misc/xclip

## LXQT
kde-frameworks/breeze-icons
kde-plasma/breeze
kde-plasma/breeze-grub
kde-plasma/breeze-gtk
kde-plasma/kwin
kde-plasma/sddm-kcm
lxde-base/lxappearance
lxqt-base/lxqt-meta
net-misc/cmst

+ 0
- 8
etc/portage/sets/gein-i3wm View File

@@ -1,8 +0,0 @@
# gein-i3wm

x11-misc/arandr
x11-misc/dmenu
x11-misc/i3lock
x11-misc/i3status
x11-wm/i3
x11-terms/st

+ 1
- 1
etc/portage/sets/gein-laptop View File

@@ -1,4 +1,4 @@
# gein-laptop
# /etc/portage/sets/gein-laptop

app-laptop/laptop-mode-tools
net-misc/connman

+ 0
- 11
etc/portage/sets/gein-lxqt View File

@@ -1,11 +0,0 @@
# gein-lxqt

kde-frameworks/breeze-icons
kde-plasma/breeze
kde-plasma/breeze-grub
kde-plasma/breeze-gtk
kde-plasma/kwin
kde-plasma/sddm-kcm
lxde-base/lxappearance
lxqt-base/lxqt-meta
net-misc/cmst

+ 17
- 0
etc/portage/sets/gein-minimal View File

@@ -0,0 +1,17 @@
# /etc/portage/sets/gein-minimal

## Desktop
media-fonts/noto
media-libs/alsa-lib
media-sound/alsa-utils
sys-apps/mlocate
x11-apps/xset
x11-apps/xsetroot
x11-misc/xclip

## i3wm
x11-misc/dmenu
x11-misc/i3lock
x11-misc/i3status
x11-terms/st
x11-wm/i3

+ 0
- 36
etc/portage/sets/gein-steam View File

@@ -1,36 +0,0 @@
# gein-steam

dev-libs/glib:2
dev-libs/libgcrypt
dev-libs/nspr
dev-libs/nss
gnome-base/gconf
media-libs/alsa-lib
media-libs/fontconfig
media-libs/freetype:2
media-libs/libjpeg-turbo
media-libs/libogg
media-libs/libpng:1.2
media-libs/libsdl
media-libs/libtheora
media-libs/libtxc_dxtn
media-libs/libvorbis
media-libs/openal
net-misc/curl
net-print/cups
sys-apps/dbus
virtual/libusb:1
virtual/opengl
x11-libs/cairo
x11-libs/gdk-pixbuf
x11-libs/gtk+:2
x11-libs/libX11
x11-libs/libXScrnSaver
x11-libs/libXext
x11-libs/libXfixes
x11-libs/libXi
x11-libs/libXrandr
x11-libs/libXrender
x11-libs/pango
x11-libs/pixman
x11-misc/xdg-user-dirs

+ 4
- 0
etc/profile.d/gpkg.sh View File

@@ -20,6 +20,10 @@ gpkg() {
$SU emerge -av --quiet-build ${@:2}
;;

-d|depends)
$SU equery
;;

-r|--remove)
$SU emerge -avc --quiet-build ${@:2}
;;

+ 127
- 154
gein.sh View File

@@ -49,17 +49,19 @@ CONFIG() {
# moved into place.
Configs="
/etc/portage/make.conf

/etc/portage/package.accept_keywords
/etc/portage/package.env
/etc/portage/package.license

/etc/portage/package.use/defaults
/etc/portage/package.use/multilib
/etc/portage/package.use/packages

/etc/portage/sets/gein-base
/etc/portage/sets/gein-i3wm
/etc/portage/sets/gein-minimal
/etc/portage/sets/gein-complete
/etc/portage/sets/gein-laptop
/etc/portage/sets/gein-lxqt
/etc/portage/sets/gein-steam

/etc/profile
/etc/profile.d/alias.sh
@@ -69,10 +71,11 @@ CONFIG() {
/etc/profile.d/racket.sh

/etc/emacs/default.el

/etc/i3status.conf
/etc/i3/config

/etc/Xresources
/etc/i3status.conf
/etc/tmux.conf
/etc/vimrc
/etc/xinitrc
@@ -202,19 +205,21 @@ BOOTSTRAP() {
fi

echo "gein: Ensuring we are in /mnt/gentoo..."
[ ! -e /mnt/gentoo/$(basename "$0") ] &&
cp "$0" /mnt/gentoo/ &&
cd /mnt/gentoo &&
if [ ! -e /mnt/gentoo/$(basename "$0") ]; then
cp "$0" /mnt/gentoo/
cd /mnt/gentoo
fi

echo "gein: Setting system time via ntpd..."
[ -x "$(command -v ntpd)" ] &&
ntpd -q -g &&
echo "gein: Setting system time via ntpd..."
if [ -x "$(command -v ntpd)" ]; then
ntpd -q -g
fi

echo "gein: Downloading and extracting Stage3 tarball..."
echo "gein: Downloading and extracting Stage3 tarball..."
if [ -n "$Stage3" ]; then
$Wget "$Stage3" &&
tar -xpf stage3-* --xattrs --numeric-owner &&
rm -rf stage3-*
$Wget "$Stage3"
tar -xpf stage3-* --xattrs --numeric-owner
rm -rf stage3-*
else
echo "gein: 'Stage3' variable is not set! Is cURL missing?"
echo "gein: Exiting..."
@@ -227,10 +232,10 @@ BOOTSTRAP() {
if [ -e /mnt/gentoo/"$target" ]; then
case "$target" in
proc) mount -t proc /proc /mnt/gentoo/proc ;;
sys ) mount --rbind /sys /mnt/gentoo/sys &&
mount --make-rslave /mnt/gentoo/sys ;;
dev ) mount --rbind /dev /mnt/gentoo/dev &&
mount --make-rslave /mnt/gentoo/dev ;;
sys ) mount --rbind /sys /mnt/gentoo/sys
mount --make-rslave /mnt/gentoo/sys ;;
dev ) mount --rbind /dev /mnt/gentoo/dev
mount --make-rslave /mnt/gentoo/dev ;;
*) echo "gein: $target: Improper hardware device"
exit
esac
@@ -242,68 +247,69 @@ BOOTSTRAP() {

SwapFile="/mnt/gentoo/swapfile"
if [ ! -e "$SwapFile" ]; then
echo "gein: Setting up swapfile..." &&
fallocate -l "$SwapSize" "$SwapFile" &&
chmod 0600 "$SwapFile" &&
mkswap "$SwapFile" &&
swapon "$SwapFile" &&
echo "/swapfile none swap sw 0 0" >> /mnt/gentoo/etc/fstab
echo "gein: Setting up swapfile..."
fallocate -l "$SwapSize" "$SwapFile"
chmod 0600 "$SwapFile"
mkswap "$SwapFile"
swapon "$SwapFile"
echo "/swapfile none swap sw 0 0" >> /mnt/gentoo/etc/fstab
fi

echo "gein: Copying '/etc/resolv.conf'..." &&
cp -L /etc/resolv.conf /mnt/gentoo/etc/
echo "gein: Chroot'ing into /mnt/gentoo..." &&
chroot /mnt/gentoo /usr/bin/env -i \
HOME="/root" TERM="$TERM" PS1="[chroot \u@\h \W]$ " \
PATH="/usr/local/sbin/:/usr/local/bin:/usr/sbin" \
PATH="$PATH:/usr/bin:/sbin:/bin:/opt/bin" \
MANPATH="/usr/man:/usr/share/man:/usr/local/man" \
MANPATH="$MANPATH:/usr/local/share/man" \
/bin/bash --login
echo "gein: Copying '/etc/resolv.conf'..."
cp -L /etc/resolv.conf /mnt/gentoo/etc/
echo "gein: Chroot'ing into /mnt/gentoo..."
chroot /mnt/gentoo /usr/bin/env -i \
HOME="/root" TERM="$TERM" PS1="[chroot \u@\h \W]$ " \
PATH="/usr/local/sbin/:/usr/local/bin:/usr/sbin" \
PATH="$PATH:/usr/bin:/sbin:/bin:/opt/bin" \
MANPATH="/usr/man:/usr/share/man:/usr/local/man" \
MANPATH="$MANPATH:/usr/local/share/man" \
/bin/bash --login
}


# In this section we will update various configuration files, select the
# desired profile, compile the kernel, and install some basic packages.

MINIMAL() {
echo "gein: Setting CPU cores and GPU type..." &&
sed -i "s/Video_Cards/$VideoCards/g; s/Make_Opts/-j$CPUCores/g" \
/etc/portage/make.conf

echo "gein: Syncing Portage and selecting profile..." &&
emerge -q --sync &&
eselect profile list | grep -Evi "dev|exp"

echo "gein: choose the latest stable release" &&
TargetProfile="" &&
while [ -z "$TargetProfile" ]; do
read -ep "Which profile?: " TargetProfile
done &&
eselect profile set "$TargetProfile" &&
$Emerge -uDN @world

echo "gein: Setting timezone..." &&
echo "$TimeZone" > /etc/timezone &&
$Emerge --config sys-libs/timezone-data

echo "gein: Setting locale..." &&
echo "$Locale" > /etc/locale.gen &&
locale-gen && locale -a &&
LocaleMain=$(echo $Locale | awk -F '[-]' '{print $1}') &&
LocaleSet=$(eselect locale list | grep -i $LocaleMain | \
awk -F '[][]' '{print $2}') &&
eselect locale set $LocaleSet &&
env-update && source /etc/profile &&
export PS1="[chroot \u@\h \W]$ "

echo "gein: Emerging minimal packages..." &&
$Emerge @gein-base
BASE() {
CONFIG

echo "gein: Setting CPU cores and GPU type..."
sed -i "s/Video_Cards/$VideoCards/g; s/Make_Opts/-j$CPUCores/g" \
/etc/portage/make.conf

echo "gein: Syncing Portage and selecting profile..."
emerge -q --sync
eselect profile list | grep -Evi "dev|exp"

echo "gein: choose the latest stable release"
TargetProfile=""
while [ -z "$TargetProfile" ]; do
read -ep "Which profile?: " TargetProfile
done
eselect profile set "$TargetProfile"
$Emerge -uDN @world

echo "gein: Setting timezone..."
echo "$TimeZone" > /etc/timezone
$Emerge --config sys-libs/timezone-data

echo "gein: Setting locale..."
echo "$Locale" > /etc/locale.gen
locale-gen
L=$(echo $Locale | awk -F '[-]' '{print $1}')
LSet=$(eselect locale list|grep -i $L|awk -F '[][]' '{print $2}')
eselect locale set $LSet
env-update && source /etc/profile
export PS1="[chroot \u@\h \W]$ "

echo "gein: Emerging base system packages..."
$Emerge @gein-base

if grep -Rqi 'intel' /proc/cpuinfo; then
echo "gein: emerging intel-microcode" &&
$Emerge intel-microcode
echo "gein: Emerging intel-microcode"
$Emerge intel-microcode
fi

echo "gein: Configuring Linux kernel..."
@@ -316,32 +322,31 @@ MINIMAL() {
fi
elif [ "$AutoKernel" = "false" ]; then
if [ -z "$KernelConfig" ]; then
make defconfig &&
make menuconfig
make defconfig
make menuconfig
else
$Wget "$KernelConfig" -O /usr/src/linux/.config &&
make menuconfig
$Wget "$KernelConfig" -O /usr/src/linux/.config
make menuconfig
fi
else
echo "gein: Error: AutoKernel isn't true or false. Exiting..."
fi

echo "gein: Compiling Linux kernel and modules..." &&
$Make && $Make modules &&
$Make install && $Make modules install &&
$Make distclean &&
cd /
echo "gein: Compiling Linux kernel and modules..."
$Make && $Make modules && $Make install && $Make modules install
$Make distclean
cd /

echo "gein: Adding services to OpenRC..." &&
rc-update add dhcpcd default &&
rc-update add cronie default
echo "gein: Adding services to OpenRC..."
rc-update add dhcpcd default
rc-update add cronie default

echo "gein: Setting hostname..." &&
echo "hostname=$Hostname" > /etc/conf.d/hostname
echo "gein: Setting hostname..."
echo "hostname=$Hostname" > /etc/conf.d/hostname

echo "gein: Installing Grub to $PartitionBoot..." &&
grub-install "$PartitionBoot" &&
grub-mkconfig -o /boot/grub/grub.cfg
echo "gein: Installing Grub to $PartitionBoot..."
grub-install "$PartitionBoot"
grub-mkconfig -o /boot/grub/grub.cfg
}


@@ -350,13 +355,26 @@ MINIMAL() {
# as a convenience.

DESKTOP() {
echo "gein: Installing Xorg drivers..." &&
$Emerge x11-base/xorg-drivers &&
env-update && source /etc/profile &&
export PS1="[chroot \u@\h \W]$ "

echo "gein: Installing desktop packages..." &&
$Emerge @gein-base "$DesktopChoice"
echo "gein: Enabling X in '/etc/portage/package.use/defaults'..."
sed -i '2,$s/^# //g' /etc/portage/package.use/defaults

echo "gein: Installing Xorg drivers..."
$Emerge x11-base/xorg-drivers
env-update && source /etc/profile
export PS1="[chroot \u@\h \W]$ "

echo "gein: Installing desktop packages..."
$Emerge "$DesktopChoice"

if echo "$DesktopChoice" | grep -iq "^y"; then
echo "azryn: Set SDDM as the display manager"
sed -i 's/DISPLAYMANAGER="xdm"/DISPLAYMANAGER="sddm"/g' \
/etc/conf.d/xdm
sed -i 's/startl|xqt/"ck-launch-session dbus-launch startlxqt"/g' \
/usr/share/xsessions/lxqt.desktop
rc-update add xdm default
rc-update add dbus default
fi

read -ep "gein: Install laptop packages? [Y/N]: " SetupUser
if echo "$SetupUser" | grep -iq "^y"; then
@@ -380,11 +398,11 @@ POSTINSTALL() {

read -ep "gein: Setup a standard user? [Y/N]: " SetupUser
if echo "$SetupUser" | grep -iq "^y"; then
echo "gein: Creating user account" &&
read -ep "Username: " Username &&
useradd -m -G wheel,audio,video \
-s /bin/bash "$Username" &&
passwd $Username
echo "gein: Creating user account"
read -ep "Username: " Username
useradd -m -G wheel,audio,video \
-s /bin/bash "$Username"
passwd $Username
fi

echo "gein: Installation complete."
@@ -397,65 +415,20 @@ POSTINSTALL() {

shopt -s nocasematch
case $1 in
-b|bootstrap)
BOOTSTRAP
;;

-m|minimal)
CONFIG
MINIMAL
POSTINSTALL
;;

-d|desktop)
case $2 in
i3wm)
DesktopChoice="@gein-i3wm"
sed -i '2,$s/^# //g' /etc/portage/package.use/defaults

CONFIG
MINIMAL
DESKTOP
POSTINSTALL
;;

lxqt)
DesktopChoice="@gein-lxqt"
sed -i '2,$s/^# //g' /etc/portage/package.use/defaults

CONFIG
MINIMAL
DESKTOP

echo "azryn: Set SDDM as the display manager" &&
sed -i 's/DISPLAYMANAGER="xdm"/DISPLAYMANAGER="sddm"/g' \
/etc/conf.d/xdm &&
sed -i 's/startl|xqt/"ck-launch-session dbus-launch startlxqt"/g' \
/usr/share/xsessions/lxqt.desktop &&
rc-update add xdm default &&
rc-update add dbus default

POSTINSTALL
;;

*)
echo "gein: $2 not an available desktop"
echo ""
echo "Available desktops:"
echo " i3wm A complete i3wm desktop"
echo " lxqt A complete LXQT desktop"
esac
;;
bootstrap) BOOTSTRAP ;;
base) BASE && POSTINSTALL;;
minimal) DesktopChoice="@gein-i3wm"
BASE && DESKTOP && POSTINSTALL;;
complete) DesktopChoice="@gein-lxqt"
BASE && DESKTOP && POSTINSTALL;;

*)
echo "gein: Linux-based derivative of Gentoo"
echo " -h, help Shows this output"
echo " -b, bootstrap Bootstrap the stage3 tarball"
echo " bootstrap Bootstrap the stage3 tarball"
echo ""
echo "Post-bootstrap:"
echo " -m, minimal Perform a basic Gentoo installation"
echo " -d, desktop Install a gein desktop"
echo " i3wm A complete i3wm desktop"
echo " lxqt A complete LXQT desktop"
echo " base Basic headless server & development"
echo " minimal X, i3wm, and base packages"
echo " complete A complete LXQT Gentoo desktop"
esac
shopt -u nocasematch

Loading…
Cancel
Save