From 6c6d03915ec6e00a7cf84b672b3f26165a3e8fdd Mon Sep 17 00:00:00 2001 From: dkwo Date: Tue, 7 Mar 2023 16:11:17 -0500 Subject: [PATCH] new package: tinyramfs-0.1.0 --- srcpkgs/tinyramfs/files/config | 4 ++++ srcpkgs/tinyramfs/files/kernel-hook-postinst | 13 +++++++++++ srcpkgs/tinyramfs/files/kernel-hook-postrm | 10 ++++++++ srcpkgs/tinyramfs/template | 24 ++++++++++++++++++++ 4 files changed, 51 insertions(+) create mode 100644 srcpkgs/tinyramfs/files/config create mode 100644 srcpkgs/tinyramfs/files/kernel-hook-postinst create mode 100644 srcpkgs/tinyramfs/files/kernel-hook-postrm create mode 100644 srcpkgs/tinyramfs/template diff --git a/srcpkgs/tinyramfs/files/config b/srcpkgs/tinyramfs/files/config new file mode 100644 index 000000000000..d7c6d9728768 --- /dev/null +++ b/srcpkgs/tinyramfs/files/config @@ -0,0 +1,4 @@ +compress="gzip -9" +hooks="eudev" +root= +root_type=ext4 \ No newline at end of file diff --git a/srcpkgs/tinyramfs/files/kernel-hook-postinst b/srcpkgs/tinyramfs/files/kernel-hook-postinst new file mode 100644 index 000000000000..c96f55b83d2f --- /dev/null +++ b/srcpkgs/tinyramfs/files/kernel-hook-postinst @@ -0,0 +1,13 @@ +#!/bin/sh +# +# Kernel post-install hook for tinyramfs. +# +# Arguments passed to this script: $1 pkgname, $2 version. +# +PKGNAME="$1" +VERSION="$2" + +[ -x usr/bin/tinyramfs ] || exit 0 + +umask 0077 +usr/bin/tinyramfs -f -k ${VERSION} boot/initramfs-${VERSION}.img diff --git a/srcpkgs/tinyramfs/files/kernel-hook-postrm b/srcpkgs/tinyramfs/files/kernel-hook-postrm new file mode 100644 index 000000000000..d429eade59b4 --- /dev/null +++ b/srcpkgs/tinyramfs/files/kernel-hook-postrm @@ -0,0 +1,10 @@ +#!/bin/sh +# +# Kernel post-remove hook for tinyramfs. +# +# Arguments passed to this script: $1 pkgname, $2 version. +# +PKGNAME="$1" +VERSION="$2" + +rm -f boot/initramfs-${VERSION}.img \ No newline at end of file diff --git a/srcpkgs/tinyramfs/template b/srcpkgs/tinyramfs/template new file mode 100644 index 000000000000..2e82a71f4770 --- /dev/null +++ b/srcpkgs/tinyramfs/template @@ -0,0 +1,24 @@ +# Template file for 'tinyramfs' +pkgname=tinyramfs +version=0.1.0 +revision=1 +build_style=gnu-makefile +depends="util-linux cpio binutils kmod" +short_desc="Tiny initramfs written in POSIX shell" +maintainer="dkwo " +license="GPL-3.0-only" +homepage="https://github.com/illiliti/tinyramfs" +distfiles="https://github.com/illiliti/tinyramfs/archive/refs/tags/${version}.tar.gz" +checksum=a78ecd56a52a02bc1f4b86ba829a957ad1f83c252bfde66562d5c3ef40be7c51 +alternatives=" + initramfs:/etc/kernel.d/post-install/20-initramfs:/usr/libexec/tinyramfs/kernel-hook-postinst + initramfs:/etc/kernel.d/post-remove/20-initramfs:/usr/libexec/tinyramfs/kernel-hook-postrm +" +make_check=no # checking requires qemu, locally this still fails +conf_files="/etc/tinyramfs/config" + +post_install() { + vinstall ${FILESDIR}/kernel-hook-postinst 755 usr/libexec/tinyramfs + vinstall ${FILESDIR}/kernel-hook-postrm 755 usr/libexec/tinyramfs + vinstall ${FILESDIR}/config 644 etc/tinyramfs +}