Gentoo Archives: gentoo-user

From: Hans <linux@××××××××××××××.au>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: Minimal (fast and cool)
Date: Tue, 04 Feb 2014 07:05:27
Message-Id: lcpp66$137$1@ger.gmane.org
In Reply to: [gentoo-user] Minimal (fast and cool) by James
1 On 29/01/14 02:06, James wrote:
2 > I'm interested in aggregating tips, tricks, ebuild suggestions and config
3 > file snippets and examples, related to going minimal on your system,
4 > regardless if your system in resource constrained or not. The benefit
5 > is not limited to resource constrained systems.
6 >
7 > The idea is when a person ditches KDE (or other bloated environments?)
8 > they can look at a single gentoo-specific document to get a list of
9 > addtional ebuilds and config files to install resulting in but one possible
10 > fast, cool, feature-rich minimal environment. with a mininmal of setup time
11 > and effort.
12 >
13 > If you are uncomfortable posting here, just drop me some private
14 > email.
15 >
16 > TIA,
17 > James
18 >
19 >
20 >
21 # These instructions are for installing Gentoo on Oracle VirtualBox with
22 # Oracle VirtualBox Extentions installed on the host PC.
23 # I allocate 1GB during intallation and change to 512KB after competing
24 the installation.
25 # I can still work with 255 KB but slow.
26
27 # My local setup is a LAN with several Linux and Win$ boxes with fixed
28 IP addresses.
29 # My local domain name: "itw.lan"
30 # My Gentoo VM FQDN: "gentoo.itw.lan"
31 # IP address: 192.168.0.32
32 # Nameserver-1: 192.168.0.2
33 # Nameserver-2: 192.168.0.1 (my Router has a very basic build in Name
34 Server.)
35 # Route: 192.168.0.1
36 # Locale Australia/Brisbane
37
38 # Change these at the approbriate places in below text to yours.
39
40 # The text without "#" in front are commands to be entered or copied into
41 # the terminal followed by hitting the Enter Key.
42
43
44 # Preparation:
45 # Download Gentoo Install CD from:
46 #
47 distfiles.gentoo.org/releases/amd64/autobuilds/current-iso/install-amd64-minimal-20140130.iso
48
49 # Configure a Gentoo x86_64 virtual maschine to boot with Gentoo CD.iso
50 as CD Drive,
51 # a virtual 30GB dard drive and Network Adapter as "Bridged Adapter ".
52
53 # Boot your new virtual maschine with kernel option "net.ifnames=0".
54
55 ## type on Gentoo Installer Screen
56 ifconfig
57 # write down the IP address and name of your ethernet card like "eth0"
58
59 net-setup eth0 #For manual setup if your Router does not have a DHCP
60 server.
61
62 # Create a password for ssh access.
63 passwd
64 abc123
65 abc123
66
67 time /etc/init.d/sshd start
68 ping -c 3 google.com
69
70 # This completes configiration of the installation system for ssh access
71 from a second PC.
72
73 # --------------------------------------------
74
75 # Open a terminal on your second or Host PC and log by ssh into Gentoo
76 ssh root@××××××××××.lan
77 abc123
78
79
80 # Manally, step by step partition your Hard drive with these keybord
81 commands:
82 # If you make a mistake, exit fdisk by 'q' and start again.
83
84 fdisk /dev/sda
85 n
86 p
87 1
88 (Enter)
89 +500M
90 n
91 e
92 2
93 (Enter)
94 (Enter)
95 n
96 l
97 (Enter)
98 +2G
99 (Enter)
100 t
101 5
102 82
103 n
104 l
105 (Enter)
106 +20G
107 n
108 l
109 (Enter)
110 (Enter)
111 a
112 1
113 p
114 w
115 # DONE!
116
117 # ----------------------------------------------
118 # Now proceed by copying below texts to your terminal followed by Enter.
119 # You can copy line by line, section by section or several saections at
120 a time
121 #-----------------------------------------------
122
123
124 # Create the File System:
125 mkfs.ext4 /dev/sda1
126 mkfs.ext4 /dev/sda6
127 mkfs.ext4 /dev/sda7
128 mkswap /dev/sda5
129 swapon /dev/sda5
130
131 # Mount the Filesystem:
132 mount /dev/sda6 /mnt/gentoo
133 mkdir /mnt/gentoo/boot
134 mkdir /mnt/gentoo/home
135 mount /dev/sda1 /mnt/gentoo/boot
136 mount /dev/sda7 /mnt/gentoo/home
137
138 # Check the date
139 date
140
141 # Get Gentoo files from the internet
142 cd /mnt/gentoo
143 links http://www.gentoo.org/main/en/mirrors.xml
144 # Select and download stage3....tar.bz2
145 ls -l
146 tar xvjpf stage3-*.tar.bz2
147
148 # Change Root
149 mount -t proc none /mnt/gentoo/proc
150 mount --rbind /sys /mnt/gentoo/sys
151 mount --rbind /dev /mnt/gentoo/dev
152 chroot /mnt/gentoo /bin/bash
153 source /etc/profile
154 export PS1="gentoo.itw.lan $PS1"
155
156 #Set root Password
157 passwd root
158 abc123
159 abc123
160
161 # Configure make.conf:
162 echo "CFLAGS=\"-O2 -march=native -pipe\"" > /etc/portage/make.conf
163 echo "CXXFLAGS=\"${CFLAGS}\"" >> /etc/portage/make.conf
164
165 # Change "-j5" to the numbe rof your processors plus 1.
166 echo "MAKEOPTS=\"-j2\"" >> /etc/portage/make.conf
167
168 echo "FEATURES=\"-preserve-libs\"" >> /etc/portage/make.conf
169 echo "CHOST=\"x86_64-pc-linux-gnu\"" >> /etc/portage/make.cof
170 echo "ACCEPT_KEYWORDS=\"amd64\"" >> /etc/portage/make.conf
171 echo "ACCEPT_LICENSE=\"*\"" >> /etc/portage/make.conf
172 echo "LINGUAS=\"en\"" >> /etc/portage/make.conf
173 echo "INPUT_DEVISES=\"evdev virtualbox\"" >> /etc/portage/make.conf
174 echo "VIDEO_CARDS=\"vesa\"" >> /etc/portage/make.conf
175 echo "USE_PYTHON=\"2.7\"" >> /etc/portage/make.conf
176 echo "PYTHON_TARGETS=\"python2_7\"" >> /etc/portage/make.conf
177
178 # change "http://ftp.swin.edu.au/gentoo\" to you mirror
179 echo "GENTOO_MIRRORS=\"http://ftp.swin.edu.au/gentoo\"" >>
180 /etc/portage/make.conf
181
182 # change "rsync://rsync1.au.gentoo.org/gentoo-portage\"
183 echo "SYNC=\"rsync://rsync1.au.gentoo.org/gentoo-portage\"" >>
184 /etc/portage/make.conf
185
186 # Create package.* files
187 echo "### package.keywords ###" > /etc/portage/package.keywords
188 echo "### package.unmask ###" > /etc/portage/package.unmask
189 echo "### package.mask ###" > /etc/portage/package.mask
190
191 # Select Timezone
192 emerge --config sys-libs/timezone-data
193
194 # Replace "Australia/Brisbane" with your Timezone and Location
195 cp /usr/share/zoneinfo/Australia/Brisbane /etc/localtime
196 echo "Australia/Brisbane" > /etc/timezone
197 date
198
199 # Copy DNS information
200 # Replace "itw.lan" with your domain name
201 echo "domain itw.lan" > /etc/resolv.conf
202 echo "nameserver 192.168.0.2" >> /etc/resolv.conf
203 echo "nameserver 192.168.0.1" >> /etc/resolv.conf
204
205 # Configure Portage
206 emerge-webrsync
207 emerge --sync
208 emerge --oneshot portage
209
210 # Read IMPORTANT News
211 eselect news read
212
213 # Select Profile. We list and use Desktop (3) or Gnome (4)
214 eselect profile list
215
216 # for Xfce Desktop
217 # eselect profile set 3
218
219 echo "### package.use ###" >> /etc/portage/package.use
220 echo "dev-util/cmake -qt4" >> /etc/portage/package.use
221 echo "app-text/poppler -qt4" >> /etc/portage/package.use
222 echo "x11-base/xorg-server udev" >> /etc/portage/package.use
223 echo "gnome-base/gvfs -http" >> /etc/portage/package.use
224
225 # If you use Samba:
226 echo "net-fs/samba swat" >> /etc/portage/package.use
227 echo "xfce-base/thunar gvfs samba" >> /etc/portage/package.use
228
229 # You may have to change the version numbers.
230 echo ">=media-libs/gd-2.0.35-r3 fontconfig" >> /etc/portage/package.use
231 echo "=dev-lang/python-2.7.5-r3 sqlite" >> /etc/portage/package.use
232
233 echo "### package.keywords ###" >> /etc/portage/package.keywords
234 # required by net-dns/dnssec-tools-2.0-r1
235 # required by app-admin/webmin-1.660
236 # required by webmin (argument)
237 echo "=dev-perl/Getopt-GUI-Long-0.930.0 ~amd64" >>
238 /etc/portage/package.keywords
239
240 echo "# required by webmin (argument)" >> /etc/portage/package.keywords
241 echo "=app-admin/webmin-1.660 ~amd64" >> /etc/portage/package.keywords
242
243 echo "# required by app-admin/webmin-1.660" >> /etc/portage/package.keywords
244 echo "# required by webmin (argument)" >> /etc/portage/package.keywords
245 echo "=dev-perl/Authen-Libwrap-0.220.0 ~amd64" >>
246 /etc/portage/package.keywords
247
248 echo "# required by app-admin/webmin-1.660" >> /etc/portage/package.keywords
249 echo "# required by webmin (argument)" >> /etc/portage/package.keywords
250 echo "=net-dns/dnssec-tools-2.0-r1 ~amd64" >> /etc/portage/package.keywords
251
252 # Specify your locale. (change to yours)
253 echo "en_AU ISO-8859-1" >> /etc/locale.gen
254 echo "en_AU.UTF-8 UTF-8" >> /etc/locale.gen
255 locale-gen
256 echo "LANG=\"en_AU.UTF-8\"" > /etc/env.d/02locale
257 echo "LC_COLLATE=\"C\"" >> /etc/env.d/02locale
258 env-update && source /etc/profile
259
260 # Install Kernel Sources
261 emerge gentoo-sources
262 ls -l /usr/src/linux
263
264 # Use General Kernel and/or modify Kernel Configuration
265 emerge genkernel
266 genkernel all
267
268 # Verify Kernel installation
269 ls /boot/kernel* /boot/initramfs*
270
271 # Create /etc/fstab
272 # nano -w /etc/fstab
273 echo "# <fs> <mountpoint> <type> <opts>
274 <dump/pass>" > /etc/fstab
275 echo "/dev/sda1 /boot ext4 noauto,noatime 1 2" >>
276 /etc/fstab
277 echo "/dev/sda6 / ext4 noatime 0 1" >>
278 /etc/fstab
279 echo "/dev/sda7 /home ext4 noatime 0 2" >>
280 /etc/fstab
281 echo "/dev/sda5 none swap sw 0 0" >>
282 /etc/fstab
283 echo "/dev/cdrom /mnt/cdrom auto noauto,ro 0 0" >>
284 /etc/fstab
285 echo "# /dev/fd0 /mnt/floppy auto noauto 0 0" >>
286 /etc/fstab
287
288 # Configure networking
289 cd /etc/conf.d
290 echo 'hostname="gentoo"' > hostname
291 hostname gentoo
292 hostname -f
293
294 # Change 192.168.0.32 to your fixed IP address previously written down
295 echo 'config_eth0="192.168.0.32 netmask 255.255.255.0 brd
296 192.168.0.255"' > net
297 echo 'routes_eth0="default via 192.168.0.1"' >> net
298
299 # Adding net.eth0 to the default runlevel
300 cd /etc/init.d
301 ln -s net.lo net.eth0
302 rc-update add net.eth0 default
303
304 # Filling in the networking information
305 cd /etc
306 echo "127.0.0.1 gentoo.itw.lan gentoo localhost" > /etc/hosts
307
308 # Change 192.168.0.32 to your fixed IP address previously written down
309 echo "192.168.0.32 gentoo.itw.lan gentoo" >> /etc/hosts
310
311 # Setting the root password
312 passwd
313 abc123
314 abc123
315
316 # Install a syslogger, a cron daemon, mc and sshd
317 emerge syslog-ng vixie-cron
318 rc-update add syslog-ng default
319 rc-update add vixie-cron default
320 rc-update add sshd default
321 env-update && source /etc/profile
322
323 emerge mlocate
324 emerge app-misc/mc
325 emerge gentoolkit
326 emerge app-admin/eclean-kernel
327 emerge app-portage/diffmask
328 emerge app-portage/flaggie
329 emerge app-portage/install-mask
330 emerge app-portage/portpeek
331 emerge app-portage/smart-live-rebuild
332
333 # Emerge grub and edit its configuration file
334 emerge grub
335 mkdir /boot/grub
336 ls -l /boot/*
337 # Write down the kernel and initramfs full file names and versions
338 # nano -w /boot/grub/grub.conf
339 echo "default 0" > /boot/grub/grub.conf
340 echo "timeout 10" >> /boot/grub/grub.conf
341 echo "" >> /boot/grub/grub.conf
342
343 # Change "3.10.17" to your kernel version
344 echo "title Gentoo Linux 3.10.17" >> /boot/grub/grub.conf
345 echo "root (hd0,0)" >> /boot/grub/grub.conf
346
347 # Change the kernel and initramfs filenames to your full name and versions
348 echo "kernel /boot/kernel-genkernel-x86_64-3.10.17-gentoo net.ifnames=0
349 root=/dev/ram0 real_root=/dev/sda6" >> /boot/grub/grub.conf
350 echo "initrd /boot/initramfs-genkernel-x86_64-3.10.17-gentoo" >>
351 /boot/grub/grub.conf
352 echo "" >> /boot/grub/grub.conf
353
354 # Install grub
355 grub --no-floppy
356 # grub> root (hd0,0)
357 # grub> setup (hd0)
358 # grub> quit
359
360 # Add your username
361 useradd -m -G users,wheel,audio,CD -s /bin/bash username
362 passwd
363 abc123
364 abc123
365
366 # Poweroff
367 exit
368 umount -l /mnt/gentoo/dev{/shm,/pts,}
369 umount -l /mnt/gentoo{/proc,/boot,/home,/sys,}
370 poweroff
371
372 # ----------------------------------------
373 # End of basic installation
374 # ----------------------------------------
375
376 # Remove the Gentoo CD
377
378
379 # This completes the installation of the Base System.
380 # Boot your Gentoo VM, log in with your username, ping google.com to
381 verify that it works.
382 # Then login as root from your workstation terminal.
383
384 Change directory to /
385 cd /
386
387 # Install X
388 emerge xorg-server
389 env-update
390 source /etc/profile
391
392 # Install Xfce
393 emerge xfce
394 env-update && source /etc/profile
395 /etc/init.d/dbus start
396 rc-update add dbus default
397 rc-update add xdm default
398
399 # Editing /etc/conf.d/xdm
400 nano -wc /etc/conf.d/xdm
401 DISPLAYMANAGER="slim"
402
403 # Optionally install Samba
404 emerge net-fs/samba
405 emerge net-print/hplip
406
407 #-------------------------------------
408 # End of Xfce installation
409 # ------------------------------------
410
411
412 reboot
413
414 # if all is well, you should now see the Slim login screen
415 # Login as root
416 # emerge your favorite Xfce and other applications like:
417 # porthole
418 # leafpad
419 # midori
420 # claws mail
421 # webmin
422 # avoid Gnome and KDE applications. They pull in tons of dependencies
423
424 # Happy computing!