Code Monkey home page Code Monkey logo

easygentoo's Introduction

Easy Gentoo

Easy Gentoo is free software distributed under the terms of the MIT license. For license details, see LICENSE.


WARNING: THERE MAYBE SOME MISTAKES OR PARTS THAT NEED IMPROVING. I RECOMMEND YOU TO TEST THIS SCRIPT IN A VIRTUAL ENVIRONMENT FIRST. DON'T FORGET TO CROSS FINGERS WHILE USING ON A REAL MACHINE :)

Bash script for easy Gentoo Linux installation

"Easy Gentoo" is a bash script, which is basically a combination of Gentoo Handbook steps, that installs Gentoo Linux from a stage3 tarball. The overall procedure is unattended, everything is handled by script. Installation includes "localization (English, Brazilian and Turkish), kernel compilation, X server setup, desktop environment setup (Xfce)" and more. These steps are enabled or disabled according to a profile.

Profile is a simple text file which has the necessary options, settings etc. for the installation. (Profile must be named as "profile") With a proper profile, it is possible to have a basic system (without X) or a ready to use Xfce desktop with a few key strokes.

"Easy Gentoo" was tested on lots of machines with different profiles. Many successful installations were made. Hope it becomes a time-saver for you. Happy compiling!

Important Notes

  • Easy Gentoo doesn't do partitioning, you need to do that by yourself. It formats and mounts your selection of existing partitions.
  • Using a capable intallation media which has more filesystem utilities, Easy Gentoo can format, mount, configure partitions for these filesystems: "btrfs, ext2, ext3, ext4, ntfs, reiserfs, xfs"
  • Localization is based on your "keymap". "us" is for English, "br" is for Brazilian, "trq" and "trf" are for Turkish.
  • A temporary swap file with 1 GB size is created as a precaution if root partition is bigger than 8 GB
  • There are two install types; basic: doesn't include X,LightDM,Xfce,Alsa,NetworkManager, normal: includes X,LightDM,Xfce,Alsa,NetworkManager. Base system configuration is the same for both.
  • Easy Gentoo needs an ethernet connection to operate, wireless connection is not an option for now.
  • If the host computer is a laptop, some USE flag changes and additional package merges are made (these have nothing to do with wireless)
  • Stable packages are used
  • Based on a stage3 tarball (latest one)
  • CFLAGS="-march=native -O2 -pipe"
  • LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,--hash-style=gnu"
  • Mirrors for Turkish users:

http://ftp.linux.org.tr/gentoo ftp://ftp.linux.org.tr/gentoo ftp://mirrors.linuxant.fr/distfiles.gentoo.org

  • Mirrors for other users:

ftp://mirrors.linuxant.fr/distfiles.gentoo.org http://gentoo.supp.name http://portage.org.ua

  • Portage profile is "${arch}/13.0/ for basic install" and "${arch}/13.0/desktop for normal install"
  • Kernel has lots of drivers activated to help to get an error free first boot
  • Grub2 is used, not Grub legacy
  • No system logger and no cron included
  • A few performance and security related sysctl settings are included
  • sudo configuration and some aliases are included
  • File manager is Thunar with automount support
  • Login Manager is LightDM

After Using Easy Gentoo, you should check/change these

  • Timezone
  • Grub config (parameters, title)
  • Startup services
  • USE flags (default ones may not be enough for you)
  • Mirrors
  • Kernel config (it is recommended to compile a new kernel with a customized config)
  • Compile list (to check if your 'must have' ones are installed)

How to use

  • boot from an installation media (ex. Gentoo Minimal Install CD)
  • execute these commands:

wget https://raw.githubusercontent.com/shdcn/easygentoo/master/easygentoo

chmod +x easygentoo

  • create a profile in the same directory where script is placed

for more information on profile please read:

https://github.com/shdcn/easygentoo/blob/master/profile

  • start script:

./easygentoo

Steps for basic install

  • Check if necessary tools/commands are available to continue
  • Format partitions
  • Mount partitions
  • Check mirrors
  • Download and extract latest stage3 tarball and portage snapshot
  • Continue inside chroot
  • Create a temporary make.conf
  • Emerge portage and some tools
  • Create locale.gen
  • Update make.conf and create package.use
  • Do a controlled "emerge -e system"
  • Kernel compilation (genkernel-next) with lots of needed settings/drivers
  • Emerge grub2 and create grub.cfg
  • Create/update configuration files (localtime, keymaps, hostname, etc)
  • Change locale based on keymap
  • Change root password and create user
  • Update /etc/sudoers and .bashrc
  • Unmerge unnecessary packages and do "emerge -uDN world"

Steps for normal install

  • Emerge xorg-server and create xorg.conf
  • Emerge and configure Xfce
  • Emerge and configure LightDM
  • Configure evdev
  • Emerge NetworkManager
  • Emerge and configure Alsa

End of normal install steps

  • Purge unnecessary man pages etc. (localepurge)
  • Create a small report about whole process.
  • Delete temporary files that were created by script
  • Shutdown computer

easygentoo's People

Contributors

kylebruene avatar likewhoa avatar rushsteve1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

easygentoo's Issues

Passing mountpoint options on fstab

hello,

I, usually, do this when installing gentoo:

# create partitions
sgdisk -Z /dev/vda
sgdisk -o /dev/vda
sgdisk -n 1::+3M -t 1:ef02 /dev/vda
sgdisk -n 2::+500M -t 2:8300 /dev/vda
sgdisk -n 3::+512M -t 3:8200 /dev/vda
sgdisk -n 4:: -t 4:8300 /dev/vda

# create filesystems
mkfs -t btrfs -L boot /dev/vda2
mkfs -t btrfs -L btrfsroot /dev/vda4
mkswap /dev/vda3

# create subvols
mkdir /mnt/gentoo
mount /dev/vda4 /mnt/gentoo
cd /mnt/gentoo
btrfs subvol create root
btrfs subvol create home
btrfs subvol create srv
btrfs subvol create var

# unmount
cd ..
umount gentoo

This creates /dev/vda4 with subvolumes; in which I put stuff. My fstab looks like this:

# <fs>          <mountpoint>    <type>  <opts>                                              <dump/pass>

shm             /dev/shm        tmpfs   nodev,nosuid,noexec                                 0 0

/dev/vda4       /               btrfs   rw,noatime,compress=lzo,autodefrag,subvol=root      0 0
/dev/vda4       /home           btrfs   rw,noatime,compress=lzo,autodefrag,subvol=home      0 0
/dev/vda4       /srv            btrfs   rw,noatime,compress=lzo,autodefrag,subvol=srv       0 0
/dev/vda4       /var            btrfs   rw,noatime,compress=lzo,autodefrag,subvol=var       0 0
/dev/vda3       none            swap    sw                                                  0 0
/dev/vda2       /boot           btrfs   rw,noatime                                          0 0

Is there a way to pass arguments to the partition section so I can add the subvol=whatever to my profile?

Compilation failed on VMWare Workstation 10

Hi,

I've started your script on my laptop (HP Pavilion dv9744) and VMWare Workstation 10.0.3, but it failed with the following message :

Installation failed due to compile error. Package: sys-fs/udev-216. Easygentoo will exit now.

Here's the snapshot of the screen : screenshot

If I chroot and try to manually emerge this package I get this : screenshot

Hmm, looks like systemd is blocking udev, but why
does it try to install then? More details at : systemd page.

How should I proceed? Btw excellent work, really saves my time.

Download Function Date - Broken.

Get an error when script tries to download tarball - apparently there is a mismatch between the date the download function uses and the tarball date. Manually entered name of tarball (stage3-amd64-20140508.tar.bz2" in the line:

lnk="${tarballurl}/${date}/stage3-amd64-20140508.tar.bz2"; arg="1"

and it functions correctly.

Path error

line 1754 and line 1756 in easygentoo ,the path is error.

OpenRC fork?

Hi

I hate systemd, and one of Gentoo's primary benefits these days is not using it by default.

Can we please have a non-systemd version of this amazing script??

Problem with installation

Hi.

The problem is at the end of installation when install gcc-4.8.4:4.8::gentoo installation failed and exit.
Only 44 packages more need install but can't because gcc package failed.

Tried it for the first time, got this.

Verifying ebuild manifests
Running pre-merge checks for sys-apps/systemd-226-r2

  • Determining the location of the kernel source code
  • Unable to find kernel sources at /usr/src/linux
  • Please make sure that /usr/src/linux points at your running kernel,
  • (or the kernel you wish to build against).
  • Alternatively, set the KERNEL_DIR environment variable to the kernel sources location
  • Unable to calculate Linux Kernel version for build, attempting to use running version
  • Checking for suitable kernel configuration options...
  • CONFIG_DEVPTS_MULTIPLE_INSTANCES: is not set when it should be.
  • CONFIG_FW_LOADER_USER_HELPER: should not be set. But it is.
  • Please check to make sure these options are set correctly.
  • Failure to do so may cause unexpected problems.
    Emerging (1 of 1) sys-apps/systemd-226-r2::gentoo
    Installing (1 of 1) sys-apps/systemd-226-r2::gentoo
    Failed to install sys-apps/systemd-226-r2
    Jobs: 0 of 1 complete, 1 failed Load avg: 1.36, 1.75, 1.85
  • Messages for package sys-apps/systemd-226-r2:
  • Unable to find kernel sources at /usr/src/linux
  • Unable to calculate Linux Kernel version for build, attempting to use running version
  • CONFIG_DEVPTS_MULTIPLE_INSTANCES: is not set when it should be.
  • CONFIG_FW_LOADER_USER_HELPER: should not be set. But it is.
  • Please check to make sure these options are set correctly.
  • Failure to do so may cause unexpected problems.
  • Messages for package sys-apps/systemd-226-r2:
  • This package will overwrite one or more files that may belong to other
  • packages (see list below). You can use a command such as `portageq
  • owners / ` to identify the installed package that owns a
  • file. If portageq reports that only one package owns a file then do
  • NOT file a bug report. A bug report is only useful if it identifies at
  • least two or more packages that are known to install the same file(s).
  • If a collision occurs and you can not explain where the file came from
  • then you should simply ignore the collision since there is not enough
  • information to determine if a real problem exists. Please do NOT file
  • a bug report at http://bugs.gentoo.org unless you report exactly which
  • two packages install the same file(s). See
  • http://wiki.gentoo.org/wiki/Knowledge_Base:Blockers for tips on how to
  • solve the problem. And once again, please do NOT file a bug report
  • unless you have completely understood the above message.
  • Detected file collision(s):
  •  /etc/udev/udev.conf
    
  •  /lib/udev/cdrom_id
    
  •  /lib/udev/collect
    
  •  /lib/udev/ata_id
    
  •  /lib/udev/scsi_id
    
  •  /lib/udev/mtd_probe
    
  •  /lib/udev/v4l_id
    
  •  /lib/udev/rules.d/75-net-description.rules
    
  •  /lib/udev/rules.d/80-drivers.rules
    
  •  /lib/udev/rules.d/60-persistent-alsa.rules
    
  •  /lib/udev/rules.d/64-btrfs.rules
    
  •  /lib/udev/rules.d/60-cdrom_id.rules
    
  •  /lib/udev/rules.d/60-persistent-v4l.rules
    
  •  /lib/udev/rules.d/60-evdev.rules
    
  •  /lib/udev/rules.d/60-drm.rules
    
  •  /lib/udev/rules.d/78-sound-card.rules
    
  •  /lib/udev/rules.d/60-serial.rules
    
  •  /lib/udev/rules.d/50-udev-default.rules
    
  •  /lib/udev/rules.d/60-persistent-input.rules
    
  •  /lib/udev/rules.d/70-mouse.rules
    
  •  /lib/udev/rules.d/60-block.rules
    
  •  /lib/udev/rules.d/60-persistent-storage.rules
    
  •  /lib/udev/rules.d/75-probe_mtd.rules
    
  •  /lib/udev/rules.d/60-persistent-storage-tape.rules
    
  •  /usr/lib64/pkgconfig/libudev.pc
    
  •  /usr/include/libudev.h
    
  •  /usr/share/man/man8/udevadm.8.bz2
    
  •  /usr/share/man/man7/udev.7.bz2
    
  •  /usr/share/man/man5/udev.conf.5.bz2
    
  •  /usr/share/pkgconfig/udev.pc
    
  •  /usr/lib64/libudev.so
    
  • Searching all installed packages for file collisions...
  • Press Ctrl-C to Stop
  • sys-fs/eudev-3.1.5:0::gentoo
  •  /etc/udev/udev.conf
    
  •  /lib/udev/ata_id
    
  •  /lib/udev/cdrom_id
    
  •  /lib/udev/collect
    
  •  /lib/udev/mtd_probe
    
  •  /lib/udev/rules.d/50-udev-default.rules
    
  •  /lib/udev/rules.d/60-cdrom_id.rules
    
  •  /lib/udev/rules.d/60-drm.rules
    
  •  /lib/udev/rules.d/60-evdev.rules
    
  •  /lib/udev/rules.d/60-persistent-alsa.rules
    
  •  /lib/udev/rules.d/60-persistent-input.rules
    
  •  /lib/udev/rules.d/60-persistent-v4l.rules
    
  •  /lib/udev/rules.d/60-serial.rules
    
  •  /lib/udev/rules.d/64-btrfs.rules
    
  •  /lib/udev/rules.d/70-mouse.rules
    
  •  /lib/udev/rules.d/75-net-description.rules
    
  •  /lib/udev/rules.d/78-sound-card.rules
    
  •  /lib/udev/rules.d/80-drivers.rules
    
  •  /lib/udev/scsi_id
    
  •  /lib/udev/v4l_id
    
  • Package 'sys-apps/systemd-226-r2' NOT merged due to file collisions.
  • If necessary, refer to your elog messages for the whole content of the
  • above message.

Installation failed due to compile error.
Package: sys-apps/systemd-226-r2:0/2::gentoo.
Easygentoo will exit now.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.