Commit cc19145d authored by picodotdev's avatar picodotdev
Browse files

Merge branch 'sid'

parents a9ec6c66 e3fa1aa8
Loading
Loading
Loading
Loading
+48 −1
Original line number Diff line number Diff line
@@ -27,8 +27,9 @@ Currently these scripts are for me but maybe they are useful for you too.
* VirtualBox guest utils
* Intel processors microcode
* Users creation and add to sudoers
* Common and custom packages installation
* yaourt installation
* Custom packages installation
* Retry packages download on conection/mirror error
* Desktop environments (GDM, KDE, XFCE, Mate, Cinnamon, LXDE), display managers (GDM, SDDM, Lightdm, lxdm) and no desktop environments
* Additional kernels installation (linux-lts, linux-hardened, linux-zen)
* Kernels compression
@@ -62,3 +63,49 @@ Currently these scripts are for me but maybe they are useful for you too.
### Arch Linux Installation Media

https://www.archlinux.org/download/

### Reference

* https://wiki.archlinux.org/index.php/Installation_guide
* https://wiki.archlinux.org/index.php/Main_page
* https://wiki.archlinux.org/index.php/General_recommendations
* https://wiki.archlinux.org/index.php/List_of_applications
* https://wiki.archlinux.org/index.php/Network_configuration
* https://wiki.archlinux.org/index.php/Wireless_network_configuration
* https://wiki.archlinux.org/index.php/NetworkManager
* https://wiki.archlinux.org/index.php/Solid_State_Drives
* https://wiki.archlinux.org/index.php/Partitioning
* https://wiki.archlinux.org/index.php/Fstab
* https://wiki.archlinux.org/index.php/Swap
* https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface
* https://wiki.archlinux.org/index.php/EFI_System_Partition
* https://wiki.archlinux.org/index.php/File_systems
* https://wiki.archlinux.org/index.php/Ext4
* https://wiki.archlinux.org/index.php/Persistent_block_device_naming
* https://wiki.archlinux.org/index.php/LVM
* https://wiki.archlinux.org/index.php/Dm-crypt
* https://wiki.archlinux.org/index.php/Dm-crypt/Device_encryption
* https://wiki.archlinux.org/index.php/Pacman
* https://wiki.archlinux.org/index.php/Mirrors
* https://wiki.archlinux.org/index.php/VirtualBox
* https://wiki.archlinux.org/index.php/Mkinitcpio
* https://wiki.archlinux.org/index.php/Intel_graphics
* https://wiki.archlinux.org/index.php/NVIDIA
* https://wiki.archlinux.org/index.php/ATI
* https://wiki.archlinux.org/index.php/Kernels
* https://wiki.archlinux.org/index.php/Kernel_mode_setting
* https://wiki.archlinux.org/index.php/Kernel_parameters
* https://wiki.archlinux.org/index.php/Category:Boot_loaders
* https://wiki.archlinux.org/index.php/GRUB
* https://wiki.archlinux.org/index.php/REFInd
* https://wiki.archlinux.org/index.php/Systemd-boot
* https://wiki.archlinux.org/index.php/Systemd
* https://wiki.archlinux.org/index.php/Microcode
* https://wiki.archlinux.org/index.php/Wayland
* https://wiki.archlinux.org/index.php/Xorg
* https://wiki.archlinux.org/index.php/Desktop_environment
* https://wiki.archlinux.org/index.php/GNOME
* https://wiki.archlinux.org/index.php/KDE
* https://wiki.archlinux.org/index.php/Xfce
* http://tldp.org/LDP/Bash-Beginners-Guide/html/
* http://tldp.org/LDP/abs/html/
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ set -e

# Usage:
# # loadkeys es
# # curl https://raw.githubusercontent.com/picodotdev/alis/master/download.sh | bash
# # curl https://raw.githubusercontent.com/picodotdev/alis/master/download.sh | bash, or with URL shortener curl -sL https://bit.ly/2F3CATp | bash
# # vim alis.conf
# # ./alis-recovery.sh

+29 −5
Original line number Diff line number Diff line
@@ -37,14 +37,38 @@ ADDITIONAL_USER_PASSWORDS="" # list separated by space
# bootloader
BOOTLOADER="grub" # grub refind systemd

# packages
PACKAGES_PACMAN="" # firefox firefox-i18n-es-es ntfs-3g gimp libreoffice libreoffice-fresh libreoffice-fresh-es vlc gstreamer0.10-plugins gstreamer0.10-good-plugins gstreamer0.10-bad-plugins gstreamer0.10-ugly-plugins
PACKAGES_YAOURT=""
YAOURT="true"

# desktop
DESKTOP_ENVIRONMENT="gnome" # gnome kde xfce mate cinnamon lxde
DISPLAY_DRIVER="" # xf86-video-intel xf86-video-amdgpu xf86-video-ati nvidia nvidia-340xx nvidia-340xx-lts nvidia-304xx nvidia-304xx-lts xf86-video-nouveau

# packages (precede package name with ! for not install)
PACKAGES_PACMAN_INTERNET="!firefox !chromium !apache !nginx !curl !wget !filezilla !sshfs !openssh !transmission-gtk !transmission-qt !amule !geary !thunderbird !empathy !kopete !polari !konversation !liferea !hugo !gnome-boxes"
PACKAGES_PACMAN_MULTIMEDIA="!gthumb gimp !imagemagick !krita !inkscape !blender !cmus !vlc !easytag !ardour !audacity !ffmpeg !gnome-phone-manager !kdeconnect !gstreamer !gst-plugins-good !gst-plugins-bad !gst-plugins-ugly !bluez !bluez-utils"
PACKAGES_PACMAN_UTILITIES="!eclipse-java !intellij-idea-community-edition !gradle !maven lz4 !meld !dosfstools !ntfs-3g !exfat-utils"
PACKAGES_PACMAN_DOCUMENTS_AND_TEXT="!libreoffice-fresh !calligra !discount !lyx !vim !calibre"
PACKAGES_PACMAN_SECURITY="!rsync !gnupg !keepassx2"
PACKAGES_PACMAN_SCIENCE="!geogebra !octave"
PACKAGES_PACMAN_OTHERS="!klavaro !tmux"
PACKAGES_PACMAN_DEVELOPER="!openjdk !python !dotnet-sdk !php !rust !go !virtualbox !docker !ansible !vagrant"
PACKAGES_PACMAN_CUSTOM=""

PACKAGES_YAOURT_INTERNET="!dropbox"
PACKAGES_YAOURT_MULTIMEDIA=""
PACKAGES_YAOURT_UTILITIES="!visual-studio-code-bin"
PACKAGES_YAOURT_DOCUMENTS_AND_TEXT="!wps-office"
PACKAGES_YAOURT_SECURITY="!freefilesync"
PACKAGES_YAOURT_SCIENCE=""
PACKAGES_YAOURT_OTHERS="!gnucash"
PACKAGES_YAOURT_DEVELOPER=""
PACKAGES_YAOURT_CUSTOM=""

PACKAGES_PACMAN="$PACKAGES_PACMAN_INTERNET $PACKAGES_PACMAN_MULTIMEDIA $PACKAGES_PACMAN_UTILITIES $PACKAGES_PACMAN_DOCUMENTS_AND_TEXT $PACKAGES_PACMAN_SECURITY $PACKAGES_PACMAN_SCIENCE $PACKAGES_PACMAN_OTHERS $PACKAGES_PACMAN_DEVELOPER $PACKAGES_PACMAN_CUSTOM"
PACKAGES_YAOURT="$PACKAGES_YAOURT_INTERNET $PACKAGES_YAOURT_MULTIMEDIA $PACKAGES_YAOURT_UTILITIES $PACKAGES_YAOURT_DOCUMENTS_AND_TEXT $PACKAGES_YAOURT_SECURITY $PACKAGES_YAOURT_SCIENCE $PACKAGES_YAOURT_OTHERS $PACKAGES_YAOURT_DEVELOPER $PACKAGES_YAOURT_CUSTOM"
PACKAGES_PACMAN=$(echo $PACKAGES_PACMAN | sed "s/![^ ]*//g")
PACKAGES_YAOURT=$(echo $PACKAGES_YAOURT | sed "s/![^ ]*//g")
PACKAGES_PACMAN=$(echo $PACKAGES_PACMAN | sed "s/ {2,}/ /g")
PACKAGES_YAOURT=$(echo $PACKAGES_YAOURT | sed "s/ {2,}/ /g")
YAOURT="true"

#reboot
REBOOT="true"
+58 −26
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ set -e

# Usage:
# # loadkeys es
# # curl https://raw.githubusercontent.com/picodotdev/alis/master/download.sh | bash
# # curl https://raw.githubusercontent.com/picodotdev/alis/master/download.sh | bash, or with URL shortener curl -sL https://bit.ly/2F3CATp | bash
# # vim alis.conf
# # ./alis.sh

@@ -54,7 +54,6 @@ UUID_ROOT=""
PARTUUID_BOOT=""
PARTUUID_ROOT=""
DEVICE_TRIM=""
ALLOW_DISCARDS=""
CPU_INTEL=""
VIRTUALBOX=""
CMDLINE_LINUX_ROOT=""
@@ -201,10 +200,14 @@ function check_facts() {

function prepare() {
    prepare_partition
    timedatectl set-ntp true
    configure_time
    configure_network
}

function configure_time() {
    timedatectl set-ntp true
}

function prepare_partition() {
    if [ -d /mnt/boot ]; then
        umount /mnt/boot
@@ -362,9 +365,9 @@ function install() {
}

function kernels() {
    arch-chroot /mnt pacman -Sy --noconfirm linux-headers
    pacman_install "linux-headers"
    if [ -n "$KERNELS" ]; then
        arch-chroot /mnt pacman -Sy --noconfirm $KERNELS
        pacman_install "$KERNELS"
    fi
}

@@ -399,15 +402,15 @@ function configuration() {
}

function network() {
    arch-chroot /mnt pacman -Sy --noconfirm networkmanager
    pacman_install "networkmanager"
    arch-chroot /mnt systemctl enable NetworkManager.service
}

function virtualbox() {
    if [ -z "$KERNELS" ]; then
        arch-chroot /mnt pacman -Sy --noconfirm virtualbox-guest-utils virtualbox-guest-modules-arch
        pacman_install "virtualbox-guest-utils virtualbox-guest-modules-arch"
    else
        arch-chroot /mnt pacman -Sy --noconfirm virtualbox-guest-utils virtualbox-guest-dkms
        pacman_install "virtualbox-guest-utils virtualbox-guest-dkms"
    fi
}

@@ -444,8 +447,11 @@ function mkinitcpio() {
}

function bootloader() {
    BOOTLOADER_DEVICE_ROOT_MAPPER=""
    BOOTLOADER_ALLOW_DISCARDS=""

    if [ "$CPU_INTEL" == "true" -a "$VIRTUALBOX" != "true" ]; then
        arch-chroot /mnt pacman -Sy --noconfirm intel-ucode
        pacman_install "intel-ucode"
    fi

    if [ "$LVM" == "true" ]; then
@@ -454,11 +460,11 @@ function bootloader() {
        CMDLINE_LINUX_ROOT="root=PARTUUID=$PARTUUID_ROOT"
    fi
    if [ -n "$PARTITION_ROOT_ENCRYPTION_PASSWORD" ]; then
        BOOTLOADER_DEVICE_ROOT_MAPPER=":$DEVICE_ROOT_MAPPER"
        if [ "$DEVICE_TRIM" == "true" ]; then
            ALLOW_DISCARDS=":allow-discards"
            BOOTLOADER_ALLOW_DISCARDS=":allow-discards"
        fi

        CMDLINE_LINUX="cryptdevice=PARTUUID=$PARTUUID_ROOT:lvm$ALLOW_DISCARDS"
        CMDLINE_LINUX="cryptdevice=PARTUUID=$PARTUUID_ROOT$BOOTLOADER_DEVICE_ROOT_MAPPER$BOOTLOADER_ALLOW_DISCARDS"
    fi

    case "$BOOTLOADER" in
@@ -475,7 +481,7 @@ function bootloader() {
}

function grub() {
    arch-chroot /mnt pacman -Sy --noconfirm grub dosfstools
    pacman_install "grub dosfstools"
    arch-chroot /mnt sed -i 's/GRUB_DEFAULT=0/GRUB_DEFAULT=saved/' /etc/default/grub
    arch-chroot /mnt sed -i 's/#GRUB_SAVEDEFAULT="true"/GRUB_SAVEDEFAULT="true"/' /etc/default/grub
    arch-chroot /mnt sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="quiet"/GRUB_CMDLINE_LINUX_DEFAULT=""/' /etc/default/grub
@@ -485,7 +491,7 @@ function grub() {
    echo "GRUB_DISABLE_SUBMENU=y" >> /mnt/etc/default/grub

    if [ "$BIOS_TYPE" == "uefi" ]; then
        arch-chroot /mnt pacman -Sy --noconfirm efibootmgr
        pacman_install "efibootmgr"
        arch-chroot /mnt grub-install --target=x86_64-efi --bootloader-id=grub --efi-directory=$ESP_DIRECTORY --recheck
        #arch-chroot /mnt efibootmgr --create --disk $DEVICE --part $PARTITION_BOOT_NUMBER --loader /EFI/grub/grubx64.efi --label "GRUB Boot Manager"
    fi
@@ -501,7 +507,7 @@ function grub() {
}

function refind() {
    arch-chroot /mnt pacman -Sy --noconfirm refind-efi
    pacman_install "refind-efi"
    arch-chroot /mnt refind-install

    arch-chroot /mnt rm /boot/refind_linux.conf
@@ -735,7 +741,7 @@ function desktop_environment() {
            ;;
    esac

    arch-chroot /mnt pacman -Sy --noconfirm xorg-server xorg-apps $DISPLAY_DRIVER mesa $MESA_LIBGL
    pacman_install "xorg-server xorg-apps $DISPLAY_DRIVER mesa $MESA_LIBGL"

    case "$DESKTOP_ENVIRONMENT" in
        "gnome" )
@@ -760,43 +766,43 @@ function desktop_environment() {
}

function desktop_environment_gnome() {
    arch-chroot /mnt pacman -Sy --noconfirm gnome gnome-extra
    pacman_install "gnome gnome-extra"
    arch-chroot /mnt systemctl enable gdm.service
}

function desktop_environment_kde() {
    arch-chroot /mnt pacman -Sy --noconfirm plasma-meta kde-applications-meta
    pacman_install "plasma-meta kde-applications-meta"
    arch-chroot /mnt sed -i 's/Current=.*/Current=breeze/' /etc/sddm.conf
    arch-chroot /mnt systemctl enable sddm.service
}

function desktop_environment_xfce() {
    arch-chroot /mnt pacman -Sy --noconfirm xfce4 xfce4-goodies lightdm lightdm-gtk-greeter
    pacman_install "xfce4 xfce4-goodies lightdm lightdm-gtk-greeter"
    arch-chroot /mnt systemctl enable lightdm.service
}

function desktop_environment_mate() {
    arch-chroot /mnt pacman -Sy --noconfirm mate mate-extra lightdm lightdm-gtk-greeter
    pacman_install "mate mate-extra lightdm lightdm-gtk-greeter"
    arch-chroot /mnt systemctl enable lightdm.service
}

function desktop_environment_cinnamon() {
    arch-chroot /mnt pacman -Sy --noconfirm cinnamon lightdm lightdm-gtk-greeter
    pacman_install "cinnamon lightdm lightdm-gtk-greeter"
    arch-chroot /mnt systemctl enable lightdm.service
}

function desktop_environment_lxde() {
    arch-chroot /mnt pacman -Sy --noconfirm lxde lxdm
    pacman_install "clxde lxdm"
    arch-chroot /mnt systemctl enable lxdm.service
}

function packages() {
    if [ "$FILE_SYSTEM_TYPE" == "btrfs" ]; then
        arch-chroot /mnt pacman -Sy --noconfirm btrfs-progs
        pacman_install "btrfs-progs"
    fi

    if [ -n "$PACKAGES_PACMAN" ]; then
        arch-chroot /mnt pacman -Sy --noconfirm --needed $PACKAGES_PACMAN
        pacman_install "$PACKAGES_PACMAN"
    fi

    packages_yaourt
@@ -809,11 +815,11 @@ function packages_yaourt() {
        echo "SigLevel=Optional TrustAll" >> /mnt/etc/pacman.conf
        echo "Server=http://repo.archlinux.fr/\$arch" >> /mnt/etc/pacman.conf

        arch-chroot /mnt pacman -Sy --noconfirm yaourt
        pacman_install "yaourt"
    fi

    if [ -n "$PACKAGES_YAOURT" ]; then
        arch-chroot /mnt yaourt -S --noconfirm --needed $PACKAGES_YAOURT
        yaourt_install "$PACKAGES_YAOURT"
    fi
}

@@ -850,6 +856,32 @@ function end() {
    fi
}

function pacman_install() {
    PACKAGES=$1
    for VARIABLE in {1..5}
    do
        arch-chroot /mnt pacman -Sy --noconfirm $PACKAGES
        if [ $? == 0 ]; then
            break
        else
            sleep 10
        fi
    done
}

function yaourt_install() {
    PACKAGES=$1
    for VARIABLE in {1..5}
    do
        arch-chroot /mnt bash -c "echo -e \"$USER_PASSWORD\n$USER_PASSWORD\n$USER_PASSWORD\n$USER_PASSWORD\n\" | su $USER_NAME yaourt -Sy --noconfirm --needed $PACKAGES"
        if [ $? == 0 ]; then
            break
        else
            sleep 10
        fi
    done
}

function main() {
    configuration_install
    check_variables