Merge pull request #215 from minextu/improvements

Improvements
pull/217/head
Jesus Alvarez 7 years ago committed by GitHub
commit c61e10899e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      build.sh
  2. 18
      lib.sh
  3. 12
      packages/dkms/zfs-dkms-git/zfs.install
  4. 12
      packages/dkms/zfs-dkms/zfs.install
  5. 9
      repo.sh
  6. 1
      src/kernels/archiso.sh
  7. 1
      src/kernels/linux-hardened.sh
  8. 1
      src/kernels/linux-lts.sh
  9. 1
      src/kernels/linux-vfio.sh
  10. 1
      src/kernels/linux-zen.sh
  11. 1
      src/kernels/linux.sh
  12. 12
      src/spl-dkms/60-spl-dkms-install.hook
  13. 14
      src/spl-dkms/PKGBUILD.sh
  14. 28
      src/spl-dkms/spl-dkms-alpm-hook
  15. 1
      src/zfs-dkms/PKGBUILD.sh
  16. 16
      src/zfs-dkms/zfs.install.sh

@ -159,13 +159,15 @@ generate_package_files() {
msg2 "Copying zfs-utils.initcpio.install"
run_cmd_no_output "cp ${script_dir}/src/zfs-utils/zfs-utils.initcpio.install ${zfs_utils_pkgbuild_path}/zfs-utils.initcpio.install"
elif [[ "${kernel_name}" == "dkms" ]]; then
msg2 "Copying 60-spl-dkms-install.hook"
run_cmd_no_output "cp ${script_dir}/src/spl-dkms/60-spl-dkms-install.hook ${spl_dkms_pkgbuild_path}/"
msg2 "Copying spl-dkms-alpm-hook"
run_cmd_no_output "cp ${script_dir}/src/spl-dkms/spl-dkms-alpm-hook ${spl_dkms_pkgbuild_path}/"
msg2 "Creating spl-dkms PKGBUILD"
run_cmd_no_output "source ${script_dir}/src/spl-dkms/PKGBUILD.sh"
msg2 "Creating zfs-dkms PKGBUILD"
run_cmd_no_output "source ${script_dir}/src/zfs-dkms/PKGBUILD.sh"
msg2 "Creating zfs.install"
run_cmd_no_output "source ${script_dir}/src/zfs-dkms/zfs.install.sh"
else
# remove own headers from conflicts
zfs_headers_conflicts=${zfs_headers_conflicts_all/"'${zfs_pkgname}-headers'"}

@ -727,18 +727,12 @@ get_conflicts() {
if [[ "$kernel" == "common.sh" || "$kernel" == "common-git.sh" || "$kernel" == "dkms.sh" ]]; then
continue;
fi
# get update funcs
updatefuncstmp=$(cat "${script_dir}/src/kernels/${kernel}" | grep -v "^.*#" | grep -oh "update_.*_pkgbuilds")
# generate conflict list
for func in ${updatefuncstmp}; do
zfs_headers_conflicts_all+=$(source ${script_dir}/src/kernels/${kernel}; commands=(); ${func}; conflicts=${pkg_list[@]//spl*}; printf "'%s-headers' " "${conflicts[@]}")
spl_headers_conflicts_all+=$(source ${script_dir}/src/kernels/${kernel}; commands=(); ${func}; conflicts=${pkg_list[@]//zfs*}; printf "'%s-headers' " "${conflicts[@]}")
zfs_conflicts_all+=$(source ${script_dir}/src/kernels/${kernel}; commands=(); ${func}; conflicts=${pkg_list[@]//spl*}; printf "'%s' " "${conflicts[@]}")
spl_conflicts_all+=$(source ${script_dir}/src/kernels/${kernel}; commands=(); ${func}; conflicts=${pkg_list[@]//zfs*}; printf "'%s' " "${conflicts[@]}")
done
source_safe "src/kernels/${kernel}"
zfs_headers_conflicts_all+="'zfs-${package_base}-headers' 'zfs-${package_base}-git-headers' "
spl_headers_conflicts_all+="'spl-${package_base}-headers' 'spl-${package_base}-git-headers' "
zfs_conflicts_all+="'zfs-${package_base}' 'zfs-${package_base}-git' "
spl_conflicts_all+="'spl-${package_base}' 'spl-${package_base}-git' "
done
}

@ -1,12 +0,0 @@
post_install() {
# https://bugs.archlinux.org/task/52901
echo '>>> If DKMS fails to build ZFS, run this command:'
echo -e '# dkms install -m zfs/git -k <kernel_version>\n'
echo 'If you are using ZFS on your root partition run this afterwards:'
echo '# mkinitcpio -P'
}
post_upgrade() {
post_install "$1"
}

@ -1,12 +0,0 @@
post_install() {
# https://bugs.archlinux.org/task/52901
echo '>>> If DKMS fails to build ZFS, run this command:'
echo -e '# dkms install -m zfs/0.7.5 -k <kernel_version>\n'
echo 'If you are using ZFS on your root partition run this afterwards:'
echo '# mkinitcpio -P'
}
post_upgrade() {
post_install "$1"
}

@ -13,6 +13,7 @@ repo_name="" # The destination repo for the packages
package_list=() # A list of packages to add. Array items are in the form of "name;pkg.tar.xz;repo_path".
package_src_list=() # A list of package sources to move
package_exist_list=()
all_added_pkgs=() # A list of all packages, that were added to the repo
haz_error=0
@ -271,6 +272,7 @@ repo_add() {
bname=$(basename ${pkgp})
pkg_add_list+=("${dest}/${bname}")
all_added_pkgs+=("${bname}")
done
debug_print_array "pkg_cp_list" "${pkg_cp_list[@]}"
@ -379,6 +381,13 @@ for (( i = 0; i < ${#modes[@]}; i++ )); do
done
done
if [[ ${#all_added_pkgs[@]} -gt 0 ]]; then
msg2 "${#all_added_pkgs[@]} packages were added to the repo:"
printf '%s\n' "${all_added_pkgs[@]}"
else
msg2 "No packages were added to the repo"
fi
if [[ ${haz_error} -ne 0 ]]; then
warning "An error has been detected! Inspect output above closely..."
fi

@ -1,5 +1,6 @@
# For build.sh
mode_name="iso"
package_base="archiso-linux"
mode_desc="Select and use the packages for the archiso linux kernel"
# Kernel versions for LTS packages

@ -1,5 +1,6 @@
# For build.sh
mode_name="hardened"
package_base="linux-hardened"
mode_desc="Select and use the packages for the linux-hardened kernel"
# Kernel versions for hardened packages

@ -1,5 +1,6 @@
# For build.sh
mode_name="lts"
package_base="linux-lts"
mode_desc="Select and use the packages for the linux-lts kernel"
# Kernel versions for LTS packages

@ -1,5 +1,6 @@
# For build.sh
mode_name="vfio"
package_base="linux-vfio"
mode_desc="Select and use the packages for the linux-vfio kernel"
# Kernel versions for default ZFS packages

@ -1,5 +1,6 @@
# For build.sh
mode_name="zen"
package_base="linux-zen"
mode_desc="Select and use the packages for the linux-zen kernel"
# Kernel versions for default ZFS packages

@ -1,5 +1,6 @@
# For build.sh
mode_name="std"
package_base="linux"
mode_desc="Select and use the packages for the default linux kernel"
# Kernel versions for default ZFS packages

@ -0,0 +1,12 @@
[Trigger]
Operation = Install
Operation = Upgrade
Type = File
Target = usr/src/spl-*/dkms.conf
Target = usr/lib/modules/*/build/include/
[Action]
Description = Installing SPL
Depends = dkms
When = PostTransaction
Exec = /usr/lib/dkms/spl-dkms-alpm-hook

@ -9,13 +9,17 @@ pkgrel=${spl_pkgrel}
makedepends=(${spl_makedepends})
arch=("x86_64")
url="http://zfsonlinux.org/"
source=("${spl_src_target}")
sha256sums=("${spl_src_hash}")
source=("${spl_src_target}"
"60-spl-dkms-install.hook"
"spl-dkms-alpm-hook")
sha256sums=("${spl_src_hash}"
"15f71a9ceccf795cdac65743bee338e9987ec77e217721f32d55099be6ecf3d7"
"836002f310b9e1d4b1a0e5c30d5b0ac5aa120d335b3ea223228a0b9f037ef8b8")
license=("GPL")
depends=("${spl_utils_pkgname}" "dkms")
provides=("spl")
groups=("${archzfs_package_group}")
conflicts=(${spl_conflicts} ${spl_conflicts_all} ${spl_headers_conflicts_all})
conflicts=(${spl_conflicts} ${spl_conflicts_all} ${spl_headrs_conflicts_all})
${spl_replaces}
build() {
@ -24,6 +28,10 @@ build() {
}
package() {
# install alpm hook
install -D -m 644 \${srcdir}/60-spl-dkms-install.hook \${pkgdir}/usr/share/libalpm/hooks/60-spl-dkms-install.hook
install -D -m 755 \${srcdir}/spl-dkms-alpm-hook \${pkgdir}/usr/lib/dkms/spl-dkms-alpm-hook
dkmsdir="\${pkgdir}/usr/src/spl-${spl_mod_ver}"
install -d "\${dkmsdir}"
cp -a ${spl_workdir}/. \${dkmsdir}

@ -0,0 +1,28 @@
#!/bin/bash
# display what to run and run it quietly
run() {
echo "==> $*"
"$@" > /dev/null
}
# compile spl for the given kernel
install_spl() {
local kernel="${1}"
for m in $(ls /usr/src); do
if [[ "${m}" =~ ^spl-(.*)$ ]]; then
run dkms install "spl/${BASH_REMATCH[1]}" -k "${kernel}"
fi
done
}
# go through all kernels and run install_spl()
main() {
for kernel in $(ls /usr/lib/modules); do
if [[ -d "/usr/lib/modules/${kernel}/kernel" ]]; then
install_spl "${kernel}"
fi
done
}
main

@ -13,7 +13,6 @@ source=("${zfs_src_target}")
sha256sums=("${zfs_src_hash}")
license=("CDDL")
depends=("${spl_pkgname}" "${zfs_utils_pkgname}")
install=zfs.install
provides=("zfs")
groups=("${archzfs_package_group}")
conflicts=(${zfs_conflicts} ${zfs_conflicts_all} ${zfs_headers_conflicts_all})

@ -1,16 +0,0 @@
#!/bin/bash
cat << EOF > ${zfs_dkms_pkgbuild_path}/zfs.install
post_install() {
# https://bugs.archlinux.org/task/52901
echo '>>> If DKMS fails to build ZFS, run this command:'
echo -e '# dkms install -m zfs/${zfs_mod_ver} -k <kernel_version>\n'
echo 'If you are using ZFS on your root partition run this afterwards:'
echo '# mkinitcpio -P'
}
post_upgrade() {
post_install "\$1"
}
EOF
Loading…
Cancel
Save