forked from mirrored-repos/manjaro-tools
prepare #197
rename arch & branch vars -> target_arch & target_branch better not to use $arch -> already in use in PKGBUILDs
This commit is contained in:
parent
766427cfa3
commit
222793697b
14 changed files with 98 additions and 100 deletions
|
@ -51,10 +51,10 @@ overriding
|
|||
################ manjaro-tools.conf ##################
|
||||
######################################################
|
||||
|
||||
# default branch
|
||||
# branch=stable
|
||||
# default target branch
|
||||
# target_branch=stable
|
||||
|
||||
# default arch: auto detect
|
||||
# default target arch: auto detect
|
||||
# arch=$(uname -m)
|
||||
|
||||
# cache dir where buildpkg, buildtree cache packages/pkgbuild, builiso iso files
|
||||
|
|
|
@ -32,7 +32,7 @@ show_profile(){
|
|||
msg2 "plymouth_boot: %s" "${plymouth_boot}"
|
||||
${plymouth_boot} && msg2 "plymouth_theme: %s" "${plymouth_theme}"
|
||||
|
||||
[[ ${arch} == 'x86_64' ]] && msg2 "multilib: %s" "${multilib}"
|
||||
[[ ${target_arch} == 'x86_64' ]] && msg2 "multilib: %s" "${multilib}"
|
||||
|
||||
msg2 "efi_boot_loader: %s" "${efi_boot_loader}"
|
||||
msg2 "efi_part_size: %s" "${efi_part_size}"
|
||||
|
@ -70,8 +70,8 @@ display_settings(){
|
|||
msg2 "pacman_conf: %s" "${pacman_conf}"
|
||||
|
||||
msg "OPTIONS:"
|
||||
msg2 "arch: %s" "${arch}"
|
||||
msg2 "branch: %s" "${branch}"
|
||||
msg2 "arch: %s" "${target_arch}"
|
||||
msg2 "branch: %s" "${target_branch}"
|
||||
msg2 "chroots_iso: %s" "${chroots_iso}"
|
||||
msg2 "initsys: %s" "${initsys}"
|
||||
msg2 "kernel: %s" "${kernel}"
|
||||
|
@ -122,8 +122,8 @@ pacman_conf_arch='default'
|
|||
usage() {
|
||||
echo "Usage: ${0##*/} [options]"
|
||||
echo " -p <profile> Buildset or profile [default: ${buildset_iso}]"
|
||||
echo " -a <arch> Arch [default: ${arch}]"
|
||||
echo " -b <branch> Branch [default: ${branch}]"
|
||||
echo " -a <arch> Arch [default: ${target_arch}]"
|
||||
echo " -b <branch> Branch [default: ${target_branch}]"
|
||||
echo ' -r <dir> Chroots directory'
|
||||
echo " [default: ${chroots_iso}]"
|
||||
echo ' -t <dir> Target directory'
|
||||
|
@ -152,8 +152,8 @@ opts='p:a:b:r:t:k:i:czxsvqh'
|
|||
while getopts "${opts}" arg; do
|
||||
case "${arg}" in
|
||||
p) buildset_iso="$OPTARG" ;;
|
||||
a) arch="$OPTARG" ;;
|
||||
b) branch="$OPTARG" ;;
|
||||
a) target_arch="$OPTARG" ;;
|
||||
b) target_branch="$OPTARG" ;;
|
||||
r) chroots_iso="$OPTARG" ;;
|
||||
t) cache_dir_iso="$OPTARG" ;;
|
||||
k) kernel="$OPTARG" ;;
|
||||
|
@ -173,9 +173,9 @@ shift $(($OPTIND - 1))
|
|||
|
||||
timer_start=$(get_timer)
|
||||
|
||||
[[ "${arch}" == 'x86_64' ]] && pacman_conf_arch='multilib'
|
||||
[[ "${target_arch}" == 'x86_64' ]] && pacman_conf_arch='multilib'
|
||||
|
||||
mirrors_conf="${DATADIR}/pacman-mirrors-${branch}.conf"
|
||||
mirrors_conf="${DATADIR}/pacman-mirrors-${target_branch}.conf"
|
||||
|
||||
check_root "$0" "${orig_argv[@]}"
|
||||
|
||||
|
|
|
@ -42,8 +42,8 @@ display_settings(){
|
|||
msg2 "is_buildset: %s" "${is_buildset}"
|
||||
|
||||
msg "OPTIONS:"
|
||||
msg2 "arch: %s" "${arch}"
|
||||
msg2 "branch: %s" "${branch}"
|
||||
msg2 "arch: %s" "${target_arch}"
|
||||
msg2 "branch: %s" "${target_branch}"
|
||||
msg2 "chroots_pkg: %s" "${chroots_pkg}"
|
||||
|
||||
msg "ARGS:"
|
||||
|
@ -57,7 +57,7 @@ display_settings(){
|
|||
msg "PATHS:"
|
||||
msg2 "work_dir: %s" "${work_dir}"
|
||||
msg2 "pkg_dir: %s" "${pkg_dir}"
|
||||
msg2 "build_mirror: %s" "${build_mirror}/${branch}"
|
||||
msg2 "build_mirror: %s" "${build_mirror}/${target_branch}"
|
||||
|
||||
if ${clean_first};then
|
||||
msg "PKG:"
|
||||
|
@ -89,8 +89,8 @@ udev_root=false
|
|||
usage() {
|
||||
echo "Usage: ${0##*/} [options]"
|
||||
echo " -p <pkg> Buildset or pkg [default: ${buildset_pkg}]"
|
||||
echo " -a <arch> Arch [default: ${arch}]"
|
||||
echo " -b <branch> Branch [default: ${branch}]"
|
||||
echo " -a <arch> Arch [default: ${target_arch}]"
|
||||
echo " -b <branch> Branch [default: ${target_branch}]"
|
||||
echo ' -r <dir> Chroots directory'
|
||||
echo " [default: ${chroots_pkg}]"
|
||||
echo ' -i <pkg> Install a package into the working copy of the chroot'
|
||||
|
@ -113,8 +113,8 @@ opts='p:a:b:r:i:cwnsuqh'
|
|||
while getopts "${opts}" arg; do
|
||||
case "${arg}" in
|
||||
p) buildset_pkg="$OPTARG" ;;
|
||||
a) arch="$OPTARG" ;;
|
||||
b) branch="$OPTARG" ;;
|
||||
a) target_arch="$OPTARG" ;;
|
||||
b) target_branch="$OPTARG" ;;
|
||||
r) chroots_pkg="$OPTARG" ;;
|
||||
i) install_pkgs+="$OPTARG"; mkchrootpkg_args+=(-I ${install_pkgs[*]}) ;;
|
||||
c) clean_first=true; mkchroot_args+=(-L) ;;
|
||||
|
@ -128,24 +128,24 @@ while getopts "${opts}" arg; do
|
|||
esac
|
||||
done
|
||||
|
||||
if [[ "${arch}" == 'multilib' ]]; then
|
||||
pacman_conf_arch=${arch}
|
||||
work_dir=${chroots_pkg}/${branch}/${arch}
|
||||
pkg_dir=${cache_dir_pkg}/${branch}/${arch}
|
||||
if [[ "${target_arch}" == 'multilib' ]]; then
|
||||
pacman_conf_arch=${target_arch}
|
||||
work_dir=${chroots_pkg}/${target_branch}/${target_arch}
|
||||
pkg_dir=${cache_dir_pkg}/${target_branch}/${target_arch}
|
||||
arch='x86_64'
|
||||
is_multilib=true
|
||||
else
|
||||
pacman_conf_arch='default'
|
||||
work_dir=${chroots_pkg}/${branch}/${arch}
|
||||
pkg_dir=${cache_dir_pkg}/${branch}/${arch}
|
||||
work_dir=${chroots_pkg}/${target_branch}/${target_arch}
|
||||
pkg_dir=${cache_dir_pkg}/${target_branch}/${target_arch}
|
||||
is_multilib=false
|
||||
fi
|
||||
|
||||
pacman_conf="${DATADIR}/pacman-${pacman_conf_arch}.conf"
|
||||
makepkg_conf="${DATADIR}/makepkg-${arch}.conf"
|
||||
mirrors_conf="${DATADIR}/pacman-mirrors-${branch}.conf"
|
||||
makepkg_conf="${DATADIR}/makepkg-${target_arch}.conf"
|
||||
mirrors_conf="${DATADIR}/pacman-mirrors-${target_branch}.conf"
|
||||
|
||||
mkchroot_args+=(-C ${pacman_conf} -M ${makepkg_conf} -S ${mirrors_conf} -B "${build_mirror}/${branch}")
|
||||
mkchroot_args+=(-C ${pacman_conf} -M ${makepkg_conf} -S ${mirrors_conf} -B "${build_mirror}/${target_branch}")
|
||||
|
||||
mkchrootpkg_args+=(-r ${work_dir})
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ display_settings(){
|
|||
msg2 "is_buildset: %s" "${is_buildset}"
|
||||
|
||||
msg "OPTIONS:"
|
||||
msg2 "arch: %s" "${arch}"
|
||||
msg2 "arch: %s" "${target_arch}"
|
||||
msg2 "initsys: %s" "${initsys}"
|
||||
msg2 "limit: %s kB/s" "${limit}"
|
||||
|
||||
|
@ -84,7 +84,7 @@ mktorrent_args=(-v -p)
|
|||
usage() {
|
||||
echo "Usage: ${0##*/} [options]"
|
||||
echo " -p Source folder to upload [default:${buildset_iso}]"
|
||||
echo " -a Arch to upload [default:${arch}]"
|
||||
echo " -a Arch to upload [default:${target_arch}]"
|
||||
echo " -i The iso's init system [default:${initsys}]"
|
||||
echo " -l Limit bandwidth in kB/s [default:${limit}]"
|
||||
echo ' -c Create new remote edition_type with subtree'
|
||||
|
@ -103,7 +103,7 @@ opts='p:a:l:i:ctuvqh'
|
|||
while getopts "${opts}" arg; do
|
||||
case "${arg}" in
|
||||
p) buildset_iso="$OPTARG" ;;
|
||||
a) arch="$OPTARG" ;;
|
||||
a) target_arch="$OPTARG" ;;
|
||||
i) initsys="$OPTARG" ;;
|
||||
l) limit="$OPTARG" ;;
|
||||
c) remote_create=true ;;
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
################ manjaro-tools.conf ##################
|
||||
######################################################
|
||||
|
||||
# default branch
|
||||
# branch=stable
|
||||
# default target branch
|
||||
# target_branch=stable
|
||||
|
||||
# default arch: auto detect
|
||||
# arch=$(uname -m)
|
||||
# default taget arch: auto detect
|
||||
# target_arch=$(uname -m)
|
||||
|
||||
# cache dir where buildpkg, buildtree cache packages/pkgbuild, builiso iso files
|
||||
# cache_dir=/var/cache/manjaro-tools
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><varname>branch=</varname></term>
|
||||
<term><varname>target_branch=</varname></term>
|
||||
|
||||
<listitem><para>Takes <option>stable</option> (the default),
|
||||
<option>testing</option> or <option>unstable</option>. It defines
|
||||
|
@ -78,7 +78,7 @@
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>arch=</varname></term>
|
||||
<term><varname>target_arch=</varname></term>
|
||||
|
||||
<listitem><para>Takes <option>i686</option> or <option>x86_64</option>.
|
||||
By default it will try to autodetect the current architecture.
|
||||
|
|
|
@ -84,30 +84,30 @@ write_loader_conf(){
|
|||
local conf=$1/${fn}
|
||||
msg2 "Writing %s ..." "${fn}"
|
||||
echo 'timeout 3' > ${conf}
|
||||
echo "default ${iso_name}-${arch}" >> ${conf}
|
||||
echo "default ${iso_name}-${target_arch}" >> ${conf}
|
||||
}
|
||||
|
||||
write_efi_shellv1_conf(){
|
||||
local fn=uefi-shell-v1-${arch}.conf
|
||||
local fn=uefi-shell-v1-${target_arch}.conf
|
||||
local conf=$1/${fn}
|
||||
msg2 "Writing %s ..." "${fn}"
|
||||
echo "title UEFI Shell ${arch} v1" > ${conf}
|
||||
echo "title UEFI Shell ${target_arch} v1" > ${conf}
|
||||
echo "efi /EFI/shellx64_v1.efi" >> ${conf}
|
||||
}
|
||||
|
||||
write_efi_shellv2_conf(){
|
||||
local fn=uefi-shell-v2-${arch}.conf
|
||||
local fn=uefi-shell-v2-${target_arch}.conf
|
||||
local conf=$1/${fn}
|
||||
msg2 "Writing %s ..." "${fn}"
|
||||
echo "title UEFI Shell ${arch} v2" > ${conf}
|
||||
echo "title UEFI Shell ${target_arch} v2" > ${conf}
|
||||
echo "efi /EFI/shellx64_v2.efi" >> ${conf}
|
||||
}
|
||||
|
||||
write_dvd_conf(){
|
||||
local fn=${iso_name}-${arch}.conf
|
||||
local fn=${iso_name}-${target_arch}.conf
|
||||
local conf=$1/${fn} path=$2
|
||||
msg2 "Writing %s ..." "${fn}"
|
||||
echo "title ${dist_name} Linux ${arch} UEFI DVD (default)" > ${conf}
|
||||
echo "title ${dist_name} Linux ${target_arch} UEFI DVD (default)" > ${conf}
|
||||
echo "linux /EFI/miso/${iso_name}.efi" >> ${conf}
|
||||
if [[ -f ${path}/${iso_name}/boot/intel_ucode.img ]] ; then
|
||||
msg2 "Using intel_ucode.img ..."
|
||||
|
@ -118,10 +118,10 @@ write_dvd_conf(){
|
|||
}
|
||||
|
||||
write_dvd_nonfree_conf(){
|
||||
local fn=${iso_name}-${arch}-nonfree.conf
|
||||
local fn=${iso_name}-${target_arch}-nonfree.conf
|
||||
local conf=$1/${fn} path=$2
|
||||
msg2 "Writing %s ..." "${fn}"
|
||||
echo "title ${dist_name} Linux ${arch} UEFI DVD (nonfree)" > ${conf}
|
||||
echo "title ${dist_name} Linux ${target_arch} UEFI DVD (nonfree)" > ${conf}
|
||||
echo "linux /EFI/miso/${iso_name}.efi" >> ${conf}
|
||||
if [[ -f ${path}/${iso_name}/boot/intel_ucode.img ]] ; then
|
||||
msg2 "Using intel_ucode.img ..."
|
||||
|
@ -132,30 +132,30 @@ write_dvd_nonfree_conf(){
|
|||
}
|
||||
|
||||
write_usb_conf(){
|
||||
local fn=${iso_name}-${arch}.conf
|
||||
local fn=${iso_name}-${target_arch}.conf
|
||||
local conf=$1/${fn} path=$2
|
||||
msg2 "Writing %s ..." "${fn}"
|
||||
echo "title ${dist_name} Linux ${arch} UEFI USB (default)" > ${conf}
|
||||
echo "linux /${iso_name}/boot/${arch}/${iso_name}" >> ${conf}
|
||||
echo "title ${dist_name} Linux ${target_arch} UEFI USB (default)" > ${conf}
|
||||
echo "linux /${iso_name}/boot/${target_arch}/${iso_name}" >> ${conf}
|
||||
if [[ -f ${path}/${iso_name}/boot/intel_ucode.img ]] ; then
|
||||
msg2 "Using intel_ucode.img ..."
|
||||
echo "initrd /${iso_name}/boot/intel_ucode.img" >> ${conf}
|
||||
fi
|
||||
echo "initrd /${iso_name}/boot/${arch}/${iso_name}.img" >> ${conf}
|
||||
echo "initrd /${iso_name}/boot/${target_arch}/${iso_name}.img" >> ${conf}
|
||||
echo "options misobasedir=${iso_name} misolabel=${iso_label} nouveau.modeset=1 i915.modeset=1 radeon.modeset=1 logo.nologo overlay=free" >> ${conf}
|
||||
}
|
||||
|
||||
write_usb_nonfree_conf(){
|
||||
local fn=${iso_name}-${arch}-nonfree.conf
|
||||
local fn=${iso_name}-${target_arch}-nonfree.conf
|
||||
local conf=$1/${fn} path=$2
|
||||
msg2 "Writing %s ..." "${fn}"
|
||||
echo "title ${dist_name} Linux ${arch} UEFI USB (nonfree)" > ${conf}
|
||||
echo "linux /${iso_name}/boot/${arch}/${iso_name}" >> ${conf}
|
||||
echo "title ${dist_name} Linux ${target_arch} UEFI USB (nonfree)" > ${conf}
|
||||
echo "linux /${iso_name}/boot/${target_arch}/${iso_name}" >> ${conf}
|
||||
if [[ -f ${path}/${iso_name}/boot/intel_ucode.img ]] ; then
|
||||
msg2 "Using intel_ucode.img ..."
|
||||
echo "initrd /${iso_name}/boot/intel_ucode.img" >> ${conf}
|
||||
fi
|
||||
echo "initrd /${iso_name}/boot/${arch}/${iso_name}.img" >> ${conf}
|
||||
echo "initrd /${iso_name}/boot/${target_arch}/${iso_name}.img" >> ${conf}
|
||||
echo "options misobasedir=${iso_name} misolabel=${iso_label} nouveau.modeset=1 i915.modeset=1 radeon.modeset=1 logo.nologo overlay=nonfree nonfree=yes" >> ${conf}
|
||||
}
|
||||
|
||||
|
@ -195,7 +195,7 @@ gen_boot_args(){
|
|||
}
|
||||
|
||||
gen_initrd_arg(){
|
||||
local path="/${iso_name}/boot/${arch}/${iso_name}.img"
|
||||
local path="/${iso_name}/boot/${target_arch}/${iso_name}.img"
|
||||
local arg="initrd=${path}"
|
||||
if [[ -f $1/${iso_name}/boot/intel_ucode.img ]] ; then
|
||||
arg="initrd=/${iso_name}/boot/intel_ucode.img,${path}"
|
||||
|
@ -215,7 +215,7 @@ write_isolinux_cfg(){
|
|||
echo "timeout 200" >> ${conf}
|
||||
echo '' >> ${conf}
|
||||
echo "label start" >> ${conf}
|
||||
echo " kernel /${iso_name}/boot/${arch}/${iso_name}" >> ${conf}
|
||||
echo " kernel /${iso_name}/boot/${target_arch}/${iso_name}" >> ${conf}
|
||||
|
||||
local boot_args=($(gen_boot_args))
|
||||
local initrd_arg=$(gen_initrd_arg $path)
|
||||
|
@ -225,7 +225,7 @@ write_isolinux_cfg(){
|
|||
echo '' >> ${conf}
|
||||
if ${nonfree_xorg};then
|
||||
echo "label nonfree" >> ${conf}
|
||||
echo " kernel /${iso_name}/boot/${arch}/${iso_name}" >> ${conf}
|
||||
echo " kernel /${iso_name}/boot/${target_arch}/${iso_name}" >> ${conf}
|
||||
echo " append ${initrd_arg} misobasedir=${iso_name} misolabel=${iso_label} nouveau.modeset=0 i915.modeset=1 radeon.modeset=0 nonfree=yes logo.nologo overlay=nonfree ${boot_args[@]} showopts" >> ${conf}
|
||||
echo '' >> ${conf}
|
||||
fi
|
||||
|
@ -264,7 +264,7 @@ update_isolinux_cfg(){
|
|||
msg2 "Updating %s ..." "${fn}"
|
||||
sed -i "s|%ISO_LABEL%|${iso_label}|g;
|
||||
s|%ISO_NAME%|${iso_name}|g;
|
||||
s|%ARCH%|${arch}|g" $2/${fn}
|
||||
s|%ARCH%|${target_arch}|g" $2/${fn}
|
||||
}
|
||||
|
||||
update_isolinux_msg(){
|
||||
|
@ -279,15 +279,15 @@ write_isomounts(){
|
|||
echo '# Sample kernel argument in syslinux: overlay=extra,extra2' >> ${file}
|
||||
echo '' >> ${file}
|
||||
msg2 "Writing live entry ..."
|
||||
echo "${arch}/live-image.sqfs ${arch} / squashfs" >> ${file}
|
||||
echo "${target_arch}/live-image.sqfs ${target_arch} / squashfs" >> ${file}
|
||||
if [[ -f ${packages_mhwd} ]] ; then
|
||||
msg2 "Writing mhwd entry ..."
|
||||
echo "${arch}/mhwd-image.sqfs ${arch} / squashfs" >> ${file}
|
||||
echo "${target_arch}/mhwd-image.sqfs ${target_arch} / squashfs" >> ${file}
|
||||
fi
|
||||
if [[ -f "${packages_custom}" ]] ; then
|
||||
msg2 "Writing %s entry ..." "${profile}"
|
||||
echo "${arch}/${profile}-image.sqfs ${arch} / squashfs" >> ${file}
|
||||
echo "${target_arch}/${profile}-image.sqfs ${target_arch} / squashfs" >> ${file}
|
||||
fi
|
||||
msg2 "Writing root entry ..."
|
||||
echo "${arch}/root-image.sqfs ${arch} / squashfs" >> ${file}
|
||||
echo "${target_arch}/root-image.sqfs ${target_arch} / squashfs" >> ${file}
|
||||
}
|
||||
|
|
|
@ -136,10 +136,10 @@ write_calamares_unpack_conf(){
|
|||
local conf="$1/etc/calamares/modules/unpackfs.conf"
|
||||
echo "---" > "$conf"
|
||||
echo "unpack:" >> "$conf"
|
||||
echo " - source: \"/bootmnt/${iso_name}/${arch}/root-image.sqfs\"" >> "$conf"
|
||||
echo " - source: \"/bootmnt/${iso_name}/${target_arch}/root-image.sqfs\"" >> "$conf"
|
||||
echo " sourcefs: \"squashfs\"" >> "$conf"
|
||||
echo " destination: \"\"" >> "$conf"
|
||||
echo " - source: \"/bootmnt/${iso_name}/${arch}/${profile}-image.sqfs\"" >> "$conf"
|
||||
echo " - source: \"/bootmnt/${iso_name}/${target_arch}/${profile}-image.sqfs\"" >> "$conf"
|
||||
echo " sourcefs: \"squashfs\"" >> "$conf"
|
||||
echo " destination: \"\"" >> "$conf"
|
||||
}
|
||||
|
@ -225,8 +225,8 @@ configure_thus(){
|
|||
echo "DISTRIBUTION_VERSION = \"${dist_release}\"" >> "$conf"
|
||||
echo "SHORT_NAME = \"${dist_name}\"" >> "$conf"
|
||||
echo "[install]" >> "$conf"
|
||||
echo "LIVE_MEDIA_SOURCE = \"/bootmnt/${iso_name}/${arch}/root-image.sqfs\"" >> "$conf"
|
||||
echo "LIVE_MEDIA_DESKTOP = \"/bootmnt/${iso_name}/${arch}/${profile}-image.sqfs\"" >> "$conf"
|
||||
echo "LIVE_MEDIA_SOURCE = \"/bootmnt/${iso_name}/${target_arch}/root-image.sqfs\"" >> "$conf"
|
||||
echo "LIVE_MEDIA_DESKTOP = \"/bootmnt/${iso_name}/${target_arch}/${profile}-image.sqfs\"" >> "$conf"
|
||||
echo "LIVE_MEDIA_TYPE = \"squashfs\"" >> "$conf"
|
||||
echo "LIVE_USER_NAME = \"${username}\"" >> "$conf"
|
||||
echo "KERNEL = \"${kernel}\"" >> "$conf"
|
||||
|
|
|
@ -265,7 +265,7 @@ configure_lsb(){
|
|||
}
|
||||
|
||||
configure_mhwd(){
|
||||
if [[ ${arch} == "x86_64" ]];then
|
||||
if [[ ${target_arch} == "x86_64" ]];then
|
||||
if ! ${multilib};then
|
||||
msg2 "Disable mhwd lib32 support"
|
||||
echo 'MHWD64_IS_LIB32="false"' > $1/etc/mhwd-x86_64.conf
|
||||
|
@ -425,13 +425,13 @@ download_to_cache(){
|
|||
chroot-run \
|
||||
-r "${mountargs_ro}" \
|
||||
-w "${mountargs_rw}" \
|
||||
-B "${build_mirror}/${branch}" \
|
||||
-B "${build_mirror}/${target_branch}" \
|
||||
"$1" \
|
||||
pacman -v -Syw $2 --noconfirm || return 1
|
||||
chroot-run \
|
||||
-r "${mountargs_ro}" \
|
||||
-w "${mountargs_rw}" \
|
||||
-B "${build_mirror}/${branch}" \
|
||||
-B "${build_mirror}/${target_branch}" \
|
||||
"$1" \
|
||||
pacman -v -Sp $2 --noconfirm > "$1"/cache-packages.txt
|
||||
sed -ni '/.pkg.tar.xz/p' "$1"/cache-packages.txt
|
||||
|
@ -442,7 +442,7 @@ download_to_cache(){
|
|||
# $2: packages
|
||||
chroot_create(){
|
||||
[[ "$1" == "${work_dir}/root-image" ]] && local flag="-L"
|
||||
setarch "${arch}" \
|
||||
setarch "${target_arch}" \
|
||||
mkchroot ${mkchroot_args[*]} ${flag} $@
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ make_sqfs() {
|
|||
error "$1 is not a directory"
|
||||
return 1
|
||||
fi
|
||||
local timer=$(get_timer) path=${work_dir}/iso/${iso_name}/${arch}
|
||||
local timer=$(get_timer) path=${work_dir}/iso/${iso_name}/${target_arch}
|
||||
local name=${1##*/}
|
||||
local sq_img="${path}/$name.sqfs"
|
||||
mkdir -p ${path}
|
||||
|
@ -178,7 +178,7 @@ gen_iso_fn(){
|
|||
[[ ${edition} == 'community' ]] && vars+=("${edition}")
|
||||
[[ ${initsys} == 'openrc' ]] && vars+=("${initsys}")
|
||||
vars+=("${dist_release}")
|
||||
vars+=("${arch}")
|
||||
vars+=("${target_arch}")
|
||||
for n in ${vars[@]};do
|
||||
name=${name:-}${name:+-}${n}
|
||||
done
|
||||
|
@ -305,9 +305,9 @@ make_image_boot() {
|
|||
if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
|
||||
msg "Prepare [%s/boot]" "${iso_name}"
|
||||
local path_iso="${work_dir}/iso/${iso_name}/boot"
|
||||
mkdir -p ${path_iso}/${arch}
|
||||
cp ${work_dir}/root-image/boot/memtest86+/memtest.bin ${path_iso}/${arch}/memtest
|
||||
cp ${work_dir}/root-image/boot/vmlinuz* ${path_iso}/${arch}/${iso_name}
|
||||
mkdir -p ${path_iso}/${target_arch}
|
||||
cp ${work_dir}/root-image/boot/memtest86+/memtest.bin ${path_iso}/${target_arch}/memtest
|
||||
cp ${work_dir}/root-image/boot/vmlinuz* ${path_iso}/${target_arch}/${iso_name}
|
||||
local path="${work_dir}/boot-image"
|
||||
mkdir -p ${path}
|
||||
|
||||
|
@ -317,7 +317,7 @@ make_image_boot() {
|
|||
|
||||
gen_boot_image "${path}"
|
||||
|
||||
mv ${path}/boot/${iso_name}.img ${path_iso}/${arch}/${iso_name}.img
|
||||
mv ${path}/boot/${iso_name}.img ${path_iso}/${target_arch}/${iso_name}.img
|
||||
[[ -f ${path}/boot/intel-ucode.img ]] && copy_ucode "${path}" "${path_iso}"
|
||||
|
||||
umount_image
|
||||
|
@ -428,7 +428,7 @@ load_pkgs(){
|
|||
_init="s|>systemd||g"
|
||||
_init_rm="s|>openrc.*||g"
|
||||
fi
|
||||
if [[ "${arch}" == "i686" ]]; then
|
||||
if [[ "${target_arch}" == "i686" ]]; then
|
||||
_arch="s|>i686||g"
|
||||
_arch_rm="s|>x86_64.*||g"
|
||||
_multi="s|>multilib.*||g"
|
||||
|
@ -560,11 +560,11 @@ check_profile(){
|
|||
|
||||
check_requirements(){
|
||||
[[ -f ${run_dir}/.buildiso ]] || die "%s is not a valid iso profiles directory!" "${run_dir}"
|
||||
if ! $(is_valid_arch_iso ${arch});then
|
||||
die "%s is not a valid arch!" "${arch}"
|
||||
if ! $(is_valid_arch_iso ${target_arch});then
|
||||
die "%s is not a valid arch!" "${target_arch}"
|
||||
fi
|
||||
if ! $(is_valid_branch ${branch});then
|
||||
die "%s is not a valid branch!" "${branch}"
|
||||
if ! $(is_valid_branch ${target_branch});then
|
||||
die "%s is not a valid branch!" "${target_branch}"
|
||||
fi
|
||||
|
||||
if ! is_valid_init "${initsys}";then
|
||||
|
@ -614,7 +614,7 @@ prepare_images(){
|
|||
run_safe "make_image_mhwd"
|
||||
fi
|
||||
run_safe "make_image_boot"
|
||||
if [[ "${arch}" == "x86_64" ]]; then
|
||||
if [[ "${target_arch}" == "x86_64" ]]; then
|
||||
run_safe "make_efi"
|
||||
run_safe "make_efiboot"
|
||||
fi
|
||||
|
@ -670,10 +670,10 @@ load_profile(){
|
|||
|
||||
iso_file=$(gen_iso_fn).iso
|
||||
|
||||
mkchroot_args+=(-C ${pacman_conf} -S ${mirrors_conf} -B "${build_mirror}/${branch}" -K)
|
||||
work_dir=${chroots_iso}/${profile}/${arch}
|
||||
mkchroot_args+=(-C ${pacman_conf} -S ${mirrors_conf} -B "${build_mirror}/${target_branch}" -K)
|
||||
work_dir=${chroots_iso}/${profile}/${target_arch}
|
||||
|
||||
iso_dir="${cache_dir_iso}/${edition}/${profile}/${dist_release}/${arch}"
|
||||
iso_dir="${cache_dir_iso}/${edition}/${profile}/${dist_release}/${target_arch}"
|
||||
|
||||
prepare_dir "${iso_dir}"
|
||||
prepare_dir "${log_dir}"
|
||||
|
|
|
@ -97,10 +97,10 @@ chroot_mount_partitions(){
|
|||
|
||||
local chroot_arch=$(get_chroot_arch $1)
|
||||
[[ ${chroot_arch} == x86-64 ]] && chroot_arch=${chroot_arch/-/_}
|
||||
case ${arch} in
|
||||
case ${target_arch} in
|
||||
i686)
|
||||
if [[ ${chroot_arch} == x86_64 ]];then
|
||||
die "You can't chroot from %s host into %s!" "${arch}" "${chroot_arch}"
|
||||
die "You can't chroot from %s host into %s!" "${target_arch}" "${chroot_arch}"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
|
|
@ -144,16 +144,16 @@ init_base_devel(){
|
|||
}
|
||||
|
||||
chroot_create(){
|
||||
msg "Creating chroot for [%s] (%s)..." "${branch}" "${arch}"
|
||||
msg "Creating chroot for [%s] (%s)..." "${target_branch}" "${target_arch}"
|
||||
mkdir -p "${work_dir}"
|
||||
setarch "${arch}" \
|
||||
setarch "${target_arch}" \
|
||||
mkchroot ${mkchroot_args[*]} \
|
||||
"${work_dir}/root" \
|
||||
${base_packages[*]} || abort
|
||||
}
|
||||
|
||||
chroot_clean(){
|
||||
msg "Cleaning chroot for [%s] (%s)..." "${branch}" "${arch}"
|
||||
msg "Cleaning chroot for [%s] (%s)..." "${target_branch}" "${target_arch}"
|
||||
for copy in "${work_dir}"/*; do
|
||||
[[ -d ${copy} ]] || continue
|
||||
msg2 "Deleting chroot copy %s ..." "$(basename "${copy}")"
|
||||
|
@ -171,7 +171,7 @@ chroot_clean(){
|
|||
}
|
||||
|
||||
chroot_update(){
|
||||
msg "Updating chroot for [%s] (%s)..." "${branch}" "${arch}"
|
||||
msg "Updating chroot for [%s] (%s)..." "${target_branch}" "${target_arch}"
|
||||
chroot-run ${mkchroot_args[*]} \
|
||||
"${work_dir}/${OWNER}" \
|
||||
pacman -Syu --noconfirm || abort
|
||||
|
@ -193,13 +193,12 @@ sign_pkg(){
|
|||
}
|
||||
|
||||
post_build(){
|
||||
local _arch=${arch}
|
||||
source PKGBUILD
|
||||
local ext='pkg.tar.xz' pinfo loglist=() lname
|
||||
if [[ ${arch} == "any" ]]; then
|
||||
pinfo=${pkgver}-${pkgrel}-any
|
||||
else
|
||||
pinfo=${pkgver}-${pkgrel}-${_arch}
|
||||
pinfo=${pkgver}-${pkgrel}-${arch}
|
||||
fi
|
||||
if [[ -n $PKGDEST ]];then
|
||||
if [[ -n ${pkgbase} ]];then
|
||||
|
@ -226,7 +225,6 @@ post_build(){
|
|||
tar -cJf ${lname}-${pinfo}.log.tar.xz ${loglist[@]}
|
||||
find . -maxdepth 1 -name '*.log' -delete #&> /dev/null
|
||||
fi
|
||||
arch=$_arch
|
||||
}
|
||||
|
||||
chroot_init(){
|
||||
|
@ -243,7 +241,7 @@ chroot_init(){
|
|||
}
|
||||
|
||||
build_pkg(){
|
||||
setarch "${arch}" \
|
||||
setarch "${target_arch}" \
|
||||
mkchrootpkg ${mkchrootpkg_args[*]}
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ create_subtree(){
|
|||
|
||||
prepare_transfer(){
|
||||
edition=$(get_edition $1)
|
||||
remote_dir="${edition}/$1/${dist_release}/${arch}"
|
||||
remote_dir="${edition}/$1/${dist_release}/${target_arch}"
|
||||
src_dir="${run_dir}/${remote_dir}"
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ gen_iso_fn(){
|
|||
[[ ${edition} == 'community' ]] && vars+=("${edition}")
|
||||
[[ ${initsys} == 'openrc' ]] && vars+=("${initsys}")
|
||||
vars+=("${dist_release}")
|
||||
vars+=("${arch}")
|
||||
vars+=("${target_arch}")
|
||||
for n in ${vars[@]};do
|
||||
name=${name:-}${name:+-}${n}
|
||||
done
|
||||
|
@ -59,7 +59,7 @@ sync_dir(){
|
|||
prepare_transfer "$1"
|
||||
${torrent_create} && create_torrent "$1"
|
||||
${remote_create} && create_subtree "$1"
|
||||
msg "Start upload [%s] (%s) ..." "$1" "${arch}"
|
||||
msg "Start upload [%s] (%s) ..." "$1" "${target_arch}"
|
||||
rsync ${rsync_args[*]} ${src_dir}/ ${sf_url}/${remote_dir}/
|
||||
msg "Done upload [%s]" "$1"
|
||||
show_elapsed_time "${FUNCNAME}" "${timer_start}"
|
||||
|
|
|
@ -201,9 +201,9 @@ set_branch(){
|
|||
}
|
||||
|
||||
init_common(){
|
||||
[[ -z ${branch} ]] && branch='stable'
|
||||
[[ -z ${target_branch} ]] && target_branch='stable'
|
||||
|
||||
[[ -z ${arch} ]] && arch=$(uname -m)
|
||||
[[ -z ${target_arch} ]] && target_arch=$(uname -m)
|
||||
|
||||
[[ -z ${cache_dir} ]] && cache_dir='/var/cache/manjaro-tools'
|
||||
|
||||
|
|
Loading…
Reference in a new issue