change instalation metod from xpbs-install to ROOTFS
This commit is contained in:
parent
c48b67854b
commit
1b99ea6f6e
|
@ -1,15 +1,16 @@
|
||||||
#!/bin/env bash
|
#!/bin/env bash
|
||||||
#############################################################################
|
#############################################################################
|
||||||
# __ __ _ _ ___ _ _ _
|
# ██╗ ██╗ ██████╗ ██╗██████╗ ██╗███╗ ██╗███████╗████████╗ █████╗ ██╗ ██╗ ███████╗██████╗
|
||||||
# \ \ / /___ (_) __| | |_ _|_ __ ___| |_ __ _| | | ___ _ __
|
# ██║ ██║██╔═══██╗██║██╔══██╗ ██║████╗ ██║██╔════╝╚══██╔══╝██╔══██╗██║ ██║ ██╔════╝██╔══██╗
|
||||||
# \ \ / // _ \| |/ _` | | || '_ \/ __| __|/ _` | | |/ _ \| '__\
|
# ██║ ██║██║ ██║██║██║ ██║ ██║██╔██╗ ██║███████╗ ██║ ███████║██║ ██║ █████╗ ██████╔╝
|
||||||
# \ V /| (_) | | (_| | | || | | \__ \ |_| (_| | | | __/| |
|
# ╚██╗ ██╔╝██║ ██║██║██║ ██║ ██║██║╚██╗██║╚════██║ ██║ ██╔══██║██║ ██║ ██╔══╝ ██╔══██╗
|
||||||
# \_/ \___/|_|\__,_| |___|_| |_|___/\__|\__,_|_|_|\___||_|
|
# ╚████╔╝ ╚██████╔╝██║██████╔╝ ██║██║ ╚████║███████║ ██║ ██║ ██║███████╗███████╗███████╗██║ ██║
|
||||||
#
|
# ╚═══╝ ╚═════╝ ╚═╝╚═════╝ ╚═╝╚═╝ ╚═══╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝╚═╝ ╚═╝
|
||||||
#############################################################################
|
#############################################################################
|
||||||
# Autor:Alex Ham
|
# Autor:Alex Ham
|
||||||
# Email:kandil@disroot.org
|
# Email:kandil@disroot.org
|
||||||
# Description:This script install OS GNU/Linux VoidLinux on USB or HDD drives
|
# Description:This script install OS GNU/Linux VoidLinux on USB or HDD drives
|
||||||
|
# Dependencies:xz, curl
|
||||||
#############################################################################
|
#############################################################################
|
||||||
# [-]=waiting
|
# [-]=waiting
|
||||||
# [+]=successful
|
# [+]=successful
|
||||||
|
@ -58,6 +59,16 @@ if [ "$(id -u)" != "0" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check dependencies
|
||||||
|
compgen -c | grep -qE "^xz$"
|
||||||
|
if [ "$?" == "0" ]; then
|
||||||
|
tar xf void.tar.xz -C /mnt
|
||||||
|
rm -f void.tar.xz >/dev/null
|
||||||
|
else
|
||||||
|
printf "Pleace install utilite xz"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Prompt user to select disk for installation
|
# Prompt user to select disk for installation
|
||||||
select line in $(lsblk -dnpo NAME,SIZE | sed 's/ \+/:/g' | grep -v ${run_dev}); do
|
select line in $(lsblk -dnpo NAME,SIZE | sed 's/ \+/:/g' | grep -v ${run_dev}); do
|
||||||
if [ -z "${line}" ]; then
|
if [ -z "${line}" ]; then
|
||||||
|
@ -238,21 +249,44 @@ printf "%s=======================%s\n" "${cl_green}" "${cl_normal}"
|
||||||
printf "%s[*] System installation%s\n" "${cl_green}" "${cl_normal}"
|
printf "%s[*] System installation%s\n" "${cl_green}" "${cl_normal}"
|
||||||
printf "%s=======================%s\n" "${cl_green}" "${cl_normal}"
|
printf "%s=======================%s\n" "${cl_green}" "${cl_normal}"
|
||||||
|
|
||||||
# Creating xbps keys
|
# Cloning and unpacking packages
|
||||||
printf "[-] Instalation, wait... "
|
printf "[-] Downloading rootfs, wait... "
|
||||||
mkdir -p /mnt/var/db/xbps/keys
|
curl -s https://repo-default.voidlinux.org/live/current/void-x86_64-ROOTFS-20230628.tar.xz \
|
||||||
cp /var/db/xbps/keys/* /mnt/var/db/xbps/keys/
|
-o void.tar.xz
|
||||||
|
|
||||||
mkdir -p /mnt/var/cache/xbps
|
# Update DNS
|
||||||
cp -r /var/cache/xbps /mnt/var/cache/xbps
|
printf "[+] Update /etc/resolv.conf"
|
||||||
xbps-install -Sy -R https://repo-default.voidlinux.org/current \
|
cp /etc/resolv.conf /mnt/etc/ >/dev/null
|
||||||
-r /mnt base-system lvm2 cryptsetup grub git stow >/dev/null
|
|
||||||
printf "OK!\n"
|
printf "OK!\n"
|
||||||
|
|
||||||
printf "%s##########%s\n" "${cl_blue}" "${cl_normal}"
|
printf "%s##########%s\n" "${cl_blue}" "${cl_normal}"
|
||||||
printf "%s# Chroot #%s\n" "${cl_blue}" "${cl_normal}"
|
printf "%s# Chroot #%s\n" "${cl_blue}" "${cl_normal}"
|
||||||
printf "%s##########%s\n" "${cl_blue}" "${cl_normal}"
|
printf "%s##########%s\n" "${cl_blue}" "${cl_normal}"
|
||||||
|
|
||||||
|
# # Date setting
|
||||||
|
# read -rp "[?] Enter the real date in the format: “YYYY-MM-DD HH:MM”? " _date
|
||||||
|
# echo "${_date}" | grep -qE \
|
||||||
|
# "^20[2-9][0-9]-[0-1][0-9]-[0-3][0-9] [0-2][0-9]:[0-5][0-9]$"
|
||||||
|
# if [ "$?" == "1" ]; then
|
||||||
|
# printf "%s[!] Not correct date!!!%s\n" "${cl_red}" "${cl_normal}"
|
||||||
|
# exit 1
|
||||||
|
# fi
|
||||||
|
# chroot /mnt date -s "${_date}"
|
||||||
|
|
||||||
|
# Installing xbps packages
|
||||||
|
printf "[-] Installing package xbps, wait... "
|
||||||
|
chroot /mnt xbps-install -Suy xbps >/dev/null
|
||||||
|
printf "OK!\n"
|
||||||
|
printf "[-] Updating system, wait... "
|
||||||
|
chroot /mnt xbps-install -uy >/dev/null
|
||||||
|
printf "OK!\n"
|
||||||
|
printf "[-] Installing base-system packages, wait... "
|
||||||
|
chroot /mnt xbps-install -y base-system lvm2 cryptsetup grub >/dev/null
|
||||||
|
printf "OK!\n"
|
||||||
|
printf "[-] Removing package base-voidstrap, wait... "
|
||||||
|
chroot /mnt xbps-remove -y base-voidstrap >/dev/null
|
||||||
|
printf "OK!\n"
|
||||||
|
|
||||||
# finish up the configuration
|
# finish up the configuration
|
||||||
printf "[-] Configuration, wait... "
|
printf "[-] Configuration, wait... "
|
||||||
chroot /mnt chown root:root /
|
chroot /mnt chown root:root /
|
||||||
|
@ -264,7 +298,7 @@ echo ${sys_hostname} > /mnt/etc/hostname
|
||||||
# For glibc systems
|
# For glibc systems
|
||||||
echo ${sys_lang} > /mnt/etc/locale.conf
|
echo ${sys_lang} > /mnt/etc/locale.conf
|
||||||
echo ${sys_locale} >> /mnt/etc/default/libc-locales
|
echo ${sys_locale} >> /mnt/etc/default/libc-locales
|
||||||
xbps-reconfigure -fr /mnt/ glibc-locales >/dev/null
|
chroot /mnt xbps-reconfigure -f glibc-locales >/dev/null
|
||||||
|
|
||||||
# Modify file /etc/fstab in chroot
|
# Modify file /etc/fstab in chroot
|
||||||
grep "/dev/mapper/${lvm_group_name}" /proc/mounts | awk \
|
grep "/dev/mapper/${lvm_group_name}" /proc/mounts | awk \
|
||||||
|
@ -295,7 +329,7 @@ printf "install_items+=\" /root/volume.key /etc/crypttab \"" > \
|
||||||
# Complete system installation
|
# Complete system installation
|
||||||
printf "[-] Grub instalation, wait... "
|
printf "[-] Grub instalation, wait... "
|
||||||
chroot /mnt grub-install ${inst_dev} >/dev/null
|
chroot /mnt grub-install ${inst_dev} >/dev/null
|
||||||
xbps-reconfigure -r /mnt -fa >/dev/null
|
chroot /mnt xbps-reconfigure -r /mnt -fa >/dev/null
|
||||||
printf "OK!\n"
|
printf "OK!\n"
|
||||||
|
|
||||||
printf "%s=======================%s\n" "${cl_green}" "${cl_normal}"
|
printf "%s=======================%s\n" "${cl_green}" "${cl_normal}"
|
||||||
|
@ -307,10 +341,9 @@ printf "%s#######################%s\n" "${cl_blue}" "${cl_normal}"
|
||||||
printf "%s# Finish install Void #%s\n" "${cl_blue}" "${cl_normal}"
|
printf "%s# Finish install Void #%s\n" "${cl_blue}" "${cl_normal}"
|
||||||
printf "%s#######################%s\n" "${cl_blue}" "${cl_normal}"
|
printf "%s#######################%s\n" "${cl_blue}" "${cl_normal}"
|
||||||
|
|
||||||
printf "[?] Unmount newly created Void installation? (y/n) "
|
read -rp "[?] Unmount newly created Void installation? (y/n) " _key
|
||||||
read -r _key
|
|
||||||
if [[ "${_key}" == "y" ]]; then
|
if [[ "${_key}" == "y" ]]; then
|
||||||
umount -R /mnt # Unmount root volume
|
umount -R /mnt # Unmount root volume
|
||||||
vgchange -an ${lvm_name} # Deactivate volume group
|
vgchange -an ${lvm_name} # Deactivate volume group
|
||||||
cryptsetup close ${luks_name} # Close LUKS encrypted partition
|
cryptsetup close ${luks_name} # Close LUKS encrypted partition
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue