Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
EasyGentoo as hell. Automatic Instaling Gentoo from skript
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
maxim.251
Tux's lil' helper
Tux's lil' helper


Joined: 14 Jul 2012
Posts: 86

PostPosted: Fri Feb 28, 2014 11:39 pm    Post subject: EasyGentoo as hell. Automatic Instaling Gentoo from skript Reply with quote

This is a Gentoo installation process. Based on the Gentoo Wiki and updates made ​​by me.
The installation process has made ​​our lives easier. Since anyway we all need to install exactly the same way. So why bother clicking on the keyboard 3 days, if you can set the basic data and enable the auto installations, which will take one day.



I was working on my installer.
The difference is that I shared facilities into categories, where it is easier to change at any case of any problems.
I decided that I did not I turn to the installation partition, but still I think about it.
But it seems to me that geparted enough for it to partition your hard drive.
  My installation will be more focus on versatility and simplicity.
I do not want to create the installer that the construction will be difficult.
The installation will continue until xorg.

And this is my script.

This is demo, and still i need work make.

I want to thank for everything shdcn, is that thanks to him I myself started to create something of mine.
That through his script, I myself decided to create something of mine.
Thank you shdcn


After testing my previous script, I stood in a deadlock.
  It turned out that the problem is to move the folder /user on separate partitions.
I've tried everything, I did that compiled kernel to be able to mounting /user fileat separate partition, but I do not know why does not detect my init script.
I came to the conclusion that giving up the possibility of moving the files from root folder on a separate partition, and arrange basic instalation.

This script is written from scratch, based on the basic installation of gentoo-handbook,
and added a innovacions to script. So now the progress is cleaner, and you can observe a progress of parts what is now instaling.

Forgive me that it is in Polish, but still is in the works. But it is now more stable. But for me it is more clear catch errors or add new patches.

A few words about the script. :

The script can be initiated from a folder home or other location.
  In the terminal you need to give a set of law executable
Code:
chmod 700 instalowanie_gentoo.sh

To run the screept, beter is use new komand
Code:
 bash instalowanie_gentoo.sh

Because BASH supports the more command and is modern.
Code:
sh
command is old and does not support some new commands.
This is very important!
you need to edit the script and set your own parameters, where should be mounted partitions.
Code:
swap_dysk="/dev/sda5"
root_dysk="/dev/sda8"
boot_dysk="/dev/sda7"    #1        #about 500Mb

tarbal='http://gentoo.mirror.pw.edu.pl/releases/x86/current-stage3/stage3-i686-20140225.tar.bz2'

root_folder=/mnt/gentoo
boot_folder=/mnt/gentoo/boot
haslo=1
ch="chroot /mnt/gentoo"

Please go to the web browser,
and look at your own tarball www.gentoo.org and copy the link to the script.
Code:
tarbal='http://gentoo.mirror.pw.edu.pl/releases/x86/current-stage3/stage3-i686-20140225.tar.bz2'

It is important to leave these characters ' ' between the link.


If for some reason your installation ended unexpectedly Or if you want to make a change and move the system from the place where the last finished. It's enough to add more hash.
Code:

#montowanie
#brakuje_program   #   <---  change to  ---->    #brakuje_program
#pobieranie
#rozpakowanie
#montowanie_root
#przygotowanie_chroot
#update_shell
#instalowanie_portage
#wybranie_profilu
#instalacja_ufed
zmiany_w_makeconf
znajdz_flagi
zoneinfo
config_locales
uruchom_local
instalacja_zrudel
kompilacja_kernela
modules_pro
konfiguring_fstab
konfiguring_host
ustaw_haslo
grub_config
setings_xorg
Instalowanie_programow
#instalowanie_gnome

And the installation will start from the place where you want to begin.

At the end also very important!
at begining of screept you can change what you want have on make.conf. This is only base of that what is needed to corect instaling system.


Line of installing the Gnome desktop environment "gnome-light" is not tested, and you yourself see what flags are needed to properly install the software.

And finally, if you are familiar with writing BASH Look at the code and change it if you think you need. for you're needs.

EasyGentoo as hell 1.0.6 <--- this is updating, ill will make it number up if I make change something.

good luck

name of file, you can rename it if you want.
Code:
 instalacja_gentoo.sh


Last edited by maxim.251 on Sun Mar 02, 2014 2:41 pm; edited 6 times in total
Back to top
View user's profile Send private message
maxim.251
Tux's lil' helper
Tux's lil' helper


Joined: 14 Jul 2012
Posts: 86

PostPosted: Sun Mar 02, 2014 1:02 am    Post subject: instalowanie_gentoo.sh Reply with quote

Code:
#!/bin/bash
CXX='${CFLAGS}'     #<==== Do not change!

#### Start configuring ####

swap_dysk="/dev/sda2"
root_dysk="/dev/sda4"
#boot_dysk="/dev/sda7"    #1        #about 500Mb

tarbal=http://distfiles.gentoo.org/releases/x86/autobuilds/current-stage3/stage3-i686-20140225.tar.bz2

root_folder=/mnt/gentoo
boot_folder=/mnt/gentoo/boot
ch="chroot /mnt/gentoo"
path_kernel=/usr/src/linux

pasword=1
name_host="maxim"
user_name="maxim"

### MAKE.CONF file.
make_conf="-j2"
cf_lags="-Os -march=native -pipe"
use_flags="X dbus gnome gtk laptop mmx networkmanager systemd sse sse2 sse3 ssse3 symlink
     -bluetooth -llvm -telepathy -ipv6 -kde -qt4 -bindist"
ling_uas="pl en"
video_card="intel"
python_target="python2_7"
input_device="evdev keyboard mouse synaptics wacom"
###

##### End configuring ####

export user_name=$user_name
export name_host=$name_host
export pasword=$pasword
export path_kernel=$path_kernel
export a=$1

com_p(){
   export a=$1
   echo "     now is make + $a"
   echo '#!/bin/bash' > /mnt/gentoo/com.sh
   echo 'echo "wykonanie komendy * $a"'>> /mnt/gentoo/com.sh
   echo "$1" >> /mnt/gentoo/com.sh
   echo 'sleep 2' >> /mnt/gentoo/com.sh
   chmod 700 /mnt/gentoo/com.sh
   xterm -e "$ch /bin/bash /com.sh"
   echo "     comand finish * $a"
}

montowanie(){
   swapon all
   cd /
   if [ -e /mnt/gentoo/gentoo_ex.log ]
   then
      echo "folder /mnt/gentoo           * istnieje"
      sleep 1
   else
      touch /mnt/gentoo/gentoo_ex.log
      echo "utworzenie folderu $root_folder"
      mkdir $root_folder
      sleep 1
   fi
   if [ -e /mnt/gentoo/is_mounted.log ]
   then
      echo "folder /mnt/gentoo           * jest zamontowany"
      sleep 1
   else
      echo "montowanie root"
      touch /mnt/gentoo/is_mounted.log
      mount $root_dysk $root_folder
      sleep 1
   fi
        if [ -e /mnt/gentoo/boot/is_mounted.log ]
        then
      echo "folder /mnt/gentoo/boot      * jest zamontowany"
      sleep 1
   else
      echo "montowanie /mnt/gentoo/boot"
      touch /mnt/gentoo/boot/is_mounted.log
      mount $boot_dysk /mnt/gentoo/boot
      sleep 1
   fi
}

pobieranie () {

        echo "przejscie folderu $root_folder"
        cd /mnt/gentoo
        sleep 1

        echo "pobranie tarball"
        sleep 1
        xterm -e "wget $tarbal"
#
}
rozpakowanie () {
        echo "rozpakowanie pakietu"
        sleep 1
        cd /mnt/gentoo
        if [ -e $root_folder/stage3* ]
        then
      root_folder=/mnt/gentoo
      echo "rozpakowanie pakietu"
      xterm -e "tar -xvjpf $root_folder/stage3*"
        else
      echo "Pakage tarball is not downloaded"
      echo "I stop execution of the script. Check the path tarball or in the terminal make it manually and then run the script.
tarbal=   <The path to the tarball that I need to download>"
      echo "koncze działanie"
      exit
   fi

}
montowanie_root () {
#nano -w /mnt/gentoo/etc/portage/make.conf
        echo "montowanie plików root"
        sleep 1
        cd /
        echo "montowanie proc"
        mount -t proc proc /mnt/gentoo/proc
        sleep 1
        echo "montowanie sys"
        mount --rbind /sys /mnt/gentoo/sys
        sleep 1
        echo "montowanie dev"
        mount --rbind /dev /mnt/gentoo/dev
        sleep 1
        echo "kopiowanie resolv.conf"
        cp -L /etc/resolv.conf  /mnt/gentoo/etc
        sleep 1

}
przygotowanie_chroot(){
 echo "przygotowanie chroot"
 sleep 1
 cat /proc/mounts > /etc/mtab
 export SHELL=$(which bash);  setterm -blank 0;
}

update_shell (){
   echo "aktualizacja Shell"
   com_p 'env-update'
   com_p 'source /etc/profile'
   #com_p 'cat /proc/mounts > /etc/mtab'
   sleep 1
}
instalowanie_portage () {
   echo "instalowanie portage"
   sleep 1
   com_p 'emerge-webrsync'
   echo "sprawdzanie poprawności drzewa"
   sleep 1
   com_p 'emerge --sync'
   update_shell
}
wybranie_profilu () {
   echo "wybranie profilu 4"
   sleep 1
   #echo "wybierz z listy"
   #read klawisz
   #eselect profile set $klawisz
   b=4
   com_p "eselect profile set 4"
   com_p 'eselect profile list; sleep 3'
   sleep 1
}
instalacja_ufed () {
   echo "instalacja ufed"
   sleep 1
   com_p 'emerge -v ufed'
}
make_conf(){
   echo "make change to makeconf"
   sleep 1

echo "CFLAGS=\"${cf_lags}\"
CXXFLAGS=\"$CXX\"

CHOST=\"i686-pc-linux-gnu\"

USE=\"$use_flags\"
LINGUAS=\"$ling_uas\"
MAKEOPTS=\"$make_conf\"
VIDEO_CARDS=\"$video_card\"
PYTHON_TARGETS=\"$python_target\"
#\" python3_2\"
#PYTHON_SINGLE_TARGET=\"python2_7 python3_2\"
INPUT_DEVICES=\"$input_device\"
#SYNC=\"rsync://rsync.europe.gentoo.org/gentoo-portage\"" > /mnt/gentoo/etc/portage/make.conf
}
znajdz_flagi() {
    cpu_inst="$(grep flags /proc/cpuinfo | uniq | tr -s '[:blank:]' ' ' | cut -d':' -f2)"
    flags_list="3dnow 3dnowext mmx mmxext sse sse2 sse3 sse4 sse4a sse4_1 sse4_2 sse5 ssse3"

    for v in ${flags_list}
    do
        echo "${cpu_inst}" | grep -o -w "${v}" >> flags.eg
    done

    echo "${cpu_inst}" | grep -o -w "pni" &>/dev/null && echo "sse3" >> flags.eg

    "available_cpu_flags=\"$(tr '\n' ' ' < flags.eg | sed -e 's:^[ \t]*::' -e 's:[ \t]*$::')\""
    }
zoneinfo (){
   #ls /usr/share/zoneinfo/Europe/
   echo "Ustawienie czasu na Warzawa"
   sleep 1
   #read miasto
   #miasto="Warsaw"
   echo "Europe/Warsaw" > /mnt/gentoo/etc/timezone
}
config_locales (){
   echo "ustawianie lokalizacji UTF-8"
   sleep 1
   echo "pl_PL.UTF-8 UTF-8" >> /mnt/gentoo/etc/locale.gen
   echo "pl_PL ISO-8859-2" >> /mnt/gentoo/etc/locale.gen
}
uruchom_local (){
   echo "uruchomienie programu aktualizującego lokalizacje"
   sleep 1
   update_shell
   com_p 'eselect locale set 4'
   com_p 'locale-gen'
   update_shell
}
instalacja_zrudel (){
   echo "instalowanie zrudel kernela"
   sleep 1
   com_p 'emerge -v gentoo-sources'
   sleep 1
}
kompilacja_kernela (){
   echo "kompilacja kernela"
   cd /mnt/gentoo/usr/src/linux
   sleep 1
   #com_p 'emerge -v genkernel'
   com_p 'cd $path_kernel; make mrproper'
   com_p 'cd $path_kernel; make clean'
   com_p 'cd $path_kernel; make defconfig'
   cp /home/maxim/config.kernel /mnt/gentoo/usr/src/linux
   make xconfig
   com_p 'cd $path_kernel; make $make_opts'
   com_p 'cd $path_kernel; make install'
   com_p 'cd $path_kernel; make modules_install'
   com_p 'cd $path_kernel; genkernel --install  initramfs'
   sleep 1
}
modules_pro (){
        echo "zapisywanie modulow do pliku autostartu"
        sleep 1
        # lub
        #     cat /proc/modules
        for i
        in `lsmod | cut -d ' ' -f 1 | grep -v 'Module'`
        do
                echo "modules=\"$i\"" >> /mnt/gentoo/etc/conf.d/modules
        done
        com_p 'modules-update'
        com_p 'rc-update add modules boot'
}
konfiguring_fstab(){
echo "ustawianie dysków w fstab"
echo "

# <fs>                  <mountpoint>    <type>          <opts>          <dump/p$

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.

$boot_dysk              /boot           ext2            noatime,noauto  1 2
$root_dysk              /               ext4            noatime         0 1
$swap_dysk             none            swap            sw         0 0
/dev/cdrom              /mnt/cdrom      auto            noauto,ro       0 0
/dev/fd0                /mnt/floppy     auto            noauto          0 0

proc              /proc           proc       defaults        0 0
shm               /dev/shm        tmpfs      nodev,nosuid,noexec  0 0" > /etc/fstab
sleep 1
}
konfiguring_host(){
   echo "configuracja host"
   com_p 'echo "hostname=\"$name_host\"" >> /etc/conf.d/hostname'
   echo "LANG=\"pl_PL.UTF-8\"" >> /mnt/gentoo/etc/env.d/02locale
   echo "LC_TYPE=\"pl_PL.UTF-8\"" >> /mnt/gentoo/etc/env.d/02locale
   update_shell
}
ustaw_haslo() {
com_p "useradd -m -G users,wheel,audio,portage,usb,plugdev -s /bin/bash $user_name"
com_p "passwd<<-PAS
$pasword
$pasword
PAS"
echo "twoje hasło to 1"
echo "     * twoje root  hasło to 1"
com_p "passwd $user_name<<-PAS1
$pasword
$pasword
PAS1"
echo "twoje haslo to $pasword"
com_p "gpasswd -a $user_name plugdev,users,wheel,audio,portage"
}
grub_config(){
        cd /
        export instaling=$instaling
        echo "instalowanie grub"
        sleep 1
        prog2="grub os-prober sys-fs/ntfs3g"
        for installing
        in $prog2
        do
                echo "instalowanie grub"
                sleep 2
                com_p "MAKEOPTS=$make_opts emerge -v $installing"
        done
        com_p 'grep -v rootfs /proc/mounts > /etc/mtab'
        com_p 'grub2-install /dev/sda'
        sleep 2
        com_p 'grub2-mkconfig -o /boot/grub/grub.cfg'
        sleep 2
}
setings_xorg(){
   echo 'INPUT_DEVICES="evdev keyboard mouse synaptics wacom"' >> /mnt/gentoo/etc/portage/make.conf
   echo "instalowanie xorg serwer"
   com_p 'emerge -v xorg-server'
   com_p 'emerge -v twm'
   com_p 'emerge -v zclock'
   com_p 'USE="toolbar" emerge -v xterm'
}
update_system(){
   com_p 'emerge --update --deep --newuse system'
}
update_world(){
   com_p 'emerge gentoolkit'
   com_p 'emerge --update --deep --newuse world'
   com_p 'emerge --depclean'
   com_p 'revdep-rebuild'
}

Instalowanie_programow(){
   com_p 'emerge -v pcmciautils'
   com_p 'USE="-ipv6" emerge -v syslog-ng'
   com_p 'rc-update add syslog-ng default'
   com_p 'USE="-ipv6" emerge -v dhcpcd'
   com_p 'rc-update add dhcpcd default'
   #com_p 'USE="-gnome -pulseaudio X -gtk -libnotify -qt4 -ipv6 -pcre -pm-utils -ipv6 -bluetooth " emerge -v wicd'
   #com_p 'rc-update add wicd default'
   #com_p '/etc/init.d/dbus start'
   com_p 'rc-update add dbus default'
   com_p 'emerge -v lshw'
}
instalowanie_gnome(){
   echo "Instalowanie gnome"
   com_p 'eselect profile set 4
   eselect profile list
   sleep 3'
   update_shell
echo '
gnome-base/gnome-session branding
>=sys-auth/pambase-20120417-r3 systemd
>=net-dialup/ppp-2.4.5-r3 ipv6
#>=app-admin/syslog-ng-3.4.2 -ipv6
#>=net-misc/dhcpcd-6.2.0-r1 -ipv6
#=dev-libs/openssl-1.0.0j -bindist
#=x11-libs/libdrm-2.4.46 libkms
#=media-libs/mesa-9.1.6 xa
#>=dev-libs/openssl-1.0.1f -bindist' >> /mnt/gentoo/etc/portage/package.use
   com_p 'emerge gnome-light'
   #echo 'XSESSION="Gnome" > /mnt/gentoo/etc/env.d/90xsession' # For X session ustawienie, jeśli nie ma login manager
   com_p 'env-update && source /etc/profile'
   com_p 'emerge -v gdm'
   #com_p 'rc-update add xdm default'

   #com_p 'echo "exec gnome-session">~/.xinitrc'
   #com_p 'echo 'DISPLAYMANAGER="GDM"'>/etc/conf.d/xdm'
}

#montowanie
#pobieranie
#rozpakowanie
#montowanie_root
#przygotowanie_chroot
#update_shell
#make_conf
#instalowanie_portage
#wybranie_profilu
#instalacja_ufed
#znajdz_flagi
#zoneinfo
#config_locales
#uruchom_local
#instalacja_zrudel
#kompilacja_kernela
#modules_pro
#konfiguring_fstab
#konfiguring_host
#ustaw_haslo
#grub_config
#setings_xorg
   #update_system
   #update_world
#Instalowanie_programow
   #instalowanie_gnome

comen=$1
$comen         #<------ this comand is a future, it make able to tart only this part of proces instaling what you want. example "instalowanie_gentoo.sh zoneinfo" But before you make that, you need make hash all comands executing parts of screept.
Back to top
View user's profile Send private message
tkhemili78
n00b
n00b


Joined: 31 Jul 2007
Posts: 38
Location: Eastern US

PostPosted: Sat Nov 08, 2014 9:09 am    Post subject: pxeboot Reply with quote

Have you tried running this thru pxeboot. for a rebuild/dr situation ?
Back to top
View user's profile Send private message
szczerb
Veteran
Veteran


Joined: 24 Feb 2007
Posts: 1656
Location: Poland => Lodz

PostPosted: Sat Nov 08, 2014 5:14 pm    Post subject: Reply with quote

Seems like a nice contribution, but why on earth did you use polish for all the labels in the script?

I never use polish in my code. It just makes the content quite hard to read for most of the world...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum