linux-qubasis
linux oasis port as a qubes template
git clone https://9o.is/git/linux-qubasis.git
commit c2ad2a0df87d417cef6226f426dee1ddb8904edf parent 8e48a0c8214fdfdb3f3a4f242844eadb22b55aeb Author: Jul <jul@9o.is> Date: Thu, 4 Sep 2025 18:04:03 +0800 fetch linux-headers with extract-deflate ninja rule Diffstat:
| M | gen.sh | | | 1 | + |
| M | ninja/functions.sh | | | 25 | ++++++++++++++++--------- |
| M | ninja/rules.ninja | | | 10 | +++++----- |
| A | pkg/linux-headers/gen.sh | | | 8 | ++++++++ |
4 files changed, 30 insertions(+), 14 deletions(-)
diff --git a/gen.sh b/gen.sh @@ -23,6 +23,7 @@ subgen pkg/b3sum subgen pkg/byacc subgen pkg/fspec-sync subgen pkg/less +subgen pkg/linux-headers subgen pkg/mandoc subgen pkg/netbsd-curses subgen pkg/oksh diff --git a/ninja/functions.sh b/ninja/functions.sh @@ -460,8 +460,10 @@ _ninja_flush_fetch() { build fetch-git $_fetchdir/fetched ;; curl) - _url=$2 - _sha256=$3 + shift + _url=$1; shift + _sha256=$1; shift + _srcs=$* _name=${_url##*/} build fetch-curl $_fetchdir/$_name @@ -472,19 +474,24 @@ _ninja_flush_fetch() { case $_name in *.tar.gz|*.tgz) _archive=${_name%.t*gz}.tar - _cmpr=gunzip - _cmpr_dep=$hostdir/minigzip + _tool=gunzip + _tool_dep=$hostdir/minigzip + _extract_rule=extract-deflate + ;; + *.tar.xz) + _archive=${_name%.xz} + _tool=xz + _extract_rule=extract-deflate ;; *) _archive=$_name + _extract_rule=extract ;; esac - if [ $_cmpr ]; then - build $_cmpr $_fetchdir/$_archive $_fetchdir/$_name '|' ${_cmpr_dep-} $_fetchdir/checked - fi - - build extract $_fetchdir/fetched $_fetchdir/$_archive '|' $hostdir/pax $_fetchdir/checked + build $_extract_rule $_fetchdir/fetched $_fetchdir/$_name '|' $hostdir/pax $_fetchdir/checked ${_tool_dep-} + bind tool $_tool + bind srcs $_srcs if ! grep -qE "^$_ninja_gendir/repo$" "$_ninja_basedir"/.git/info/exclude; then printf "%s/repo\n" "$_ninja_gendir" >> "$_ninja_basedir"/.git/info/exclude diff --git a/ninja/rules.ninja b/ninja/rules.ninja @@ -43,10 +43,6 @@ rule gzip command = $hostdir/minigzip -c -9 <$in >$out description = GZIP $out -rule gunzip - command = $hostdir/minigzip -c -d <$in >$out - description = GUNZIP $out - rule awk command = awk $expr $in >$out description = AWK $out @@ -86,9 +82,13 @@ rule sha256sum description = SHA256SUM $in rule extract - command = rm -rf $srcdir && $hostdir/pax -r -s ',^[^/]*,$srcdir,' <$in && touch $out + command = rm -rf $srcdir && $hostdir/pax -r -s ',^[^/]*,$srcdir,' $srcs <$in && touch $out description = EXTRACT $srcdir +rule extract-deflate + command = rm -rf $srcdir && $tool -c -d <$in | $hostdir/pax -r -s ',^[^/]*,$srcdir,' $srcs && touch $out + description = EXTRACT/DEFLATE $srcdir + rule patch command = git -C $srcdir am --3way --keep-non-patch --no-gpg-sign --whitespace=nowarn $PWD/$in && touch $out description = PATCH $in diff --git a/pkg/linux-headers/gen.sh b/pkg/linux-headers/gen.sh @@ -0,0 +1,8 @@ +fetch curl \ + https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.12.tar.xz \ + b1a2562be56e42afb3f8489d4c2a7ac472ac23098f1ef1c1e40da601f54625eb \ + 'linux-*/Makefile' \ + 'linux-*/arch/*/include/uapi/' \ + 'linux-*/arch/*/entry/syscalls/' \ + 'linux-*/include/uapi/' \ + 'linux-*/scripts/unifdef.c'