init archzfs repository

This commit is contained in:
eoli3n 2020-05-06 10:53:38 +02:00
parent 52835c103e
commit 203c4740dc

18
init
View file

@ -24,7 +24,7 @@ get_iso_build_date () {
# Returns running kernel build date formated as 'YYYY/MM/DD' # Returns running kernel build date formated as 'YYYY/MM/DD'
# Get running kernel build date # Get running kernel build date
kernel_date=(date +%Y/%m/%d -d "$(LANG=C pacman -Qi linux |sed -n 's/^Install Date\s*: //p')") kernel_date=$(date +%Y/%m/%d -d "$(LANG=C pacman -Qi linux |sed -n 's/^Install Date\s*: //p')")
return "$kernel_date" return "$kernel_date"
} }
@ -54,19 +54,12 @@ init_archlinux_archive () {
repo="Server=https://archive.archlinux.org/repos/$1/\$repo/os/\$arch" repo="Server=https://archive.archlinux.org/repos/$1/\$repo/os/\$arch"
# If repo exists, set it, if not, return False # If repo exists, set it, if not, return False
curl -s $repo && echo $repo > /etc/pacman.d/mirrorlist || return "False" curl -s "$repo" && echo "$repo" > /etc/pacman.d/mirrorlist || return 1
return "True"
return 0
} }
init_repositories () {
# $1 is date formated as 'YYYY/MM/DD'
init_archzfs
init_archlinux_archive
pacman -Sy
}
search_package () { search_package () {
# $1 is package name to search # $1 is package name to search
# $2 is version to match # $2 is version to match
@ -137,6 +130,9 @@ print "Increasing cowspace to half of RAM"
mount -o remount,size=50% /run/archiso/cowspace mount -o remount,size=50% /run/archiso/cowspace
# Init archzfs repository
init_archzfs
# Search kernel package # Search kernel package
# https://github.com/archzfs/archzfs/issues/337#issuecomment-624312576 # https://github.com/archzfs/archzfs/issues/337#issuecomment-624312576
kernel_version=$(get_running_kernel_version) kernel_version=$(get_running_kernel_version)