My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

a very small Live CD shaped to look and act like Puppy Linux.

Moderator: fredx181

Post Reply
gumanzoy
Posts: 93
Joined: Mon May 03, 2021 3:38 pm
Has thanked: 14 times
Been thanked: 18 times
Contact:

My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

Post by gumanzoy »

First big thanks to Fred @fredx181 !

Full announce, description and screenshots of my build English / Russian

Bookworm version of my LiveUSB build for hardware testing (mostly laptops).

Update 2024.11.05
Size 1.35GB
Updates and fixes for initrd post1 post2
To reduce size quick-remaster removed from BASE_DOG_APPS_INSTALL=
Update firmware-nonfree 20240909
Update some software: Chromium 130, FurMark 2.4.1.0

Update 2024.10.08
Size 1.36GB
kernels 5.10.223-amd64 / 6.10.12-amd64 / 6.1.106-i686 (without PAE for old CPUs compatible)
kernel 5.10.223-amd64 build with intel-nvme-remap patch from EndlessOS to make NVMe SSDs available on 8th-10th gen Intel Core i3/i5/i7 platforms with "Intel RST Premium With Optane" option enabled in UEFI Setup.
amd64: add mesa-24.2.2-drm-2.4.123.squashfs and mesa-vulkan-drivers-24.2.2.squashfs with versions from backports.
amd64: nvidia driver 550.120, and two legacy versions as before 340.108, 390.157
firmware-nonfree 20240709
Update some software: NetSurf 3.11, Chromium 129, CPU-X 5.0.4, x0tigervncserver 1.14.0

Size 1.3GB
LANG="en_US.UTF-8"
Contains both amd64 and i686 versions.
kernels 5.10.178-amd64 / 6.1.25-amd64 / 6.1.25-i686 (without PAE for old CPUs compatible)
Xfce desktop
Chromium (amd64 only) and NetSurf browsers
Includes applications such as GPUTest, Unigine Heaven, CPU-X, GSmartControl, GParted, Partimage, Partclone, TestDisk, ddrescue, WHDD, DMDE.
All my modifications in 05-customtools.squashfs
I build 3 versions of nvidia drivers in separate modules: 340.108, 390.157 and 525.105.17
And add to linuxrc new param nvidia_detect (based on old Porteus code vga_detect). Description here and in my blog (in Russian language)

When boot 6.1 or 6.10 kernel the new ntfs3 kernel module being used for mount instead of fuse ntfs-3g

root password: dog
puppy password: dog

Image Image Image Image Image Image Image Image

liveusb-doglinux-debian-12-2024.11.05.torrent
(33.53 KiB) Downloaded 10 times

drive.google.com
Main version download: full LiveUSB tree with installdog.sh installer and syslinux + systemd-boot (gummiboot) bootloaders.
Also contain config for grub4dos and ventoy_grub.cfg.

UEFI + Legacy/CSM compatible.

Image

The advantage of syslinux bootloader command interface - easy to combine multiple cheatcodes (boot options)

Examples:
dogram text - not run startx.
dogram autorun=command - instead of startx run command
dogram nomodeset nonvidia - disable Linux kernel modesetting (all GPU drivers)
dogram modprobe.blacklist=radeon,amdgpu - disable AMD GPU drivers (in case of Intel iGPU working + AMD dGPU have hardware problem)
dogram nonvidia modprobe.blacklist=nouveau - disable NVIDIA GPU drivers (in case of dGPU problem + AMD/Intel iGPU working)
dogram nonvidia load=nv390 - force load of legacy NVIDIA driver

Old version downloads:

liveusb-doglinux-debian-12-2024.10.08.torrent
(33.81 KiB) Downloaded 19 times
liveusb-doglinux-debian-12-2023.05.06.torrent
(32.35 KiB) Downloaded 58 times

Alternative download grub2 .ISO image (dd compatible): doglinux-debian-12-20230506.iso
md5sum: e6be5ae22496336276ca0731697324bb


Modified for 2024.10.04 build script mklive-bookworm and config in next message. Modified same as previous version mklive-bullseye-gumanzoy.

Code: Select all

./mklive-bookworm-gumanzoy -cli mklive-bookworm64-xfce-gumanzoy.conf
Last edited by gumanzoy on Tue Nov 05, 2024 12:15 pm, edited 12 times in total.

My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

gumanzoy
Posts: 93
Joined: Mon May 03, 2021 3:38 pm
Has thanked: 14 times
Been thanked: 18 times
Contact:

Re: My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

Post by gumanzoy »

mklive-bookworm-gumanzoy-2024.11.05.tar.xz
(16.96 KiB) Downloaded 5 times

Modified for 2024.11.05 build script mklive-bookworm and config.
To reduce size quick-remaster removed from BASE_DOG_APPS_INSTALL=
Added mandb --create after remove localized manpages. Recreate db /var/cache/man/


mklive-bookworm-gumanzoy-2024.10.04.tar.xz
(16.94 KiB) Downloaded 18 times

Modified for 2024.10.04 build script mklive-bookworm and config.

I will not use no-merged-usr. And i use bookworm version of debootstrap. This is why i remove/comment this code.

Code: Select all

-  if [ "$NMU" = "TRUE" ]; then  # NO merged-usr, install devuan debootstrap
-# download and install debootstrap no-merged-usr deb from Devuan
-DEBOOTSTRAP=debootstrap_1.0.128+nmu2devuan2_all.deb
-wget --no-check-certificate https://debiandog.github.io/MakeLive/$DEBOOTSTRAP -O $DEBOOTSTRAP
-  else
 # download and install debootstrap deb
-DEBOOTSTRAP=debootstrap_1.0.134_all.deb
-wget --no-check-certificate https://debiandog.github.io/MakeLive/$DEBOOTSTRAP -O $DEBOOTSTRAP
-  fi
-
-dpkg -i "$DEBOOTSTRAP"
+#DEBOOTSTRAP=debootstrap_1.0.134_all.deb
+#wget --no-check-certificate https://debiandog.github.io/MakeLive/$DEBOOTSTRAP -O $DEBOOTSTRAP
+#  fi
+#
+#dpkg -i "$DEBOOTSTRAP"

I comment out proposed-updates and add backports to sources.list. dpkg --add-architecture i386, Disable smartd.
Exclude mesa d3d12_dri.so library. Its only functional inside MS WSL2. And have no sense on bare metal.
I don't use conky and remove conkytoggle.desktop. And i don't like aero cursors root/.icons from dog-boot-bookworm-20221013.tar.gz, remove it.

Code: Select all

 deb http://deb.debian.org/debian bookworm-updates main contrib non-free
 #deb-src http://deb.debian.org/debian bookworm-updates main contrib non-free
 
-deb http://deb.debian.org/debian bookworm-proposed-updates main contrib non-free
+#deb http://deb.debian.org/debian bookworm-proposed-updates main contrib non-free
 #deb-src http://deb.debian.org/debian bookworm-proposed-updates main contrib non-free
 
 deb http://security.debian.org bookworm-security main contrib non-free
 #deb-src http://security.debian.org bookworm-security main contrib non-free
 
+deb http://deb.debian.org/debian bookworm-backports main contrib non-free non-free-firmware
+#deb-src http://deb.debian.org/debian bookworm-backports main contrib non-free
+
 '
 
 [ "$ARCH" = "i386" ] && echo "$REPOS32" > /etc/apt/sources.list
 
 [ "$ARCH" = "amd64" ] && echo "$REPOS64" > /etc/apt/sources.list 
 
+[ "$ARCH" = "amd64" ] && dpkg --add-architecture i386
+
+echo path-exclude=/etc/init.d/smartmontools > etc/dpkg/dpkg.cfg.d/smartd
+echo path-exclude=/usr/sbin/smartd >> etc/dpkg/dpkg.cfg.d/smartd
+echo path-exclude=/usr/lib/x86_64-linux-gnu/dri/d3d12_dri.so > etc/dpkg/dpkg.cfg.d/mesa_d3d12_dri
+
+rm -f root/Desktop/conkytoggle.desktop
+rm -rf root/.icons
+rm -f home/puppy/Desktop/conkytoggle.desktop
+rm -rf home/puppy/.icons
+

I fix my code for download and install libpng12_i386.deb in "$ARCH" = "amd64".
Now it is work as needed and don't makes copies of libpng12-0_1.2.50-2+deb8u3.3_i386.deb for each run of script.
Added code for install backported version of netsurf. I rebuild it from src deb testing version.
Just put debs to build/bookworm/chroot/var/cache/apt/archives/

Code: Select all

+if [ "$ARCH" = "amd64" ]; then
+ls var/cache/apt/archives/libpng12*_i386.deb 2> /dev/null || \
+wget --no-check-certificate https://github.com/doglinux/bookworm/raw/master/i386/libpng12-0_1.2.50-2+deb8u3.3_i386.deb \
+-P var/cache/apt/archives
+dpkg --force-overwrite -i var/cache/apt/archives/libpng12*_i386.deb
+fi
+
+ls var/cache/apt/archives/netsurf-*_3.11*.deb 2> /dev/null && \
+dpkg -i var/cache/apt/archives/netsurf-common_3.11*_all.deb \
+var/cache/apt/archives/netsurf-gtk_3.11*_"$ARCH".deb
+

Remove mesa libs from 01-filesystem.squashfs. Because i make module with updated mesa and libdrm from backports.

Code: Select all

+# Remove mesa libs from 01-filesystem.squashfs
+# Prefer to make module with mesa and libdrm from backports
+if [ "$ARCH" = "amd64" ]; then
+rm -f usr/lib/x86_64-linux-gnu/dri/*_dri.so
+rm -f usr/lib/x86_64-linux-gnu/libdrm_*so.*
+rm -f usr/lib/x86_64-linux-gnu/libEGL_mesa.so.0*
+fi
+
gumanzoy wrote: Mon Jul 25, 2022 5:45 am

I prefer to keep eng manpages, but delete /usr/share/doc and /usr/share/info
Copy code from livekit Slax cleanup to ungzip manpages.

Code: Select all

+# Unzip gzipped files (man pages), so LZMA can compress 2times better.
+# First we fix symlinks, then uncompress files
+# $1 = search directory
+uncompress_files()
+{
+   local LINK LINE
+
+   find "$1" -type l -name "*.gz" | while read LINE; do
+      LINK="$(readlink "$LINE" | sed -r 's/.gz$//')"
+      FILE="$(echo "$LINE" | sed -r 's/.gz$//')"
+      ln -sfn "$LINK" "$FILE"
+      rm -f "$LINE"
+   done
+   find "$1" -type f -name "*.gz" | xargs -r gunzip
+}
+
+uncompress_files etc/alternatives
+
 if [ "$KEEPMANDOC" = "FALSE" ]; then
 find /usr/share/doc -type f -exec rm -f {} 2> /dev/null \;
 find usr/share/man -type f -exec rm -f {} 2> /dev/null \;
 find usr/share/gtk-doc -type f -exec rm -f {} 2> /dev/null \;
 find usr/share/info -type f -exec rm -f {} 2> /dev/null \;
     chown -R man:root usr/share/man
+else
+find usr/share/doc -type f -exec rm -f {} 2> /dev/null \;
+find usr/share/gtk-doc -type f -exec rm -f {} 2> /dev/null \;
+find usr/share/info -type f -exec rm -f {} 2> /dev/null \;
+rm -f usr/local/bin/man
+rm -fr usr/share/man/??
+rm -fr usr/share/man/??.*
+rm -fr usr/share/man/*_*
+uncompress_files usr/share/man
+    chown -R man:root usr/share/man
 fi

I will add some details about modules building in next posts.

Last edited by gumanzoy on Fri Nov 15, 2024 6:20 am, edited 7 times in total.

My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

gumanzoy
Posts: 93
Joined: Mon May 03, 2021 3:38 pm
Has thanked: 14 times
Been thanked: 18 times
Contact:

Re: My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

Post by gumanzoy »

Rebuilding debs with pbuilder

Code: Select all

sudo apt install pbuilder
sudo pbuilder --create --distribution bookworm --architecture amd64 --basetgz /var/cache/pbuilder/bookworm-amd64-base.tgz
sudo pbuilder --create --distribution bookworm --architecture i386 --basetgz /var/cache/pbuilder/bookworm-i386-base.tgz

Rebuild netsurf 3.11 from testing

Download netsurf_3.11.orig.tar.gz netsurf_3.11-2.debian.tar.xz netsurf_3.11-2.dsc from https://packages.debian.org/source/trixie/netsurf

Code: Select all

sudo pbuilder --build --distribution bookworm --architecture amd64 --basetgz /var/cache/pbuilder/bookworm-amd64-base.tgz netsurf_3.11-2.dsc
sudo pbuilder --build --distribution bookworm --architecture i386 --basetgz /var/cache/pbuilder/bookworm-i386-base.tgz netsurf_3.11-2.dsc

New debs netsurf-common_3.11-2_all.deb netsurf-gtk_3.11-2_amd64.deb netsurf-gtk_3.11-2_i386.deb found in /var/cache/pbuilder/result/


Rebuild nvidia-settings-legacy-340xx and nvidia-settings-legacy-390xx debs from sid

Download from https://packages.debian.org/source/sid/ ... gacy-340xx

Code: Select all

nvidia-settings-legacy-340xx_340.108.orig.tar.bz2
nvidia-settings-legacy-340xx_340.108-7.debian.tar.xz
nvidia-settings-legacy-340xx_340.108-7.dsc

From https://packages.debian.org/source/sid/ ... gacy-390xx

Code: Select all

nvidia-settings-legacy-390xx_390.157.orig.tar.bz2
nvidia-settings-legacy-390xx_390.157-1.debian.tar.xz
nvidia-settings-legacy-390xx_390.157-1.dsc

Code: Select all

sudo pbuilder --build --distribution bookworm --architecture amd64 --basetgz /var/cache/pbuilder/bookworm-amd64-base.tgz nvidia-settings-legacy-340xx_340.108-7.dsc
sudo pbuilder --build --distribution bookworm --architecture amd64 --basetgz /var/cache/pbuilder/bookworm-amd64-base.tgz nvidia-settings-legacy-390xx_390.157-1.dsc

New debs nvidia-settings-legacy-340xx_340.108-7_amd64.deb nvidia-settings-legacy-390xx_390.157-1_amd64.deb found in /var/cache/pbuilder/result/

It used to build modules optional/nv340.108.squashfs and optional/nv390.157.squashfs


Build fresh version cpu-x 5.0.4 from testing
It depends on libcpuid-dev (>= 0.6.4). So we need to build it for stable bookworm first.

Download libcpuid_0.6.5+repack1.orig.tar.xz libcpuid_0.6.5+repack1-1.debian.tar.xz libcpuid_0.6.5+repack1-1.dsc from https://packages.debian.org/source/trixie/libcpuid

Code: Select all

sudo pbuilder --build --distribution bookworm --architecture amd64 --basetgz /var/cache/pbuilder/bookworm-amd64-base.tgz libcpuid_0.6.5+repack1-1.dsc

Then we need to add hook to pbuilder. As it described in wiki https://wiki.debian.org/PbuilderTricks# ... _the_build
Add to /etc/pbuilderrc

Code: Select all

HOOKDIR="/var/cache/pbuilder/hook.d/"
if [ -n "$DEPS" ] ; then
        export DEPSBASE=/var/cache/pbuilder/deps
        BINDMOUNTS=$DEPSBASE
fi

Create dirs and copy files

Code: Select all

sudo mkdir -p /var/cache/pbuilder/hook.d /var/cache/pbuilder/deps/libcpuid
sudo cp /var/cache/pbuilder/result/{libcpuid16_0.6.5+repack1-1_amd64.deb,libcpuid-dev_0.6.5+repack1-1_amd64.deb} /var/cache/pbuilder/deps/libcpuid

Create hook script /var/cache/pbuilder/hook.d/D05deps and make it executable

Code: Select all

DEPSPATH="$DEPSBASE/$DEPS"
if [ -n "$DEPS" ] && [ -d "$DEPSPATH" ] ; then
        apt-get install --assume-yes apt-utils
        ( cd "$DEPSPATH"; apt-ftparchive packages . > Packages )
        echo "deb [trusted=yes] file://$DEPSPATH ./" >> /etc/apt/sources.list
        apt-get update
fi

Code: Select all

sudo chmod +x /var/cache/pbuilder/hook.d/D05deps

Download cpu-x_5.0.4.orig.tar.gz cpu-x_5.0.4-1.debian.tar.xz cpu-x_5.0.4-1.dsc from https://packages.debian.org/source/trixie/cpu-x

Code: Select all

DEPS=libcpuid sudo pbuilder --build --distribution bookworm --architecture amd64 --basetgz /var/cache/pbuilder/bookworm-amd64-base.tgz cpu-x_5.0.4-1.dsc

New debs cpuidtool_0.6.5+repack1-1_amd64.deb cpu-x_5.0.4-1_amd64.deb libcpuid16_0.6.5+repack1-1_amd64.deb found in /var/cache/pbuilder/result/

i386 build is similar.

It used to build modules/cpu-x-5.0.4.squashfs for both amd64 and i386


Build fresh version tigervncserver 1.14.0 from upstream (Ubuntu version) deb-src for Debian.
Not have in sid at the time of writing this post.

Download tigervnc_1.14.0.orig.tar.gz tigervnc_1.14.0-1ubuntu1.debian.tar.gz tigervnc_1.14.0-1ubuntu1.dsc from sourceforge.net
Unpack source

Code: Select all

dpkg-source -x tigervnc_1.14.0-1ubuntu1.dsc

Edit tigervnc_1.14.0/debian/control

Code: Select all

- libjpeg-turbo8-dev,
+ libjpeg62-turbo-dev,

  libfltk1.3-dev,
+ fluid,

- openjdk-8-jdk,
+# openjdk-8-jdk,

Build

Code: Select all

cd tigervnc_1.14.0
sudo pdebuild -- --distribution bookworm --architecture amd64 --basetgz /var/cache/pbuilder/bookworm-amd64-base.tgz
sudo pdebuild -- --distribution bookworm --architecture i386 --basetgz /var/cache/pbuilder/bookworm-i386-base.tgz

New debs tigervncserver_1.14.0-1ubuntu1_amd64.debb tigervncserver_1.14.0-1ubuntu1_i386.deb found in /var/cache/pbuilder/result/

It used to build modules optional/x0tigervncserver-1.14.0.squashfs for both amd64 and i386


Small tip: I make mpv modules with packages from https://fruit.je/apt repo. It is quite smaller than debian repo version.
https://apt.fruit.je/debian/bookworm/mpv/

It used to build modules/mpv-0.38.0.squashfs for both amd64 and i386

Last edited by gumanzoy on Tue Oct 22, 2024 5:17 am, edited 7 times in total.

My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

gumanzoy
Posts: 93
Joined: Mon May 03, 2021 3:38 pm
Has thanked: 14 times
Been thanked: 18 times
Contact:

Re: My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

Post by gumanzoy »

@fredx181
Kernel 6.10 in this build have problem with path i applied intel-nvme-remap from EndlessOS

Can not boot in configurations with Intel RST.

I will remove path, rebuild kernel, rebuild nvidia modules (because it depends of kernel modules), and upload new version in 3-5 days.
I will apply same patch to kernel 5.10 instead. Because i want to keep it for legacy 340xx nvidia driver.

Image Image Image

UPD. I rebuild kernels and modules. But i want to test it first on real hardware for sure.

This patch for kernel 5.10. intel-nvme-remap I use it before for bullseye build.
This version works with 6.1 kernel. But i want to drop 6.1-amd64 kernel. And use 6.10 and 5.10 only.
5.10 is important to support legacy nvidia 340xx driver on notebooks with optimus.

Intel makes a problem. And not want to fix it. Affected some notebooks with Core i3 i5 i7 from 8th to 10th gen.

UPD2: Done. New version 2024.10.08 uploaded. Files changed:

Code: Select all

live/dk5/initrd1.xz
live/dk5/k-5.10.0-32-amd64.squashfs
live/dk5/vmlinuz1
live/optional/dkms.squashfs
live/optional/headers-5.10.0-32-amd64.squashfs
live/optional/headers-6.10.12-amd64.squashfs
live/optional/nv340.108-k5.10.0-32-amd64.squashfs
live/optional/nv340.108-k6.10.12-amd64.squashfs
live/optional/nv390.157-k5.10.0-32-amd64.squashfs
live/optional/nv390.157-k6.10.12-amd64.squashfs
live/optional/nvidia-550.120-k6.10.12-amd64.squashfs
live/initrd1.xz
live/k-6.10.12-amd64.squashfs
live/vmlinuz1

My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

gumanzoy
Posts: 93
Joined: Mon May 03, 2021 3:38 pm
Has thanked: 14 times
Been thanked: 18 times
Contact:

Re: My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

Post by gumanzoy »

Today FurMark 2.4.0.0 (GPU Stress Test and Graphics Benchmark) Released
But there are no significant changes in the Linux version.
I make module.
Download and copy to live/modules/, then delete old version.

furmark-2.4.0.0.squashfs 12.3MB drive.google.com vk.com
md5sum: 9365923ab2a9a572b677facfbd446753

Image

My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

gumanzoy
Posts: 93
Joined: Mon May 03, 2021 3:38 pm
Has thanked: 14 times
Been thanked: 18 times
Contact:

Re: My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

Post by gumanzoy »

Debian kernels rebuilding howto

Rebuild oldstable 5.10 bullseye kernel
With intel-nvme-remap.patch from EndlessOS.
And with current stable bookworm gcc-12 version.

Code: Select all

sudo apt-get install libelf-dev python3-dacite pahole

Maybe need some more packages. But i have installed it already on my bookworm desktop.

* Download sources
linux_5.10.223.orig.tar.xz linux_5.10.223-1.debian.tar.xz linux_5.10.223-1.dsc

* Unpack sources

Code: Select all

dpkg-source -x linux_5.10.223-1.dsc

* Download patch

Code: Select all

wget https://github.com/endlessm/linux/commit/9e1ef9e62c174ba14cb01ff1e894a6a100a8eaf3.patch -O intel-nvme-remap.patch

* Apply patch

Code: Select all

cd linux-5.10.223
patch -p1 -i ../intel-nvme-remap.patch

* Modify configs in debian folder to change gcc version

Code: Select all

sed -i s/gcc-10/gcc-12/g debian/config/defines.toml
sed -i s/gcc-10/gcc-12/g debian/control
sed -i s/gcc-10/gcc-12/g debian/rules.gen

* Run building process
Build linux-image-5.10.0-32-amd64-unsigned_5.10.223-1_amd64.deb and linux-headers-5.10.0-32-amd64_5.10.223-1_amd64.deb packages

Code: Select all

fakeroot make -j `nproc` -f debian/rules.gen binary-arch_amd64_none_amd64_real

Build linux-compiler-gcc-12-x86_5.10.223-1_amd64.deb package

Code: Select all

fakeroot make -j -f debian/rules.gen binary-arch_amd64_extra

Build linux-headers-5.10.0-32-common_5.10.223-1_all.deb package

Code: Select all

fakeroot make -j -f debian/rules.gen binary-indep_none_real

I don't know how to build linux-kbuild-5.10_5.10.223-1_amd64.deb package. I download it from bullseye repo.
And also download libssl1.1_1.1.1w-0+deb11u1_amd64.deb it's dependency.

linux-compiler linux-headers and linux-kbuild packages needed to build optional/headers-5.10.0-32-amd64.squashfs module.


Rebuild 6.10 kernel from sid
With current stable bookworm gcc-12 version.
And with CONFIG_NTFS3_FS=m

* Download sources
linux_6.10.12.orig.tar.xz linux_6.10.12-1.debian.tar.xz linux_6.10.12-1.dsc

* Unpack sources

Code: Select all

dpkg-source -x linux_6.10.12-1.dsc

Code: Select all

cd linux-6.10.12

* Modify debian/config/config
disable CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
disable CONFIG_MODULE_SIG_ALL
disable CONFIG_MODULE_COMPRESS_XZ
And enable CONFIG_NTFS3_FS=m CONFIG_NTFS3_LZX_XPRESS=y

Code: Select all

+CONFIG_NTFS3_FS=m
+CONFIG_NTFS3_LZX_XPRESS=y

-CONFIG_MODULE_SIG_ALL=y
+# CONFIG_MODULE_SIG_ALL is not set

-CONFIG_MODULE_COMPRESS_XZ=y
+# CONFIG_MODULE_COMPRESS_XZ is not set

-CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
+# CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT is not set

* Modify configs in debian folder to change gcc version

Code: Select all

sed -i s/gcc-13/gcc-12/g debian/config/defines.toml
sed -i s/gcc-13/gcc-12/g debian/control
sed -i s/gcc-13/gcc-12/g debian/rules.gen

* Run building process
Build linux-image-6.10.12-amd64-unsigned_6.10.12-1_amd64.deb package

Code: Select all

fakeroot make -j `nproc` -f debian/rules.gen binary-arch_amd64_none_amd64_image

Build linux-kbuild-6.10.12_6.10.12-1_amd64.deb package

Code: Select all

fakeroot make -j `nproc` -f debian/rules.gen binary-arch_amd64_kbuild

Build linux-headers-6.10.12-amd64_6.10.12-1_amd64.deb package

Code: Select all

fakeroot make -f debian/rules.gen binary-arch_amd64_none_amd64_headers

Build linux-headers-6.10.12-common_6.10.12-1_all.deb package

Code: Select all

fakeroot make -f debian/rules.gen binary-indep_none_headers-common

linux-headers and linux-kbuild packages needed to build optional/headers-6.10.12-amd64.squashfs module.

My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

gumanzoy
Posts: 93
Joined: Mon May 03, 2021 3:38 pm
Has thanked: 14 times
Been thanked: 18 times
Contact:

Re: My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

Post by gumanzoy »

Build firmware/firmware-VERSION.squashfs module (it is common for amd64 and i386)

Boot DogLinux

Code: Select all

echo "deb http://deb.debian.org/debian sid non-free-firmware" >> /etc/apt/sources.list
apt update
apt -y install firmware-amd-graphics firmware-nvidia-graphics firmware-intel-graphics firmware-intel-sound firmware-intel-misc firmware-cirrus firmware-ath9k-htc firmware-atheros firmware-ipw2x00 firmware-iwlwifi firmware-mediatek firmware-realtek firmware-b43-installer firmware-b43legacy-installer firmware-brcm80211 firmware-zd1211 firmware-sof-signed

Run remastercow, then before creating .squashfs
Copy /usr/lib/firmware/tigon/ from package firmware-misc-nonfree

Code: Select all

apt -y install firmware-misc-nonfree
cp -ra /usr/lib/firmware/tigon /tmp/firmware/usr/lib/firmware

Remove some unneeded stuff from /tmp/firmware
Remove nvidia gsp firmware to reduce size of .squashfs. If somebody need it, it can be installed from another package firmware-nvidia-gsp
And remove /usr/bin/b43-fwcutter it is unneeded after download firmware.

Code: Select all

cd /tmp/firmware
rm -rf etc/apt
rm -rf root
rm -rf usr/lib/firmware/nvidia/*/gsp
rm -rf usr/bin
cd /tmp

Use xz for better compression.


Build optional/dkms.squashfs modules both amd64 and i386

Boot DogLinux

Code: Select all

apt update
apt -y install dkms

Run remastercow and uncheck "Disable dpkg registration"

Then before creating .squashfs - remove some unneeded stuff from /tmp/dkms
Use xz for better compression.


Build optional/headers-6.1.0-25-686.squashfs module

Boot DogLinux dog32 load=dkms

Code: Select all

apt update
apt -y install linux-headers-6.1.0-25-686

Run remastercow, then before creating .squashfs - remove some unneeded stuff from /tmp/headers-6.1.0-25-686


Build kernel/fs/ntfs3/ntfs3.ko and update k-6.1.0-25-686.squashfs module

Boot DogLinux dog32 load=dkms;headers

Code: Select all

apt update
apt -y install linux-source-6.1

Mount some partition (posix compatible)

Code: Select all

cd /mnt/sda1
tar -xf /usr/src/linux-source-6.1.tar.xz
cd linux-source-6.1
make CONFIG_NTFS3_FS=m CONFIG_NTFS3_LZX_XPRESS=y -C /lib/modules/`uname -r`/build M=$PWD/fs/ntfs3 modules
strip --strip-debug fs/ntfs3/ntfs3.ko
mkdir /lib/modules/`uname -r`/kernel/fs/ntfs3/
cp fs/ntfs3/ntfs3.ko /lib/modules/`uname -r`/kernel/fs/ntfs3/
depmod
cd ..
mkdir -p k-`uname -r`/usr/lib/modules/
cp -ra /lib/modules/`uname -r` k-`uname -r`/usr/lib/modules/
mksquashfs k-`uname -r` k-`uname -r`.squashfs -comp xz -b 512k -Xbcj x86
Last edited by gumanzoy on Mon Nov 04, 2024 3:31 pm, edited 4 times in total.

My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

gumanzoy
Posts: 93
Joined: Mon May 03, 2021 3:38 pm
Has thanked: 14 times
Been thanked: 18 times
Contact:

Re: My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

Post by gumanzoy »

Changes to linuxrc script for slightly different extramod= param usage

I use one module with firmware for both amd64 and i386 versions.
I place firmware module to live/firmware/firmware-VERSION.squashfs
And i386 version to live32/live/ folder.

I place second amd64 kernel 5.10 to live/dk5/ folder.
It contains vmlinuz1 initrd1.xz and k-5.10.0-32-amd64.squashfs with kernel modules.

All boot variant (64 and 32bit versions) should contain extramod=/live/firmware param.
i386 boot variants use from=/live32
And dk5 variant contain extramod=/live/firmware;/live/dk5 noload=k-6.1

syslinux.cfg:

Code: Select all

default dogram
timeout 300
prompt 1
display syslinux.msg
F1 syslinux.msg
label dog32
  kernel /live32/live/vmlinuz1
  append initrd=/live32/live/initrd1.xz noauto nocd from=/live32 extramod=/live/firmware mitigations=off
label dog32ram
  kernel /live32/live/vmlinuz1
  append initrd=/live32/live/initrd1.xz copy2ram noauto nocd from=/live32 extramod=/live/firmware mitigations=off
label dog32wp
  kernel /live32/live/vmlinuz1
  append initrd=/live32/live/initrd1.xz autorun=winpasswd copy2ram auto noload=modules nocd from=/live32 extramod=/live/firmware mitigations=off
label dog
  kernel /live/vmlinuz1
  append initrd=/live/initrd1.xz nvidia_detect noauto nocd from=/ extramod=/live/firmware mitigations=off nvme_core.default_ps_max_latency_us=5500
label dogram
  kernel /live/vmlinuz1
  append initrd=/live/initrd1.xz copy2ram nvidia_detect noauto nocd from=/ extramod=/live/firmware mitigations=off nvme_core.default_ps_max_latency_us=5500
label dogwp
  kernel /live/vmlinuz1
  append initrd=/live/initrd1.xz autorun=winpasswd copy2ram auto noload=modules nocd from=/ extramod=/live/firmware mitigations=off nvme_core.default_ps_max_latency_us=5500
label dogkmb
  kernel /live/vmlinuz1
  append initrd=/live/initrd1.xz load=dkms;headers noauto nocd from=/ extramod=/live/firmware mitigations=off nvme_core.default_ps_max_latency_us=5500
label dk5
  kernel /live/dk5/vmlinuz1
  append initrd=/live/dk5/initrd1.xz nvidia_detect noauto nocd from=/ extramod=/live/firmware;/live/dk5 noload=k-6.1 mitigations=off nvme_core.default_ps_max_latency_us=5500
label dk5ram
  kernel /live/dk5/vmlinuz1
  append initrd=/live/dk5/initrd1.xz copy2ram nvidia_detect noauto nocd from=/ extramod=/live/firmware;/live/dk5 noload=k-6.1 mitigations=off nvme_core.default_ps_max_latency_us=5500

I make changes to linuxrc because extramod= kernel modules live/dk5/k-5.10.0-32-amd64.squashfs
should be loaded before (but not after) optional/nv340*.squashfs or nv390*.squashfs driver modules.

Changes in /usr/local/cr-initrd/initramfs/linuxrc script:

Original code:

Code: Select all

# Find modules:
find $PTH $PTH/base $PTH/modules -maxdepth 1 -name "*.squashfs" 2>/dev/null | egrep -ve "$NOLOAD" | sort >/tmp/modules
find $PTH/optional -name "*.squashfs" 2>/dev/null | egrep -e "$LOAD" | sort >>/tmp/modules

New version:

Code: Select all

# Find base modules:
find $PTH $PTH/base -maxdepth 1 -name "*.squashfs" 2>/dev/null | egrep -ve "$NOLOAD" | sort >/tmp/modules

if [ "$EXTRAMOD" ]; then
	for folder in $EXTRAMOD; do
		echo $i"searching for additional modules in $folder"
		locate -d $folder && { find /mnt/$DEV/$LPTH -name "*.squashfs" 2>/dev/null | egrep -ve "$NOLOAD" | sort >>/tmp/modules; } || fail $folder
	done
fi

And second part. I comment out block of if param base_only; then (not support it, sorry).

Code: Select all

if param base_only; then
grep live /tmp/modules | grep -v modules > /tmp/mod
#    grep base/0 /tmp/modules > /tmp/mod
    mv /tmp/mod /tmp/modules
else
    if [ "$EXTRAMOD" ]; then
	for folder in $EXTRAMOD; do
	    echo $i"searching for additional modules in $folder"
	    locate -d $folder && { find /mnt/$DEV/$LPTH -name "*.squashfs" 2>/dev/null | egrep -ve "$NOLOAD" | sort >>/tmp/modules; } || fail $folder
	done
    fi
fi

And replace it with code for $PTH/modules and $PTH/optional loading.

Code: Select all

# Find other modules:
find $PTH/modules -name "*.squashfs" 2>/dev/null | egrep -ve "$NOLOAD" | sort >>/tmp/modules
find $PTH/optional -name "*.squashfs" 2>/dev/null | egrep -e "$LOAD" | sort >>/tmp/modules

#if param base_only; then

Changes to linuxrc and mkinitrd scripts for support new param nvidia_detect
Description in my blog (in Russian language)

The purpose of param nvidia_detect is: load pre-created .squashfs modules with proper nvidia driver version
for video card discovered by lspci (or not load it if no one of corresponding video card ID's present).

Changes in /usr/local/cr-initrd/initramfs/linuxrc script:

New code (insert it after existing if param vga_detect; then block and before second part of new code # Find other modules:):

Code: Select all

if param nvidia_detect; then
	echo $i"detecting nvidia GPU"
	lspci >/tmp/lspci
	nvlist=`grep -i "030.: 10de:" /tmp/lspci | cut -d":" -f4`
	if param nonvidia; then
	echo $i"skipping nvidia GPU detection"
	elif [ -n "$nvlist" ]; then
	for nv in $nvlist
	do
		echo $i"$nv chip found, checking which nvidia driver supports it"
		if grep -sqi 10de$nv /usr/share/nvidia/nvidia.ids; then NV=nvidia; break
		elif grep -sqi 10de$nv /usr/share/nvidia/nvidia-legacy-390xx.ids; then NV=nv390; break
		elif grep -sqi 10de$nv /usr/share/nvidia/nvidia-legacy-340xx.ids; then NV=nv340; break
		else echo $i"$nv chip is not supported by nvidia driver"
		fi
	done
	if [ $NV ]; then
		echo $i"$NV driver will be activated"
		find $PTH/optional -name "$NV*.squashfs" 2>/dev/null >>/tmp/modules
		NOLOAD="$NOLOAD|mesa-vulkan-drivers"
	fi
	else echo $i"could not find any nVidia GPU on this PC"
	fi
fi

# Find other modules:

Changes in /usr/local/cr-initrd/mkinitrd script:

Insert code to copy /usr/share/nvidia/{nvidia.ids,nvidia-legacy-390xx.ids,nvidia-legacy-340xx.ids} to initrd.
nvidia-detect package added to mklive-bookworm64-xfce-gumanzoy.conf BASE_INSTALL=
I insert it after commented old code. And before new code to copy modules:

Code: Select all

#cp -a /var/tmp/mkinitramfs_*/lib/modules/* $INITRAMFS/lib/modules/

if [ -f /usr/share/nvidia/nvidia.ids ]; then
echo -n "copy nvidia.ids"
mkdir $INITRAMFS/usr/share/nvidia
cp /usr/share/nvidia/nvidia.ids $INITRAMFS/usr/share/nvidia/
cp /usr/share/nvidia/nvidia-legacy-390xx.ids $INITRAMFS/usr/share/nvidia/
#cp /usr/share/nvidia/nvidia-legacy-340xx.ids $INITRAMFS/usr/share/nvidia/
echo " - done"
fi

# copy file to initramfs tree, including

This line commented by default because current 6.10 and 6.1 kernels have partially broken support of (unsupported :D ) nvidia-legacy-340xx-driver
#cp /usr/share/nvidia/nvidia-legacy-340xx.ids $INITRAMFS/usr/share/nvidia/
Auto detecting old GPUs and loading optional/nv340*.squashfs modules disabled.

If display connected directly to dGPU NVIDIA it is work ok. But with iGPU Intel + dGPU NVIDIA configuration have black screen.
But as i build optional/nv340.108-k6.10.12-amd64.squashfs - it can be loaded with kernel 6.10 manual by load=nv340
I recommend to use kernel 5.10 for this case.

To build initrd.xz for 5.10 kernel need to comment out
#cp /usr/share/nvidia/nvidia.ids $INITRAMFS/usr/share/nvidia/ and uncomment
cp /usr/share/nvidia/nvidia-legacy-340xx.ids $INITRAMFS/usr/share/nvidia/

When optional/nv340*.squashfs driver loaded - downgraded xserver will be used optional/nv340-xserver-1.20.11.squashfs
Module contains xserver-xorg-core xserver-xorg-input-evdev xserver-xorg-input-synaptics from Bullseye.
It is important to support optimus iGPU Intel + dGPU NVIDIA configurations.


live/05-customtools.squashfs in my build contains all this scripts changes.
Update: from 24.10.2024 included to Bookworm Build script GitHub

Last edited by gumanzoy on Mon Nov 04, 2024 3:48 pm, edited 10 times in total.

My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

User avatar
fredx181
Posts: 3085
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 376 times
Been thanked: 1315 times
Contact:

Re: My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

Post by fredx181 »

@gumanzoy
Thanks. Would you agree if I incorporate your changes ?
(so that it will be included in the initrd on a new mklive build, and also in e.g. upgrade-kernel package)

gumanzoy
Posts: 93
Joined: Mon May 03, 2021 3:38 pm
Has thanked: 14 times
Been thanked: 18 times
Contact:

Re: My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

Post by gumanzoy »

Insert export NO_AT_BRIDGE=1 to /etc/profile

To prevent warning message in terminal when run GTK3 apps.

Code: Select all

dbind-WARNING **: AT-SPI: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files

Changes to /etc/profile script for setup cyrillic font and keyboard layout switching in TTY

Insert new code after:

Code: Select all

if [ -z "${DISPLAY}" ] && [ $(tty) = /dev/tty1 ]
then

Code: Select all

if [ -z "${DISPLAY}" ] && [ $(tty) = /dev/tty1 ]; then
  /etc/console-setup/cached_setup_font.sh &> /dev/null
  /etc/console-setup/cached_setup_keyboard.sh &> /dev/null

All needed files generated by dpkg-reconfigure console-setup and included into live/05-customtools.squashfs
But full console-setup package not needed and not included (for reduce size).

Code: Select all

/etc/console-setup:
cached_setup_font.sh cached_setup_keyboard.sh cached_UTF-8_del.kmap.gz
/etc/default:
console-setup keyboard
/usr/share/consolefonts:
CyrKoi-VGA16.psf.gz

Changes to /etc/profile and /etc/xdg/xfce4/xinitrc scripts for support nvidia-legacy-optimus
Description in my blog (in Russian language)

nvidia-legacy-340xx-driver and nvidia-legacy-390xx-driver
Not support PRIME render offload.
Hybrid graphics notebooks by default use iGPU Intel
I add code to run X11 desktop on dGPU NVIDIA with these drivers.
Based on ArchLinux Wiki Use_NVIDIA_graphics_only

Insert new code to /etc/profile after:

Code: Select all

if [ -z "${DISPLAY}" ] && [ $(tty) = /dev/tty1 ]
then

Code: Select all

  if egrep -qe "nv340|nv390" /mnt/live/tmp/modules; then
    if grep -q i915 /proc/modules; then
    mv /etc/nvidia-legacy-optimus-outputclass.conf /etc/X11/xorg.conf.d/ 2>/dev/null
    echo "#!/bin/sh" > /etc/nvidia-legacy-optimus-xrandr.sh
    echo "xrandr --setprovideroutputsource modesetting NVIDIA-0" >> /etc/nvidia-legacy-optimus-xrandr.sh
    echo "xrandr --auto" >> /etc/nvidia-legacy-optimus-xrandr.sh
    chmod +x /etc/nvidia-legacy-optimus-xrandr.sh
    fi
  fi

Insert new line to /etc/xdg/xfce4/xinitrc

Code: Select all

+[ -x /etc/nvidia-legacy-optimus-xrandr.sh ] && /etc/nvidia-legacy-optimus-xrandr.sh

 # check if we start xfce4-session with ck-launch-session. this is only
 # required for starting from a console, not a login manager

This solution in not DE/WM independent. To use another DE/WM needs to edit their startup script.

/etc/nvidia-legacy-optimus-outputclass.conf

Code: Select all

Section "OutputClass"
    Identifier "intel"
    MatchDriver "i915"
    Driver "modesetting"
EndSection

Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    Option "PrimaryGPU" "yes"
    ModulePath "/usr/lib/xorg/modules/linux"
    ModulePath "/usr/lib/xorg/modules"
EndSection

#~/.xinitrc
#xrandr --setprovideroutputsource modesetting NVIDIA-0
#xrandr --auto

Modified files included into live/05-customtools.squashfs


Changes to /etc/profile script for support autorun= and text cheatcodes

Replace old code:

Code: Select all

sleep 3
startx

With:

Code: Select all

  if grep -q autorun /proc/cmdline; then
  echo "`cat /proc/cmdline|sed -e 's/^/ /'`" > /etc/cmdline
  AUTORUNCMD=`egrep -o " autorun=[^ ]+" /etc/cmdline | cut -d= -f2;`
    if [ -n "$AUTORUNCMD" ]; then
    echo -e "\E[32m\033[1mautorun=$AUTORUNCMD"
    tput sgr0
    "$AUTORUNCMD"
    fi
  elif ! grep -q text /proc/cmdline; then
  sleep 3
  startx
  fi

live/05-customtools.squashfs in my build contains all script changes and other support files

Last edited by gumanzoy on Mon Oct 21, 2024 6:48 pm, edited 9 times in total.

My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

gumanzoy
Posts: 93
Joined: Mon May 03, 2021 3:38 pm
Has thanked: 14 times
Been thanked: 18 times
Contact:

Re: My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

Post by gumanzoy »

Replace symlink /usr/sbin/mount.ntfs -> mount.ntfs-3g

With script file

Code: Select all

#!/bin/sh

mountntfs3 () {
exec mount -t ntfs3 -o force,sparse "$@"
}

if grep -q ntfs3 /proc/filesystems; then mountntfs3 "$@"
elif modprobe -q ntfs3; then mountntfs3 "$@"
else exec ntfs-3g "$@"
fi

To support of mounting by ntfs3 kernel module in case of it is existing in current kernel.
As fallback mount handled by ntfs-3g


Replace /root/Startup/volumeicon

With script file

Code: Select all

#!/bin/sh
if ! lspci | grep -qi audio; then
    echo No soundcard, exit
    exit
fi

while ! test -c /dev/snd/controlC0; do sleep 1;
done

if amixer get Master > /dev/null; then exec volumeicon
fi

for card in 1 2 3 4 5 0; do
    if amixer -c $card get Master > /dev/null; then break
    elif amixer -c $card get PCM > /dev/null; then break
    fi
done

if [ $card != "0" ]; then
    echo write /etc/asound.conf
    echo defaults.pcm.card $card > /etc/asound.conf
    echo defaults.ctl.card $card >> /etc/asound.conf
fi

exec volumeicon

Try to detect real soundcard (not HDMI)
And switch audio output to it
To use analog speakers (instead of HDMI) if possible.


live/05-customtools.squashfs in my build contains all this scripts

My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

gumanzoy
Posts: 93
Joined: Mon May 03, 2021 3:38 pm
Has thanked: 14 times
Been thanked: 18 times
Contact:

Re: My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

Post by gumanzoy »

Build optional/nv340.108.squashfs and optional/nv390.157.squashfs modules

First get nvidia-settings-legacy debs rebuilded for stable bookworm. It is need to fix dependency problem.
Process described in previous post.
nvidia-settings-legacy-340xx_340.108-7_amd64.deb
nvidia-settings-legacy-390xx_390.157-1_amd64.deb

Boot DogLinux dk5 load=dkms;headers

Code: Select all

echo "deb http://deb.debian.org/debian sid non-free" >> /etc/apt/sources.list
apt update

Code: Select all

apt -y install nvidia-legacy-340xx-driver libgles1-nvidia-legacy-340xx libgles2-nvidia-legacy-340xx libnvidia-legacy-340xx-cfg1 nvidia-legacy-340xx-smi
dpkg -i nvidia-settings-legacy-340xx_340.108-7_amd64.deb

Run remastercow, then before creating .squashfs - mv kernel modules and remove some unneeded stuff from /tmp/nv340.108

Code: Select all

cd /tmp/nv340.108
rm -rf etc/apt
rm -rf usr/src
rm -rf var/lib/dkms
mkdir -p /tmp/nv340.108-k`uname -r`/usr/lib/modules/
mv usr/lib/modules/`uname -r` /tmp/nv340.108-k`uname -r`/usr/lib/modules/
cd /tmp/
mksquashfs nv340.108-k`uname -r` nv340.108-k`uname -r`.squashfs -comp xz -b 1M -Xbcj x86

Use xz for better compression.


Build optional/nv390.157.squashfs modules

Boot DogLinux dog load=dkms;headers, add sid repo and apt update same as for nv340.108

Code: Select all

apt -y install nvidia-legacy-390xx-driver libgles-nvidia-legacy-390xx1 libgles-nvidia-legacy-390xx2 libnvidia-legacy-390xx-cfg1 nvidia-legacy-390xx-smi nvidia-legacy-390xx-vulkan-icd
dpkg -i nvidia-settings-legacy-390xx_390.157-1_amd64.deb

Run remastercow, then before creating .squashfs - mv kernel modules and remove some unneeded stuff from /tmp/nv390.157

Code: Select all

cd /tmp/nv390.157
rm -rf etc/apt
rm -rf usr/src
rm -rf var/lib/dkms
mkdir -p /tmp/nv390.157-k`uname -r`/usr/lib/modules/
mv usr/lib/modules/`uname -r` /tmp/nv390.157-k`uname -r`/usr/lib/modules/
cd /tmp/
mksquashfs nv390.157-k`uname -r` nv390.157-k`uname -r`.squashfs -comp xz -b 1M -Xbcj x86

Use xz for better compression.


Build optional/nv390.157-k5.10.0-32-amd64.squashfs module for 5.10 kernel

Boot DogLinux dk5 load=dkms;headers, add sid repo and apt update same as for nv340.108

Code: Select all

apt -y install nvidia-legacy-390xx-kernel-dkms

Code: Select all

cd /tmp/
mkdir -p nv390.157-k`uname -r`/usr/lib/modules/
cp -ra /mnt/live/memory/changes/upperdir/usr/lib/modules/`uname -r` nv390.157-k`uname -r`/usr/lib/modules/
mksquashfs nv390.157-k`uname -r` nv390.157-k`uname -r`.squashfs -comp xz -b 1M -Xbcj x86
Last edited by gumanzoy on Tue Oct 22, 2024 9:15 am, edited 6 times in total.

My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

User avatar
fredx181
Posts: 3085
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 376 times
Been thanked: 1315 times
Contact:

Re: My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

Post by fredx181 »

gumanzoy wrote: Mon Oct 21, 2024 4:57 pm

Build optional/nv340.108.squashfs and optional/nv390.157.squashfs modules

Boot DogLinux dog load=dkms;headers

Code: Select all

echo "deb http://deb.debian.org/debian sid contrib non-free" >> /etc/apt/sources.list
apt update

Code: Select all

apt -y install nvidia-legacy-340xx-driver libgles1-nvidia-legacy-340xx libgles2-nvidia-legacy-340xx libnvidia-legacy-340xx-cfg1 nvidia-legacy-340xx-smi

I always hesitate to mix stable with unstable, do you think this is safe ? (even if it's just temporary to have sid repo in sources.list it may give trouble from what I experienced)
edit: or if it works ok for the purpose of just creating a .squashfs module, shouldn't it be better to remove the sid repo after done ?

gumanzoy
Posts: 93
Joined: Mon May 03, 2021 3:38 pm
Has thanked: 14 times
Been thanked: 18 times
Contact:

Re: My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

Post by gumanzoy »

fredx181 wrote: Mon Oct 21, 2024 5:27 pm

I always hesitate to mix stable with unstable, do you think this is safe ? (even if it's just temporary to have sid repo in sources.list it may give trouble from what I experienced)
edit: or if it works ok for the purpose of just creating a .squashfs module, shouldn't it be better to remove the sid repo after done ?

Yes. rm -rf /tmp/*/etc/apt before create module. I do it by file-manager, and i don't described each thing, so it is not full complete howto, sorry.
But better to look at contents of my created modules to check if some file needs to keep or needs to be deleted.

None of my modules have /etc/apt/sources.list

And, it is important. I don't add sid main, add only sid non-free and sid non-free-firmware for creating firmware modules. All of this is temporary.
nvidia-legacy-340xx-driver and nvidia-legacy-390xx-driver present only in sid repo.

edit: i edit post, and add rm -rf etc/apt to makes it is pretty clear.
edit2: sid contrib don't need. Only need sid non-free.
But nvidia-settings-legacy debs should get rebuilded for bookworm. It is need to fix dependency problem.

My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

gumanzoy
Posts: 93
Joined: Mon May 03, 2021 3:38 pm
Has thanked: 14 times
Been thanked: 18 times
Contact:

Re: My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

Post by gumanzoy »

Build optional/nvidia-550.120.squashfs and optional/cuda-550.120.squashfs modules

Boot DogLinux dog load=dkms;headers

Mount some partition (posix compatible)

Download installer

Code: Select all

cd /mnt/sda1
wget https://download.nvidia.com/XFree86/Linux-x86_64/550.120/NVIDIA-Linux-x86_64-550.120-no-compat32.run

Code: Select all

apt update
apt -y purge nvidia-installer-cleanup
apt -y install libc6-dev libglvnd-dev pkg-config

Run installer

Code: Select all

chmod +x NVIDIA-Linux-x86_64-550.120-no-compat32.run
./NVIDIA-Linux-x86_64-550.120-no-compat32.run

Purge -dev libraries after installer completed

Code: Select all

apt purge libc-dev-bin libc6-dev libcrypt-dev libegl-dev libgl-dev libgles-dev libglvnd-core-dev libglvnd-dev libglx-dev libnsl-dev libopengl-dev libpkgconf3 libpthread-stubs0-dev libtirpc-dev libx11-dev libxau-dev libxcb1-dev libxdmcp-dev linux-libc-dev pkg-config pkgconf pkgconf-bin rpcsvc-proto x11proto-dev xorg-sgml-doctools xtrans-dev

Create two important configs

Code: Select all

echo "blacklist nouveau" > /etc/modprobe.d/nvidia-blacklists-nouveau.conf
echo nvidia-drm > /etc/modules-load.d/nvidia-load.conf

Compress /usr/src/nvidia-550.120 it can be used after. In case of need to build module to another kernel.

Code: Select all

cd /usr/src/
tar --xz -cf /mnt/sda1/nvidia-550.120-src.tar.xz nvidia-550.120

Run remastercow, then before creating .squashfs - mv kernel modules and remove some unneeded stuff:
Move kernel modules

Code: Select all

cd /mnt/sda1
mkdir -p nvidia-550.120-k`uname -r`/usr/lib/modules/
mv nvidia-550.120/usr/lib/modules/`uname -r` nvidia-550.120-k`uname -r`/usr/lib/modules/
mksquashfs nvidia-550.120-k`uname -r` nvidia-550.120-k`uname -r`.squashfs -comp xz -b 1M -Xbcj x86

Remove unneeded stuff

Code: Select all

cd nvidia-550.120
rm -rf etc/apt
rm -rf usr/src
rm -rf var/lib/dkms

Split folder into two modules and remove other unneeded stuff to reduce size:
nvidia-550.120.squashfs file list:

Code: Select all

/etc/modprobe.d/nvidia-blacklists-nouveau.conf
/etc/modules-load.d/nvidia-load.conf
/etc/vulkan/icd.d/nvidia_icd.json
/etc/vulkan/implicit_layer.d/nvidia_layers.json
/usr/bin/nvidia-bug-report.sh
/usr/bin/nvidia-debugdump
/usr/bin/nvidia-modprobe
/usr/bin/nvidia-settings
/usr/bin/nvidia-sleep.sh
/usr/bin/nvidia-smi
/usr/bin/nvidia-xconfig
/usr/lib/libGL.so.1
/usr/lib/nvidia/egl_dummy_vendor.json
/usr/lib/nvidia/glvnd_check
/usr/lib/nvidia/libGLX_installcheck.so.0
/usr/lib/x86_64-linux-gnu/gbm/nvidia-drm_gbm.so
/usr/lib/x86_64-linux-gnu/libEGL_nvidia.so.0
/usr/lib/x86_64-linux-gnu/libEGL_nvidia.so.550.120
/usr/lib/x86_64-linux-gnu/libGLESv1_CM_nvidia.so.1
/usr/lib/x86_64-linux-gnu/libGLESv1_CM_nvidia.so.550.120
/usr/lib/x86_64-linux-gnu/libGLESv2_nvidia.so.2
/usr/lib/x86_64-linux-gnu/libGLESv2_nvidia.so.550.120
/usr/lib/x86_64-linux-gnu/libGLX_indirect.so.0
/usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.0
/usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.550.120
/usr/lib/x86_64-linux-gnu/libnvidia-allocator.so
/usr/lib/x86_64-linux-gnu/libnvidia-allocator.so.1
/usr/lib/x86_64-linux-gnu/libnvidia-allocator.so.550.120
/usr/lib/x86_64-linux-gnu/libnvidia-api.so.1
/usr/lib/x86_64-linux-gnu/libnvidia-cfg.so
/usr/lib/x86_64-linux-gnu/libnvidia-cfg.so.1
/usr/lib/x86_64-linux-gnu/libnvidia-cfg.so.550.120
/usr/lib/x86_64-linux-gnu/libnvidia-egl-gbm.so.1
/usr/lib/x86_64-linux-gnu/libnvidia-egl-gbm.so.1.1.1
/usr/lib/x86_64-linux-gnu/libnvidia-egl-wayland.so.1
/usr/lib/x86_64-linux-gnu/libnvidia-egl-wayland.so.1.1.13
/usr/lib/x86_64-linux-gnu/libnvidia-eglcore.so.550.120
/usr/lib/x86_64-linux-gnu/libnvidia-fbc.so
/usr/lib/x86_64-linux-gnu/libnvidia-fbc.so.1
/usr/lib/x86_64-linux-gnu/libnvidia-fbc.so.550.120
/usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.550.120
/usr/lib/x86_64-linux-gnu/libnvidia-glsi.so.550.120
/usr/lib/x86_64-linux-gnu/libnvidia-glvkspirv.so.550.120
/usr/lib/x86_64-linux-gnu/libnvidia-gpucomp.so.550.120
/usr/lib/x86_64-linux-gnu/libnvidia-gtk2.so.550.120
/usr/lib/x86_64-linux-gnu/libnvidia-gtk3.so.550.120
/usr/lib/x86_64-linux-gnu/libnvidia-ml.so
/usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1
/usr/lib/x86_64-linux-gnu/libnvidia-ml.so.550.120
/usr/lib/x86_64-linux-gnu/libnvidia-tls.so.550.120
/usr/lib/x86_64-linux-gnu/libnvidia-wayland-client.so.550.120
/usr/lib/xorg/modules/drivers/nvidia_drv.so
/usr/lib/xorg/modules/extensions/libglxserver_nvidia.so
/usr/lib/xorg/modules/extensions/libglxserver_nvidia.so.550.120
/usr/share/X11/xorg.conf.d/nvidia-drm-outputclass.conf
/usr/share/applications/nvidia-settings.desktop
/usr/share/egl/egl_external_platform.d/10_nvidia_wayland.json
/usr/share/egl/egl_external_platform.d/15_nvidia_gbm.json
/usr/share/glvnd/egl_vendor.d/10_nvidia.json
/usr/share/man/man1/nvidia-modprobe.1
/usr/share/man/man1/nvidia-settings.1
/usr/share/man/man1/nvidia-smi.1
/usr/share/man/man1/nvidia-xconfig.1
/usr/share/nvidia/nvidia-application-profiles-550.120-key-documentation
/usr/share/nvidia/nvidia-application-profiles-550.120-rc
/usr/share/pixmaps/nvidia-settings.png
/var/lib/nvidia/100
/var/lib/nvidia/dirs
/var/lib/nvidia/log

cuda-550.120.squashfs file list:

Code: Select all

/etc/OpenCL/vendors/nvidia.icd
/usr/bin/nvidia-cuda-mps-control
/usr/bin/nvidia-cuda-mps-server
/usr/lib/x86_64-linux-gnu/libOpenCL.so
/usr/lib/x86_64-linux-gnu/libOpenCL.so.1
/usr/lib/x86_64-linux-gnu/libOpenCL.so.1.0
/usr/lib/x86_64-linux-gnu/libOpenCL.so.1.0.0
/usr/lib/x86_64-linux-gnu/libcuda.so
/usr/lib/x86_64-linux-gnu/libcuda.so.1
/usr/lib/x86_64-linux-gnu/libcuda.so.550.120
/usr/lib/x86_64-linux-gnu/libcudadebugger.so.1
/usr/lib/x86_64-linux-gnu/libcudadebugger.so.550.120
/usr/lib/x86_64-linux-gnu/libnvcuvid.so
/usr/lib/x86_64-linux-gnu/libnvcuvid.so.1
/usr/lib/x86_64-linux-gnu/libnvcuvid.so.550.120
/usr/lib/x86_64-linux-gnu/libnvidia-encode.so
/usr/lib/x86_64-linux-gnu/libnvidia-encode.so.1
/usr/lib/x86_64-linux-gnu/libnvidia-encode.so.550.120
/usr/lib/x86_64-linux-gnu/libnvidia-nvvm.so
/usr/lib/x86_64-linux-gnu/libnvidia-nvvm.so.4
/usr/lib/x86_64-linux-gnu/libnvidia-nvvm.so.550.120
/usr/lib/x86_64-linux-gnu/libnvidia-opencl.so.1
/usr/lib/x86_64-linux-gnu/libnvidia-opencl.so.550.120
/usr/lib/x86_64-linux-gnu/libnvidia-pkcs11-openssl3.so.550.120
/usr/lib/x86_64-linux-gnu/libnvidia-pkcs11.so.550.120
/usr/lib/x86_64-linux-gnu/libnvidia-ptxjitcompiler.so
/usr/lib/x86_64-linux-gnu/libnvidia-ptxjitcompiler.so.1
/usr/lib/x86_64-linux-gnu/libnvidia-ptxjitcompiler.so.550.120
/usr/share/man/man1/nvidia-cuda-mps-control.1

Get updated nvidia.ids file from nvidia installer

nvidia-driver from debian slightly outdated.
I build module with fresh version from nvidia installer.
But it support some more adapters.
To allow linuxrc detect it automatically - need update
/usr/share/nvidia/nvidia.ids file.

I look at debian source of nvidia-graphics-drivers
rules file have code to do it:

Code: Select all

nv-readme.ids: unpack-stamp
	sed -r -n '/^Chapter [0-9]+\. GSP Firmware|^A1\. CURRENT NVIDIA GPUS|^A1\. NVIDIA GEFORCE GPUS/,/^Chapter|^Appendix|^Below/ s/^(.{41}|.{49}) ([0-9a-fA-F]{4})($$| .*)/10de\2/p' \
		NVIDIA-Linux/README.txt \
		| tr a-f A-F | sort -u > $@

Extract nvidia installer

Code: Select all

./NVIDIA-Linux-x86_64-550.120-no-compat32.run -x

Code: Select all

cd NVIDIA-Linux-x86_64-550.120-no-compat32
sed -r -n '/^Chapter [0-9]+\. GSP Firmware|^A1\. CURRENT NVIDIA GPUS|^A1\. NVIDIA GEFORCE GPUS/,/^Chapter|^Appendix|^Below/ s/^(.{41}|.{49}) ([0-9a-fA-F]{4})($$| .*)/10de\2/p' \
README.txt | tr a-f A-F | sort -u > nvidia.ids
cp nvidia.ids /usr/share/nvidia/nvidia.ids

Then can run /usr/local/cr-initrd/mkinitrd to create updated initrd.xz

I also copy updated /usr/share/nvidia/nvidia.ids to 05-customtools.squashfs module.

My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

gumanzoy
Posts: 93
Joined: Mon May 03, 2021 3:38 pm
Has thanked: 14 times
Been thanked: 18 times
Contact:

Re: My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

Post by gumanzoy »

New version 2024.11.05 uploaded. Files changed:

Code: Select all

live/01-filesystem.squashfs
live/05-customtools.squashfs
live/initrd1.xz
live/dk5/initrd1.xz
live/rootcopy/usr/local/bin/ddrescue-loop
live/rootcopy/usr/local/bin/installdog
live/rootcopy/usr/local/bin/instddog2win
live32/live/01-filesystem.squashfs
live32/live/initrd1.xz
installdog.sh

Added:

Code: Select all

live/firmware/firmware-20240909.squashfs
live/modules/chromium-130.0.6723.91.squashfs
live/modules/furmark-2.4.1.0.squashfs

My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

Clarity
Posts: 3842
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1632 times
Been thanked: 526 times

Re: My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

Post by Clarity »

Hello @gumanzoy

I am just getting around to revisiting this distro. I noticed you announced v1105.

I have looked on your site here: https://github.com/doglinux/book-worm/releases

But, I do not see your latest version. Has it been retired and will be replaced in next month's issue?

I have 3 nvidia Intel PCs and wanted to test and report ISO file booting experiences to you.

gumanzoy
Posts: 93
Joined: Mon May 03, 2021 3:38 pm
Has thanked: 14 times
Been thanked: 18 times
Contact:

Re: My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

Post by gumanzoy »

Clarity wrote: Thu Nov 21, 2024 6:51 am

I have looked on your site here: https://github.com/doglinux/book-worm/releases

Hi

It is not my site.

I prefer to make releases as liveusb tree not .iso file.

As i told before. Have 2 options to create .iso or boot from live folder.

gumanzoy wrote: Tue Oct 08, 2024 10:24 am

Annother way for create iso from liveusb tree described in iso_doglinux/iso_doglinux_readme_en.txt
Provided iso_doglinux/boot/grub/grub.cfg

Code: Select all

mv live* ./iso_doglinux
grub-mkrescue --locales= -volid DogLinux -o doglinux.iso ./iso_doglinux

Only grub2 without isolinux.
Can boot with Ventoy in normal mode. But need to enable VTOY_LINUX_REMOUNT option.

***
And for Ventoy i have better way to installation described in install_en.txt
By custom grub2 menu ventoy/ventoy_grub.cfg

Copy folders live live32 and ventoy to drive.
When boot Ventoy menu appears - press F6 to show DebianDog menu.

Thanks for your feedback. fredx181 update iso on github now.

My LiveUSB DogLinux Bookworm build for hardware testing (nvidia-drivers, GPUTest)

Post Reply

Return to “DebianDogs”