From cb69821988ed7515e8b7ac6d2e5947e0c74047f8 Mon Sep 17 00:00:00 2001 From: "Ward Nakchbandi (Cosmic Fusion)" <83735213+CosmicFusion@users.noreply.github.com> Date: Sat, 2 Sep 2023 16:33:40 +0300 Subject: [PATCH] Abomnation --- debian/changelog | 5 -- debian/control | 19 ----- debian/rules | 80 ------------------- main.sh | 21 +++-- nvidia-pikaos-kernel-module/Makefile | 13 +++ .../debian}/copyright | 0 nvidia-pikaos-kernel-module/debian/rules | 9 +++ .../debian}/source/format | 0 .../get_pwd.sh | 0 9 files changed, 38 insertions(+), 109 deletions(-) delete mode 100644 debian/changelog delete mode 100644 debian/control delete mode 100755 debian/rules create mode 100644 nvidia-pikaos-kernel-module/Makefile rename {debian => nvidia-pikaos-kernel-module/debian}/copyright (100%) create mode 100644 nvidia-pikaos-kernel-module/debian/rules rename {debian => nvidia-pikaos-kernel-module/debian}/source/format (100%) rename {debian/scripts => nvidia-pikaos-kernel-module}/get_pwd.sh (100%) mode change 100755 => 100644 diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index 328bc5c..0000000 --- a/debian/changelog +++ /dev/null @@ -1,5 +0,0 @@ -upstream-name (pkgver-pkgrel) distro_codename; urgency=medium - - * Initial release. (Closes: #nnnn) - - -- ferreo Wed, 18 Jan 2023 21:48:14 +0000 diff --git a/debian/control b/debian/control deleted file mode 100644 index 0bcd8e0..0000000 --- a/debian/control +++ /dev/null @@ -1,19 +0,0 @@ -Source: upstream-name -Section: admin -Priority: optional -Maintainer: name -Standards-Version: 4.6.1 -Build-Depends: debhelper-compat (= 13) -Rules-Requires-Root: no - -Package: pkgname1 -Architecture: linux-any -# Delete any of these lines if un-used -Depends: ${misc:Depends}, depends -Recommends: high priority optdepends -Conflicts: conflicts -Suggests: low priority optdepends -Breaks: also conflicts!? -Provides: provides -# -Description: pkgdesc diff --git a/debian/rules b/debian/rules deleted file mode 100755 index ed40aff..0000000 --- a/debian/rules +++ /dev/null @@ -1,80 +0,0 @@ -#! /usr/bin/make -f - -## See debhelper(7) (uncomment to enable). -## Output every command that modifies files on the build system. -export DH_VERBOSE = 1 - -## === Set paths env vars === - -## Source directory, called upon by $(srcdir) -srcdir = $(shell debian/scripts/get_pwd.sh) -## The Root of package number one, called upon by $(pkgdir1) -pkgdir1 = $(srcdir)/debian/pkgdir1 -## The Root of package number two, you can add as many of these as you like -pkgdir2 = $(srcdir)/debian/pkgdir2 - -## If building a singular package you can remove the number, and as you guessed you call upon it with $(pkgdir) -# pkgdir = $(srcdir)/debian/pkgdir - -## === End end of region === - -## === the chain of command === -## debuild runs a chain of dh functions in the following order: -## dh_testdir -## dh_clean -## dh_auto_clean -## dh_update_autotools_config -## dh_autoreconf -## dh_auto_configure -## dh_prep -## dh_build -## dh_auto_build -## dh_install -## dh_auto_install -## dh_installdocs -## dh_installchangelogs -## dh_perl -## dh_link -## dh_strip_nondeterminism -## dh_compress -## dh_fixperms -## dh_missing -## dh_dwz -## dh_strip -## dh_makeshlibs -## dh_shlibdeps -## dh_installdeb -## dh_gencontrol -## but you are most likely to only need to override the following: -## dh_clean -## dh_auto_configure -## dh_build -## dh_install - -## === End end of region === - -## === overriding dh functions === -## by default all dh functions will run a specific command based on the build system selected by "dh $@" -## if you have a makefile that does everything you need this is fine, -## but most likely you have no MakeFile and you want to add your own commands -## Note : overrides must be places above %: -## So here's a few examples: - -## overriding dh_clean to make it not delete rust vendor files: -#override_dh_clean: -# echo "disabled" - -## overriding dh_auto_configure to add custom configs: -#override_dh_auto_configure: -# $(srcdir)/configure -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_DATADIR=/usr/share -DCMAKE_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu -DBUILD_PLUGIN=OFF - -## overriding dh_install to install files to a package: -#override_dh_auto_configure: -# mkdir -p $(pkgdir1)/usr/bin -# cp $(srcdir)/pikman $(pkgdir1)/usr/bin/ - -## === End end of region === - -## This here will start the build: -%: - dh $@ diff --git a/main.sh b/main.sh index 4fd7b08..315f6fb 100755 --- a/main.sh +++ b/main.sh @@ -1,14 +1,25 @@ #! /bin/bash +DRIVER=535 + +echo "$(apt-cache show nvidia-driver-$DRIVER | grep Version: | head -n1 | cut -f2 -d":" | cut -f1,2,3 -d"." | cut -f1 -d"-" | tr -d ' ')" > ./nvidia-pikaos-kernel-module/DRIVER +echo "$(apt-cache show kernel-pika | grep Depends: | head -n1 | cut -f2 -d":" | cut -f1 -d"," | cut -f3,4 -d"-" | tr -d ' ')" > ./nvidia-pikaos-kernel-module/KERNEL +echo "$(apt-cache show nvidia-dkms-535 | grep Version: | head -n1 | cut -f2 -d":" | tr -d ' ')" > ./nvidia-pikaos-kernel-module/DRIVER_VERSION + +cd ./nvidia-pikaos-kernel-module + +chmod +x ./nvidia-pikaos-kernel-module/get_pwd.sh + +echo -e "nvidia-pikaos-kernel-module ($(cat ./DRIVER)-$(cat ./KERNEL)-99pika1.lunar) lunar; urgency=medium\n\n * New Release\n\n -- Ward Nakchbandi Sat, 01 Oct 2022 14:50:00 +0200" > debian/changelog + +echo -e "Source: nvidia-pikaos-kernel-module\nSection: graphics\nPriority: optional\nMaintainer: Ward Nakchbandi \nStandards-Version: 4.6.1\nBuild-Depends: debhelper-compat (= 13), linux-image-$(cat ./KERNEL)-pikaos, linux-headers-$(cat ./KERNEL)-pikaos, dkms, fakeroot\nRules-Requires-Root: no\n\nPackage: nvidia-$(cat ./KERNEL)-module-$DRIVER\nArchitecture: linux-any\nDepends: linux-image-$(cat ./KERNEL)-pikaos, linux-headers-$(cat ./KERNEL)-pikaos, $(apt-cache show nvidia-dkms-$DRIVER | grep Depends: | head -n1 | cut -f2 -d":")\nConflicts: nvidia-dkms-$DRIVER (= $(cat DRIVER_VERSION))\nProvides: nvidia-dkms-$DRIVER (= $(cat DRIVER_VERSION))\nReplaces: nvidia-dkms-$DRIVER (= $(cat DRIVER_VERSION))\nDescription: Prebuilt Nvidia module for PikaOS kernel" > ./debian/control + DEBIAN_FRONTEND=noninteractive -# Clone Upstream -mkdir -p ./src-pkg-name -cp -rvf ./debian ./src-pkg-name/ -cd ./src-pkg-name/ - # Get build deps apt-get build-dep ./ -y +apt download nvidia-dkms-$DRIVER -y +dpkg-deb -x ./nvidia-dkms-$DRIVER*.deb / # Build package dpkg-buildpackage --no-sign diff --git a/nvidia-pikaos-kernel-module/Makefile b/nvidia-pikaos-kernel-module/Makefile new file mode 100644 index 0000000..995d561 --- /dev/null +++ b/nvidia-pikaos-kernel-module/Makefile @@ -0,0 +1,13 @@ +DRIVER=$(shell cat ${./DRIVER}) +KERNEL=$(shell cat ${./KERNEL}) +VERSION=$(shell cat ${./VERSION}) +CARCH=x86_64 + +.PHONY: install +all: + true + +install: + fakeroot dkms build --dkmstree "$(shell ./get_pwd.sh)" -m nvidia/"${DRIVER}" -k "${KERNEL}" + install -Dt "$(DESTDIR)/usr/lib/modules/"${KERNEL}"/extramodules" -m644 nvidia/"${DRIVER}"/"${KERNEL}"/"${CARCH}"/module/* + find "$(DESTDIR)" -name '*.ko' -exec xz -T1 {} + \ No newline at end of file diff --git a/debian/copyright b/nvidia-pikaos-kernel-module/debian/copyright similarity index 100% rename from debian/copyright rename to nvidia-pikaos-kernel-module/debian/copyright diff --git a/nvidia-pikaos-kernel-module/debian/rules b/nvidia-pikaos-kernel-module/debian/rules new file mode 100644 index 0000000..e5ede8e --- /dev/null +++ b/nvidia-pikaos-kernel-module/debian/rules @@ -0,0 +1,9 @@ +#! /usr/bin/make -f + +## See debhelper(7) (uncomment to enable). +## Output every command that modifies files on the build system. +export DH_VERBOSE = 1 + +## This here will start the build: +%: + dh $@ diff --git a/debian/source/format b/nvidia-pikaos-kernel-module/debian/source/format similarity index 100% rename from debian/source/format rename to nvidia-pikaos-kernel-module/debian/source/format diff --git a/debian/scripts/get_pwd.sh b/nvidia-pikaos-kernel-module/get_pwd.sh old mode 100755 new mode 100644 similarity index 100% rename from debian/scripts/get_pwd.sh rename to nvidia-pikaos-kernel-module/get_pwd.sh