From d2f70aa8bd331f3c3368456a9cb66cea3dc6ce5e Mon Sep 17 00:00:00 2001 From: travankor Date: Sat, 13 Mar 2021 07:51:37 -0700 Subject: [PATCH] New package: booster-0.3 --- srcpkgs/booster/files/kernel-hook-postinst | 15 ++++++++++ srcpkgs/booster/files/kernel-hook-postrm | 11 +++++++ srcpkgs/booster/template | 35 ++++++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 srcpkgs/booster/files/kernel-hook-postinst create mode 100644 srcpkgs/booster/files/kernel-hook-postrm create mode 100644 srcpkgs/booster/template diff --git a/srcpkgs/booster/files/kernel-hook-postinst b/srcpkgs/booster/files/kernel-hook-postinst new file mode 100644 index 000000000000..0efbcecb56ec --- /dev/null +++ b/srcpkgs/booster/files/kernel-hook-postinst @@ -0,0 +1,15 @@ +#!/bin/sh +# +# Kernel post-install hook for booster. +# +# Arguments passed to this script: $1 pkgname, $2 version. +# +PKGNAME="$1" +VERSION="$2" + +if [ ! -x usr/bin/booster ]; then + exit 0 +fi + +usr/bin/booster -output boot/initramfs-${VERSION}.img -kernelVersion ${VERSION} +exit $? diff --git a/srcpkgs/booster/files/kernel-hook-postrm b/srcpkgs/booster/files/kernel-hook-postrm new file mode 100644 index 000000000000..ef13d1967a67 --- /dev/null +++ b/srcpkgs/booster/files/kernel-hook-postrm @@ -0,0 +1,11 @@ +#!/bin/sh +# +# Kernel post-remove hook for booster. +# +# Arguments passed to this script: $1 pkgname, $2 version. +# +PKGNAME="$1" +VERSION="$2" + +rm -f boot/initramfs-${VERSION}.img +exit $? diff --git a/srcpkgs/booster/template b/srcpkgs/booster/template new file mode 100644 index 000000000000..952b76d1dc8e --- /dev/null +++ b/srcpkgs/booster/template @@ -0,0 +1,35 @@ +# Template file for 'booster' +pkgname=booster +version=0.3 +revision=1 +build_style=go +go_import_path=github.com/anatol/booster +go_package="${go_import_path}/generator ${go_import_path}/init" +hostmakedepends="git" +depends="busybox-static" +short_desc="Fast and secure initramfs generator" +maintainer="travankor " +license="MIT" +homepage="https://github.com/anatol/booster" +distfiles="https://github.com/anatol/booster/archive/${version}.tar.gz" +checksum=77067a5056e1070aee0f27130c31ebbf7cacca18644dc4906290371a04f07371 +conf_files="/etc/booster.yaml" + +do_install() { + if [ "$CROSS_BUILD" ]; then + vbin ${GOPATH}/bin/linux_${GOARCH}/generator booster + vinstall ${GOPATH}/bin/linux_${GOARCH}/init 755 usr/lib/booster + else + vbin ${GOPATH}/bin/generator booster + vinstall ${GOPATH}/bin/init 755 usr/lib/booster + fi + vman generator/booster.1 + echo "vconsole: false" > booster.yaml +} + +post_install() { + vconf booster.yaml + vinstall ${FILESDIR}/kernel-hook-postinst 755 etc/kernel.d/post-install 20-booster + vinstall ${FILESDIR}/kernel-hook-postrm 755 etc/kernel.d/post-remove 20-booster + vlicense LICENSE +}