Bullseye build script

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

Moderator: fredx181

Post Reply
User avatar
rcrsn51
Posts: 1390
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 357 times

Re: Bullseye build script

Post by rcrsn51 »

I don't understand that. If you have removed a package from your system, the "upgrade" operation should not be trying to re-install it.

User avatar
puddlemoon
Posts: 189
Joined: Sun Sep 06, 2020 9:26 pm
Location: In between
Has thanked: 89 times
Been thanked: 64 times

Re: Bullseye build script

Post by puddlemoon »

Hi
So I rebuilt my sfs/iso with the newer script. ( not the newest with the uefi toggle, but the previous)
so far, just a handful of reboots but I have only seen the drive swap issue on the the liquorix kernel.
Both the included and the rt have been consistent so far. I will report if I see any other behaviour.

I will also report I find any porteus cheatcodes that don't work... :)

User avatar
Duprate
Posts: 309
Joined: Sat Aug 22, 2020 8:14 pm
Location: Southern Brazil
Has thanked: 163 times
Been thanked: 107 times

Re: Bullseye build script

Post by Duprate »

Hi Fred! I walk a little quiet. I adapted so well to Debian Dog Bullseye that I was speechless! I update the system whenever you make a new mklive-bullseye script available. As I use browsers in separate modules, I always remove Firefox-esr. However, this is not a problem but a private choice of mine.
Always have a lot of energy to continue this beautiful work. Good luck! :thumbup2:

Obs.: I am using the LZ4 file compression standard.
.Sfs modules (edited in linuxrc script (in initrd):
line 36 CFG = initrd;
line 304, 305,345, subscribe .squashfs to .sfs

Attachments
Bullseye.png
Bullseye.png (116.33 KiB) Viewed 2128 times
User avatar
Duprate
Posts: 309
Joined: Sat Aug 22, 2020 8:14 pm
Location: Southern Brazil
Has thanked: 163 times
Been thanked: 107 times

Re: Bullseye build script

Post by Duprate »

Hello? What silence! It must be a good sign. When everything is fine, nobody complains ...
DebianDog Bullseye ... My favorite!
Currently using Peebee's 5.11.6-lxpup64 kernel. Very good! :thumbup2:

Attachments
Kernel.png
Kernel.png (58.84 KiB) Viewed 2020 times
User avatar
fredx181
Posts: 3075
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 374 times
Been thanked: 1313 times
Contact:

Re: Bullseye build script

Post by fredx181 »

*** Updated packages: porteusbootscripts and sfsload ***

Some problems I found with the transition from "aufs" to "overlay" boot system, installing these packages should fix/improve things.

porteusbootscripts (1.1.0) changes and fixes:
ONLY for when booted with changes=EXIT: parameter (save changes at shutdown/demand only)
- Modified "snapmergepuppy" script (that takes care at copying files at shutdown)
Previously, unneeded "mask" files could be left over in the save storage, which could lead to problems, fixed now.
- Added a systemd service (saveatshutdown.service) for save at shutdown from console (dialog choice to save or not)
This is in case booted with systemd, as SparkyBonsai does (DebianDog derivative)

sfsload (1.0.9) changes and fixes:
- Added initscript (etc/init.d/sfsunload) that takes care of properly unloading (at shutdown) any manually loaded .squashfs or .sfs
Should run also when booted with systemd.

Install from synaptic or with apt:

Code: Select all

apt update
apt install porteusbootscripts sfsload

Added these packages also to the custom repository for Sid

Fred

User avatar
SparkyBonsai
Posts: 26
Joined: Sun Apr 04, 2021 2:41 pm
Been thanked: 5 times
Contact:

Re: Bullseye build script

Post by SparkyBonsai »

Tested the new sfsload on sparkybonsai, activates modules as expected BUT if you try to deactivate them (loadmodule -d) returns "ERROR: Module "..." is not currently activated".
The script checks at /mnt/live/memory/images/SFS for the mounted sfs folder which exists as expected. For some reason the new script doesn't detect it to deactivate it.

Edit: There is no problem, i made a mistake activating/deactivating sfs files with a similar filename. The script is crystal clear!

Edit2: The gtk-* buttons works only on icon themes with gtk button names. For Sparkybonsai using ultra-flat-icons doesn't work because there arent gtk-button names. Most recent themes supporting both Gtk/Qt doesnt include them too.

User avatar
Kennel Dweller
Posts: 42
Joined: Sat Sep 12, 2020 10:29 am
Location: England
Has thanked: 7 times
Been thanked: 1 time

Re: Bullseye build script

Post by Kennel Dweller »

It's all looking good and I've only broke it a few times recently so I must be learning something or remembering it.
Is there a way of getting rid of this annoying popup?
I also get one asking me to add a workspace when I push middle button on any blank screen, probably not an issue for most people but with hands like mine and a joystick mouse it's a real pain.
One more request but I doubt this can be granted xfce annoys me by telling me I am root user and could damage my system, like I don't know.
Beer time now have a nice day.

Screenshot_2021-04-19_13-16-37.png
Screenshot_2021-04-19_13-16-37.png (77.53 KiB) Viewed 1891 times
User avatar
Kennel Dweller
Posts: 42
Joined: Sat Sep 12, 2020 10:29 am
Location: England
Has thanked: 7 times
Been thanked: 1 time

Re: Bullseye build script

Post by Kennel Dweller »

I found a tickbox in terminal preferences to get rid of unsafe paste popup, hope it works unticking it.
I still have the add a workspace on middle button and found no useful help online to disable that as yet.

Screenshot_2021-04-20_11-16-36.png
Screenshot_2021-04-20_11-16-36.png (17.49 KiB) Viewed 1880 times
dancytron
Posts: 722
Joined: Fri Dec 13, 2019 6:26 pm
Has thanked: 520 times
Been thanked: 217 times

Re: Bullseye build script

Post by dancytron »

How hard would it be to make a version of Bullseye that ran on a 4.9.x/Stretch era kernel?

(My desktop computer doesn't work with anything later than Stretch because the kernel errors out on boot.)

User avatar
fredx181
Posts: 3075
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 374 times
Been thanked: 1313 times
Contact:

Re: Bullseye build script

Post by fredx181 »

dancytron wrote: Wed Apr 21, 2021 3:35 pm

How hard would it be to make a version of Bullseye that ran on a 4.9.x/Stretch era kernel?

(My desktop computer doesn't work with anything later than Stretch because the kernel errors out on boot.)

Very easy, just download and extract kernel-stretch-amd64.tar.gz https://debiandog.github.io/MakeLive/ke ... d64.tar.gz in "live". I didn't test with Bullseye, but I guess it should work .

Fred

dancytron
Posts: 722
Joined: Fri Dec 13, 2019 6:26 pm
Has thanked: 520 times
Been thanked: 217 times

Re: Bullseye build script

Post by dancytron »

That worked.

Thanks...

User avatar
fredx181
Posts: 3075
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 374 times
Been thanked: 1313 times
Contact:

Re: Bullseye build script

Post by fredx181 »

fredx181 wrote: Wed Apr 21, 2021 5:04 pm
dancytron wrote: Wed Apr 21, 2021 3:35 pm

How hard would it be to make a version of Bullseye that ran on a 4.9.x/Stretch era kernel?

(My desktop computer doesn't work with anything later than Stretch because the kernel errors out on boot.)

Very easy, just download and extract kernel-stretch-amd64.tar.gz https://debiandog.github.io/MakeLive/ke ... d64.tar.gz in "live". I didn't test with Bullseye, but I guess it should work .

Fred

On second thought, this way might be a little problematic as with the Stretch kernel you're booting with aufs (rather than overlay).
Probably a workaround is to install on Bullseye: porteusbootscripts and sfsload from Stretch (aufs supported).
This to make save-on-exit and sfsload on-the-fly work properly then.

Fred

dancytron
Posts: 722
Joined: Fri Dec 13, 2019 6:26 pm
Has thanked: 520 times
Been thanked: 217 times

Re: Bullseye build script

Post by dancytron »

fredx181 wrote: Sun Apr 25, 2021 8:59 am
fredx181 wrote: Wed Apr 21, 2021 5:04 pm
dancytron wrote: Wed Apr 21, 2021 3:35 pm

How hard would it be to make a version of Bullseye that ran on a 4.9.x/Stretch era kernel?

(My desktop computer doesn't work with anything later than Stretch because the kernel errors out on boot.)

Very easy, just download and extract kernel-stretch-amd64.tar.gz https://debiandog.github.io/MakeLive/ke ... d64.tar.gz in "live". I didn't test with Bullseye, but I guess it should work .

Fred

On second thought, this way might be a little problematic as with the Stretch kernel you're booting with aufs (rather than overlay).
Probably a workaround is to install on Bullseye: porteusbootscripts and sfsload from Stretch (aufs supported).
This to make save-on-exit and sfsload on-the-fly work properly then.

Fred

That makes some of the things I saw make sense. I'll try to test it real quick on the little test environment I used some time this week.

For completeness, I am running Stretch with systemd enabled AND with the Bullseye version "My Squash Loader" installed.

I will build the environment I really want to use and then go through and document/test everything properly, but probably not anytime too soon since Stretch is working fine for me.

User avatar
rcrsn51
Posts: 1390
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 357 times

Re: Bullseye build script

Post by rcrsn51 »

dancytron wrote: Wed Apr 21, 2021 3:35 pm

(My desktop computer doesn't work with anything later than Stretch because the kernel errors out on boot.)

What kind of errors?

In my experience, the most likely culprit is a video problem. Have you tried a fallback driver like vesa or framebuffer?

dancytron
Posts: 722
Joined: Fri Dec 13, 2019 6:26 pm
Has thanked: 520 times
Been thanked: 217 times

Re: Bullseye build script

Post by dancytron »

rcrsn51 wrote: Mon Apr 26, 2021 5:33 pm
dancytron wrote: Wed Apr 21, 2021 3:35 pm

(My desktop computer doesn't work with anything later than Stretch because the kernel errors out on boot.)

What kind of errors?

In my experience, the most likely culprit is a video problem. Have you tried a fallback driver like vesa or framebuffer?

I took a picture of the error. That's actually Buster Dog, but that's all I had setup ahead of time, and it's the same error as far as I can tell.

I haven't tried any fallbacks. TBH, I just accepted it as a hardware issue with later kernels.

edit:

This is my computer. It only cost $40 so I'm not too sad that it can't run later kernels.

"HP 8000 ELITE Desktop PC - Intel E8400 Core 2 Duo 3.0GHz CPU - 250GB HDD - 4GB RAM - DVDROM"

edit again: obviously that's not the computer in the picture. The screen is one of the all-in-one computers with an external VGA input.

01-error.jpg
01-error.jpg (153.57 KiB) Viewed 2142 times
darry19662018
Posts: 453
Joined: Sat Dec 14, 2019 12:24 am
Has thanked: 54 times
Been thanked: 65 times

Re: Bullseye build script

Post by darry19662018 »

Hi Fred,

Thank you for this a lot of fun to use - making a minimal jwm setup.

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

Re: Bullseye build script

Post by gumanzoy »

Hi Fred. Many thanks for your work.

Pls add exfat to initrdport-bullseye.tar.gz/modlist to make porteus initrd can boot from exfat USB drive.
As exfat in main kernel tree from version 5.7, and have in bullseye kernel 5.10 modules tree.

I extract initrd1.xz. Edit modlist, copy exfat module, run

Code: Select all

depmod -b /root/initrd1

Pack it back.

Code: Select all

find . -print | cpio -o -H newc 2>/dev/null | xz -f --extreme --check=crc32 > ../initrd1.xz

And its boot fine.

Attachments
porteus-livedbg.txt
success boot from exfat USB drive
(524 Bytes) Downloaded 52 times
alexmartin
Posts: 9
Joined: Tue May 04, 2021 12:11 pm

Re: Bullseye build script

Post by alexmartin »

Hi
I am using mklive-bullseye64 script first time. Downloaded it today.

I get following error.

mv: cannot stat '/opt/tmp/saveatshutdown.service': No such file or directory
dpkg: error processing package porteusbootscripts (--configure):

in bullseye/apt/archives folder porteusbootscripts_1.1.0_all.deb file is available.

Code: Select all

xterm is already the newest version (366-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up porteusbootscripts (1.1.0) ...
mv: cannot stat '/opt/tmp/saveatshutdown.service': No such file or directory
dpkg: error processing package porteusbootscripts (--configure):
 installed porteusbootscripts package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of sfsload:
 sfsload depends on porteusbootscripts; however:
  Package porteusbootscripts is not configured yet.

dpkg: error processing package sfsload (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 porteusbootscripts
 sfsload
E: Sub-process /usr/bin/dpkg returned an error code (1)
FAILED
Unmounting mount binds in chroot
gumanzoy
Posts: 91
Joined: Mon May 03, 2021 3:38 pm
Has thanked: 14 times
Been thanked: 18 times
Contact:

Re: Bullseye build script

Post by gumanzoy »

alexmartin wrote: Tue May 04, 2021 12:25 pm

Hi
I am using mklive-bullseye64 script first time. Downloaded it today.

I get following error.

mv: cannot stat '/opt/tmp/saveatshutdown.service': No such file or directory
dpkg: error processing package porteusbootscripts (--configure):

in bullseye/apt/archives folder porteusbootscripts_1.1.0_all.deb file is available.

Code: Select all

xterm is already the newest version (366-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up porteusbootscripts (1.1.0) ...
mv: cannot stat '/opt/tmp/saveatshutdown.service': No such file or directory
dpkg: error processing package porteusbootscripts (--configure):
 installed porteusbootscripts package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of sfsload:
 sfsload depends on porteusbootscripts; however:
  Package porteusbootscripts is not configured yet.

dpkg: error processing package sfsload (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 porteusbootscripts
 sfsload
E: Sub-process /usr/bin/dpkg returned an error code (1)
FAILED
Unmounting mount binds in chroot

I have same problem when i run mklive-bullseye script in Ubuntu 18.04.
Problem with postinst script in porteusbootscripts_1.1.0_all.deb

Code: Select all

if [ -n "$(pidof systemd)" ]; then
systemctl daemon-reload
systemctl enable saveatshutdown.service
systemctl start saveatshutdown.service
fi

It try to detect systemd and make changes to work with.
But we no have systemd in chroot. And have running systemd in host system.
As workaround i make symlink. Need to run mklive-bullseye script and wait for debootstrap done.

Code: Select all

ln -s /bin/true path_to_chroot/bin/systemctl

And remove it when build script paused before run mksquashfs

Need to fix systemd detection method in porteusbootscripts_1.1.0_all.deb.

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

alexmartin
Posts: 9
Joined: Tue May 04, 2021 12:11 pm

Re: Bullseye build script

Post by alexmartin »

Hi gumanzoy

Thanks for your reply

gumanzoy wrote: Tue May 04, 2021 1:34 pm
alexmartin wrote: Tue May 04, 2021 12:25 pm

Hi
I am using mklive-bullseye64 script first time. Downloaded it today.

I get following error.

mv: cannot stat '/opt/tmp/saveatshutdown.service': No such file or directory
dpkg: error processing package porteusbootscripts (--configure):

in bullseye/apt/archives folder porteusbootscripts_1.1.0_all.deb file is available.

I have same problem when i run mklive-bullseye script in Ubuntu 18.04.
Problem with postinst script in porteusbootscripts_1.1.0_all.deb

Code: Select all

if [ -n "$(pidof systemd)" ]; then
systemctl daemon-reload
systemctl enable saveatshutdown.service
systemctl start saveatshutdown.service
fi

I repackaged porteusbootscripts_1.1.0_all.deb with following change in bullseye/...

Code: Select all

#if [ -n "$(pidof systemd)" ]; then
#systemctl daemon-reload
#systemctl enable saveatshutdown.service
#systemctl start saveatshutdown.service
#fi
User avatar
fredx181
Posts: 3075
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 374 times
Been thanked: 1313 times
Contact:

Re: Bullseye build script

Post by fredx181 »

Yes, it fails when running the build from a OS with systemd enabled (didn't test with that earlier).
@alexmartin Can you try again?, I've updated the porteusbootscripts package (1.1.1) in the repo with a fix and should be OK now.
@gumanzoy Thanks for the pointer about systemd.
Answering your question about exfat support, I'll look into it when I have time.
I prefer not to update the mklive script and appimages, so need to find another way, not sure how yet.

Fred

User avatar
fredx181
Posts: 3075
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 374 times
Been thanked: 1313 times
Contact:

Re: Bullseye build script

Post by fredx181 »

@gumanzoy
I've added exfat support now (by modifying dog-boot-bullseye*.tar.gz and initrdport-bullseye.tar.gz)
Btw, out of curiosity, what's the advantage of exfat ?
Looks like it's not supported by grub4dos, tested with GRUB2 and it booted OK.

Fred

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

Re: Bullseye build script

Post by gumanzoy »

fredx181 wrote: Tue May 04, 2021 7:49 pm

Btw, out of curiosity, what's the advantage of exfat ?
Looks like it's not supported by grub4dos, tested with GRUB2 and it booted OK.

It used by default in Ventoy boot manager https://github.com/ventoy/Ventoy. based on grub2
exfat support files above 4Gb, support in Windows and not journalled - better than ntfs for lifetime for cheap USB flash drives
Most time i use small USB flash with fat32, and boot with syslinux and systemd-boot (gummiboot) for UEFI.
But for 64-128Gb flash i can choose exfat.

Thanks.

I have another suggestion. I use modules copy method from linux-live/Slax initramfs_create.
https://github.com/Tomas-M/linux-live/b ... mfs_create
Instead of
# copy lib/modules from /var/tmp/mkinitramfs_* to /tmp/initrdport-bullseye/
cp -a /var/tmp/mkinitramfs_*/lib/modules/* /tmp/initrdport-bullseye/lib/modules/

And initrd1.xz make a half smaller. It can be impact on boot speed for early stage for old pre-UEFI BIOS computers.

Code: Select all

#!/bin/bash
# Create initramfs image
# Author: Tomas M <http://www.linux-live.org/>
#

#cd /tmp
#wget --no-check-certificate https://raw.githubusercontent.com/DebianDog/MakeLive/gh-pages/initrdport-bullseye.tar.gz
#tar -zxf initrdport-bullseye.tar.gz
#cd /tmp/initrdport-bullseye

INITRAMFS=/tmp/initrdport-bullseye
#KERNEL=5.10.0-6-amd64
KERNEL=$(ls /lib/modules/)
LMK="lib/modules/$KERNEL"

# copy file to initramfs tree, including
# all library dependencies (as shown by ldd)
# $1 = file to copy (full path)
copy_including_deps()
{
   # if source doesn't exist or target exists, do nothing
   if [ ! -e "$1" -o -e "$INITRAMFS"/"$1" ]; then
      return
   fi

   cp -R --parents "$1" "$INITRAMFS"
   if [ -L "$1" ]; then
      DIR="$(dirname "$1")"
      LNK="$(readlink "$1")"
      copy_including_deps "$(cd "$DIR"; realpath -s "$LNK")"
   fi

   ldd "$1" 2>/dev/null | sed -r "s/.*=>|[(].*//g" | sed -r "s/^\\s+|\\s+\$//" \
     | while read LIB; do
        copy_including_deps "$LIB"
     done

   for MOD in $(find "$1" -type f | grep .ko); do
      for DEP in $(cat /$LMK/modules.dep | fgrep /$(basename $MOD):); do
         copy_including_deps "/$LMK/$DEP"
      done
   done

   shift
   if [ "$1" != "" ]; then
       copy_including_deps "$@"
   fi
}

#copy_including_deps /usr/bin/strace
#copy_including_deps /usr/bin/lsof

#copy_including_deps /$LMK/kernel/fs/aufs
copy_including_deps /$LMK/kernel/fs/overlayfs
copy_including_deps /$LMK/kernel/fs/exfat
copy_including_deps /$LMK/kernel/fs/ext2
#copy_including_deps /$LMK/kernel/fs/ext3
copy_including_deps /$LMK/kernel/fs/ext4
copy_including_deps /$LMK/kernel/fs/fat
copy_including_deps /$LMK/kernel/fs/nls
copy_including_deps /$LMK/kernel/fs/fuse
copy_including_deps /$LMK/kernel/fs/isofs
copy_including_deps /$LMK/kernel/fs/ntfs
copy_including_deps /$LMK/kernel/fs/reiserfs
copy_including_deps /$LMK/kernel/fs/squashfs

# crc32c is needed for ext4, but I don't know which one, add them all, they are small
find /$LMK/kernel/ | grep crc32c | while read LINE; do
   copy_including_deps $LINE
done

copy_including_deps /$LMK/kernel/drivers/staging/zsmalloc # needed by zram
copy_including_deps /$LMK/kernel/drivers/block/zram
copy_including_deps /$LMK/kernel/drivers/block/loop.*

# usb drivers
copy_including_deps /$LMK/kernel/drivers/usb/storage/usb-storage.*
copy_including_deps /$LMK/kernel/drivers/usb/host
copy_including_deps /$LMK/kernel/drivers/usb/common
copy_including_deps /$LMK/kernel/drivers/usb/core
copy_including_deps /$LMK/kernel/drivers/hid/usbhid
copy_including_deps /$LMK/kernel/drivers/hid/hid.*
copy_including_deps /$LMK/kernel/drivers/hid/uhid.*
copy_including_deps /$LMK/kernel/drivers/hid/hid-generic.*

# disk and cdrom drivers
copy_including_deps /$LMK/kernel/drivers/cdrom
copy_including_deps /$LMK/kernel/drivers/scsi/sr_mod.*
copy_including_deps /$LMK/kernel/drivers/scsi/sd_mod.*
copy_including_deps /$LMK/kernel/drivers/scsi/scsi_mod.*
copy_including_deps /$LMK/kernel/drivers/scsi/sg.*
copy_including_deps /$LMK/kernel/drivers/ata
copy_including_deps /$LMK/kernel/drivers/nvme
copy_including_deps /$LMK/kernel/drivers/mmc

# network support drivers
#if [ "$NETWORK" = "true" ]; then
   # add all known ethernet drivers
   copy_including_deps /$LMK/kernel/drivers/net/ethernet
   copy_including_deps /$LMK/kernel/fs/nfs
#fi

# copy all custom-built modules
#copy_including_deps /$LMK/updates

copy_including_deps /$LMK/modules.*

# trim modules.order file. Perhaps we could remove it entirely
MODULEORDER="$(cd "$INITRAMFS/$LMK/"; find -name "*.ko" | sed -r "s:^./::g" | tr "\n" "|" | sed -r "s:[.]:.:g")"
cat $INITRAMFS/$LMK/modules.order | sed -r "s/.ko.gz\$/.ko/" | grep -E "$MODULEORDER"/foo/bar > $INITRAMFS/$LMK/_
mv $INITRAMFS/$LMK/_ $INITRAMFS/$LMK/modules.order

depmod -b $INITRAMFS $KERNEL

mv -f /tmp/initrdport-bullseye/modlist /tmp/initrdport-bullseye/modlist.tmp 2> /dev/null

## Create modlist in /tmp/initrdport-bullseye (then modprobe only existing modules at boot, faster)
for m in $(cat /tmp/initrdport-bullseye/modlist.tmp 2> /dev/null); do
modprobe -S $KERNEL -d /tmp/initrdport-bullseye/ -Dq $m | grep -v builtin > /dev/null 2> /dev/null
[ $? -eq 0 ] && echo -n "$m "  >> /tmp/initrdport-bullseye/modlist
done
rm /tmp/initrdport-bullseye/modlist.tmp

find . -print | cpio -o -H newc 2>/dev/null | xz -f --extreme --check=crc32 > ../initrd1.xz

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

User avatar
fredx181
Posts: 3075
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 374 times
Been thanked: 1313 times
Contact:

Re: Bullseye build script

Post by fredx181 »

gumanzoy wrote:

I have another suggestion. I use modules copy method from linux-live/Slax initramfs_create

Well, I've tried that in the past, looked promising, but found (rcrsn51 did some tests with different hardware back then) that it won't boot in some cases e.g. from USB3, eMMC, so I went back to using the more "safe" mkinitramfs method.

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

Re: Bullseye build script

Post by Clarity »

Hello @gumanzoy. Saw the last 2 post on this thread and offer some info.

Ventoy can be made to run on other filesystem vs exFAT. Its not too difficult to change the filesystem on the booting USB while maintaining the boot expectations. It is described on the Ventoy forum.

The reason that author uses exFat is because of his view of the OS world which includes MACs & Windows; namely flexibility.

As for the DOG/PUP community, you will find implementations of almost every filesystem known to man. EAch author, here, can choose the FS he wants to enHello @gumanzoy. Saw the last 2 post on this thread and offer some info.

Ventoy can be made to run on other filesystem vs exFAT. Its not too difficult to change the filesystem on the booting USB while maintaining the boot expectations. It is described on the Ventoy forum.

The reason that author uses exFat is because of his view of the OS world which includes MACs & Windows; namely flexibility.

As for the DOG/PUP community, you will find implementations of almost every filesystem known to man. EAch author, here, can choose the FS he wants to enclose when building.

I prefer to use SG2D versus Ventoy for its simplicity in PUP-DOG ISO boots.

BTW, @gumanzoy you can ALSO add the SG2D ISO to a Ventoy USB and have the luxury of using either to boot ISO files to desktop. To insure compatibility with BOTH, PLEASE put all your ISO files in a folder on the USB named BOOTISOS. This way both Ventoy and SG2D's ISO will find all the ISOs and present them for booting. SG2D gets past some of the few issues that arise in Ventoy when attempting to boot some PUP ISOs. In that case, you boot the USB and on the Ventoy menu, select SGbuild-x86_64-slackware64-15.0-112D and it will find and list the same ISOs: And the problematic "Ventoy boot" for some of the ISOs, disappear.

An example of a Ventoy boot process using USB with a ext4 format vs exFat

PC boot process.png
PC boot process.png (18.3 KiB) Viewed 2258 times

This is presently tested. Hope this clears some concepts.

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

Re: Bullseye build script

Post by gumanzoy »

Clarity wrote: Wed May 05, 2021 9:30 pm

Ventoy can be made to run on other filesystem vs exFAT. Its not too difficult to change the filesystem on the booting USB while maintaining the boot expectations.

Hi.

I use Ventoy formatted to ntfs to boot several different Windows isos from usb hdd. ext4 is not suitable for this.
And i don't make DebianDog iso. I boot it directly from live folder on usb. Its advantage of porteus initrd can add or edit files to rootcopy and don't need rebuild iso.
For Ventoy i use grub menu extension /ventoy/ventoy_grub.cfg. Press F6 to show

Code: Select all

submenu 'DebianDog Linux -->' --class=customsub {        
    menuentry "DebianDog 64bit Linux" --class=custom {
        echo 'Loading ...'
        set root=${vtoy_iso_part}
        linux /live/vmlinuz1 \
        noauto nocd from=/ extramod=/live/firmware mitigations=off nvme_core.default_ps_max_latency_us=5500
        initrd /live/initrd1.xz
    }
    
    menuentry "DebianDog 64bit Linux Copy to RAM" --class=custom {
        echo 'Loading ...'
        set root=${vtoy_iso_part}
        linux /live/vmlinuz1 \
        copy2ram noauto nocd from=/ extramod=/live/firmware mitigations=off nvme_core.default_ps_max_latency_us=5500
        initrd /live/initrd1.xz
    }
    
    menuentry '<-- Return to previous menu [Esc]' --class=vtoyret VTOY_RET {
        echo 'Return ...'
    }
}

menuentry '<-- Return to previous menu [Esc]' --class=vtoyret VTOY_RET {
    echo 'Return ...'
}
fredx181 wrote: Wed May 05, 2021 7:30 pm
gumanzoy wrote:

I have another suggestion. I use modules copy method from linux-live/Slax initramfs_create

Well, I've tried that in the past, looked promising, but found (rcrsn51 did some tests with different hardware back then) that it won't boot in some cases e.g. from USB3, eMMC, so I went back to using the more "safe" mkinitramfs method.

I think list of modules to copy by Slax method need to be revised compare to initrdport-bullseye.tar.gz/modlist.
I tested USB3.0 works. I add fs/overlayfs for bullseye and fs/nfs for boot from PXE

Add mmc drivers
Tomas-M committed on Oct 14, 2019

Add nvme driver to initrd
Tomas-M committed on Apr 28, 2019

Before i build Slax based on Debian 10 and build linux 5.5 from debian sources + aufs git.
Use it for 1 year maybe. In service center i boot it every day many times on lot of legacy and recent PC and notebooks.
Now i look to replace Slax because lack of aufs support in Debian kernels. And i find DebianDog + Porteus initrd is great !
I build modules for Geeks3D GpuTest and nvidia drivers legacy 340, 390, 460-current and can choose what driver to load. Already tested on corresponding hardware.

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

alexmartin
Posts: 9
Joined: Tue May 04, 2021 12:11 pm

Re: Bullseye build script

Post by alexmartin »

Hi,

It works.

fredx181 wrote: Tue May 04, 2021 3:49 pm

Yes, it fails when running the build from a OS with systemd enabled (didn't test with that earlier).
@alexmartin Can you try again?, I've updated the porteusbootscripts package (1.1.1) in the repo with a fix and should be OK now.
@gumanzoy Thanks for the pointer about systemd.
Answering your question about exfat support, I'll look into it when I have time.
I prefer not to update the mklive script and appimages, so need to find another way, not sure how yet.

Fred

During build I get following messages.

Code: Select all

setupcon is missing. Please install the 'console-setup' package.

W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168e-1.fw for module r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168d-2.fw for module r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168d-1.fw for module r8169

W: Possible missing firmware /lib/firmware/i915/icl_dmc_ver1_09.bin for module i915
W: Possible missing firmware /lib/firmware/i915/tgl_dmc_ver2_08.bin for module i915
W: Possible missing firmware /lib/firmware/i915/rkl_dmc_ver2_02.bin for module i915

Alex

User avatar
fredx181
Posts: 3075
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 374 times
Been thanked: 1313 times
Contact:

Re: Bullseye build script

Post by fredx181 »

alexmartin wrote: Thu May 06, 2021 10:08 am

Hi,

During build I get following messages.
....

Alex

Yes, I get similar warnings and just ignore them.
However when adding package to install list : firmware-misc-nonfree, then I don't see those warnings.

Fred

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

Re: Bullseye build script

Post by gumanzoy »

@fredx181

Hi.

You test boot porteus initrd from PXE ?
I try and it's not work. But i fix it. I made patch for initrdport-bullseye/linuxrc

Code: Select all

--- linuxrc	2021-01-18 17:48:18.000000000 +0500
+++ linuxrcnew	2021-05-08 20:30:11.163768000 +0500
@@ -75,9 +75,11 @@
 # Find *.cfg file:
 echo $i"searching for $CFG file"
 if [ $IP ]; then BOOTDEV=network; CFGDEV=/mnt/nfs
+#   softdep for r8169 https://bugzilla.kernel.org/show_bug.cgi?id=204343
+    modprobe realtek 2>/dev/null
     for x in `lspci | grep 0200: | cut -d: -f3-4 | sed s/:/.*/g | tr a-z A-Z`; do modprobe `grep $x /lib/modules/$(uname -r)/modules.alias | tail -n1 | rev | cut -d" " -f1 | rev` 2>/dev/null; done
     ls /sys/class/net | grep -q eth || { for x in `find /lib/modules/$(uname -r)/kernel/drivers/net -name "*.ko" | sed 's/.ko//g'`; do modprobe `basename $x` 2>/dev/null; ls /sys/class/net | grep -q eth && break || modprobe -r `basename $x` 2>/dev/null; done; }
-    mkdir -p /mnt/nfs/porteus /mnt/nfs/storage; udhcpc; modprobe nfsv4; mount -t nfs4 $IP:/srv/pxe/porteus /mnt/nfs/porteus -o ro,nolock 2>/dev/null || { modprobe nfsv3; mount -t nfs $IP:/srv/pxe/porteus /mnt/nfs/porteus -o ro,nolock 2>/dev/null; }
+    mkdir -p /mnt/nfs/storage; udhcpc; modprobe nfsv4; mount -t nfs4 $IP:/srv/pxe /mnt/nfs -o ro,nolock 2>/dev/null || { modprobe nfsv3; mount -t nfs $IP:/srv/pxe /mnt/nfs -o ro,nolock 2>/dev/null; }
     MAC=`ifconfig | grep eth0 | cut -d: -f5-7 | sed s/://g | cut -d" " -f1`
     if [ "$CHANGES" = /srv/pxe/storage ]; then
 	if lsmod | grep -q nfsv3; then
@@ -86,6 +88,9 @@
 	    mount -t nfs4 $IP:/srv/pxe/storage /mnt/nfs/storage -o rw,nolock 2>/dev/null && { mkdir -p /mnt/nfs/storage/client-$MAC/changes/home; CHANGES="/storage/client-$MAC"; }
 	fi
     fi
+    if [ $FROM ]; then
+        FOLDER=$FROM/live
+    fi
 elif [ $ISO ]; then CFGDEV=/mnt/isoloop
     locate -e $FROM && { BOOTDEV=/mnt/$DEV; mkdir /mnt/isoloop; mount -o loop /mnt/$DEV/$LPTH /mnt/isoloop; ISOSRC=/mnt/$DEV/$LPTH; }
 else
@@ -452,7 +457,7 @@
 debug
 #if param copy2ram; then
 if param copy2ram; then
-    [ $CFGDEV = /mnt/isoloop -o $CFGDEV = /mnt/nfs ] && { umount `grep $CFGDEV /etc/mtab | sed -n 1p | cut -d" " -f2`; CFGDEV=$BOOTDEV; }
+    [ $CFGDEV = /mnt/isoloop -o $CFGDEV = /mnt/nfs ] && { umount `grep $CFGDEV /etc/mtab | sed -n 1p | cut -d" " -f2` 2>/dev/null; CFGDEV=$BOOTDEV; }
     CHNDISK=`echo $CHNDEV | cut -b6-8`; CFGDISK=`echo $CFGDEV | cut -b6-8`; REMOVABLE=`cat /sys/block/$CFGDISK*/removable 2>/dev/null`
     if [ -z "`egrep -o " noeject( |\$)" /etc/cmdline`" -a "$CHNDISK" != "$CFGDISK" ]; then
 	if [ "$REMOVABLE" = 1 ]; then

First i replace

Code: Select all

mount -t nfs $IP:/srv/pxe/porteus /mnt/nfs/porteus
mount -t nfs $IP:/srv/pxe /mnt/nfs

ethernet driver r8169 have softdep realtek module.

Code: Select all

softdep r8169 pre: realtek

But busybox modprobe from porteus initrd not support softdep. Add modprobe realtek manual
https://bugzilla.kernel.org/show_bug.cgi?id=204343

Code: Select all

modprobe realtek 2>/dev/null

If boot from PXE cheatcode from= just ignored. I add code to make possible to boot from separate folder.

Code: Select all

if [ $FROM ]; then
FOLDER=$FROM/live
fi

Add 2>/dev/null when umount after copy2ram

Code: Select all

[ $CFGDEV = /mnt/isoloop -o $CFGDEV = /mnt/nfs ] && { umount

My PXE setup: part of /etc/dnsmasq.conf

Code: Select all

# Enable dnsmasq's built-in TFTP server
enable-tftp

# Set the root directory for files available via FTP.
tftp-root=/srv/pxe

dhcp-match=set:efi-x86_64,option:client-arch,7
dhcp-match=set:efi-x86_64,option:client-arch,9
dhcp-match=set:bios,option:client-arch,0
dhcp-boot=tag:efi-x86_64,"syslinux.efi"
dhcp-boot=tag:bios,"pxelinux.0"

/etc/exports

Code: Select all

/srv/pxe	*(ro,crossmnt,no_subtree_check,all_squash,insecure,anonuid=1000,anongid=1000)

Code: Select all

ls -l /srv/pxe/
ldlinux.e64 -> /usr/lib/syslinux/modules/efi64/ldlinux.e64
live
live32
memdisk -> /usr/lib/syslinux/memdisk
pxelinux.0
pxelinux.cfg
syslinux.efi -> /usr/lib/SYSLINUX.EFI/efi64/syslinux.efi
syslinux.msg

pxelinux.cfg/default

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
  ipappend 1
label dog32ram
  kernel live32/live/vmlinuz1
  append initrd=live32/live/initrd1.xz copy2ram noauto nocd from=live32 extramod=/live/firmware mitigations=off
  ipappend 1
label dog
  kernel live/vmlinuz1
  append initrd=live/initrd1.xz noauto nocd extramod=/live/firmware mitigations=off nvme_core.default_ps_max_latency_us=5500
  ipappend 1
label dogram
  kernel live/vmlinuz1
  append initrd=live/initrd1.xz copy2ram noauto nocd extramod=/live/firmware mitigations=off nvme_core.default_ps_max_latency_us=5500
  ipappend 1
label dognv
  kernel live/vmlinuz1
  append initrd=live/initrd1.xz copy2ram modprobe.blacklist=nouveau load=nvidia noauto nocd extramod=/live/firmware mitigations=off nvme_core.default_ps_max_latency_us=5500
  ipappend 1
label dognv34
  kernel live/vmlinuz1
  append initrd=live/initrd1.xz copy2ram modprobe.blacklist=nouveau load=nv34 noauto nocd extramod=/live/firmware mitigations=off nvme_core.default_ps_max_latency_us=5500
  ipappend 1
label dognv39
  kernel live/vmlinuz1
  append initrd=live/initrd1.xz copy2ram modprobe.blacklist=nouveau load=nv39 noauto nocd extramod=/live/firmware mitigations=off nvme_core.default_ps_max_latency_us=5500
  ipappend 1

Fixed for PXE version of initramfs_create

Code: Select all

#!/bin/bash
# Create initramfs image
# Author: Tomas M <http://www.linux-live.org/>
#

#cd /tmp
#wget --no-check-certificate https://raw.githubusercontent.com/DebianDog/MakeLive/gh-pages/initrdport-bullseye.tar.gz
#tar -zxf initrdport-bullseye.tar.gz
#cd /tmp/initrdport-bullseye

INITRAMFS=/tmp/initrdport-bullseye
#KERNEL=5.10.0-6-amd64
KERNEL=$(ls /lib/modules/)
LMK="lib/modules/$KERNEL"

# copy file to initramfs tree, including
# all library dependencies (as shown by ldd)
# $1 = file to copy (full path)
copy_including_deps()
{
   # if source doesn't exist or target exists, do nothing
   if [ ! -e "$1" -o -e "$INITRAMFS"/"$1" ]; then
      return
   fi

   cp -R --parents "$1" "$INITRAMFS"
   if [ -L "$1" ]; then
      DIR="$(dirname "$1")"
      LNK="$(readlink "$1")"
      copy_including_deps "$(cd "$DIR"; realpath -s "$LNK")"
   fi

   ldd "$1" 2>/dev/null | sed -r "s/.*=>|[(].*//g" | sed -r "s/^\\s+|\\s+\$//" \
     | while read LIB; do
        copy_including_deps "$LIB"
     done

   for MOD in $(find "$1" -type f | grep .ko); do
      for DEP in $(cat /$LMK/modules.dep | fgrep /$(basename $MOD):); do
         copy_including_deps "/$LMK/$DEP"
      done
   done

   shift
   if [ "$1" != "" ]; then
       copy_including_deps "$@"
   fi
}

#copy_including_deps /usr/bin/strace
#copy_including_deps /usr/bin/lsof

#copy_including_deps /$LMK/kernel/fs/aufs
copy_including_deps /$LMK/kernel/fs/overlayfs
copy_including_deps /$LMK/kernel/fs/exfat
copy_including_deps /$LMK/kernel/fs/ext2
#copy_including_deps /$LMK/kernel/fs/ext3
copy_including_deps /$LMK/kernel/fs/ext4
copy_including_deps /$LMK/kernel/fs/fat
copy_including_deps /$LMK/kernel/fs/nls
copy_including_deps /$LMK/kernel/fs/fuse
copy_including_deps /$LMK/kernel/fs/isofs
copy_including_deps /$LMK/kernel/fs/ntfs
copy_including_deps /$LMK/kernel/fs/reiserfs
copy_including_deps /$LMK/kernel/fs/squashfs

# crc32c is needed for ext4, but I don't know which one, add them all, they are small
find /$LMK/kernel/ | grep crc32c | while read LINE; do
   copy_including_deps $LINE
done

copy_including_deps /$LMK/kernel/drivers/staging/zsmalloc # needed by zram
copy_including_deps /$LMK/kernel/drivers/block/zram
copy_including_deps /$LMK/kernel/drivers/block/loop.*

# usb drivers
copy_including_deps /$LMK/kernel/drivers/usb/storage/usb-storage.*
copy_including_deps /$LMK/kernel/drivers/usb/host
copy_including_deps /$LMK/kernel/drivers/usb/common
copy_including_deps /$LMK/kernel/drivers/usb/core
copy_including_deps /$LMK/kernel/drivers/hid/usbhid
copy_including_deps /$LMK/kernel/drivers/hid/hid.*
copy_including_deps /$LMK/kernel/drivers/hid/uhid.*
copy_including_deps /$LMK/kernel/drivers/hid/hid-generic.*

# disk and cdrom drivers
copy_including_deps /$LMK/kernel/drivers/cdrom
copy_including_deps /$LMK/kernel/drivers/scsi/sr_mod.*
copy_including_deps /$LMK/kernel/drivers/scsi/sd_mod.*
copy_including_deps /$LMK/kernel/drivers/scsi/scsi_mod.*
copy_including_deps /$LMK/kernel/drivers/scsi/sg.*
copy_including_deps /$LMK/kernel/drivers/ata
copy_including_deps /$LMK/kernel/drivers/nvme
copy_including_deps /$LMK/kernel/drivers/mmc

# network support drivers
#if [ "$NETWORK" = "true" ]; then
   # add all known ethernet drivers
   copy_including_deps /$LMK/kernel/drivers/net/phy/realtek.*
   copy_including_deps /$LMK/kernel/drivers/net/ethernet
   copy_including_deps /$LMK/kernel/fs/nfs
#fi

# copy all custom-built modules
#copy_including_deps /$LMK/updates

copy_including_deps /$LMK/modules.*

# trim modules.order file. Perhaps we could remove it entirely
MODULEORDER="$(cd "$INITRAMFS/$LMK/"; find -name "*.ko" | sed -r "s:^./::g" | tr "\n" "|" | sed -r "s:[.]:.:g")"
cat $INITRAMFS/$LMK/modules.order | sed -r "s/.ko.gz\$/.ko/" | grep -E "$MODULEORDER"/foo/bar > $INITRAMFS/$LMK/_
mv $INITRAMFS/$LMK/_ $INITRAMFS/$LMK/modules.order

depmod -b $INITRAMFS $KERNEL

mv -f /tmp/initrdport-bullseye/modlist /tmp/initrdport-bullseye/modlist.tmp 2> /dev/null

## Create modlist in /tmp/initrdport-bullseye (then modprobe only existing modules at boot, faster)
for m in $(cat /tmp/initrdport-bullseye/modlist.tmp 2> /dev/null); do
modprobe -S $KERNEL -d /tmp/initrdport-bullseye/ -Dq $m | grep -v builtin > /dev/null 2> /dev/null
[ $? -eq 0 ] && echo -n "$m "  >> /tmp/initrdport-bullseye/modlist
done
rm /tmp/initrdport-bullseye/modlist.tmp

find . -print | cpio -o -H newc 2>/dev/null | xz -f --extreme --check=crc32 > ../initrd1.xz

Attachments
linuxrcpxe.patch.txt
linuxrc PXE fix patch
(2.42 KiB) Downloaded 61 times

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

User avatar
fredx181
Posts: 3075
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 374 times
Been thanked: 1313 times
Contact:

Re: Bullseye build script

Post by fredx181 »

Hi gumanzoy , nice job!
I know very little about PXE boot, so I couldn't have done it, many thanks for fixing! Also for the detailed info.

I didn't test PXE, but I trust that you know what you're doing, so I re-uploaded initrdport-bullseye.tar.gz with the patched linuxrc included.

Fred

Post Reply

Return to “DebianDogs”