mirror of
https://gitlab.com/JKANetwork/JKArch.git
synced 2026-02-16 10:11:32 +01:00
Some fixes and better swap support
This commit is contained in:
@@ -71,36 +71,17 @@ function pacmanerror {
|
|||||||
##This function logs and execute commands
|
##This function logs and execute commands
|
||||||
function execl {
|
function execl {
|
||||||
local command
|
local command
|
||||||
echo "------" >> "/tmp/install.log"
|
|
||||||
if [[ $1 != "chroot" && $1 != "chuser" ]];then #If it runs normally
|
if [[ $1 != "chroot" && $1 != "chuser" ]];then #If it runs normally
|
||||||
command="$1"
|
$1
|
||||||
for (( i=2; i<=$#; i++ ))
|
else #There is a chroot/chuser word and we have to delete it, and then use
|
||||||
do
|
command=`echo $command | cut -d" " -f2-`
|
||||||
command="$command $(echo $* | cut -f$i -d" ")"
|
if [[ $1 = "chroot" ]];then #If it runs in the chroot
|
||||||
done
|
chroot /mnt /bin/bash -c "$command"
|
||||||
echo "$command" >> "/tmp/install.log"
|
elif [[ $1 = "chuser" ]];then #If it has to run in the created user in chroot
|
||||||
$command
|
chroot /mnt /bin/bash -c "su $nameuser -c \"$command\" "
|
||||||
else #There is a "First word", avoid it
|
fi
|
||||||
for (( i=2; i<=$#; i++ ))
|
|
||||||
do
|
|
||||||
command="$command $(echo $* | cut -f$i -d" ")"
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $1 = "chroot" ]];then #If it runs in chroot
|
|
||||||
echo "(In the install partition/chroot) $command" >> "/tmp/install.log"
|
|
||||||
chroot /mnt /bin/bash -c "$command"
|
|
||||||
elif [[ $1 = "chuser" ]];then #If it has to run in chroot but in the user name
|
|
||||||
echo "(In a 'user' chroot in install partition) $command" >> "/tmp/install.log"
|
|
||||||
chroot /mnt /bin/bash -c "su $nameuser -c \"$command\" "
|
|
||||||
fi
|
|
||||||
|
|
||||||
#Log result of the command
|
|
||||||
if [[ $? == 0 ]];then
|
|
||||||
echo "Result Ok " >> "/tmp/install.log"
|
|
||||||
else
|
|
||||||
echo "Error: Code $?" >> "/tmp/install.log"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
##Function for show to the user if an option is on or off
|
##Function for show to the user if an option is on or off
|
||||||
@@ -441,7 +422,7 @@ function installconf {
|
|||||||
isanetworkerror # Comprueba si hubo un error de descarga
|
isanetworkerror # Comprueba si hubo un error de descarga
|
||||||
tput setaf 2 ; echo "$(T "Downloading")" ; tput setaf 9
|
tput setaf 2 ; echo "$(T "Downloading")" ; tput setaf 9
|
||||||
#Install base and disk format drivers. Reflector and rsync is for updating mirrorlist later
|
#Install base and disk format drivers. Reflector and rsync is for updating mirrorlist later
|
||||||
execl pacstrap -C pacman.conf /mnt/ base jkarch-mirrorlist reflector rsync dosfstools ntfs-3g btrfs-progs exfat-utils
|
execl pacstrap -C pacman.conf /mnt/ base jkarch-mirrorlist reflector rsync dosfstools ntfs-3g btrfs-progs exfat-utils systemd-swap
|
||||||
pacmanerror
|
pacmanerror
|
||||||
# Copy pacman.conf
|
# Copy pacman.conf
|
||||||
execl cp pacman.conf /mnt/etc/pacman.conf
|
execl cp pacman.conf /mnt/etc/pacman.conf
|
||||||
@@ -482,6 +463,8 @@ function installconf {
|
|||||||
# Standard packages
|
# Standard packages
|
||||||
allpackages="$allpackages flashplugin evince ristretto librsvg gnome-calculator gnome-disk-utility file-roller lrzip p7zip unace unrar tumbler poppler-glib ffmpegthumbnailer libgsf notepadqq leafpad libreoffice-fresh vlc qt4 noto-fonts noto-fonts-cjk noto-fonts-emoji ttf-dejavu ttf-liberation ttf-ms-fonts"
|
allpackages="$allpackages flashplugin evince ristretto librsvg gnome-calculator gnome-disk-utility file-roller lrzip p7zip unace unrar tumbler poppler-glib ffmpegthumbnailer libgsf notepadqq leafpad libreoffice-fresh vlc qt4 noto-fonts noto-fonts-cjk noto-fonts-emoji ttf-dejavu ttf-liberation ttf-ms-fonts"
|
||||||
|
|
||||||
|
# Video pkgs
|
||||||
|
allpackages=$allpackages" "$(pacman -Ssq xf86-video-*)
|
||||||
# If spanish, add spanish lang
|
# If spanish, add spanish lang
|
||||||
if [[ $sclang == "es" ]];then
|
if [[ $sclang == "es" ]];then
|
||||||
allpackages="$allpackages libreoffice-fresh-es firefox-i18n-es-es"
|
allpackages="$allpackages libreoffice-fresh-es firefox-i18n-es-es"
|
||||||
@@ -525,14 +508,15 @@ function installconf {
|
|||||||
# Add sudo support for wheel users like user added
|
# Add sudo support for wheel users like user added
|
||||||
sed -i "s/\# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/g" /mnt/etc/sudoers
|
sed -i "s/\# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/g" /mnt/etc/sudoers
|
||||||
|
|
||||||
# User directory (Photos, Desktop..) create
|
# User directory creation (Photos, Desktop..)
|
||||||
execl chroot xdg-user-dirs-update
|
execl chroot xdg-user-dirs-update
|
||||||
|
execl chuser xdg-user-dirs-update
|
||||||
# Turn on some services
|
# Turn on some services
|
||||||
execl chroot systemctl enable lightdm
|
execl chroot systemctl enable lightdm
|
||||||
execl chroot systemctl enable NetworkManager
|
execl chroot systemctl enable NetworkManager
|
||||||
execl chroot systemctl enable dhcpcd
|
execl chroot systemctl enable dhcpcd
|
||||||
# Enable cupsd service for printing
|
execl chroot systemctl enable systemd-swap #Swap detection
|
||||||
execl chroot systemctl enable org.cups.cupsd
|
execl chroot systemctl enable org.cups.cupsd #Enable cupsd service for printing
|
||||||
|
|
||||||
# Configure wine if neccesary
|
# Configure wine if neccesary
|
||||||
if [[ $inswine = "1" ]];then
|
if [[ $inswine = "1" ]];then
|
||||||
@@ -718,10 +702,7 @@ umount /mnt/
|
|||||||
# Start questions, functions for timezone, enviroment, programs...
|
# Start questions, functions for timezone, enviroment, programs...
|
||||||
|
|
||||||
particiones
|
particiones
|
||||||
horaidioma
|
horaidioma
|
||||||
|
|
||||||
#Graficos (Falta la parte de VM)
|
|
||||||
allpackages=$allpackages" "$(pacman -Ssq xf86-video-*)
|
|
||||||
|
|
||||||
#Aqui va la personalizacion de programas, ya que son graficos.
|
#Aqui va la personalizacion de programas, ya que son graficos.
|
||||||
appsuser
|
appsuser
|
||||||
|
|||||||
Reference in New Issue
Block a user