Installation
===================================

.. toctree::
   :maxdepth: 2
   :caption: Contents:
===================================

From the iso file running on Milis Linux, you can directly install the Milis Linux Operating System to the target partition.
Then, as well as the settings you configured on the iso file
will be copied to your computer's disk(s).

Before Installation
--------------------

Signature Verification
^^^^^^^^^^^^^^^^^
In spite of any file corruption and download errors, before starting the installation.
It is recommended that you should verify the signature of the file.
To do this, put the downloaded sha256sum file into the same folder as your iso file and
run the command below:

.. code:: bash

    sha256sum -c milis-2.0-xfce4-B05.19.iso.sha256sum


Booting the Milis Linux Operating System with Live Image
^^^^^^^^^^^^^^^^^^^^^^^
Flash(Burn) the downloaded iso file to a USB storage or CD storage and start with the driver. 
After live image booting, you can install Milis Linux on your computer in three different ways:

1. Installation with a Terminal(Console) User Interface 
--------------------

Run the installation application via a terminal(console) and run the command **milis-kur**.
Milis-kur application is a installation utility with a terminal user interface(console based interface).
Installation is explained step by step below. 

The installation application takes place by following the steps shown in the picture. 
After making the necessary settings for all steps, the installation starts with the **Install** step.

.. image:: resim/kurulum/0menu.png
   :width: 500

1.1 Keyboard Layout
^^^^^^^^^^^^^^^^^^^^^^^^^
Choose your keyboard layout. 
Keyboard layout for installation, Keymap values ​​for minimal installation.

.. image:: resim/kurulum/1klavye.png
   :width: 500

1.2 Hostname
^^^^^^^^^^^^^^^^^^^^^^^^^
Enter your hostname

.. image:: resim/kurulum/2bilgisayar.png
   :width: 500

1.3 Locale Settings
^^^^^^^^^^^^^^^^^^^^^^^^^
The relevant regional settings are selected. It will determine the language of the system.

.. image:: resim/kurulum/3bolgesel.png
   :width: 500
   
1.4 Time zone
^^^^^^^^^^^^^^^^^^^^^^^^^
Related time zone is selected, for Turkey, you'll need to select Turkey which is at the end of the section.

.. image:: resim/kurulum/4zaman.png
   :width: 500

1.5 Root Account
^^^^^^^^^^^^^^^^^^^^^^^^^
A password is assigned for the root account.

.. image:: resim/kurulum/5root.png
   :width: 500
   
1.6 Create a User Account 
^^^^^^^^^^^^^^^^^^^^^^^^^
User account settings will be created.
User login name is the name you will use when you'll login to the system.
**Turkish characters cannot be typed**.

.. image:: resim/kurulum/6kull1.png
   :width: 500

The user can be thought of as their first name, long name or first name-last name.
Turkish characters can be typed.

.. image:: resim/kurulum/6kull2.png
   :width: 500

A password is assigned for the user.

.. image:: resim/kurulum/6kull3.png
   :width: 500

If there is a group needed for adding the user(s) into it, it will be selected.
By default it will be installed with the required groups for the user(s).
For adding user to the groups select OK.

.. image:: resim/kurulum/6kull4.png
   :width: 500
   
1.7 Bootloader configuration
^^^^^^^^^^^^^^^^^^^^^^^^^
The disk will be selected for Bootloader to be installed

.. image:: resim/kurulum/7onyukleyici.png
   :width: 500

Select Yes for the default disk partition.
 
.. image:: resim/kurulum/7onyukleyici2.png
   :width: 500

1.8 Disk Partitioning
^^^^^^^^^^^^^^^^^^^^^^^^^
It is the step where the disk partition where the Milis Linux System will be installed is getting ready.
The cfdisk application is running for the disk(s) on which the system will be installed.
The documentation of the application should be read before running cfdisk.
In our example Installation, sdb is selected.

.. image:: resim/kurulum/8bolumleme1.png
   :width: 500

To install the system, at least one ext4 disk is needed.
In addition, if EFI is to be installed, a disk partition of at least 100MB in FAT32 format should be set.

.. image:: resim/kurulum/8bolumleme2.png
   :width: 500
   
.. image:: resim/kurulum/8bolumleme3.png
   :width: 500

1.9 Choosing the File System 
^^^^^^^^^^^^^^^^^^^^^^^^^
This is the step of assigning the partition where the Milis Linux System will be installed to disk(s).
In the sample installation, it will be installed on the sdb1 partition.
By default it should be connected under **/**.
If you don't have an EFI partition, just mount it.
For EFI partition, bind under **/boot/efi**.
After that, the formatting can be approved and exit (finished) can be done.

.. image:: resim/kurulum/9dosyasistemi1.png
   :width: 500
   
.. image:: resim/kurulum/9dosyasistemi2.png
   :width: 500
   
.. image:: resim/kurulum/9dosyasistemi3.png
   :width: 500
   
.. image:: resim/kurulum/9dosyasistemi4.png
   :width: 500
   
1.10 Installing the Milis Linux Operating System
^^^^^^^^^^^^^^^^^^^^^^^^^
Before starting the installation, you may check the settings which is configured.
   
.. image:: resim/kurulum/10ayarlar.png
   :width: 500

After checking the settings configuration, the installation of the Milis Linux System will be started by selecting the install step by entering OK.
   
.. image:: resim/kurulum/10yukle1.png
   :width: 500

.. image:: resim/kurulum/10yukle2.png
   :width: 500

.. image:: resim/kurulum/10yukle3.png
   :width: 500

.. image:: resim/kurulum/10yukle4.png
   :width: 500

Exiting installation application with successfully installed message
your system can be restarted.

.. image:: resim/kurulum/10yukle5.png
   :width: 500

2. Installing Milis Linux with a Graphical User Interface
--------------------

It can also be installed using the Graphical User Interface with the installation application on the desktop.
Necessary information is available in the steps in the application.

3. Standard Installation 
--------------------

Step by step, follow the instructions below.


3.1 Preparing disk(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. warning::
    At this stage, the data on your disk will be deleted! Enough about the programs used
    If you do not know, it is strongly not recommended to continue! Before proceeding to this step, please
    Check out the `belgeleri`_ about fdisk and cfdisk programs.

.. _belgeleri: http://belgeler.org/howto/partition-howto-fdisk.html

You can use fdisk or cfdisk commands to configure the partitions where you will install the system.
Since the system will be installed on one root directory in this document, only one
section will be created. To do this,

1. You'll list your block devices by this command written below:


.. code:: bash
    
    lsblk

2. The fdisk (or cfdisk) program is started with the specified disk partition:

.. code:: bash

    fdisk /dev/sdx

3. A new partition is created on the disk(s) with the 'n' command:

::

    Command (m for help): n

Section type is determined as 'primary' or 'extended'. Default
No parameters are given to continue with the setting:

::

    Partition type
       p   primary (0 primary, 0 extended, 4 free)
       e   extended (container for logical partitions)
    Select (default p): 
    Using default response p.

Partition number is determined, in this case it is enough to proceed with default.
will:

::

    Partition number (1-4, default 1): 

Beginning sector of the department is determined, at this stage, from the beginning sector that can be used as default
starts. It continues with the default:

::

    First sector (2048-15730687, default 2048): 

The last sector of the section is configured. Instead of using numbers directly here, start
with the addition of a certain area size to the sector, calculating generally more
suitable. Just enter the size you want to use as specified, for example 20 GB
If you are going to use a field, your parameter will be + 20G. If entered by default
the program will reserve all available space:

::

    Last sector, +sectors or +size{K,M,G,T,P} (2048-15730687, default 15730687): 

4. With the 'w' command the changes in the driver are saved in the disk(s):

::

    Command (m for help): w
    The partition table has been altered.
    Calling ioctl() to re-read partition table.
    Syncing disks.



3.2 Creating the file system
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
In order to use the formatted partition, a Linux file system is created in the partition:

.. code:: bash

    mkfs.ext4 /dev/sdax


3.3 Mounting the file system
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The section prepared for installation is connected to the host system:

.. code:: bash

    mount /dev/sdax /mnt

3.4 Copying the System to the disk(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1. The existing filesystem on the host system is copied to the target disk(s):

.. code:: bash
    
    cp -axvu / /mnt

2. initramfs is created by this command written below:

.. code:: bash
    
    mount --bind /dev /mnt/dev
    mount --bind /sys /mnt/sys
    mount --bind /proc /mnt/proc
    chroot /mnt dracut -N --force --xz --omit systemd /boot/initrd

3. The GRUB settings will be configured by this command written below:

.. code:: bash
    
    grub-install --force --boot-directory=/mnt/boot /dev/sdy
    chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg

