initial import
This commit is contained in:
32
pcmemtest/60_pcmemtest
Normal file
32
pcmemtest/60_pcmemtest
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env sh
|
||||
#######################################################
|
||||
# This script generates a PCMemTest entry on grub.cfg #
|
||||
# if memtest is installed on the system. #
|
||||
#######################################################
|
||||
|
||||
prefix="/usr"
|
||||
exec_prefix="${prefix}"
|
||||
|
||||
datarootdir="/usr/share"
|
||||
datadir="${datarootdir}"
|
||||
|
||||
. "${datadir}/grub/grub-mkconfig_lib"
|
||||
|
||||
MEMTEST_IMAGE="/boot/pcmemtest/memtest.bin"
|
||||
CLASS="--class pcmemtest --class pcmemtest --class tool"
|
||||
|
||||
if [ -e "${MEMTEST_IMAGE}" ] && is_path_readable_by_grub "${MEMTEST_IMAGE}"; then
|
||||
## image exists, create menu entry
|
||||
echo "Found PCMemTest image: ${MEMTEST_IMAGE}" >&2
|
||||
_GRUB_MEMTEST_HINTS_STRING="$(${grub_probe} --target=hints_string ${MEMTEST_IMAGE})"
|
||||
_GRUB_MEMTEST_FS_UUID="$(${grub_probe} --target=fs_uuid ${MEMTEST_IMAGE})"
|
||||
_GRUB_MEMTEST_REL_PATH="$(make_system_path_relative_to_its_root ${MEMTEST_IMAGE})"
|
||||
cat << EOF
|
||||
if [ "\${grub_platform}" == "pc" ]; then
|
||||
menuentry "Memory Tester (PCMemTest)" ${CLASS} {
|
||||
search --fs-uuid --no-floppy --set=root ${_GRUB_MEMTEST_HINTS_STRING} ${_GRUB_MEMTEST_FS_UUID}
|
||||
linux16 ${_GRUB_MEMTEST_REL_PATH} ${GRUB_CMDLINE_PCMEMTEST}
|
||||
}
|
||||
fi
|
||||
EOF
|
||||
fi
|
||||
47
pcmemtest/PKGBUILD
Normal file
47
pcmemtest/PKGBUILD
Normal file
@@ -0,0 +1,47 @@
|
||||
# Maintainer: Jesus E. <heckyel@riseup.net>
|
||||
|
||||
# Based of memtest86+ package
|
||||
|
||||
pkgname='pcmemtest'
|
||||
pkgver='1.5'
|
||||
pkgrel='1'
|
||||
pkgdesc="Advanced memory diagnostic tool"
|
||||
arch=('i686' 'x86_64')
|
||||
url="https://github.com/martinwhitaker/${pkgname}"
|
||||
license=('GPL-2')
|
||||
depends=('efibootmgr' 'sh' 'util-linux')
|
||||
optdepends=('grub: for Grub support')
|
||||
provides=('memtest86+' 'memtest86')
|
||||
conflicts=('memtest86+' 'memtest86')
|
||||
replaces=('memtest86+' 'memtest86')
|
||||
_source=("https://github.com/martinwhitaker/${pkgname}")
|
||||
source=("${_source[0]}/archive/refs/tags/v${pkgver}.tar.gz"
|
||||
"60_${pkgname}" "${pkgname}-install")
|
||||
sha512sums=('12db2504fef23d62b2246fb638e6f50cd2634ce54629467686b565512e866a51e0b6bcb4b0ad89b08e824b76841568b01ec151a86c50c6c14b4ef433c342068e'
|
||||
'5c00475f87ca5b6a588a6d864545d0277e1108a41e8525dbd360491c066e34bbece2ebf42111870e9dc3cc83de96bba80c22672083d4d0090b5db4292d583220'
|
||||
'02e7583e986756894bbe11200d583a2f80f711d3f6c1ca7b383c88e9ad46cb73df43b0c841c767470c560fdc9bb3ba9f0c6bd8e4110b216217837546f933bd2e')
|
||||
if [ "${CARCH}" = 'i686' ]; then
|
||||
_arch='32'
|
||||
_uefi="ia${_arch}"
|
||||
elif [ "${CARCH}" = 'x86_64' ]; then
|
||||
_arch='64'
|
||||
_uefi="x${_arch}"
|
||||
fi
|
||||
|
||||
build() {
|
||||
cd "${pkgname}-${pkgver}/build${_arch}"
|
||||
make V='1'
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "${pkgname}-${pkgver}/build${_arch}"
|
||||
|
||||
install -Dm '644' "${srcdir}/${pkgname}-install" -t "${pkgdir}/usr/sbin"
|
||||
|
||||
install -Dm '644' "${pkgname/pc}.bin" -t "${pkgdir}/usr/share/${pkgname}"
|
||||
install -Dm '644' "${pkgname/pc}.efi" \
|
||||
"${pkgdir}/usr/share/${pkgname}/boot${_uefi}.efi"
|
||||
install -Dm '755' "${srcdir}/60_${pkgname}" -t "${pkgdir}/etc/grub.d"
|
||||
|
||||
install -Dm '644' '../LICENSE' -t "${pkgdir}/usr/share/licenses/${pkgname}"
|
||||
}
|
||||
89
pcmemtest/pcmemtest-install
Normal file
89
pcmemtest/pcmemtest-install
Normal file
@@ -0,0 +1,89 @@
|
||||
#!/bin/sh
|
||||
|
||||
# pcmemtest-install - Script to install PCMemTest
|
||||
#
|
||||
# Written in 2022 by Márcio Silva <coadde@hyperbola.info>
|
||||
#
|
||||
# To the extent possible under law, the author(s) have dedicated all copyright
|
||||
# and related and neighboring rights to this software to the public domain
|
||||
# worldwide. This software is distributed without any warranty.
|
||||
#
|
||||
# You should have received a copy of the CC0 Public Domain Dedication along
|
||||
# with this software. If not, see
|
||||
# <https://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
|
||||
if [ "${UID}" != '0' ] || [ "${USER}" != 'root' ]; then
|
||||
printf 'Only "root" user can install PCMemTest.\n'
|
||||
return 1
|
||||
fi
|
||||
|
||||
case "${1}" in
|
||||
'bios')
|
||||
install -Dm '644' '/usr/share/pcmemtest/memtest.bin' -t \
|
||||
'/boot/pcmemtest'
|
||||
;;
|
||||
'uefi')
|
||||
_SOURCE="$(findmnt -n -o 'source' '/boot/efi')"
|
||||
if [ -f '/usr/share/pcmemtest/bootia32.efi' ]; then
|
||||
install -Dm '644' '/usr/share/pcmemtest/bootia32.efi' -t \
|
||||
'/boot/efi/efi/PCMemTest'
|
||||
efibootmgr -c -d "${_SOURCE}" \
|
||||
-l '\\efi\PCMemTest\bootia32.efi' -L 'PCMemTest (IA32)' -v
|
||||
fi
|
||||
if [ -f '/usr/share/pcmemtest/bootx64.efi' ]; then
|
||||
install -Dm '644' '/usr/share/pcmemtest/bootx64.efi' -t \
|
||||
'/boot/efi/efi/PCMemTest'
|
||||
efibootmgr -c -d "${_SOURCE}" \
|
||||
-l '\\efi\PCMemTest\bootx64.efi' -L 'PCMemTest' -v
|
||||
fi
|
||||
;;
|
||||
'uefi-in-boot')
|
||||
_SOURCE="$(findmnt -n -o 'source' '/boot/efi')"
|
||||
if [ -f '/usr/share/pcmemtest/bootia32.efi' ]; then
|
||||
install -Dm '644' '/usr/share/pcmemtest/bootia32.efi' -t \
|
||||
'/boot/efi/PCMemTest'
|
||||
efibootmgr -c -d "${_SOURCE}" \
|
||||
-l '\\efi\PCMemTest\bootia32.efi' -L 'PCMemTest (IA32)' -v
|
||||
fi
|
||||
if [ -f '/usr/share/pcmemtest/bootx64.efi' ]; then
|
||||
install -Dm '644' '/usr/share/pcmemtest/bootx64.efi' -t \
|
||||
'/boot/efi/PCMemTest'
|
||||
efibootmgr -c -d "${_SOURCE}" \
|
||||
-l '\\efi\PCMemTest\bootx64.efi' -L 'PCMemTest' -v
|
||||
fi
|
||||
;;
|
||||
'both-in-boot')
|
||||
install -Dm '644' '/usr/share/pcmemtest/memtest.bin' -t \
|
||||
'/boot/pcmemtest'
|
||||
_SOURCE="$(findmnt -n -o 'source' '/boot/efi')"
|
||||
if [ -f '/usr/share/pcmemtest/bootia32.efi' ]; then
|
||||
install -Dm '644' '/usr/share/pcmemtest/bootia32.efi' -t \
|
||||
'/boot/efi/PCMemTest'
|
||||
efibootmgr -c -d "${_SOURCE}" \
|
||||
-l '\\efi\PCMemTest\bootia32.efi' -L 'PCMemTest (IA32)' -v
|
||||
fi
|
||||
if [ -f '/usr/share/pcmemtest/bootx64.efi' ]; then
|
||||
install -Dm '644' '/usr/share/pcmemtest/bootx64.efi' -t \
|
||||
'/boot/efi/PCMemTest'
|
||||
efibootmgr -c -d "${_SOURCE}" \
|
||||
-l '\\efi\PCMemTest\bootx64.efi' -L 'PCMemTest' -v
|
||||
fi
|
||||
;;
|
||||
*|'both')
|
||||
install -Dm '644' '/usr/share/pcmemtest/memtest.bin' -t \
|
||||
'/boot/pcmemtest'
|
||||
_SOURCE="$(findmnt -n -o 'source' '/boot/efi')"
|
||||
if [ -f '/usr/share/pcmemtest/bootia32.efi' ]; then
|
||||
install -Dm '644' '/usr/share/pcmemtest/bootia32.efi' -t \
|
||||
'/boot/efi/efi/PCMemTest'
|
||||
efibootmgr -c -d "${_SOURCE}" \
|
||||
-l '\\efi\PCMemTest\bootia32.efi' -L 'PCMemTest (IA32)' -v
|
||||
fi
|
||||
if [ -f '/usr/share/pcmemtest/bootx64.efi' ]; then
|
||||
install -Dm '644' '/usr/share/pcmemtest/bootx64.efi' -t \
|
||||
'/boot/efi/efi/PCMemTest'
|
||||
efibootmgr -c -d "${_SOURCE}" \
|
||||
-l '\\efi\PCMemTest\bootx64.efi' -L 'PCMemTest' -v
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user