Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #This program is free software: you can redistribute it and/or modify
- #it under the terms of the GNU General Public License as published by
- #the Free Software Foundation, either version 3 of the License, or
- #(at your option) any later version.
- #This program is distributed in the hope that it will be useful,
- #but WITHOUT ANY WARRANTY; without even the implied warranty of
- #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- #GNU General Public License for more details.
- #You should have received a copy of the GNU General Public License
- #along with this program. If not, see <http://www.gnu.org/licenses/>.
- #######################################################################
- echo "Loading additional kernel modules"
- if [ modprobe8139too ]; then
- modprobe8139too
- else
- echo "modprobe8139too failed to load....exiting"
- exit 1
- fi
- #######################################################################
- echo "Please enter root password"
- passwd
- #######################################################################
- echo "Adding user account"
- if [ $(id -u) -eq 0 ]; then
- read -p "Enter username : " username
- read -s -p "Enter password : " password
- egrep "^$username" /etc/passwd >/dev/null
- if [ $? -eq 0 ]; then
- echo "$username exists!"
- exit 1
- else
- pass=$(perl -e 'print crypt($ARGV[0], "password")' $password)
- useradd -m -G $pass $username
- [ $? -eq 0 ] && echo "User has been added to system!" || echo "Failed to add a user!"
- fi
- else
- echo "Only root may add a user to the system"
- exit 2
- fi
- #######################################################################
- while true; do
- read -p "Would you like to start the SSH daemon?" yn
- case $yn in
- [Yy]* ) /etc/init.d/sshd start;;
- [Nn]* ) exit;;
- esac
- done
- #######################################################################
- echo "Configuring network with net-setup eth0"
- net-setup eth0
- #######################################################################
- #Using Dynamic Host Control Protocol for network configuration
- #dhcpd eth0
- #If you're system administrator requires hostname and domainname to be
- #provided by the DHCP server use the following command instead
- #dhcpcd -HD eth0
- #######################################################################
- echo "Creating 2MB partition for GRUB2"
- parted -a optimal /dev/sda
- mklabel gpt
- unit mib
- mkpart primary 1 3
- name 1 grub
- set 1 bios_grub on
- print
- sleep 5
- echo "Creating boot partition 128MB"
- mkpart primary 3 131
- name 2 boot
- mkpart primary 131 643
- name 3 swap
- mkpart primary 643 -1
- name 4 rootfs
- set 2 boot on #parted automatically switches to EFI when the boot option
- #is set on the partition
- parted print
- sleep 5
- #######################################################################
- echo "Creating swap"
- mkswap /dev/sda3
- echo "Activating swap"
- swapon /dev/sda3
- #######################################################################
- echo "Mounting drives"
- mount /dev/sda4 /mnt/gentoo
- mkdir /mnt/gentoo/boot
- mount /dev/sda2 /mnt/gentoo/boot
- #chmod 1777 /mnt/gentoo/ tmp #If /tmp/ resides on seperate partition
- #This changes its permissions AFTER
- #mounting.
- #######################################################################
- echo "Installing tarball is the date correct?"
- date
- sleep 5
- cd /mnt/gentoo
- echo "Select download stage"
- links https://www.gentoo.org/downloads/mirrors/
- tar xvjpf stage3-*.tar.bz2 --xattrs
- echo "Update the /mnt/gentoo/etc/portage/make.conf file to match personal preference and save"
- nano -w /mnt/gentoo/etc/portage/make.conf
- #######################################################################
- echo "Installing base system"
- mirrorselect -i -o >> /mnt/gentoo/etc/portage/make.conf
- mkdir /mnt/gentoo/etc/portage/repos.conf
- cp /mnt/gentoo/usr/share/portage/config/repos.conf /mnt/gentoo/etc/portage/repos.conf/gentoo.conf
- cp -L /etc/resolv.conf /mnt/gentoo/etc/
- mount -t proc proc /mnt/gentoo/proc
- mount --rbind /sys /mnt/gentoo/sys
- mount --make-rslave /mnt/gentoo/sys
- mount --rbind /dev /mnt/gentoo/dev
- mount --make-rslave /mnt/gentoo/dev
- chroot /mnt/gentoo /bin/bash
- source /etc/profile
- export PS1="(chroot) $PS1"
- emerge-webrsync
- emerge --sync
- eselect news list
- eselect news read
- eselect profile list
- eselect profile set 2
- eselect profile list
- eselect profile set 5
- eselect profile set default/linux/amd64/13.0/systemd
- eselect profile list
- emerge --ask --update --deep --newuse @world
- emerge --info | grep ^USE
- less /usr/portage/profiles/use.desc
- nano -w /etc/portage/make.conf
- ls /usr/share/zoneinfo
- echo "Europe/London" > /etc/timezone
- emerge --config sys-libs/timezone-data
- echo "en_GB.UTF-8 UTF-8" > /etc/locale.gen
- env-update && source /etc/profile && export PS1="(chroot) $PS1"
- #######################################################################
- echo "Done installing base system its now up to you to manually configure the kernel and optimise it to your needs"
- sleep 3
- echo "Good luck!"
- links https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Kernel
- #######################################################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement