summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Santos2015-11-02 13:49:28 +0000
committerMauro Santos2015-11-02 13:49:28 +0000
commit16cd45fae2ab67ee94ca3e362b74f32e6e459b3d (patch)
tree4b73819f7ebf6540ea9f0e4baa932c6695dcdb61
parentaf47b2dde65daa226d6b30a4b8564a985cdf1722 (diff)
downloadaur-16cd45fae2ab67ee94ca3e362b74f32e6e459b3d.tar.gz
Update to version 1.10.
Add mklinuxpba-bios to create an uploadable PBA image. Rename mklinuxpba to mklinuxpba-initramfs in order to make the purpose more explicit. Change default initramfs compression to xz as it will result in smaller PBA images which will be faster to upload to the shadow MBR.
-rw-r--r--.SRCINFO18
-rw-r--r--PKGBUILD19
-rw-r--r--[-rwxr-xr-x]extlinux.conf2
-rw-r--r--linuxpba.conf8
-rwxr-xr-xmklinuxpba-bios85
-rwxr-xr-xmklinuxpba-initramfs (renamed from mklinuxpba)0
6 files changed, 111 insertions, 21 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 515a0e0142bc..9d6411a4ae8a 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,22 +1,26 @@
pkgbase = sedutil
pkgdesc = TCG OPAL 2.00 SED Management Program
- pkgver = 1.00
- pkgrel = 4
+ pkgver = 1.10
+ pkgrel = 1
url = https://github.com/Drive-Trust-Alliance/sedutil
install = sedutil.install
arch = i686
arch = x86_64
license = GPL3
- source = sedutil-1.00.tar.gz::https://github.com/Drive-Trust-Alliance/sedutil/archive/1.00.tar.gz
+ optdepends = syslinux: to create a bootable PBA disk image
+ optdepends = intel-ucode: microcode update files for Intel CPUs
+ source = sedutil-1.10.tar.gz::https://github.com/Drive-Trust-Alliance/sedutil/archive/1.10.tar.gz
source = extlinux.conf
- source = mklinuxpba
+ source = mklinuxpba-initramfs
+ source = mklinuxpba-bios
source = linuxpba.conf
source = linuxpba.hook
source = linuxpba.install
- sha256sums = 7d9c8b3eb408de8218e8bd29f118a8956157ca6e80fb0d8782074302cc13d2e8
- sha256sums = 6d528877c70b24367833653f5a7cc004a6b5aad8729b661d8c3fda3f1ee7d4ff
+ sha256sums = 31b1006a1f65b83fb419635f21a02bfb99bed8d4d6b351f566831af3682165dd
+ sha256sums = 5ab7ef67fea0f4e370d8f0a4da87636a1df18e0edb0152d08f906f38280cc0e8
sha256sums = c66318cb2ddd357de927ab47eb3ec4618a4353ad06e5bd48e6676d77b48b323d
- sha256sums = be7790a69eb4e82a84c690e41cdff04f08a0a61a30a6c28b88df916e3fb59950
+ sha256sums = 046e481ffca77f222f4c044e32427f25bca12ac9a5e6832ea657596f8fd84228
+ sha256sums = 9273e9c5d5ce54be31a49ec42839b06d0e54752a19c9e6d4643793174ee9214e
sha256sums = d9a7b66d8365e7f4eb0233b30c0ab70b5e978f6554960bf12994a1f0910c1447
sha256sums = 7c32370c3405fc33359c1fc5bb243f387c71ca454e9da88348669fd383f04558
diff --git a/PKGBUILD b/PKGBUILD
index 834cb645256c..6db16a0b666d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,23 +1,27 @@
# Maintainer: Mauro Santos <registo.mailling@gmail.com>
pkgname=sedutil
-pkgver=1.00
-pkgrel=4
+pkgver=1.10
+pkgrel=1
pkgdesc="TCG OPAL 2.00 SED Management Program"
arch=('i686' 'x86_64')
url="https://github.com/Drive-Trust-Alliance/sedutil"
license=('GPL3')
+optdepends=('syslinux: to create a bootable PBA disk image'
+ 'intel-ucode: microcode update files for Intel CPUs')
install=sedutil.install
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/Drive-Trust-Alliance/${pkgname}/archive/${pkgver}.tar.gz"
'extlinux.conf'
- 'mklinuxpba'
+ 'mklinuxpba-initramfs'
+ 'mklinuxpba-bios'
'linuxpba.conf'
'linuxpba.hook'
'linuxpba.install')
-sha256sums=('7d9c8b3eb408de8218e8bd29f118a8956157ca6e80fb0d8782074302cc13d2e8'
- '6d528877c70b24367833653f5a7cc004a6b5aad8729b661d8c3fda3f1ee7d4ff'
+sha256sums=('31b1006a1f65b83fb419635f21a02bfb99bed8d4d6b351f566831af3682165dd'
+ '5ab7ef67fea0f4e370d8f0a4da87636a1df18e0edb0152d08f906f38280cc0e8'
'c66318cb2ddd357de927ab47eb3ec4618a4353ad06e5bd48e6676d77b48b323d'
- 'be7790a69eb4e82a84c690e41cdff04f08a0a61a30a6c28b88df916e3fb59950'
+ '046e481ffca77f222f4c044e32427f25bca12ac9a5e6832ea657596f8fd84228'
+ '9273e9c5d5ce54be31a49ec42839b06d0e54752a19c9e6d4643793174ee9214e'
'd9a7b66d8365e7f4eb0233b30c0ab70b5e978f6554960bf12994a1f0910c1447'
'7c32370c3405fc33359c1fc5bb243f387c71ca454e9da88348669fd383f04558')
PKGEXT='.pkg.tar'
@@ -35,7 +39,8 @@ package() {
install -Dm755 "linux/CLI/dist/Release_$CARCH/GNU-Linux-x86/sedutil-cli" "${pkgdir}/usr/bin/sedutil-cli"
install -Dm644 "linux/PSIDRevert_LINUX.txt" "${pkgdir}/usr/share/doc/${pkgname}/PSIDRevert.txt"
install -Dm755 "LinuxPBA/dist/Release_$CARCH/GNU-Linux-x86/linuxpba" "${pkgdir}/usr/bin/linuxpba"
- install -Dm755 "${srcdir}/mklinuxpba" "${pkgdir}/usr/bin/mklinuxpba"
+ install -Dm755 "${srcdir}/mklinuxpba-initramfs" "${pkgdir}/usr/bin/mklinuxpba-initramfs"
+ install -Dm755 "${srcdir}/mklinuxpba-bios" "${pkgdir}/usr/bin/mklinuxpba-bios"
install -Dm644 "${srcdir}/linuxpba.hook" "${pkgdir}/usr/lib/initcpio/hooks/linuxpba"
install -Dm644 "${srcdir}/linuxpba.install" "${pkgdir}/usr/lib/initcpio/install/linuxpba"
diff --git a/extlinux.conf b/extlinux.conf
index ce2f614e5f3d..6a99c45f7662 100755..100644
--- a/extlinux.conf
+++ b/extlinux.conf
@@ -4,4 +4,4 @@ noescape 1
label linuxpba
kernel vmlinuz-linux
initrd intel-ucode.img,linuxpba.img
- append libata.allow_tpm=1 loglevel=0
+ append quiet libata.allow_tpm=1 loglevel=0
diff --git a/linuxpba.conf b/linuxpba.conf
index 978efec83c6d..17cd05371a44 100644
--- a/linuxpba.conf
+++ b/linuxpba.conf
@@ -3,10 +3,6 @@ BINARIES=""
FILES=""
HOOKS="base udev autodetect block keymap keyboard linuxpba"
-#COMPRESSION="gzip"
-#COMPRESSION="bzip2"
-#COMPRESSION="lzma"
-#COMPRESSION="xz"
-#COMPRESSION="lzop"
-#COMPRESSION="lz4"
+#COMPRESSION=<gzip|bzip2|lzma|xz|lzop|lz4>
+COMPRESSION="xz"
#COMPRESSION_OPTIONS=""
diff --git a/mklinuxpba-bios b/mklinuxpba-bios
new file mode 100755
index 000000000000..c91d4c4b45eb
--- /dev/null
+++ b/mklinuxpba-bios
@@ -0,0 +1,85 @@
+#!/bin/bash
+
+if [[ ! -e /usr/bin/extlinux ]]
+then
+ echo "syslinux is not installed: nothing to do."
+ exit 1
+fi
+
+mklinuxpba-initramfs
+
+kernel_release="$(uname -r)"
+
+case "${kernel_release##*-}" in
+ "ARCH")
+ kernel_image="vmlinuz-linux"
+ ;;
+ "lts")
+ kernel_image="vmlinuz-linux-lts"
+ ;;
+ *)
+ echo "The currenly running kernel is not supported."
+ exit 1
+ ;;
+esac
+
+linux_size=$(stat --printf="%s" /boot/$kernel_image)
+pba_size=$(stat --printf="%s" /boot/linuxpba.img)
+fallback_pba_size=$(stat --printf="%s" /boot/linuxpba-fallback.img)
+if [[ -e /boot/intel-ucode.img ]]
+then
+ intelucode_size=$(stat --printf="%s" /boot/intel-ucode.img)
+else
+ intelucode_size=0
+fi
+
+diskimg_size=$(( (linux_size+pba_size+intelucode_size)/1024+3072 ))
+fallback_diskimg_size=$(( (linux_size+fallback_pba_size+intelucode_size)/1024+3072 ))
+
+mkdir -p "/tmp/linuxpba/mnt"
+pushd "/tmp/linuxpba/"
+
+cp /usr/lib/syslinux/bios/mbr.bin linuxpba.diskimg
+truncate -s "${diskimg_size}k" linuxpba.diskimg
+echo -e "8,,,*\nwrite" | sfdisk linuxpba.diskimg
+loopdev="$(losetup --show -f -o 4096 linuxpba.diskimg)"
+sync
+mkfs.ext4 -L linuxpba "$loopdev"
+mount "$loopdev" mnt
+extlinux -i mnt
+if [[ -e /boot/intel-ucode.img ]]
+then
+ cp /boot/intel-ucode.img mnt
+ cp /etc/linuxpba/extlinux.conf mnt
+else
+ sed 's/intel-ucode.img,//' /etc/linuxpba/extlinux.conf > mnt/extlinux.conf
+fi
+cp /boot/linuxpba.img mnt
+cp /boot/$kernel_image mnt
+umount mnt
+losetup -d "$loopdev"
+
+cp /usr/lib/syslinux/bios/mbr.bin linuxpba-fallback.diskimg
+truncate -s "${fallback_diskimg_size}k" linuxpba-fallback.diskimg
+echo -e "8,,,*\nwrite" | sfdisk linuxpba-fallback.diskimg
+loopdev="$(losetup --show -f -o 4096 linuxpba-fallback.diskimg)"
+sync
+mkfs.ext4 -L linuxpba "$loopdev"
+mount "$loopdev" mnt
+extlinux -i mnt
+if [[ -e /boot/intel-ucode.img ]]
+then
+ cp /boot/intel-ucode.img mnt
+ cp /etc/linuxpba/extlinux.conf mnt
+else
+ sed 's/intel-ucode.img,//' /etc/linuxpba/extlinux.conf > mnt/extlinux.conf
+fi
+cp /boot/linuxpba-fallback.img mnt/linuxpba.img
+cp /boot/$kernel_image mnt
+umount mnt
+losetup -d "$loopdev"
+
+mv linuxpba.diskimg linuxpba-fallback.diskimg /boot
+cd /tmp
+rmdir -p linuxpba/mnt
+popd
diff --git a/mklinuxpba b/mklinuxpba-initramfs
index c1a8e357c222..c1a8e357c222 100755
--- a/mklinuxpba
+++ b/mklinuxpba-initramfs