* [gentoo-user] Re: Minimal (fast and cool)
2014-01-28 16:06 [gentoo-user] Minimal (fast and cool) James
@ 2014-02-04 4:09 ` Hans
0 siblings, 0 replies; 2+ messages in thread
From: Hans @ 2014-02-04 4:09 UTC (permalink / raw
To: gentoo-user
On 29/01/14 02:06, James wrote:
> I'm interested in aggregating tips, tricks, ebuild suggestions and config
> file snippets and examples, related to going minimal on your system,
> regardless if your system in resource constrained or not. The benefit
> is not limited to resource constrained systems.
>
> The idea is when a person ditches KDE (or other bloated environments?)
> they can look at a single gentoo-specific document to get a list of
> addtional ebuilds and config files to install resulting in but one possible
> fast, cool, feature-rich minimal environment. with a mininmal of setup time
> and effort.
>
> If you are uncomfortable posting here, just drop me some private
> email.
>
> TIA,
> James
>
>
>
# These instructions are for installing Gentoo on Oracle VirtualBox with
# Oracle VirtualBox Extentions installed on the host PC.
# I allocate 1GB during intallation and change to 512KB after competing
the installation.
# I can still work with 255 KB but slow.
# My local setup is a LAN with several Linux and Win$ boxes with fixed
IP addresses.
# My local domain name: "itw.lan"
# My Gentoo VM FQDN: "gentoo.itw.lan"
# IP address: 192.168.0.32
# Nameserver-1: 192.168.0.2
# Nameserver-2: 192.168.0.1 (my Router has a very basic build in Name
Server.)
# Route: 192.168.0.1
# Locale Australia/Brisbane
# Change these at the approbriate places in below text to yours.
# The text without "#" in front are commands to be entered or copied into
# the terminal followed by hitting the Enter Key.
# Preparation:
# Download Gentoo Install CD from:
#
distfiles.gentoo.org/releases/amd64/autobuilds/current-iso/install-amd64-minimal-20140130.iso
# Configure a Gentoo x86_64 virtual maschine to boot with Gentoo CD.iso
as CD Drive,
# a virtual 30GB dard drive and Network Adapter as "Bridged Adapter ".
# Boot your new virtual maschine with kernel option "net.ifnames=0".
## type on Gentoo Installer Screen
ifconfig
# write down the IP address and name of your ethernet card like "eth0"
net-setup eth0 #For manual setup if your Router does not have a DHCP
server.
# Create a password for ssh access.
passwd
abc123
abc123
time /etc/init.d/sshd start
ping -c 3 google.com
# This completes configiration of the installation system for ssh access
from a second PC.
# --------------------------------------------
# Open a terminal on your second or Host PC and log by ssh into Gentoo
ssh root@gentoo.itw.lan
abc123
# Manally, step by step partition your Hard drive with these keybord
commands:
# If you make a mistake, exit fdisk by 'q' and start again.
fdisk /dev/sda
n
p
1
(Enter)
+500M
n
e
2
(Enter)
(Enter)
n
l
(Enter)
+2G
(Enter)
t
5
82
n
l
(Enter)
+20G
n
l
(Enter)
(Enter)
a
1
p
w
# DONE!
# ----------------------------------------------
# Now proceed by copying below texts to your terminal followed by Enter.
# You can copy line by line, section by section or several saections at
a time
#-----------------------------------------------
# Create the File System:
mkfs.ext4 /dev/sda1
mkfs.ext4 /dev/sda6
mkfs.ext4 /dev/sda7
mkswap /dev/sda5
swapon /dev/sda5
# Mount the Filesystem:
mount /dev/sda6 /mnt/gentoo
mkdir /mnt/gentoo/boot
mkdir /mnt/gentoo/home
mount /dev/sda1 /mnt/gentoo/boot
mount /dev/sda7 /mnt/gentoo/home
# Check the date
date
# Get Gentoo files from the internet
cd /mnt/gentoo
links http://www.gentoo.org/main/en/mirrors.xml
# Select and download stage3....tar.bz2
ls -l
tar xvjpf stage3-*.tar.bz2
# Change Root
mount -t proc none /mnt/gentoo/proc
mount --rbind /sys /mnt/gentoo/sys
mount --rbind /dev /mnt/gentoo/dev
chroot /mnt/gentoo /bin/bash
source /etc/profile
export PS1="gentoo.itw.lan $PS1"
#Set root Password
passwd root
abc123
abc123
# Configure make.conf:
echo "CFLAGS=\"-O2 -march=native -pipe\"" > /etc/portage/make.conf
echo "CXXFLAGS=\"${CFLAGS}\"" >> /etc/portage/make.conf
# Change "-j5" to the numbe rof your processors plus 1.
echo "MAKEOPTS=\"-j2\"" >> /etc/portage/make.conf
echo "FEATURES=\"-preserve-libs\"" >> /etc/portage/make.conf
echo "CHOST=\"x86_64-pc-linux-gnu\"" >> /etc/portage/make.cof
echo "ACCEPT_KEYWORDS=\"amd64\"" >> /etc/portage/make.conf
echo "ACCEPT_LICENSE=\"*\"" >> /etc/portage/make.conf
echo "LINGUAS=\"en\"" >> /etc/portage/make.conf
echo "INPUT_DEVISES=\"evdev virtualbox\"" >> /etc/portage/make.conf
echo "VIDEO_CARDS=\"vesa\"" >> /etc/portage/make.conf
echo "USE_PYTHON=\"2.7\"" >> /etc/portage/make.conf
echo "PYTHON_TARGETS=\"python2_7\"" >> /etc/portage/make.conf
# change "http://ftp.swin.edu.au/gentoo\" to you mirror
echo "GENTOO_MIRRORS=\"http://ftp.swin.edu.au/gentoo\"" >>
/etc/portage/make.conf
# change "rsync://rsync1.au.gentoo.org/gentoo-portage\"
echo "SYNC=\"rsync://rsync1.au.gentoo.org/gentoo-portage\"" >>
/etc/portage/make.conf
# Create package.* files
echo "### package.keywords ###" > /etc/portage/package.keywords
echo "### package.unmask ###" > /etc/portage/package.unmask
echo "### package.mask ###" > /etc/portage/package.mask
# Select Timezone
emerge --config sys-libs/timezone-data
# Replace "Australia/Brisbane" with your Timezone and Location
cp /usr/share/zoneinfo/Australia/Brisbane /etc/localtime
echo "Australia/Brisbane" > /etc/timezone
date
# Copy DNS information
# Replace "itw.lan" with your domain name
echo "domain itw.lan" > /etc/resolv.conf
echo "nameserver 192.168.0.2" >> /etc/resolv.conf
echo "nameserver 192.168.0.1" >> /etc/resolv.conf
# Configure Portage
emerge-webrsync
emerge --sync
emerge --oneshot portage
# Read IMPORTANT News
eselect news read
# Select Profile. We list and use Desktop (3) or Gnome (4)
eselect profile list
# for Xfce Desktop
# eselect profile set 3
echo "### package.use ###" >> /etc/portage/package.use
echo "dev-util/cmake -qt4" >> /etc/portage/package.use
echo "app-text/poppler -qt4" >> /etc/portage/package.use
echo "x11-base/xorg-server udev" >> /etc/portage/package.use
echo "gnome-base/gvfs -http" >> /etc/portage/package.use
# If you use Samba:
echo "net-fs/samba swat" >> /etc/portage/package.use
echo "xfce-base/thunar gvfs samba" >> /etc/portage/package.use
# You may have to change the version numbers.
echo ">=media-libs/gd-2.0.35-r3 fontconfig" >> /etc/portage/package.use
echo "=dev-lang/python-2.7.5-r3 sqlite" >> /etc/portage/package.use
echo "### package.keywords ###" >> /etc/portage/package.keywords
# required by net-dns/dnssec-tools-2.0-r1
# required by app-admin/webmin-1.660
# required by webmin (argument)
echo "=dev-perl/Getopt-GUI-Long-0.930.0 ~amd64" >>
/etc/portage/package.keywords
echo "# required by webmin (argument)" >> /etc/portage/package.keywords
echo "=app-admin/webmin-1.660 ~amd64" >> /etc/portage/package.keywords
echo "# required by app-admin/webmin-1.660" >> /etc/portage/package.keywords
echo "# required by webmin (argument)" >> /etc/portage/package.keywords
echo "=dev-perl/Authen-Libwrap-0.220.0 ~amd64" >>
/etc/portage/package.keywords
echo "# required by app-admin/webmin-1.660" >> /etc/portage/package.keywords
echo "# required by webmin (argument)" >> /etc/portage/package.keywords
echo "=net-dns/dnssec-tools-2.0-r1 ~amd64" >> /etc/portage/package.keywords
# Specify your locale. (change to yours)
echo "en_AU ISO-8859-1" >> /etc/locale.gen
echo "en_AU.UTF-8 UTF-8" >> /etc/locale.gen
locale-gen
echo "LANG=\"en_AU.UTF-8\"" > /etc/env.d/02locale
echo "LC_COLLATE=\"C\"" >> /etc/env.d/02locale
env-update && source /etc/profile
# Install Kernel Sources
emerge gentoo-sources
ls -l /usr/src/linux
# Use General Kernel and/or modify Kernel Configuration
emerge genkernel
genkernel all
# Verify Kernel installation
ls /boot/kernel* /boot/initramfs*
# Create /etc/fstab
# nano -w /etc/fstab
echo "# <fs> <mountpoint> <type> <opts>
<dump/pass>" > /etc/fstab
echo "/dev/sda1 /boot ext4 noauto,noatime 1 2" >>
/etc/fstab
echo "/dev/sda6 / ext4 noatime 0 1" >>
/etc/fstab
echo "/dev/sda7 /home ext4 noatime 0 2" >>
/etc/fstab
echo "/dev/sda5 none swap sw 0 0" >>
/etc/fstab
echo "/dev/cdrom /mnt/cdrom auto noauto,ro 0 0" >>
/etc/fstab
echo "# /dev/fd0 /mnt/floppy auto noauto 0 0" >>
/etc/fstab
# Configure networking
cd /etc/conf.d
echo 'hostname="gentoo"' > hostname
hostname gentoo
hostname -f
# Change 192.168.0.32 to your fixed IP address previously written down
echo 'config_eth0="192.168.0.32 netmask 255.255.255.0 brd
192.168.0.255"' > net
echo 'routes_eth0="default via 192.168.0.1"' >> net
# Adding net.eth0 to the default runlevel
cd /etc/init.d
ln -s net.lo net.eth0
rc-update add net.eth0 default
# Filling in the networking information
cd /etc
echo "127.0.0.1 gentoo.itw.lan gentoo localhost" > /etc/hosts
# Change 192.168.0.32 to your fixed IP address previously written down
echo "192.168.0.32 gentoo.itw.lan gentoo" >> /etc/hosts
# Setting the root password
passwd
abc123
abc123
# Install a syslogger, a cron daemon, mc and sshd
emerge syslog-ng vixie-cron
rc-update add syslog-ng default
rc-update add vixie-cron default
rc-update add sshd default
env-update && source /etc/profile
emerge mlocate
emerge app-misc/mc
emerge gentoolkit
emerge app-admin/eclean-kernel
emerge app-portage/diffmask
emerge app-portage/flaggie
emerge app-portage/install-mask
emerge app-portage/portpeek
emerge app-portage/smart-live-rebuild
# Emerge grub and edit its configuration file
emerge grub
mkdir /boot/grub
ls -l /boot/*
# Write down the kernel and initramfs full file names and versions
# nano -w /boot/grub/grub.conf
echo "default 0" > /boot/grub/grub.conf
echo "timeout 10" >> /boot/grub/grub.conf
echo "" >> /boot/grub/grub.conf
# Change "3.10.17" to your kernel version
echo "title Gentoo Linux 3.10.17" >> /boot/grub/grub.conf
echo "root (hd0,0)" >> /boot/grub/grub.conf
# Change the kernel and initramfs filenames to your full name and versions
echo "kernel /boot/kernel-genkernel-x86_64-3.10.17-gentoo net.ifnames=0
root=/dev/ram0 real_root=/dev/sda6" >> /boot/grub/grub.conf
echo "initrd /boot/initramfs-genkernel-x86_64-3.10.17-gentoo" >>
/boot/grub/grub.conf
echo "" >> /boot/grub/grub.conf
# Install grub
grub --no-floppy
# grub> root (hd0,0)
# grub> setup (hd0)
# grub> quit
# Add your username
useradd -m -G users,wheel,audio,CD -s /bin/bash username
passwd
abc123
abc123
# Poweroff
exit
umount -l /mnt/gentoo/dev{/shm,/pts,}
umount -l /mnt/gentoo{/proc,/boot,/home,/sys,}
poweroff
# ----------------------------------------
# End of basic installation
# ----------------------------------------
# Remove the Gentoo CD
# This completes the installation of the Base System.
# Boot your Gentoo VM, log in with your username, ping google.com to
verify that it works.
# Then login as root from your workstation terminal.
Change directory to /
cd /
# Install X
emerge xorg-server
env-update
source /etc/profile
# Install Xfce
emerge xfce
env-update && source /etc/profile
/etc/init.d/dbus start
rc-update add dbus default
rc-update add xdm default
# Editing /etc/conf.d/xdm
nano -wc /etc/conf.d/xdm
DISPLAYMANAGER="slim"
# Optionally install Samba
emerge net-fs/samba
emerge net-print/hplip
#-------------------------------------
# End of Xfce installation
# ------------------------------------
reboot
# if all is well, you should now see the Slim login screen
# Login as root
# emerge your favorite Xfce and other applications like:
# porthole
# leafpad
# midori
# claws mail
# webmin
# avoid Gnome and KDE applications. They pull in tons of dependencies
# Happy computing!
^ permalink raw reply [flat|nested] 2+ messages in thread