linux-qubasis

linux oasis port as a qubes template

git clone https://9o.is/git/linux-qubasis.git

commit 6a63368d334a73e457ca595c98b2deb6c98e9896
parent b448bb624fd4fd3fb198fcb2de760e74e4363056
Author: Jul <jul@9o.is>
Date:   Tue, 18 Nov 2025 04:01:05 -0500

move rules to separate file

Diffstat:
Mpkg/gen.sh | 64++--------------------------------------------------------------
Apkg/rules.sh | 60++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mqubes/gen.sh | 27++-------------------------
Aqubes/rules.sh | 23+++++++++++++++++++++++
4 files changed, 87 insertions(+), 87 deletions(-)

diff --git a/pkg/gen.sh b/pkg/gen.sh @@ -1,5 +1,3 @@ -import genfn.sh - TARGET_ARCH=x86_64 var ar $TARGET_ARCH-linux-musl-ar @@ -11,66 +9,8 @@ var cflags -Os -fPIE -pipe -Wall -Werror -Wextra -pedantic var ldflags -s -static-pie var pkgdir $outdir -rule cc '$cc -MD -MF $out.d $cflags -c -o $out $in' -bind description 'CC $out' -bind depfile '$out.d' -bind deps gcc - -rule cpp '$cc -MD -MF $out.d $cflags -E -P -o $out $in' -bind description 'CPP $out' -bind depfile '$out.d' -bind deps gcc - -rule rsp 'ln -f $rspfile $out' -bind description 'RSP $out' -bind rspfile '$out.tmp' -bind rspfile_content '$in_newline' - -rule ar 'rm -f $out && $ar crs $out $in' -bind description 'AR $out' - -rule link '$cc $ldflags -o $out $in $ldlibs' -bind description 'LINK $out' - -rule copy 'ln -f $in $out' -bind description 'COPY $out' - -rule gzip 'gzip -c -9 <$in >$out' -bind description 'GZIP $out' - -rule awk 'awk $expr $in >$out' -bind description 'AWK $out' - -rule cat 'cat $in >$out' -bind description 'CAT $out' - -rule sed 'sed $expr $in >$out' -bind description 'SED $out' - -rule fetch_git 'git submodule update --init --filter=blob:none $srcdir 1>/dev/null && git -C $srcdir checkout $ref 1>/dev/null 2>&1 && touch $out' -bind description 'FETCH GIT $dir $ref' -bind generator 1 -bind restat 1 -bind pool console - -rule fetch_curl 'rm -f $out && curl -L# -o $out $url' -bind description 'FETCH CURL $url' -bind generator 1 -bind restat 1 -bind pool console - -rule sha256sum 'test $sha256 = "$$(sha256sum $in | awk "{print \$$1}")" && touch $out' -bind description 'SHA256SUM $in' - -rule extract '$tool -c -d <$in | $hostdir/pax -r -s ",^[^/]*,$srcdir," $srcs && touch $out' -bind description 'EXTRACT $in' - -rule patch 'git -C $srcdir am -3 --keep-non-patch --no-gpg-sign --whitespace=nowarn ../../../$in >/dev/null && touch $out' -bind description 'PATCH $in' - -rule gen_files 'sh ./pkg/gen-files.sh $outdir $files >$out' -bind description 'GEN $out' -bind generator 1 +import rules.sh +import genfn.sh pkg ag pkg awk diff --git a/pkg/rules.sh b/pkg/rules.sh @@ -0,0 +1,60 @@ +rule cc '$cc -MD -MF $out.d $cflags -c -o $out $in' +bind description 'CC $out' +bind depfile '$out.d' +bind deps gcc + +rule cpp '$cc -MD -MF $out.d $cflags -E -P -o $out $in' +bind description 'CPP $out' +bind depfile '$out.d' +bind deps gcc + +rule rsp 'ln -f $rspfile $out' +bind description 'RSP $out' +bind rspfile '$out.tmp' +bind rspfile_content '$in_newline' + +rule ar 'rm -f $out && $ar crs $out $in' +bind description 'AR $out' + +rule link '$cc $ldflags -o $out $in $ldlibs' +bind description 'LINK $out' + +rule copy 'ln -f $in $out' +bind description 'COPY $out' + +rule gzip 'gzip -c -9 <$in >$out' +bind description 'GZIP $out' + +rule awk 'awk $expr $in >$out' +bind description 'AWK $out' + +rule cat 'cat $in >$out' +bind description 'CAT $out' + +rule sed 'sed $expr $in >$out' +bind description 'SED $out' + +rule fetch_git 'git submodule update --init --filter=blob:none $srcdir 1>/dev/null && git -C $srcdir checkout $ref 1>/dev/null 2>&1 && touch $out' +bind description 'FETCH GIT $dir $ref' +bind generator 1 +bind restat 1 +bind pool console + +rule fetch_curl 'rm -f $out && curl -L# -o $out $url' +bind description 'FETCH CURL $url' +bind generator 1 +bind restat 1 +bind pool console + +rule sha256sum 'test $sha256 = "$$(sha256sum $in | awk "{print \$$1}")" && touch $out' +bind description 'SHA256SUM $in' + +rule extract '$tool -c -d <$in | $hostdir/pax -r -s ",^[^/]*,$srcdir," $srcs && touch $out' +bind description 'EXTRACT $in' + +rule patch 'git -C $srcdir am -3 --keep-non-patch --no-gpg-sign --whitespace=nowarn ../../../$in >/dev/null && touch $out' +bind description 'PATCH $in' + +rule gen_files 'sh ./pkg/gen-files.sh $outdir $files >$out' +bind description 'GEN $out' +bind generator 1 diff --git a/qubes/gen.sh b/qubes/gen.sh @@ -1,5 +1,3 @@ -import genfn.sh - var prefix var bindir /bin var libdir /lib @@ -13,29 +11,8 @@ var statedir /var var qubesdir $dir var pkgexclude -rule touch 'touch $out' -bind description 'TOUCH $out' - -rule fspec_tar '$hostdir/fspec-tar <$in | gzip -c -9 >$out' -bind description 'TAR $out' - -rule fspec_hash 'cat $in | $hostdir/fspec-hash >$out' -bind description 'FSPEC $out' - -rule fspec 'awk -f $qubesdir/gen-fspec.awk $fspecvars $in >$out 2>/dev/null' -bind description 'FSPEC $out' -bind fspecvars " - -v pkgexclude=$pkgexclude - -v prefix=$prefix - -v bindir=$bindir - -v datadir=$datadir - -v mandir=$mandir - -v sysconfdir=$sysconfdir - -v libdir=$libdir - -v libexecdir=$libexecdir - -v includedir=$includedir - -v statedir=$statedir -" +import rules.sh +import genfn.sh qvm example diff --git a/qubes/rules.sh b/qubes/rules.sh @@ -0,0 +1,23 @@ +rule touch 'touch $out' +bind description 'TOUCH $out' + +rule fspec_tar '$hostdir/fspec-tar <$in | gzip -c -9 >$out' +bind description 'TAR $out' + +rule fspec_hash 'cat $in | $hostdir/fspec-hash >$out' +bind description 'FSPEC $out' + +rule fspec 'awk -f $qubesdir/gen-fspec.awk $fspecvars $in >$out 2>/dev/null' +bind description 'FSPEC $out' +bind fspecvars " + -v pkgexclude=$pkgexclude + -v prefix=$prefix + -v bindir=$bindir + -v datadir=$datadir + -v mandir=$mandir + -v sysconfdir=$sysconfdir + -v libdir=$libdir + -v libexecdir=$libexecdir + -v includedir=$includedir + -v statedir=$statedir +"