diff --git a/Makefile b/Makefile index b75a836..6e9f65b 100644 --- a/Makefile +++ b/Makefile @@ -23,8 +23,7 @@ LIBS_BASE = \ SHARED_BASE = \ data/pacman-default.conf \ - data/pacman-multilib.conf \ - data/pacman-mirrors.conf + data/pacman-multilib.conf LIST_PKG = \ $(wildcard data/pkg.list.d/*.list) diff --git a/bin/basestrap.in b/bin/basestrap.in index 8fe5dfb..dc65bec 100644 --- a/bin/basestrap.in +++ b/bin/basestrap.in @@ -55,12 +55,12 @@ usage() { orig_argv=("$0" "$@") -opts=':C:S:B:U:cdGiM' +opts=':C:B:U:cdGiM' while getopts ${opts} arg; do case "${arg}" in C) pacman_config=$OPTARG ;; - S) mirrors_conf="$OPTARG" ;; +# S) mirrors_conf="$OPTARG" ;; d) directory=true ;; c) hostcache=true ;; i) interactive=true ;; @@ -98,20 +98,21 @@ printf '%s.UTF-8 UTF-8\n' en_US > "$working_dir/etc/locale.gen" printf 'LANG=%s.UTF-8\n' en_US > "$working_dir/etc/locale.conf" printf 'LC_MESSAGES=C\n' >> "$working_dir/etc/locale.conf" -pm_args=(-a -R -p "$newroot" -S "${branch}") +pm_args=(-a -p "$newroot" -S "${branch}") -[[ -n ${mirror} ]] && pm_args+=(-n -U "${mirror}") +[[ -n ${mirror} ]] && pm_args+=(-U "${mirror}") -info "pm_args: %s" "${pm_args[*]}" # create obligatory directories create_min_fs "$newroot" -if [[ -n $mirrors_conf ]]; then - cp ${mirrors_conf} "$newroot/etc/pacman-mirrors.conf" -fi - -info "Configuring pacman-mirrors: %s" "${branch}" -pacman-mirrors "${pm_args[@]}" +# if [[ -n $mirrors_conf ]]; then +# if [[ ! -e $newroot/etc/pacman-mirrors.conf ]]; then + prepare_pac_mirrors "$newroot" + info "Configuring pacman-mirrors: %s" "${branch}" + pacman-mirrors "${pm_args[@]}" +# fi +# rm $newroot/usr/share/pacman-mirrors/mirrors.json +# fi # mount API filesystems chroot_api_mount "$newroot" || die "failed to setup API filesystems in new root" diff --git a/bin/buildiso.in b/bin/buildiso.in index 9c46077..8f4cd35 100755 --- a/bin/buildiso.in +++ b/bin/buildiso.in @@ -41,11 +41,11 @@ prepare_build(){ pacman_conf="${DATADIR}/pacman-$pac_arch.conf" fi - local mirrors_conf=${DATADIR}/pacman-mirrors.conf +# local mirrors_conf=${DATADIR}/pacman-mirrors.conf iso_file=$(gen_iso_fn).iso - mkchroot_args+=(-C ${pacman_conf} -S ${mirrors_conf} -U "${build_mirror}/" -B "${target_branch}") + mkchroot_args+=(-C ${pacman_conf} -U "${build_mirror}/" -B "${target_branch}") work_dir=${chroots_iso}/${profile}/${target_arch} iso_dir="${cache_dir_iso}/${edition}/${profile}/${dist_release}" diff --git a/bin/buildpkg.in b/bin/buildpkg.in index 2f400d4..d4f01bb 100644 --- a/bin/buildpkg.in +++ b/bin/buildpkg.in @@ -111,9 +111,9 @@ prepare_build(){ [[ "$pac_arch" == 'multilib' ]] && target_arch='x86_64' - local mirrors_conf=${DATADIR}/pacman-mirrors.conf +# local mirrors_conf=${DATADIR}/pacman-mirrors.conf - mkchroot_args+=(-C ${pacman_conf} -M ${makepkg_conf} -S ${mirrors_conf} -U "${build_mirror}/" -B "${target_branch}") + mkchroot_args+=(-C ${pacman_conf} -M ${makepkg_conf} -U "${build_mirror}/" -B "${target_branch}") mkchrootpkg_args+=(-r ${work_dir}) diff --git a/bin/mkchroot.in b/bin/mkchroot.in index cfebcac..6303924 100644 --- a/bin/mkchroot.in +++ b/bin/mkchroot.in @@ -44,13 +44,13 @@ usage() { orig_argv=("$0" "$@") -opts='hC:M:S:U:B:c:f:s' +opts='hC:M:U:B:c:f:s' while getopts ${opts} arg; do case "${arg}" in C) pac_conf="$OPTARG" ;; M) makepkg_conf="$OPTARG" ;; - S) mirrors_conf="$OPTARG" ;; +# S) mirrors_conf="$OPTARG" ;; c) cache_dir="$OPTARG" ;; f) files+=("$OPTARG") ;; s) nosetarch=true ;; @@ -100,7 +100,7 @@ for file in "${files[@]}"; do cp "$file" "$working_dir$file" done -basestrap_args=(-GMcd ${pac_conf:+-C "$pac_conf"} -B "${branch}" -S "$mirrors_conf") +basestrap_args=(-GMcd ${pac_conf:+-C "$pac_conf"} -B "${branch}") [[ -n ${mirror} ]] && basestrap_args+=(-U "${mirror}") diff --git a/data/pacman-mirrors.conf b/data/pacman-mirrors.conf deleted file mode 100644 index 1de3c1b..0000000 --- a/data/pacman-mirrors.conf +++ /dev/null @@ -1,36 +0,0 @@ -## -## /etc/pacman-mirrors.conf -## - -## Branch Pacman should use (stable, testing, unstable) -Branch = stable - -## Generation method -## 1) rank - rank mirrors depending on their access time -## 2) random - randomly generate the output mirrorlist -# Method = rank - -## Define protocols and priority -## separated by comma 'https,http' or 'http,https' -## ATM available protocols are: http, https, ftp -## Not specifying a protocol will ban the protocol from being used -## If a mirror has more than one protocol defined only the first is written to the mirrorlist -## Empty means all in reversed alphabetic order -# Protocols = - -## Specify to use only mirrors from a specific country. -## Can add multiple countries -## separated by comma 'Germany,France,Belgium' -## Get a list of all available counties with 'pacman-mirrors -l' -## Empty means all -# OnlyCountry = - -## Mirrors directory -# MirrorlistsDir = /var/lib/pacman-mirrors - -## Output file -# OutputMirrorlist = /etc/pacman.d/mirrorlist - -## When set to False - all certificates are accepted. -## Use only if you fully trust all ssl-enabled mirrors. -# SSLVerify = True diff --git a/lib/util-chroot.sh b/lib/util-chroot.sh index f2d6452..881ff0c 100644 --- a/lib/util-chroot.sh +++ b/lib/util-chroot.sh @@ -18,9 +18,16 @@ copy_keyring(){ fi } +prepare_pac_mirrors(){ + mkdir -m 0755 -p $1/etc/pacman.d $1/var/lib/pacman-mirrors $1/usr/share/pacman-mirrors +# curl https://raw.githubusercontent.com/manjaro/pacman-mirrors/master/share/mirrors.json -o $1/usr/share/pacman-mirrors/mirrors.json + #curl https://raw.githubusercontent.com/manjaro/pacman-mirrors/master/conf/pacman-mirrors.conf -o $1/etc/pacman-mirrors.conf +# cp ${DATADIR}/pacman-mirrors.conf $1/etc +} + create_min_fs(){ msg "Creating install root at %s" "$1" - mkdir -m 0755 -p $1/var/{cache/pacman/pkg,lib/{pacman,log,pacman-mirrors}} $1/{dev,run,etc/pacman.d} + mkdir -m 0755 -p $1/var/{cache/pacman/pkg,lib/pacman,log} $1/{dev,run,etc} mkdir -m 1777 -p $1/tmp mkdir -m 0555 -p $1/{sys,proc} }