1
0
mirror of https://gitlab.com/JKANetwork/JKArch.git synced 2026-02-19 03:31:32 +01:00

Some fixes

This commit is contained in:
Kevin Puertas
2017-08-31 01:03:22 +02:00
parent 34f78c6057
commit 085eeee180

View File

@@ -19,7 +19,22 @@ function mostrardialog {
dialog --title "$titled" --msgbox "$msgd" 15 60 dialog --title "$titled" --msgbox "$msgd" 15 60
} }
## This function shows messages better to the user ##This function execute the commands
function execl {
local command
if [[ $1 != "chroot" && $1 != "chuser" ]];then #If it runs normally
$*
else #There is a chroot/chuser word and we have to delete it, and then use
command=`echo "$*" | cut -d" " -f2-`
if [[ $1 = "chroot" ]];then #If it runs in the chroot
chroot /mnt /bin/bash -c "$command"
elif [[ $1 = "chuser" ]];then #If it has to run in the created user in chroot
chroot /mnt /bin/bash -c "su $nameuser -c \"$command\" "
fi
fi
}
## This function shows messages to the user in a better way, and logs it
## $1 -> Sentence to show ## $1 -> Sentence to show
## $2 -> Start(1) /Finish(2) ## $2 -> Start(1) /Finish(2)
function showdo { function showdo {
@@ -40,6 +55,8 @@ function showdo {
echo "[ OK ] $1" echo "[ OK ] $1"
echo "[ OK ] $1" >> /tmp/install.log echo "[ OK ] $1" >> /tmp/install.log
fi fi
else
echo "[ RUN ] $1"
fi fi
} }
@@ -68,20 +85,6 @@ function pacmanerror {
fi fi
} }
##This function execute the commands
function execl {
local command
if [[ $1 != "chroot" && $1 != "chuser" ]];then #If it runs normally
$*
else #There is a chroot/chuser word and we have to delete it, and then use
command=`echo "$*" | cut -d" " -f2-`
if [[ $1 = "chroot" ]];then #If it runs in the chroot
chroot /mnt /bin/bash -c "$command"
elif [[ $1 = "chuser" ]];then #If it has to run in the created user in chroot
chroot /mnt /bin/bash -c "su $nameuser -c \"$command\" "
fi
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
function optstate { function optstate {
@@ -414,11 +417,8 @@ function installconf {
execl mount /dev/$partefi /mnt/boot/efi/ execl mount /dev/$partefi /mnt/boot/efi/
fi fi
# Download or install base system. # Download and install base system.
execl wget -nv https://gitlab.com/JKANetwork/JKArch/raw/master/installer/pacman.conf -O pacman.conf
#JKArch Mirrorlist needed
execl wget -nv https://mirror.jkanetwork.com/Arch-repository/jkarch-mirrorlist -O /etc/pacman.d/jkarch-mirrorlist
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 systemd-swap execl pacstrap -C pacman.conf /mnt/ base jkarch-mirrorlist reflector rsync dosfstools ntfs-3g btrfs-progs exfat-utils systemd-swap
@@ -492,7 +492,7 @@ function installconf {
execl chroot systemctl enable ntpd execl chroot systemctl enable ntpd
# User and desktop skel # User and desktop skel
wget -nv https://gitlab.com/JKANetwork/JKArch/raw/master/installer/skeluser.tar.xz -O- | tar xJf - -C /mnt/ tar xJf /root/skeluser.tar.xz -C /mnt/
# Create user # Create user
execl chroot useradd -m -G wheel -s /bin/bash $nameuser execl chroot useradd -m -G wheel -s /bin/bash $nameuser
@@ -511,6 +511,7 @@ function installconf {
execl chroot xdg-user-dirs-update execl chroot xdg-user-dirs-update
execl chuser xdg-user-dirs-update execl chuser xdg-user-dirs-update
# Turn on some services # Turn on some services
showdo "Enabling 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
@@ -560,9 +561,10 @@ function installconf {
# Clean pacman # Clean pacman
echo "$(T "Cleaning")" showdo "$(T "Cleaning")"
execl chroot rm -rf $sfslocate/var/cache/pacman/pkg/* execl chroot rm -rf $sfslocate/var/cache/pacman/pkg/*
execl chroot pacman -Sc --noconfirm execl chroot pacman -Sc --noconfirm
} # Fin installconf } # Fin installconf
@@ -624,6 +626,16 @@ if [[ ! -f "jkarch" ]];then
# Grow cowspace # Grow cowspace
showdo "Grow cowspace for installer" showdo "Grow cowspace for installer"
execl mount -o remount,size=700M /run/archiso/cowspace execl mount -o remount,size=700M /run/archiso/cowspace
# Download JKArch scripts and data...
showdo "Downloading JKArch scripts and data" "1"
wget -nv https://gitlab.com/JKANetwork/JKArch/raw/master/installer/translations.sh -O /root/translations.sh ; isanetworkerror
wget -nv https://gitlab.com/JKANetwork/JKArch/raw/master/installer/skeluser.tar.xz -O /root/skeluser.tar.xz ; isanetworkerror
wget -nv https://gitlab.com/JKANetwork/JKArch/raw/master/installer/pacman.conf -O /root/pacman.conf ; isanetworkerror
wget -nv https://mirror.jkanetwork.com/Arch-repository/jkarch-mirrorlist -O /etc/pacman.d/jkarch-mirrorlist ; isanetworkerror #Goes to final location directly
showdo "Downloaded JKArch scripts and data" "2"
#Enable pacman #Enable pacman
showdo "Configuring pacman" "1" showdo "Configuring pacman" "1"
execl pacman-key --init execl pacman-key --init
@@ -636,27 +648,29 @@ if [[ ! -f "jkarch" ]];then
execl reflector --verbose -l 6 --sort rate --save /etc/pacman.d/mirrorlist execl reflector --verbose -l 6 --sort rate --save /etc/pacman.d/mirrorlist
showdo "Updated mirrors" "2" showdo "Updated mirrors" "2"
showdo "Removing and installing live programs to start installation" "1"
#Delete programs (For not updating it) #Delete programs (For not updating it)
pacman -R clonezilla darkhttpd diffutils grml-zsh-config irssi linux-atm lvm2 man-db man-pages mc ndisc6 nmap smartmontools testdisk vi vim vim-runtime openconnect pcsclite python2 python reflector --noconfirm pacman -R clonezilla darkhttpd diffutils grml-zsh-config irssi linux-atm lvm2 man-db man-pages mc ndisc6 nmap smartmontools testdisk vi vim vim-runtime openconnect pcsclite python2 python reflector --noconfirm
rm -rf /var/cache/pacman/pkg/* rm -rf /var/cache/pacman/pkg/*
#Needed progs (gparted) #Needed progs (gparted)
pacman -S gparted xf86-video-vesa xorg-xinit lwm xorg-xrandr xterm --noconfirm pacman -S gparted xf86-video-vesa xorg-xinit lwm xorg-xrandr xorg-xsetroot xterm --noconfirm ; pacmanerror
rm -rf /var/cache/pacman/pkg/* rm -rf /var/cache/pacman/pkg/*
#Update progs #Update progs
pacman -Su --noconfirm --ignore linux #Do not upgrade kernel automatically pacman -Su --noconfirm --ignore linux #Do not upgrade kernel automatically
rm -rf /var/cache/pacman/pkg/* rm -rf /var/cache/pacman/pkg/*
showdo "Prepared live image to start installation" "2"
rm /etc/X11/xinit/xinitrc rm /etc/X11/xinit/xinitrc
touch /etc/X11/xinit/xinitrc touch /etc/X11/xinit/xinitrc
chmod 777 /etc/X11/xinit/xinitrc chmod 777 /etc/X11/xinit/xinitrc
echo "#Start gparted with startx command" > /etc/X11/xinit/xinitrc echo "#Start gparted with startx command" > /etc/X11/xinit/xinitrc
echo "lwm &" >> /etc/X11/xinit/xinitrc echo "lwm &" >> /etc/X11/xinit/xinitrc
echo "xrandr -s 1024x768 -r 60" >> /etc/X11/xinit/xinitrc echo "xrandr -s 1024x768 -r 60" >> /etc/X11/xinit/xinitrc
echo "xsetroot -solid lightskyblue4" >> /etc/X11/xinit/xinitrc
echo "xterm -e '/root/installer.sh' -geometry 120x35" >> /etc/X11/xinit/xinitrc echo "xterm -e '/root/installer.sh' -geometry 120x35" >> /etc/X11/xinit/xinitrc
chmod 644 /etc/X11/xinit/xinitrc chmod 644 /etc/X11/xinit/xinitrc
rm -rf /var/cache/pacman/pkg/* rm -rf /var/cache/pacman/pkg/*
#Download translations
wget -nv https://gitlab.com/JKANetwork/JKArch/raw/master/installer/translations.sh -O /root/translations.sh
# No black screensaver # No black screensaver
setterm -blank 0 -powerdown 0 -powersave off setterm -blank 0 -powerdown 0 -powersave off