The officially official Devuan Forum!

You are not logged in.

#1 2025-04-28 19:31:03

dzz
Member
From: Exmouth, South West England
Registered: 2016-12-01
Posts: 73  

Initramfs changes in Excalibur + refracta2usb

Refracta2usb remains, for me, the best tool to create a live usb. It is in need of some maintenance however.

Newer initrd layouts (excalibur>) place the kernel modules (now individually compressed) in a separate,
uncompressed cpio archive to which is concatenated to the main compressed cpio. Previously this was all lumped together. Also, if you have cpu microcode installed that will also be placed in separate, uncompressed and concatenated cpio archives. Plus live-boot (to be patched) is now version 20250225 for excalibur.

This breaks the patch_initrd function in refracta2usb which enables RW access to the partition containing the live-media. It's particular useful for a usb pen and various debugging activities.

Here's a list of those and some other changes I made here for refracta2usb. Not in any "official" capacity. Primarily for my own use but others may be interested. Starting with the most recent refracta2usb, newest changes first.

  * Update patch-initrd for live-boot 20250225 (Excalibur).
  * Support patch initramfs with multiple cpio's.

  * Fix chown failure on vfat.
  * Move PATH addition /opt/trinity/bin to main script.
  * Fix failure to delete loop device.
  * Fix failure to umount.
  * Tidy up some script comments.

  * Set USB mount options for user rw access.
  * Open file manager/editor instances as user not root.
  * Remove dialog references to root editor and file manager.
  * Include /opt/trinity/bin/kwrite as editor option.
  * Include final check and warning for USB umount failure.

  * Trinity Desktop will crash if kwrite is called from root:
  * Add extra launcher to suit TDE (shown only in TDE).
  * Add adwaita-icon-theme to recommends (cosmetic only).
  * Add --progress to all rsync commands in main script.
  * Fix root owned logfile in user's $HOME

  * Sort Lintian errors:
  * Add lintian override to suppress refracta2usb.desktop warning
  * Create basic man page (incomplete as yet).
  * Add "extended description" to debian/control.
  * Remove executable flag on some text files.

  * Remove deprecated "snapshot2usb" title references.
  * Add option to set debug mode in conf file
  * Package as "Debian Native" with full source tarball.

I haven't got round to proper testing yet in all scenarios but seems good so far.

If anyone is interested I can post later, somewhere, the result. Maybe someone else could test it and write back. Maybe the next official version can use some of this.

Offline

#2 2025-04-28 22:07:47

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,650  

Re: Initramfs changes in Excalibur + refracta2usb

Thank you! I've been dreading touching that script to make any changes. I can test it. I'm using it frequently now that I'm making excalibur isos. Maybe we should both put what we have on git.devuan.org for merging the changes.

Offline

#3 2025-04-29 11:29:08

dzz
Member
From: Exmouth, South West England
Registered: 2016-12-01
Posts: 73  

Re: Initramfs changes in Excalibur + refracta2usb

Now posted here:

https://exegnulinux.net/files/refracta2usb/

No guarantees those changes are all good, till well tested in different scenarios. It's a work in progress with Excalibur in mind but should be compatible with at least daedalus.

The git repo is a great idea. For now, maybe take a diff against the extracted, original refracta2usb-2.4.3.deb to highlight the changes.

Thanks in advance anyone who wants to test but please be warned this stuff runs as root and is experimental so far.

And thanks especially fsmithred for this and the other superb refracta tools!

Last edited by dzz (2025-04-29 11:37:07)

Offline

#4 2025-04-29 13:59:16

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,650  

Re: Initramfs changes in Excalibur + refracta2usb

Looks good in meld. I haven't tried it yet.

Don't know if this helps, but refractasnapshot now uses unmkinitramfs to extract initrd. It's simpler code. Here's the relevant commit.
https://git.devuan.org/devuan/refractas … 7d53f7d9d8

Offline

#5 2025-04-29 15:11:19

dzz
Member
From: Exmouth, South West England
Registered: 2016-12-01
Posts: 73  

Re: Initramfs changes in Excalibur + refracta2usb

unmkinitramfs version in excalibur doesn't extract as it was built (normally by update-initramfs).  Kernel modules (already compressed) are in an uncompressed "early" cpio, prepended to the compressed "main" cpio.. However  excalibur's unmkinitramfs extracts it to the "main".

The daedalus version does work as expected.

Unless I missed something, that's probably unsuitable for our purposes and maybe breaks something. I used a custom script, not wanting to rely on a deprecated version of what's probably not actually designed for our purposes..

Offline

#6 2025-04-29 15:12:42

greenjeans
Member
Registered: 2017-04-07
Posts: 954  
Website

Re: Initramfs changes in Excalibur + refracta2usb

Count me in on testing, downloading now.


https://sourceforge.net/projects/vuu-do/ New Vuu-do isos uploaded April 2025!
Vuu-do GNU/Linux, minimal Devuan-based Openbox and Mate systems to build on. Also a max version for OB.
Devuan 5 mate-mini iso, pure Devuan, 100% no-vuu-do. wink Devuan 6 version also available for testing.
Please donate to support Devuan and init freedom! https://devuan.org/os/donate

Offline

#7 2025-04-29 15:47:56

dzz
Member
From: Exmouth, South West England
Registered: 2016-12-01
Posts: 73  

Re: Initramfs changes in Excalibur + refracta2usb

That change calls mkinitramfs. It doesn't seem to work on an extracted directory. I tried it on an extracted excalibur initrd.img (while in daedalus). The output, when itself extracted, had files from my running system, not what was expected! And I see nothing in it's man page that mentions input from a directory.

EDIT: Of course, snapshot would only  be used on a running system (unless in a chroot, never tried that). Maybe then it does work for snaphot, or at least appears to. But there is still the multiple cpio  issue to consider..

Last edited by dzz (2025-04-29 16:08:10)

Offline

#8 2025-04-29 20:53:04

greenjeans
Member
Registered: 2017-04-07
Posts: 954  
Website

Re: Initramfs changes in Excalibur + refracta2usb

Yep. In Snapshot it works great on Excalibur, ran a lot of iso's with it now. Haven't tried Refracta2usb on excalibur yet, just Daedalus stuff.


https://sourceforge.net/projects/vuu-do/ New Vuu-do isos uploaded April 2025!
Vuu-do GNU/Linux, minimal Devuan-based Openbox and Mate systems to build on. Also a max version for OB.
Devuan 5 mate-mini iso, pure Devuan, 100% no-vuu-do. wink Devuan 6 version also available for testing.
Please donate to support Devuan and init freedom! https://devuan.org/os/donate

Offline

#9 2025-04-29 23:36:01

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,650  

Re: Initramfs changes in Excalibur + refracta2usb

patch-initrd works
patch-initrd with encrypted loopback file on first partition works.
loopback file on second partition works with and without encryption
reinstall syslinux works. It hung for a long time running mmove using 100% cpu, and I ended up killing that process, but it worked anyway. I suspect the problem was my usb stick that was already having booting problems. Seems to be fixed now.

There were a couple of times I tried to make a loopback file on the second partition, but it never asked which partition to use, and it wanted to put it on the first. I closed refracta2usb and restarted it, and it did what I wanted after that.

All testing done on excalibur host with a devuan excalibur desktop-live iso. (i.e. with microcode)

Offline

#10 2025-04-30 18:43:24

dzz
Member
From: Exmouth, South West England
Registered: 2016-12-01
Posts: 73  

Re: Initramfs changes in Excalibur + refracta2usb

Thanks fsmithred, I tested the modified r2u OK in excalibur and daedalus host, on similar and different OS live images. In Trinity Desktop and in XFCE. Except for one new bug discovered:

Live mounts now go to /run/live/ not (/usr)/lib/live/mount .. so setup usb from running live system option is broken in excalibur. It's a simple fix around line 158 in the main script, I can post an updated experimental package to the same place at some point.

It looks like snapshot is OK with handling initramfs edits. But that method is unsuitable for r2u since we may be working on a live OS that's different from the running system.

Thanks also greenjeans for your testing and alternative live iso flavours.

EDIT: Updated and posted https://exegnulinux.net/files/refracta2usb/

Last edited by dzz (2025-04-30 19:14:10)

Offline

#11 2025-04-30 19:25:17

golinux
Administrator
Registered: 2016-11-25
Posts: 3,447  

Re: Initramfs changes in Excalibur + refracta2usb

dzz . . . nice to see you around so much and contributing to debuging the Excalibur isos. :thumbs-up:

Online

Board footer