Update packages

This commit is contained in:
moparisthebest
2019-03-03 20:21:14 -05:00
parent e2fd47cde7
commit 59e4cffa8b
130 changed files with 1078 additions and 2538 deletions
+15 -18
View File
@@ -2,10 +2,11 @@
_pkgbasename=memtest86
pkgname=$_pkgbasename-efi
pkgver=7.5.1001
pkgrel=1
pkgver=8.1
#_build=1000
pkgrel=4
pkgdesc="A free, thorough, stand alone memory test as an EFI application"
arch=('i686' 'x86_64')
arch=('any')
url="http://www.memtest86.com"
license=('GPL2' 'custom:PassMark')
makedepends=('p7zip')
@@ -13,42 +14,38 @@ optdepends=('efibootmgr: to add a new EFI boot entry'
'grub: to add MemTest86 entry in GRUB2 menu')
backup=(etc/$pkgname/$pkgname.conf)
install=$pkgname.install
source=("https://www.passmark.com/ftp/$_pkgbasename-usb-$pkgver.tar.gz"
source=(#"https://www.passmark.com/ftp/$_pkgbasename-usb-$pkgver.$_build.zip"
"$pkgname-$pkgver.zip::https://www.memtest86.com/downloads/$_pkgbasename-usb.zip"
"memtest86-efi"
"memtest86-efi.conf"
"grub.conf"
"systemd-boot.conf"
"memtest86-efi-update.hook"
"memtest86-efi-remove.hook")
sha512sums=('10232a1c3a589407e06257f7fff14a28b524d3998bc712317d25081e3e67f87549bf36cb9e79f50ee9676e32b050d38bbfa74d2f536899d358bcd05edea3b97a'
'001151346736fc901dac0f5f2b07557b049f2e2cf2a7de0aae7019e7fde126e4e6cf291328dea920d5af45b21b08366b6465b8a8aa453f7af0fd760ced3952aa'
sha512sums=('1b4dad3afe4bdf1e7d57ce52815ab8ab7646487272485723e99af1b9d6da79807d0aafea549f5906b320d346ab4f27d9c47734681ffad6fa1e6c50375ab94ff0'
'9e4919d3a1d2435c3feed718b422be7206ec639268d79aee2ac419e9665d134829f507506da33903da547f73d22e0833335118cbe04cda0c5bbfc7e64aa3bd51'
'947df5f141bdb00a007a796c74f862d6ca41f74b4e5b28d1a444b4b8e538114e7f404f54420508639a77e554c2477ad324570ada0462c9fd7b058ed51e0ea8d8'
'df883042a5bad262e74b69e2ca0cd8c9c21a4e4eb5132aed0041a07050b5ab7f280e94681ffe106e6de547d00b621fd2a019cf5b669e00876a32e637687395f8'
'1ece1ca18d53a19eff8341cce0c6099ac6b8d27ebad176c9a85714a7cac24cef7dfa2b462d8a0160dc8eb71f21aca1ee2469ebdf095083dcd77fa0b0f90f1812'
'6952376b601b84da5fba14a7a5316d37b6083bae20f68f5b90b22d2728a19bf6d1fb367cf1adecfb82bf03e339b7dbf91f6d23f0d59731f89cf45240f16d5614'
'1fe55a642e36005f5b7b58e5fb245e8029bb1a19b5f30d8ddba6bbf5a4b96c1bba35be0dfacee478034b8367fdde62d34a934dcd787f4c6702889615bac9f78a')
prepare() {
msg2 "Extract ISO..."
7z x -y "$srcdir/memtest86-usb.img" > /dev/null
7z x -y "$srcdir/EFI System Partition.img" -oc:"$srcdir/$pkgname-$pkgver" > /dev/null
7z x -y "$srcdir/EFI System Partition.img" -oc:"$srcdir/$pkgname-$pkgver" > /dev/null
}
package() {
cd "$srcdir/$pkgname-$pkgver"
msg2 "Move MemTest86 stuff in share directory..."
[[ "$CARCH" == "i686" ]] && install -Dvm755 "EFI/BOOT/BOOTIA32.efi" "$pkgdir/usr/share/$pkgname/bootia32.efi"
[[ "$CARCH" == "x86_64" ]] && install -Dvm755 "EFI/BOOT/BOOTX64.efi" "$pkgdir/usr/share/$pkgname/bootx64.efi"
install -Dvm644 "EFI/BOOT/mt86.png" "$pkgdir/usr/share/$pkgname/mt86.png"
install -Dvm644 "EFI/BOOT/unifont.bin" "$pkgdir/usr/share/$pkgname/unifont.bin"
install -Dvm644 "license.rtf" "$pkgdir/usr/share/licenses/$pkgname/LICENSE.rtf"
install -Dvm755 "EFI/BOOT/BOOTIA32.efi" "$pkgdir/usr/share/$pkgname/bootia32.efi"
install -Dvm755 "EFI/BOOT/BOOTX64.efi" "$pkgdir/usr/share/$pkgname/bootx64.efi"
install -Dvm644 "EFI/BOOT/blacklist.cfg" "$pkgdir/usr/share/$pkgname/blacklist.cfg"
install -Dvm644 "EFI/BOOT/mt86.png" "$pkgdir/usr/share/$pkgname/mt86.png"
install -Dvm644 "EFI/BOOT/unifont.bin" "$pkgdir/usr/share/$pkgname/unifont.bin"
install -Dvm644 "license.rtf" "$pkgdir/usr/share/licenses/$pkgname/LICENSE.rtf"
msg2 "Install AUR provided script..."
install -Dvm755 "$srcdir/memtest86-efi" "$pkgdir/usr/bin/memtest86-efi"
install -Dvm644 "$srcdir/memtest86-efi.conf" "$pkgdir/etc/memtest86-efi/memtest86-efi.conf"
install -Dvm644 "$srcdir/grub.conf" "$pkgdir/etc/memtest86-efi/grub.conf"
install -Dvm644 "$srcdir/systemd-boot.conf" "$pkgdir/etc/memtest86-efi/systemd-boot.conf"
msg2 "Install Pacman hooks..."
install -Dvm644 "$srcdir/memtest86-efi-update.hook" "$pkgdir/usr/share/libalpm/hooks/memtest86-efi-update.hook"
+49 -24
View File
@@ -8,6 +8,7 @@ PRGNAME=$(basename $0)
CONFDIR="/etc/memtest86-efi"
CONFFILE="$CONFDIR/memtest86-efi.conf"
source "$CONFFILE" || exit 127
shopt -s extglob
[[ "$(uname -m)" == "i686" ]] && ARCH="ia32"
[[ "$(uname -m)" == "x86_64" ]] && ARCH="x64"
@@ -30,13 +31,40 @@ checkcommand() {
}
_common_install() {
efidir="$esp/EFI/memtest86"
efifile="$efidir/memtest$ARCH.efi"
efidir="$1"
efifile="$2"
echo -e "MemTest86 will be installed in ${CB}$efidir/${CR}."
echo -e "MemTest86 is installed into ${CB}$efidir/${CR} directory."
mkdir -pv "$efidir"
cp -v "$MEMTEST86_PATH/"* "$efidir/" # Move files in memtest ESP directory
mv -v "$efidir/boot$ARCH.efi" "$efifile" # Rename .efi file
cp -v "$MEMTEST86_PATH/"!(*.efi) "$efidir/" # Move files in memtest ESP directory
cp -v "$MEMTEST86_PATH/boot$ARCH.efi" "$efidir/$efifile" # Copy and rename .efi file
}
_write_grub_cfg() {
uuid="$1"
cat > "/etc/grub.d/86_memtest" <<FOE
#!/bin/sh
cat <<EOF
if [ "\\\$grub_platform" = "efi" ]; then
menuentry "Memtest86" {
search --set=root --no-floppy --fs-uuid $uuid
chainloader /EFI/memtest86/memtest$ARCH.efi
}
fi
EOF
FOE
chmod 755 "/etc/grub.d/86_memtest"
}
_write_systemd_boot_cfg() {
systemdbootdir="$1"
cat > "$systemdbootdir/memtest86-efi.conf" <<FOE
title MemTest86
efi /EFI/memtest86/memtest$ARCH.efi
FOE
}
install() {
@@ -86,16 +114,13 @@ install() {
case $choice in
1) # Install MemTest86 in $esp/
echo -e "MemTest86 will be installed in ${CB}$esp/${CR}."
efifile="$esp/shell$ARCH.efi"
[[ -f "$esp/shell$ARCH.efi" ]] && mv -v "$esp/shell$ARCH.efi" "$esp/shell$ARCH.efi.bak" # Backup if exist
cp -v "$MEMTEST86_PATH/"* "$esp/" # Move files in ESP root
mv -v "$esp/boot$ARCH.efi" "$efifile" # Rename .efi file
_common_install "$esp" "shell$ARCH.efi"
;;
2) # Install MemTest86 in $esp/EFI/memtest86/ & add an EFI boot entry
checkcommand efibootmgr
_common_install
_common_install "$esp/EFI/memtest86" "memtest$ARCH.efi"
echo -e "\nAdd a new EFI boot entry..."
efibootmgr -c -d ${device} -p ${partnumber} -w -L "MemTest86" -l "\EFI\memtest86\memtest$ARCH.efi" # Manage efi entry
;;
@@ -106,22 +131,21 @@ install() {
echo -e "${CE}GRUB2 seems not installed on your system. Aborted.${CR}" > /dev/stderr
exit 2
fi
_common_install
_common_install "$esp/EFI/memtest86" "memtest$ARCH.efi"
echo -e "\nAdd a new configuration file for GRUB..."
/bin/install -Dvm755 "$CONFDIR/grub.conf" "/etc/grub.d/86_memtest"
uuid=$(blkid $partition -s UUID -o value)
sed -i "s|@UUID@|$uuid|g" "/etc/grub.d/86_memtest"
sed -i "s|@ARCH@|$ARCH|g" "/etc/grub.d/86_memtest"
_write_grub_cfg "$uuid"
grub-mkconfig -o "/boot/grub/grub.cfg"
;;
4) # Install MemTest86 in $esp/EFI/memtest86/ & add a file for systemd-boot
_common_install
checkcommand bootctl
_common_install "$esp/EFI/memtest86" "memtest$ARCH.efi"
echo -e "\nAdd a new configuration file for systemd-boot..."
systemdbootdir="$esp/loader/entries"
mkdir -pv "$systemdbootdir"
/bin/install -Dvm644 "$CONFDIR/systemd-boot.conf" "$systemdbootdir/memtest86-efi.conf"
sed -i "s|@ARCH@|$ARCH|g" "$systemdbootdir/memtest86-efi.conf"
_write_systemd_boot_cfg "$systemdbootdir"
bootctl --path="$esp" update
;;
*) # Do nothing and quit
@@ -147,15 +171,11 @@ update() {
case $choice in
1) # Update files in $esp/
echo -e "MemTest86 will be updated in ${CB}$esp/${CR}."
cp -fv "$MEMTEST86_PATH/"* "$esp/"
mv -fv "$esp/boot$ARCH.efi" "$esp/shell$ARCH.efi"
_common_install "$esp" "shell$ARCH.efi"
;;
2|3|4) # Update files in $esp/EFI/memtest86/
echo -e "MemTest86 will be updated in ${CB}$esp/EFI/memtest86/${CR}."
cp -fv "$MEMTEST86_PATH/"* "$esp/EFI/memtest86/"
mv -fv "$esp/EFI/memtest86/boot$ARCH.efi" "$esp/EFI/memtest86/memtest$ARCH.efi"
_common_install "$esp/EFI/memtest86" "memtest$ARCH.efi"
;;
esac
@@ -171,7 +191,7 @@ remove() {
case $choice in
1) # Remove files in $esp/
echo -e "MemTest86 will be removed from ${CB}$esp/${CR}."
rm -v "$esp/mt86.png" "$esp/shell$ARCH.efi"
rm -v "$esp/shell$ARCH.efi" "$esp/blacklist.cfg" "$esp/mt86.png" "$esp/unifont.bin"
[[ -f "$esp/shell$ARCH.efi.bak" ]] && mv -v "$esp/shell$ARCH.efi.bak" "$esp/shell$ARCH.efi"
;;
@@ -248,6 +268,11 @@ about() {
echo -e "$PRGNAME is a script which helps you to easily use MemTest86 with your UEFI, as an EFI application."
}
if [[ -z $ARCH ]]; then
echo -e "${CE} Unsupported ARCH: $(uname -m). Aborted.${CR}" > /dev/stderr
exit -1
fi
case "$1" in
-i|--install) warn; checkuid; install; exit 0;;
-u|--update) checkuid; update; exit 0;;