mirror of
https://gitlab.com/JKANetwork/JKArch.git
synced 2026-02-14 09:11:31 +01:00
Fixes in iso script
This commit is contained in:
@@ -12,16 +12,21 @@ sfslocate="/tmp/sfsfile" #Donde se harán las modificaciones temporales (El chro
|
|||||||
function modifyimage {
|
function modifyimage {
|
||||||
sudo arch-chroot $sfslocate/ /usr/bin/pacman-key --init
|
sudo arch-chroot $sfslocate/ /usr/bin/pacman-key --init
|
||||||
sudo arch-chroot $sfslocate/ /usr/bin/pacman-key --populate
|
sudo arch-chroot $sfslocate/ /usr/bin/pacman-key --populate
|
||||||
|
|
||||||
|
#Add JKANetwork mirrorlist (needed for localepurge, and needs to be added before updating databases)
|
||||||
|
sudo arch-chroot $sfslocate/ /usr/bin/wget https://mirror.jkanetwork.com/Arch-repository/jkarch-mirrorlist -O /etc/pacman.d/jkarch-mirrorlist
|
||||||
|
sudo chmod 777 $sfslocate/etc/pacman.conf
|
||||||
|
sudo echo "#JKArch Repository" >> $sfslocate/etc/pacman.conf
|
||||||
|
sudo echo "[jkanetwork]" >> $sfslocate/etc/pacman.conf
|
||||||
|
sudo echo "SigLevel = Optional TrustAll" >> $sfslocate/etc/pacman.conf
|
||||||
|
sudo echo "Include = /etc/pacman.d/jkarch-mirrorlist" >> $sfslocate/etc/pacman.conf
|
||||||
|
sudo chmod 644 $sfslocate/etc/pacman.conf
|
||||||
|
|
||||||
sudo arch-chroot $sfslocate/ /usr/bin/pacman -Sy archlinux-keyring --noconfirm
|
sudo arch-chroot $sfslocate/ /usr/bin/pacman -Sy archlinux-keyring --noconfirm
|
||||||
|
|
||||||
sudo arch-chroot $sfslocate/ /usr/bin/pacman -S reflector --noconfirm
|
sudo arch-chroot $sfslocate/ /usr/bin/pacman -S reflector --noconfirm
|
||||||
sudo arch-chroot $sfslocate/ /usr/bin/reflector --verbose -l 6 --sort rate --save /etc/pacman.d/mirrorlist
|
sudo arch-chroot $sfslocate/ /usr/bin/reflector --verbose -l 6 --sort rate --save /etc/pacman.d/mirrorlist
|
||||||
#Add JKANetwork mirrorlist (needed for localepurge)
|
|
||||||
sudo arch-chroot $sfslocate/ /usr/bin/wget https://mirror.jkanetwork.com/Arch-repository/jkarch-mirrorlist -O /etc/pacman.d/jkarch-mirrorlist
|
|
||||||
sudo arch-chroot $sfslocate/ /usr/bin/echo "#JKArch Repository" >> /etc/pacman.conf
|
|
||||||
sudo arch-chroot $sfslocate/ /usr/bin/echo "[jkanetwork]" >> /etc/pacman.conf
|
|
||||||
sudo arch-chroot $sfslocate/ /usr/bin/echo "SigLevel = Optional TrustAll" >> /etc/pacman.conf
|
|
||||||
sudo arch-chroot $sfslocate/ /usr/bin/echo "Include = /etc/pacman.d/jkarch-mirrorlist" >> /etc/pacman.conf
|
|
||||||
|
|
||||||
#Delete packages not needed from official iso
|
#Delete packages not needed from official iso
|
||||||
sudo arch-chroot $sfslocate/ /usr/bin/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 zsh openconnect pcsclite python2 --noconfirm
|
sudo arch-chroot $sfslocate/ /usr/bin/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 zsh openconnect pcsclite python2 --noconfirm
|
||||||
@@ -30,13 +35,16 @@ function modifyimage {
|
|||||||
#Install new
|
#Install new
|
||||||
sudo arch-chroot $sfslocate/ /usr/bin/pacman -Su gparted xf86-video-vesa xorg-xinit lwm localepurge --noconfirm --ignore linux #Do not upgrade kernel automatically
|
sudo arch-chroot $sfslocate/ /usr/bin/pacman -Su gparted xf86-video-vesa xorg-xinit lwm localepurge --noconfirm --ignore linux #Do not upgrade kernel automatically
|
||||||
#For gparted to work
|
#For gparted to work
|
||||||
sudo rm $sfslocate/etc/X11/xinit/xinitrc
|
sudo rm $sfslocate/etc/X11/xinit/xinitrc
|
||||||
sudo echo "#Start gparted with startx command" > $sfslocate/etc/X11/xinit/xinitrc
|
sudo touch $sfslocate/etc/X11/xinit/xinitrc
|
||||||
sudo echo "lwm & gparted" >> $sfslocate/etc/X11/xinit/xinitrc
|
sudo chmod 777 $sfslocate/etc/X11/xinit/xinitrc
|
||||||
|
sudo echo "#Start gparted with startx command" > $sfslocate/etc/X11/xinit/xinitrc
|
||||||
|
sudo echo "lwm & gparted" >> $sfslocate/etc/X11/xinit/xinitrc
|
||||||
|
sudo chmod 644 $sfslocate/etc/X11/xinit/xinitrc
|
||||||
sudo rm -rf $sfslocate/var/cache/pacman/pkg/*
|
sudo rm -rf $sfslocate/var/cache/pacman/pkg/*
|
||||||
sudo rm $sfslocate/root/.bash_history
|
sudo rm $sfslocate/root/.bash_history
|
||||||
|
|
||||||
#Localepurge (freeing more space)
|
#Use localepurge (freeing more space)
|
||||||
sudo arch-chroot $sfslocate/ /usr/bin/sed -i '8c#NEEDSCONFIGFIRST' /etc/locale.nopurge
|
sudo arch-chroot $sfslocate/ /usr/bin/sed -i '8c#NEEDSCONFIGFIRST' /etc/locale.nopurge
|
||||||
sudo arch-chroot $sfslocate/ /usr/bin/echo "es" >> /etc/locale.nopurge
|
sudo arch-chroot $sfslocate/ /usr/bin/echo "es" >> /etc/locale.nopurge
|
||||||
sudo arch-chroot $sfslocate/ /usr/bin/echo "es_ES" >> /etc/locale.nopurge
|
sudo arch-chroot $sfslocate/ /usr/bin/echo "es_ES" >> /etc/locale.nopurge
|
||||||
@@ -117,7 +125,7 @@ function createOnline {
|
|||||||
modifyimage
|
modifyimage
|
||||||
|
|
||||||
#Creamos la ISO
|
#Creamos la ISO
|
||||||
mkisofs -b isolinux/isolinux.bin -r -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -V "JKARCH-ISO" -o output-Online.iso iso/
|
mkisofs -b isolinux/isolinux.bin -r -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -V "JKARCH-ISO" -o JKArch-Online-$yearmonth.iso iso/
|
||||||
sudo rm -rf iso/
|
sudo rm -rf iso/
|
||||||
echo "ISO Online creada"
|
echo "ISO Online creada"
|
||||||
}
|
}
|
||||||
@@ -155,22 +163,34 @@ function createOffline {
|
|||||||
rm -rf repoofflinejkarch/
|
rm -rf repoofflinejkarch/
|
||||||
|
|
||||||
#Creamos la ISO
|
#Creamos la ISO
|
||||||
mkisofs -b isolinux/isolinux.bin -r -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -V "JKARCH-ISO" -o output-Offline.iso iso/
|
mkisofs -b isolinux/isolinux.bin -r -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -V "JKARCH-ISO" -o JKArch-Offline-$yearmonth.iso iso/
|
||||||
sudo rm -rf iso/
|
sudo rm -rf iso/
|
||||||
echo "ISO Offline creada"
|
echo "ISO Offline creada"
|
||||||
}
|
}
|
||||||
|
|
||||||
#Borramos carpeta temporal
|
#Date for builds
|
||||||
rm -rf temp/
|
today=$(date +%y%m%d)
|
||||||
mkdir temp
|
yearmonth=$(date +%y%m)
|
||||||
|
|
||||||
#Download necessary files
|
mkdir temp
|
||||||
wget http://sunsite.rediris.es/mirror/archlinux/iso/latest/arch/boot/x86_64/archiso.img -O temp/archiso.img
|
lastdownload=$(< temp/datedownload)
|
||||||
wget http://sunsite.rediris.es/mirror/archlinux/iso/latest/arch/boot/x86_64/vmlinuz -O temp/vmlinuz
|
if [[ $today != $lastdownload ]];then #Only download one time at day
|
||||||
wget http://sunsite.rediris.es/mirror/archlinux/iso/latest/arch/boot/intel_ucode.img -O temp/intel_ucode.img
|
#Borramos carpeta temporal
|
||||||
wget http://sunsite.rediris.es/mirror/archlinux/iso/latest/arch/boot/intel_ucode.LICENSE -O temp/intel_ucode.LICENSE
|
rm -rf temp/*
|
||||||
wget http://sunsite.rediris.es/mirror/archlinux/iso/latest/arch/x86_64/airootfs.sfs -O temp/airootfs.sfs
|
#Download necessary files and verify its downloaded
|
||||||
#
|
wget http://sunsite.rediris.es/mirror/archlinux/iso/latest/arch/boot/x86_64/archiso.img -O temp/archiso.img
|
||||||
|
if [[ $? != 0 ]]; then exit; fi
|
||||||
|
wget http://sunsite.rediris.es/mirror/archlinux/iso/latest/arch/boot/x86_64/vmlinuz -O temp/vmlinuz
|
||||||
|
if [[ $? != 0 ]]; then exit; fi
|
||||||
|
wget http://sunsite.rediris.es/mirror/archlinux/iso/latest/arch/boot/intel_ucode.img -O temp/intel_ucode.img
|
||||||
|
if [[ $? != 0 ]]; then exit; fi
|
||||||
|
wget http://sunsite.rediris.es/mirror/archlinux/iso/latest/arch/boot/intel_ucode.LICENSE -O temp/intel_ucode.LICENSE
|
||||||
|
if [[ $? != 0 ]]; then exit; fi
|
||||||
|
wget http://sunsite.rediris.es/mirror/archlinux/iso/latest/arch/x86_64/airootfs.sfs -O temp/airootfs.sfs
|
||||||
|
if [[ $? != 0 ]]; then exit; fi
|
||||||
|
#
|
||||||
|
echo $today > temp/datedownload
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
#Switch del argumento $1 para ver si solo se quiere crear una de las dos imagenes iso
|
#Switch del argumento $1 para ver si solo se quiere crear una de las dos imagenes iso
|
||||||
@@ -182,9 +202,4 @@ case $1 in
|
|||||||
createOffline
|
createOffline
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
#Borramos carpeta temporal antes de finalizar
|
|
||||||
rm -rf temp/
|
|
||||||
mkdir temp
|
|
||||||
echo "Script terminado"
|
echo "Script terminado"
|
||||||
Reference in New Issue
Block a user