{"id":15,"date":"2009-12-15T03:17:52","date_gmt":"2009-12-15T03:17:52","guid":{"rendered":"http:\/\/cdblog.cdstealer.com\/?p=15"},"modified":"2023-05-29T15:50:01","modified_gmt":"2023-05-29T14:50:01","slug":"gentoo-install","status":"publish","type":"post","link":"https:\/\/cdblog.cdstealer.com\/?p=15","title":{"rendered":"Gentoo Install"},"content":{"rendered":"<p><a href=\"http:\/\/gentoo.org\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-307\" src=\"http:\/\/cdblog.cdstealer.com\/wp-content\/uploads\/2010\/12\/gblend-293x300.png\" alt=\"\" width=\"293\" height=\"300\" srcset=\"https:\/\/cdblog.cdstealer.com\/wp-content\/uploads\/2010\/12\/gblend-293x300.png 293w, https:\/\/cdblog.cdstealer.com\/wp-content\/uploads\/2010\/12\/gblend-1000x1024.png 1000w, https:\/\/cdblog.cdstealer.com\/wp-content\/uploads\/2010\/12\/gblend.png 1873w\" sizes=\"auto, (max-width: 293px) 100vw, 293px\" \/><\/a><\/p>\n<p><span style=\"color: #000000;\">You can download a minimal install iso from <a style=\"color: #000000;\" href=\"http:\/\/www.mirrorservice.org\/sites\/distfiles.gentoo.org\/releases\/amd64\/autobuilds\/current-stage3-amd64-nomultilib\/\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a><\/span><br \/>\n<span style=\"color: #000000;\">It is assumed that you have some knowledge of Linux and how hardware is detected.<\/span><\/p>\n<table style=\"text-align: left; width: 100%;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td bgcolor=\"#bbffbb\">'#' = Direct command<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#eeeeff\"><span style=\"color: #000000;\">Tips:* Once booted into the cd, press\u00a0CTRL, ALT &amp; F2 and enter<\/span><\/p>\n<p><span style=\"color: #000000;\">#\u00a0lspci<\/span><\/p>\n<p><span style=\"color: #000000;\">This lists your hardware, you may need to refer to this later.*<\/span><\/p>\n<p><span style=\"color: #000000;\">Research... Gentoo has a fantastic user community and documentation. \u00a0If you're using the <a style=\"color: #000000;\" title=\"Gentoo Live USB\" href=\"http:\/\/cdblog.cdstealer.com\/?p=7\" target=\"_blank\" rel=\"noopener noreferrer\">USB install<\/a>\u00a0the root is auto mounted under \/mnt\/cdrom.<\/span><\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#7a5ada\">Hard drive setup:-<\/td>\n<\/tr>\n<tr>\n<td># fdisk \/dev\/sda<\/p>\n<p>A typical filesystem layout I use is this on an 80Gb drive.<\/p>\n<p>Set partition 1 to +100M (boot)<br \/>\nSet partition 2 to +40G (root)<br \/>\nSet partition 3 to +30G (home)<br \/>\nSet partition 4 to the remainder (swap)<\/p>\n<p>Press \"t\", select partition 4 then enter code 82.<br \/>\nPress \"a\", select partition 1 then \"w\" to write changes.<\/p>\n<pre># mke2fs -L BOOTFS -t ext4 \/dev\/sda1\n# mke2fs -L ROOTFS -t ext4 \/dev\/sda2\n# mke2fs -L HOMEFS -t ext4 \/dev\/sda3\n# mkswap -L SWAPFS \/dev\/sda4\n# swapon \/dev\/sda4\n# mount -t ext4 \/dev\/sda2 \/mnt\/gentoo\n# mkdir \/mnt\/gentoo\/boot\n# mount \/dev\/sda1 \/mnt\/gentoo\/boot\n# cd \/mnt\/gentoo<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#7a5ada\">Stage &amp; Portage installation:-<\/td>\n<\/tr>\n<tr>\n<td># links http:\/\/www.gentoo.org\/main\/en\/mirrors.xml<br \/>\n(move the highlight bar to the desired URL and hit enter.)<br \/>\nMove to releases and hit enter.<br \/>\nSelect the correct arch (amd64.)<br \/>\nSelect releases<br \/>\nSelect your arch and hit enter. (amd64)<br \/>\nSelect autobuilds hit enter<br \/>\nSelect current-stage3-amd64-systemd<br \/>\nSelect the stage file. (stage3-amd64-systemd-YYYYMMDD.tar.bz2)<br \/>\nselect ok to save.<br \/>\nGo up 4 levels<br \/>\nSelect snapshots<br \/>\nSelect the most recent file. (portage-YYYYMMDD.tar.bz2)<br \/>\n# tar -xjpf stageXXX<br \/>\n# tar -xjf portage-XXX -C \/mnt\/gentoo\/usr<br \/>\n#nano -w \/mnt\/gentoo\/etc\/portage\/make.conf<br \/>\npress CTRL+X to exit, Y to accept changes and ENTER to save.<br \/>\nIf you wish to define the CPU arch, please refer to <a href=\"https:\/\/wiki.gentoo.org\/wiki\/CFLAGS\" target=\"_blank\" rel=\"noopener noreferrer\">this<\/a>.<br \/>\nAlso, please refer to the global useflags that maybe required depending on your end game.<br \/>\n# mirrorselect -i -o &gt;&gt; \/mnt\/gentoo\/etc\/portage\/make.conf<br \/>\n# mount -t proc none \/mnt\/gentoo\/proc<br \/>\n# mount --types proc \/proc \/mnt\/gentoo\/proc<br \/>\n# mount --rbind \/sys \/mnt\/gentoo\/sys<br \/>\n# mount --make-rslave \/mnt\/gentoo\/sys<br \/>\n# mount --rbind \/dev \/mnt\/gentoo\/dev<br \/>\n# mount --make-rslave \/mnt\/gentoo\/dev<br \/>\n# cp -L \/etc\/resolv.conf \/mnt\/gentoo\/etc\/resolv.conf<br \/>\n<span style=\"color: #ff0000;\">!!!!NOTE:\u00a0 Do not be tempted to add customisation at this stage.\u00a0 It is better to get the base system built, bootable and stable.<\/span><\/td>\n<\/tr>\n<tr>\n<td>Portage rsync configs are now located in\u00a0\/etc\/portage\/repos.conf\/gentoo.conf<\/p>\n<p>Create the directory:<\/p>\n<p># mkdir \/etc\/portage\/repos.conf<\/p>\n<p>Then create gentoo.conf with the content below.<\/p>\n<pre>[DEFAULT]\nmain-repo = gentoo\n[gentoo]\nlocation = \/usr\/portage\nsync-type = rsync\nsync-uri = rsync:\/\/rsync.europe.gentoo.org\/gentoo-portage<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#7a5ada\">Entering the Gentoo Environment:-<\/td>\n<\/tr>\n<tr>\n<td># chroot \/mnt\/gentoo \/bin\/bash<br \/>\n# env-update<br \/>\n# source \/etc\/profile<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#7a5ada\">Install the Kernel:-<\/td>\n<\/tr>\n<tr>\n<td># emerge -av gentoo-sources<br \/>\n# cd \/usr\/src\/linux<\/p>\n<p># make menuconfig<br \/>\n(configure the kernel for your system)<\/p>\n<p># make &amp;&amp; make modules_install<\/p>\n<p># cp arch\/x86_64\/boot\/bzimage \/boot\/kernel-?.?.?-gentoo-r?<\/p>\n<p># cp .config \/boot\/config-?.?.?-gentoo-r?<\/td>\n<\/tr>\n<tr>\n<td>Note:\u00a0 If unmasking a kernel, ensure you also unmask the linux-headers of the same version.<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#7a5ada\">Setup root user password:-<\/td>\n<\/tr>\n<tr>\n<td># passwd<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#7a5ada\">Setup Localtime:-<\/td>\n<\/tr>\n<tr>\n<td># ln -sf \/usr\/share\/zoneinfo\/Europe\/London \/etc\/localtime<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#7a5ada\">Setup FSTAB:-<\/td>\n<\/tr>\n<tr>\n<td># nano -w \/etc\/fstab<\/p>\n<pre>LABEL=BOOTFS    \/boot   ext4    noauto,noatime    1 2\nLABEL=SWAPFS    none    swap    sw                0 0\nLABEL=ROOTFS    \/       ext4    noatime           0 1\nLABEL=HOMEFS    \/home   ext4    noatime           0 1<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#7a5ada\">Setup Grub (boot loader):-<\/td>\n<\/tr>\n<tr>\n<td># emerge grub<br \/>\n# grub-install \/dev\/sda<br \/>\n# grub-mkconfig -o \/boot\/grub\/grub.cfg<\/p>\n<p>!!! NOTE !!!<br \/>\nIf grub fails to compile with the error \"illegal instruction\", as this is the first item you are compiling.\u00a0 There is a good chance that the stage3 tarball is at fault.\u00a0 Try using an older archive.It's also worth noting that if you are using systemd instead of initrc you should amend the following line in \/etc\/default\/grub to save any headaches when adding a different kernel. Append parameters to the linux kernel command line for non-recovery entries:<\/p>\n<pre>GRUB_CMDLINE_LINUX_DEFAULT=\"rootfstype=ext4 init=\/usr\/lib\/systemd\/systemd\"<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td>\u00a0install systemd &amp; networkmanager<\/p>\n<p>* you may need to unmerge udev &amp; libudev<\/td>\n<\/tr>\n<tr>\n<td># cd<br \/>\n# umount \/mnt\/gentoo\/boot \/mnt\/gentoo\/proc \/mnt\/gentoo<br \/>\n# reboot<\/td>\n<\/tr>\n<tr>\n<td>REBOOT!<\/p>\n<p>Login and enable NetworkManager.<\/p>\n<pre>systemctl enable NetworkManager<\/pre>\n<p>Now we have a bootable system, we can squeeze a little more speed from compiling.<br \/>\nAlso, I highly recommend this if you're using an SSD.<br \/>\n<a href=\"http:\/\/cdblog.cdstealer.com\/?p=1041\" target=\"_blank\" rel=\"noopener noreferrer\">Portage TMPFS<\/a><\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#7a5ada\">Setup hostname:-<\/td>\n<\/tr>\n<tr>\n<td># hostnamectl\u00a0set-hostname &lt;hostname&gt;<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#7a5ada\">Setup keyboard locale:-<\/td>\n<\/tr>\n<tr>\n<td># localectl set-keymap uk<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#7a5ada\">Network Time:-<\/td>\n<\/tr>\n<tr>\n<td>#\u00a0systemctl enable systemd-timesyncd<\/p>\n<p>Time servers are defined in \/etc\/systemd\/timesyncd.conf.<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#7a5ada\">Setup system log:-<\/td>\n<\/tr>\n<tr>\n<td># emerge syslog-ng logrotate<br \/>\n# systemctl enable syslog-ng@default<\/td>\n<\/tr>\n<tr>\n<td>\u00a0YOU NOW HAVE GENTOO INSTALLED BUT NO GUI OR APPZ...<\/td>\n<\/tr>\n<tr>\n<td>Now REBOOT<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#7a5ada\">Select system profile<\/td>\n<\/tr>\n<tr>\n<td>Then execute:<br \/>\n# eselect profile list<br \/>\nAvailable profile symlink targets:<br \/>\n[1] default\/linux\/amd64\/13.0<br \/>\n[2] default\/linux\/amd64\/13.0\/selinux<br \/>\n[3] default\/linux\/amd64\/13.0\/desktop<br \/>\n[4] default\/linux\/amd64\/13.0\/desktop\/gnome<br \/>\n[5] default\/linux\/amd64\/13.0\/desktop\/gnome\/systemd<br \/>\n[6] default\/linux\/amd64\/13.0\/desktop\/kde<br \/>\n[7] default\/linux\/amd64\/13.0\/desktop\/kde\/systemd<br \/>\n[8] default\/linux\/amd64\/13.0\/desktop\/plasma<br \/>\n[9] default\/linux\/amd64\/13.0\/desktop\/plasma\/systemd<br \/>\n[10] default\/linux\/amd64\/13.0\/developer<br \/>\n[11] default\/linux\/amd64\/13.0\/no-multilib<br \/>\n[12] default\/linux\/amd64\/13.0\/systemd *<br \/>\n[13] default\/linux\/amd64\/13.0\/x32<br \/>\n[14] hardened\/linux\/amd64<br \/>\n[15] hardened\/linux\/amd64\/selinux<br \/>\n[16] hardened\/linux\/amd64\/no-multilib<br \/>\n[17] hardened\/linux\/amd64\/no-multilib\/selinux<br \/>\n[18] hardened\/linux\/amd64\/x32<br \/>\n[19] hardened\/linux\/musl\/amd64<br \/>\n[20] hardened\/linux\/musl\/amd64\/x32<br \/>\n[21] default\/linux\/uclibc\/amd64<br \/>\n[22] hardened\/linux\/uclibc\/amd64<br \/>\nThen execute:<br \/>\n# eselect profile set 11<br \/>\nexecuting:<br \/>\n# emerge -uvnD world will install\/rebuild the the required packages for that profile. This may take a few hours.<\/td>\n<\/tr>\n<tr>\n<td>OK. \u00a0If everything went to plan you should now have a basic Gentoo installation. \u00a0Now for the hard bit :D<\/td>\n<\/tr>\n<tr>\n<td>\n<p class=\"style1\">These are only my recommendations:-<\/p>\n<p class=\"style1\">create \/etc\/locale.gen and add \"en_GB.UTF8 UTF-8\"<\/p>\n<p class=\"style1\">#\u00a0emerge ufed<\/p>\n<p class=\"style1\">Set any required global use flags via ufed.\u00a0 Some useful ones are:<\/p>\n<pre class=\"style1\">X bluetooth branding cacert cairo consolekit corefonts cups dbus egl evdev flac gd gif gles2 gnome gnome-keyring gnutls gpm gtk icu jpeg jpeg2k ibnotify mmx mp3 mpi nautilus networkmanager offensive office ogg opengl png policykit pulseaudio python qt4 smp sse sse2 sse4 sse4_1 ssse3 svg syslog systemd tiff truetype udev disks usb uxa vhosts vim-syntax vorbis xkb -bindist -ipv6 -widevine<\/pre>\n<p class=\"style1\">If you don't want to set any global flags, you can opt to set these on a per package basis (recommended).<\/p>\n<p class=\"style1\">If you do define\/remove any global flags, ensure you run an \"emerge -puvND world\" and rebuild any packages.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td><strong><span style=\"color: #ff0000;\">Example only:<\/span><\/strong><\/p>\n<p><strong>\/etc\/portage\/package.use\/qtwebkit<\/strong><br \/>\ndev-qt\/qtwebkit printsupport<\/p>\n<p><strong>\/etc\/portage\/package.use\/iputils<\/strong><br \/>\nnet-misc\/iputils -caps -filecaps<\/p>\n<p><strong>\/etc\/portage\/package.use\/libpng<\/strong><br \/>\nmedia-libs\/libpng apng<\/p>\n<p><strong>\/etc\/portage\/package.use\/python<\/strong><br \/>\ndev-lang\/python sqlite<\/p>\n<p><strong>\/etc\/portage\/package.use\/ffmpeg<\/strong><br \/>\nmedia-video\/ffmpeg opus vpx aac aacplus bluray cdio faac fdk x264 xvid<br \/>\nvirtual\/ffmpeg threads -vdpau x264<\/p>\n<p><strong>\/etc\/portage\/package.use\/libpcre<\/strong><br \/>\ndev-libs\/libpcre pcre16<\/p>\n<p><strong>\/etc\/portage\/package.use\/qtkeychain<\/strong><br \/>\ndev-libs\/qtkeychain qt5<\/p>\n<p><strong>\/etc\/portage\/package.use\/zlib<\/strong><br \/>\nsys-libs\/zlib minizip<\/p>\n<p><strong>\/etc\/portage\/package.use\/cogl<\/strong><br \/>\nmedia-libs\/cogl gles2<\/p>\n<p><strong>\/etc\/portage\/package.use\/mesa<\/strong><br \/>\nmedia-libs\/mesa gles2<\/td>\n<\/tr>\n<tr>\n<td># emerge -evD system (optional but recommended)<br \/>\n[this will rebuild the install for your architecture. It may take a while]<\/p>\n<p>#emerge gentoolkit<br \/>\n[this will install some handy tools. One is below]<\/p>\n<p># revdep-rebuild<br \/>\n[this will reinstall any dependencies. Add a \"-p\" to see what will be done]<\/p>\n<p>Now it's time to get a GUI installed.<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#7a5ada\">Install GDM &amp; Gnome<\/td>\n<\/tr>\n<tr>\n<td>Install your Desktop Environment.<\/p>\n<p># emerge av gdm gnome-light<\/p>\n<p>Once complete enable gdm to autostart<br \/>\n# systemctl enable gdm<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#7a5ada\">Caveats and Cleanups<\/td>\n<\/tr>\n<tr>\n<td><strong>Gnome-terminal may not start<\/strong><\/p>\n<p># locale-gen<\/p>\n<p>And then:<\/p>\n<p># localectl set-locale LANG=\"en_GB.UTF-8\"<\/p>\n<p>And reboot.<\/p>\n<p><strong>Gnome-shell screen cast may not work.<\/strong><\/p>\n<p>You may get the error:<\/p>\n<p>gnome-session[736]: ** (gnome-shell:805): WARNING **: ShellRecorder: failed to parse pipeline: no element \"vp9enc\"<br \/>\ngnome-session[736]: ** (gnome-shell:805): CRITICAL **: shell_recorder_close: assertion 'recorder-&gt;state != RECORDER_STATE_CLOSED' failed<\/p>\n<p>To fix this, ensure that <strong>gst-plugins-good<\/strong>, <strong>libvpx<\/strong> &amp; <strong>ffmpeg<\/strong> are installed.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>There you have it. \u00a0A full Gentoo Linux install with a Gnome3 desktop.<\/p>\n<p>Time to spend a few more hours emerging your apps: ;)<\/p>\n<p>A few useful apps are:<\/p>\n<pre>extundelete \napp-misc\/screen \nlibreoffice (take &gt;1 hour)\ngoogle-chrome\nfirefox\napp-admin\/keepassx \neog \ngimp \nvim \ncorefonts\nlinux-firmware\ndosfstools\nchrome-binary-plugins\ngnome-tweak-tool<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>How to install from CLI.  This is a stage3 install as stage1 is no longer supported.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[213,289,10,18],"class_list":["post-15","post","type-post","status-publish","format-standard","hentry","category-gentoo","tag-gentoo","tag-gnu","tag-install","tag-linux"],"_links":{"self":[{"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=\/wp\/v2\/posts\/15","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=15"}],"version-history":[{"count":114,"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=\/wp\/v2\/posts\/15\/revisions"}],"predecessor-version":[{"id":2324,"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=\/wp\/v2\/posts\/15\/revisions\/2324"}],"wp:attachment":[{"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=15"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=15"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=15"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}