Linux - Gentoo Installation with awesome desktop

来源:互联网 发布:网络程控电话交换机 编辑:程序博客网 时间:2024/05/01 15:02

Install Gentoo

https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Media

gentoo awesome-desktop


Choosing the right installation medium

https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Media

Download ISO

http://mirrors.stuhome.net/gentoo/releases/amd64/autobuilds/20150820/install-amd64-minimal-20150820.iso
http://mirrors.xmu.edu.cn/gentoo/releases/amd64/autobuilds/20150820/install-amd64-minimal-20150820.iso

Verifying the downloaded files

Windows

http://www.gpg4win.org/download.html

Linux

gpg --recv-keys 0xBB572E0E2D182910gpg --verify install-amd64-minimal-20141204.iso.DIGESTS.ascgrep -A 1 -i sha512 install-amd64-minimal-20141204.iso.DIGESTS.ascsha512sum install-amd64-minimal-20141204.iso

Configuring the network

https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Networking

ip addrnet-setup eth0ping 8.8.8.8

Preparing the disks

https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Disks

fdisk /dev/sdaDevice     Boot    Start      End  Sectors Size Id Type/dev/sda1           2048 83886079 83884032  40G  5 Extended/dev/sda5           4096  8392703  8388608   4G 83 Linux/dev/sda6        8394752 50337791 41943040  20G 83 Linux/dev/sda7       50339840 83886079 33546240  16G 83 Linux

Applying a filesystem to a partition

mkfs.ext4 /dev/sda6mkfs.ext4 /dev/sda7

Activating the Swap Partition

mkswap /dev/sda5swapon /dev/sda5

Mounting

mount /dev/sda6 /mnt/gentoomkdir /mnt/gentoo/homemount /dev/sda7 /mnt/gentoo/home

Installing the Gentoo installation files

https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Stage

For instance, to set the date to March 29th, 16:21 in the year 2014:

date 032916212014
cd /mnt/gentoo

Downloading the stage tarball

links https://www.gentoo.org/downloads/mirrors/links http://mirrors.stuhome/gentoo/links http://mirrors.stuhome.net/gentoo/releases/amd64/autobuilds/20150820/stage3-amd64-20150820.tar.bz2links http://mirrors.stuhome.net/gentoo/snapshots/portage-latest.tar.bz2tar -xjvf stage3-amd64-20150820.tar.bz2tar -xjvf portage-latest.tar.bz2 -C usr/

Configuring compile options

nano -w /mnt/gentoo/etc/portage/make.conf

Installing the Gentoo base system

https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Base

Copy DNS info

mirrorselect -i -o >> /mnt/gentoo/etc/portage/make.conf

Mounting the necessary filesystems

cp -L /etc/resolv.conf /mnt/gentoo/etc/mount -t proc proc /mnt/gentoo/procmount --rbind /sys /mnt/gentoo/sysmount --make-rslave /mnt/gentoo/sysmount --rbind /dev /mnt/gentoo/devmount --make-rslave /mnt/gentoo/devrm /dev/shm && mkdir /dev/shm mount -t tmpfs -o nosuid,nodev,noexec shm /dev/shmchmod 1777 /dev/shm

Entering the new environment

chroot . /bin/bashenv-updatesource /etc/profile

Configuring portage

export PS1="(chroot) $PS1"emerge --sync

Choosing the right profile

eselect profile listeselect profile set 4nano /etc/portage/make.confUSE="$USE alsa dvd gnome pluseaudio -kde"

Optional: Using systemd

Timezone

ls /usr/share/zoneinfocp /usr/share/zoneinfo/US/Central /etc/localtimeecho "US/Central" > /etc/timezoneemerge --config sys-libs/timezone-data

Configure locales

locale -a | lessnano -w /etc/locale.geneselect locale listeselect locale set 5nano -w /etc/env.d/02localeLANG="zh_CN.UTF-8"LC_COLLATE="C"locale-genenv-update && source /etc/profile

Configuring the Linux kernel

https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Kernel

Installing the sources

automatically

emerge gentoo-sourcesemerge genkernel         # Optional: Building an initramfsgenkernel all            # Alternative: Using genkernel

Manually

emerge --ask sys-kernel/gentoo-sourcesemerge --ask sys-apps/pciutilsemerge --ask sys-kernel/linux-firmware 
ls /boot/kernel*ls /boot/initramfs*find /lib/modules/4.0.1-gentoo/ -type f -iname '*.o' -or -iname '*.ko' | less

Configuring the system

nano -w /etc/conf.d/modules

Filesystem information

nano -w /etc/fstab/dev/sda6       /           ext4        noatime     0 1/dev/sda7       /home       ext4        defaults    0 2/dev/sda5       none        swap        sw          0 0/dev/cdrom      /mnt/cdrom  auto        noauto,ro   0 0

Networking information

nano -w /etc/conf.d/hostnamenano -w /etc/hosts          # add hostnamenano -w /etc/conf.d/net     # config_enp0s3="dhcp"emerge dhcpcdcd /etc/init.d/ln -s net.lo net.enp0s3rc-update add net.enp0s3 default

System information

passwdnano -w /etc/conf.d/keymapsnano -w /etc/conf.d/hwclocknano -w /etc/locale.genenv-update && source /etc/profileexport PS1="(chroot) $PS1"

Installing system tools

https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Tools

emerge --ask app-admin/syslog-ngrc-update add syslog-ng defaultemerge --ask sys-process/cronierc-update add cronie defaultemerge --ask sys-apps/mlocaterc-update add sshd defaultemerge --ask net-misc/dhcpcdemerge --ask net-dialup/ppp

Configuring the bootloader

https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Bootloader

emerge --ask sys-boot/grubemerge grubgrub-install /dev/sdagrub2-install /dev/sdagrub2-mkconfig -o /boot/grub2/grub.cfggrub2-mkconfig -o /boot/grub/grub.cfggrub -v rootfs /proc/mounts > /etc/mtabexitcd /umount -l /mnt/gentoo/dev{/shm,/pts}umount -l /mnt/gentoo{/home,/proc}

Finalizing

https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Finalizing

useradd -m -G users,wheel,audio -s /bin/bash nixawkpasswd nixawk

Portage

https://wiki.gentoo.org/wiki/Handbook:AMD64/Working/Portage
https://wiki.gentoo.org/wiki/GENTOO_MIRRORS

mirrorselect -s3 -D -o >> /etc/portage/make.conf/etc/make.conf/etc/portage/make.confGENTOO_MIRRORS="http://mirrors.xmu.edu.cn/gentoo http://gentoo.netnitco.net http://mirror.bytemark.co.uk/gentoo/ ftp://ftp.mirrorservice.org/sites/distfiles.gentoo.org/"# for portageSYNC="rsync://mirrors.xmu6.edu.cn/gentoo-portage"# for distfileGENTOO_MIRRORS="http://mirrors.xmu6.edu.cn/gentoo"
genli ~ # cat /etc/portage/repo.postsync.d/gentoo.conf [gentoo]location=/usr/postagesync-type=rsyncsync-uri=rsync://mirrors.xmu6.edu.cn/gentoo-portageauto-sync=yes
emerge --syncemerge --search pdfemerge --searchdesc pdfemerge --ask app-office/gnumericemerge --pretend gnumeric            #  handles dependenciesemerge --fetchonly gnumeric          #  download the sources without installing thememerge -vp alsa-libemerge --unmergeemerge --unmerge gnumericemerge --update --ask @worldemerge --update --deep @worldemerge --update --deep --with-bdeps=y @world

SERVICE MANAGEMENT

rc-service sshd startrc-service sshd stoprc-service sshd restart

DESKTOP ENVIRONMENT

# emerge -av xorg-server xorg-x11 xorg-drivers udevemerge x11-base/xorg-serveremerge --ask awesome~/.xinitrcexec ck-launch-session dbus-launch --sh-syntax --exit-with-session awesomemkdir -p ~/.config/awesomecp /etc/xdg/awesome/rc.lua ~/.config/awesome/vim ~/.config/awesome/chmod u+x ~/.xinitrcstartx

References

http://wuyuans.com/2012/12/gentoo-installation/
https://wiki.gentoo.org/wiki/Handbook:AMD64
https://www.gentoo.org/downloads/mirrors/
http://mirrors.xmu.edu.cn/howto/
https://www.gentoo.org.cn/mirrorlist/

0 0