The officially official Devuan Forum!

You are not logged in.

#1 2023-12-25 10:14:22

samhain
Member
Registered: 2017-04-03
Posts: 67  

Refracta not booting in VM

I have a problem booting ISOs created with refractasnapshot on VirtualBox and qemu. While the ISOs boot fine on real hardware they fail to find/mount the root filesystem when using the VM. Last message before stacktrace:

[5.391171] List of all partitions:
[5.391302] No Filesystem could mount root, tried:
[5.391321] 
[5.391548] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

Any idea how to work around this - or which kernel modules would have to been included to make it work?

Last edited by samhain (2023-12-25 10:15:24)

Offline

#2 2023-12-26 10:50:07

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

Re: Refracta not booting in VM

Are you using a custom kernel? If so, compare your kernel config file to the one for the stock kernel to see if something is missing.

It may be something in the way the isos were made. I boot isos in qemu and vbox all the time. The only thing that doesn't work well is if the VM is set to do a uefi boot. In that case, I have to go into the efi setup and find the actual file to boot.

Take a look at /var/log/refractasnapshot.log or let me look at it.

Offline

#3 2023-12-26 16:29:57

samhain
Member
Registered: 2017-04-03
Posts: 67  

Re: Refracta not booting in VM

I tried 4 different setups that all boot fine on real hardware but fail in Virtualbox and qemu:
- refracta_12.0_nox_amd64-20230829_1853.iso (the iso itself)
- devuan excalibur, iso created with refractasnapshot running on VirtualBox, stock kernel
- devuan chimaera with RTAI, iso created with refractasnapshot on real hardware, kernel 4.something
- devuan chimaera with PREEMPT-RT, iso created with refractasnapshot on real hardware, kernel 4.something

/var/log/refractasnapsot.log from excalibur run:

ls: Zugriff auf '/home/snapshot/*.iso' nicht möglich: Datei oder Verzeichnis nicht gefunden
14080 Blöcke
14080 Blöcke
sed: /home/work/myfs/home/user/.config/geany/geany.conf kann nicht gelesen werden: Datei oder Verzeichnis nicht gefunden
1440+0 Datensätze ein
1440+0 Datensätze aus
1474560 Bytes (1,5 MB, 1,4 MiB) kopiert, 0,0171937 s, 85,8 MB/s
cp: -r wurde nicht angegeben, daher wird das Verzeichnis '/usr/lib/grub/x86_64-efi/monolithic' ausgelassen
rm: das Entfernen von '/home/work/iso/pkglist*' ist nicht möglich: Datei oder Verzeichnis nicht gefunden
xorriso 1.5.6 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev 'stdio:/home/snapshot/snapshot-20231224_1530.iso'
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 10.4g free
xorriso : WARNING : -volid text does not comply to ISO 9660 / ECMA 119 rules
Added to ISO image: directory '/'='/home/work/iso'
xorriso : UPDATE :     329 files added in 1 seconds
xorriso : UPDATE :     329 files added in 1 seconds
xorriso : NOTE : Copying to System Area: 432 bytes from file '/usr/lib/ISOLINUX/isohdpfx.bin'
libisofs: NOTE : Automatically adjusted MBR geometry to 1017/121/32
libisofs: NOTE : Aligned image size to cylinder size by 776 blocks
xorriso : UPDATE :  0.28% done
xorriso : UPDATE :  13.78% done
xorriso : UPDATE :  22.35% done, estimate finish Sun Dec 24 15:48:50 2023
xorriso : UPDATE :  32.17% done, estimate finish Sun Dec 24 15:48:50 2023
xorriso : UPDATE :  40.69% done, estimate finish Sun Dec 24 15:48:50 2023
xorriso : UPDATE :  53.62% done, estimate finish Sun Dec 24 15:48:49 2023
xorriso : UPDATE :  63.97% done, estimate finish Sun Dec 24 15:48:49 2023
xorriso : UPDATE :  72.65% done, estimate finish Sun Dec 24 15:48:49 2023
xorriso : UPDATE :  80.63% done, estimate finish Sun Dec 24 15:48:50 2023
xorriso : UPDATE :  89.67% done, estimate finish Sun Dec 24 15:48:50 2023
xorriso : UPDATE :  95.58% done
ISO image produced: 984456 sectors
Written to medium : 984456 sectors at LBA 0
Writing to 'stdio:/home/snapshot/snapshot-20231224_1530.iso' completed successfully.

Last edited by samhain (2023-12-26 16:31:42)

Offline

#4 2023-12-26 18:15:52

isabena
Member
Registered: 2023-11-19
Posts: 9  

Re: Refracta not booting in VM

samhain wrote:

I have a problem booting ISOs created with refractasnapshot on VirtualBox and qemu. While the ISOs boot fine on real hardware they fail to find/mount the root filesystem when using the VM.

Any idea how to work around this - or which kernel modules would have to been included to make it work?

did you try to disable acceleration in VBox ?
this often brings succes in efi-booting

Offline

#5 2023-12-26 18:24:50

samhain
Member
Registered: 2017-04-03
Posts: 67  

Re: Refracta not booting in VM

Do you mean 3D acceleration? That has no effect, neither turned on or off.

Offline

#6 2023-12-26 18:28:17

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

Re: Refracta not booting in VM

Oh, that log doesn't have enough in it. Please run refractasnapshot in debug mode. For the cli script, run refractasnapshot -d and if you used the graphical version, start it from a root terminal (or sudo) as refractasnapshot-gui -d

If the snapshots are being made on a system with a swap partition or an encrypted root filesystem, that might be causing a problem. I'd need to see the debug log to be sure.

Looking at the varied selection of isos that are not working, I'm thinking maybe it's a problem with virtualization. But that's a guess.

Last edited by fsmithred (2023-12-26 18:34:42)

Offline

#7 2023-12-26 19:03:19

samhain
Member
Registered: 2017-04-03
Posts: 67  

Re: Refracta not booting in VM

Theexcalibur iso is created inside VirtualBox, the 2 with RTAI and PREEMPT-RT are created on real hardware. Non of the installations have a swap partition nor a swapfile. But what puzzeles me is that the refracta iso from your site does not boot in the VMs, either.

/var/log/refractasnapshot.log with debugging enabled (created on excalibur inside VirtualBox):

+ echo 'configfile is /etc/refractasnapshot.conf'
+ echo 'make_efi is yes'
+ check_grub
+ [[ yes = \y\e\s ]]
+ grep -v bin
+ grep grub-efi-amd64
+ dpkg -l
+ grep '^ii'
+ [[ ! -e /var/lib/dpkg/info/dosfstools.list ]]
+ choose_task
+ [[ yes = \y\e\s ]]
+ uefi_message='uefi enabled'
+ true
+ echo '
 Choose a task.

 1. Create a snapshot (uefi enabled)
 2. Re-squash and make iso (no-copy)
 3. Re-make efi files and iso (no-copy, no-squash)
 4. Re-run xorriso only. (make iso, no-copy, no-squash)
 5. Help
 6. Exit
 '
+ read ans
+ case $ans in
+ echo 'This may take a moment while the program checks for free space.    '
+ check_copies
+ [[ -d /home/snapshot ]]
+ ls /home/snapshot/snapshot-20231224_1530.iso
++ ls /home/snapshot/snapshot-20231224_1530.iso
++ wc -l
+ snapshot_count=1
++ du -sh /home/snapshot
++ awk '{print $1}'
+ snapshot_size=1,9G
+ [[ -z 1,9G ]]
+ [[ -d /home/work/myfs ]]
+ [[ no = \y\e\s ]]
++ echo '* The temporary copy of the filesystem will be created
   at /home/work/myfs and removed when this program finishes.'
+ save_message='* The temporary copy of the filesystem will be created
   at /home/work/myfs and removed when this program finishes.'
+ check_directories
++ awk -F / '{ print "/" $2 "/" $3 }'
++ echo /home/snapshot
++ grep /media/
+ snapdir_is_remote=
++ awk -F / '{ print "/" $2 "/" $3 }'
++ echo /home/work
++ grep /media/
+ workdir_is_remote=
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ [[ -d /home/snapshot ]]
+ [[ no = \n\o ]]
+ [[ -d /home/work ]]
+ mkdir -p /home/work/iso
+ mkdir -p /home/work/myfs
+ check_space
++ df -h -x tmpfs -x devtmpfs -x iso9660
++ awk '{ print "  " $2 "\t" $3 "\t" $4 "\t" $5 "  \t" $6 "\t\t\t" $1 }'
+ disk_space='  Größe	Benutzt	Verf.	Verw%  	Eingehängt			Dateisystem
  19G	7,2G	11G	41%  	/			/dev/sda1'
+ [[ yes = \y\e\s ]]
+ check_initrd
+ grep -q conf.d/cryptroot
+ lsinitramfs /initrd.img
+ lsinitramfs /initrd.img
+ grep -q cryptroot/crypttab
+ lsinitramfs /initrd.img
+ egrep -q 'conf.d/resume|conf.d/zz-resume-auto'
+ remove_resume=yes
+ swap_message='The snapshot initrd will be modified to allow booting without the host'\''s swap partition.'
+ '[' '' = yes ']'
+ report_space
+ [[ -f /usr/bin/less ]]
+ pager=/usr/bin/less
+ /usr/bin/less
+ echo '
 You will need plenty of free space. It is recommended that free space
 (Avail) in the partition that holds the work directory (probably "/")
 should be two times the total installed system size (Used). You can
 deduct the space taken up by previous snapshots and any saved copies of
 the system from the Used amount.

 * You have 1 snapshots taking up 1,9G of disk space.

 * The temporary copy of the filesystem will be created
   at /home/work/myfs and removed when this program finishes.
 * The snapshot directory is currently set to /home/snapshot

 You can change these and other settings by editing
 /etc/refractasnapshot.conf.

 Turn off NUM LOCK for some laptops.

 The snapshot initrd will be modified to allow booting without the host'\''s swap partition.

 Current disk usage:
 (For complete listing, exit and run '\''df -h'\'')

   Größe	Benutzt	Verf.	Verw%  	Eingehängt			Dateisystem
  19G	7,2G	11G	41%  	/			/dev/sda1

 To proceed, press q.
 To exit, press q and then press ctrl-c
'
+ set_distro_name
+ [[ /usr/lib/refractasnapshot/iso = \/\u\s\r\/\l\i\b\/\r\e\f\r\a\c\t\a\s\n\a\p\s\h\o\t\/\i\s\o ]]
+ [[ live.cfg = \l\i\v\e\.\c\f\g ]]
++ lsb_release -i -s
+ DISTRO=Devuan
++ grep -q Refracta /etc/issue
+ true
+ echo '
	This is the distribution name that will appear in the boot menu for the
	live image. You can change it to something else, or you can blank this,
	and the the menu entries will just say "GNU/Linux <kernel-version>"
	'
+ exec
+ break
+ [[ -z Devuan ]]
+ DISTRO=Devuan
+ housekeeping
+ [[ '' = \y\e\s ]]
+ [[ -n '' ]]
++ awk -F: '/1000:1000/ { print $1 }' /etc/passwd
+ username=user
+ [[ user != user ]]
+ [[ -e /vmlinuz ]]
+ [[ -e /initrd.img ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ yes = \y\e\s ]]
+ echo -e '\nRunning updatedb...\n'
+ updatedb
+ [[ '' = \y\e\s ]]
+ cd /home/work
+ copy_isolinux
+ [[ -f /usr/lib/ISOLINUX/isolinux.bin ]]
+ isolinuxbin=/usr/lib/ISOLINUX/isolinux.bin
+ [[ -f /usr/lib/syslinux/modules/bios/vesamenu.c32 ]]
+ vesamenu=/usr/lib/syslinux/modules/bios/vesamenu.c32
+ rsync -a /usr/lib/syslinux/modules/bios/chain.c32 /usr/lib/refractasnapshot/iso/isolinux/
+ rsync -a /usr/lib/syslinux/modules/bios/ldlinux.c32 /usr/lib/refractasnapshot/iso/isolinux/
+ rsync -a /usr/lib/syslinux/modules/bios/libcom32.c32 /usr/lib/refractasnapshot/iso/isolinux/
+ rsync -a /usr/lib/syslinux/modules/bios/libutil.c32 /usr/lib/refractasnapshot/iso/isolinux/
+ rsync -a /usr/lib/ISOLINUX/isolinux.bin /usr/lib/refractasnapshot/iso/isolinux/
+ rsync -a /usr/lib/syslinux/modules/bios/vesamenu.c32 /usr/lib/refractasnapshot/iso/isolinux/
+ [[ '' = \y\e\s ]]
+ copy_kernel
+ rsync -a /usr/lib/refractasnapshot/iso/ /home/work/iso/
+ cp /vmlinuz /home/work/iso/live/
+ cp /initrd.img /home/work/iso/live/
+ copy_filesystem
+ [[ no = \y\e\s ]]
+ rsync -avX / myfs/ --delete-before --delete-excluded --exclude=/home/work --exclude=/home/snapshot --exclude=/home/work/efi-files --exclude-from=/usr/lib/refractasnapshot/snapshot_exclude.list
+ [[ -n '' ]]
+ '[' '' = yes ']'
+ '[' yes = yes ']'
+ clean_initrd
+ extract_initrd
+ mkdir /tmp/extracted
+ pushd /tmp/extracted
++ file -L /initrd.img
++ egrep -o 'gzip compressed|XZ compressed|cpio archive'
+ COMPRESSION='cpio archive'
+ '[' 'cpio archive' = 'gzip compressed' ']'
+ '[' 'cpio archive' = 'XZ compressed' ']'
+ '[' 'cpio archive' = 'cpio archive' ']'
+ echo 'Archive is cpio archive...'
+ cpio -i
14080 Blöcke
+ exit_code=0
+ '[' 0 -ne 0 ']'
+ COMPRESSION='gzip compressed'
+ echo 'COMPRESSION is gzip compressed'
+ popd
+ echo 'Initrd is extracted'
+ edit_initrd
+ pushd /tmp/extracted
+ '[' -f conf/conf.d/cryptroot ']'
+ '[' -f cryptroot/crypttab ']'
+ '[' -f conf/conf.d/resume ']'
+ '[' -f conf/conf.d/zz-resume-auto ']'
+ popd
+ rebuild_initrd
+ pushd /tmp/extracted
+ '[' 'gzip compressed' = 'gzip compressed' ']'
+ find . -print0
+ gzip -c
+ cpio -0 -H newc -o
14080 Blöcke
+ popd
+ rm -rf /tmp/extracted
+ edit_system
+ find myfs/var/log -name '*gz' -print0
+ xargs -0r rm -f
+ find myfs/var/log/ -type f -exec truncate -s 0 '{}' ';'
+ [[ yes = \y\e\s ]]
+ [[ -f /home/work/myfs/etc/pmount.allow ]]
+ [[ yes = \y\e\s ]]
+ sed -i 's/recent_files=.*;/recent_files=/' /home/work/myfs/home/user/.config/geany/geany.conf
sed: /home/work/myfs/home/user/.config/geany/geany.conf kann nicht gelesen werden: Datei oder Verzeichnis nicht gefunden
+ [[ -e /home/work/myfs/lib/live/config/1161-openssh-server ]]
+ sed -i 's/PermitRootLogin yes/PermitRootLogin prohibit-password/' /home/work/myfs/etc/ssh/sshd_config
+ [[ yes = \y\e\s ]]
+ sed -i 's|.*PasswordAuthentication.*no|PasswordAuthentication yes|' /home/work/myfs/etc/ssh/sshd_config
+ touch /home/work/myfs/etc/fstab
+ '[' -e /home/work/myfs/etc/machine-id ']'
+ mknod -m 622 /home/work/myfs/dev/console c 5 1
+ mknod -m 666 /home/work/myfs/dev/null c 1 3
+ mknod -m 666 /home/work/myfs/dev/zero c 1 5
+ mknod -m 666 /home/work/myfs/dev/ptmx c 5 2
+ mknod -m 666 /home/work/myfs/dev/tty c 5 0
+ mknod -m 444 /home/work/myfs/dev/random c 1 8
+ mknod -m 444 /home/work/myfs/dev/urandom c 1 9
+ chown -v root:tty /home/work/myfs/dev/console /home/work/myfs/dev/ptmx /home/work/myfs/dev/tty
+ ln -sv /proc/self/fd /home/work/myfs/dev/fd
+ ln -sv /proc/self/fd/0 /home/work/myfs/dev/stdin
+ ln -sv /proc/self/fd/1 /home/work/myfs/dev/stdout
+ ln -sv /proc/self/fd/2 /home/work/myfs/dev/stderr
+ ln -sv /proc/kcore /home/work/myfs/dev/core
+ mkdir -v /home/work/myfs/dev/shm
+ mkdir -v /home/work/myfs/dev/pts
+ chmod 1777 /home/work/myfs/dev/shm
+ [[ -z '' ]]
+ echo '# The loopback network interface
auto lo
iface lo inet loopback
'
+ rm -f '/home/work/myfs/var/lib/wicd/configurations/*'
+ rm -f /home/work/myfs/etc/wicd/wireless-settings.conf
+ rm -f '/home/work/myfs/etc/NetworkManager/system-connections/*'
+ rm -f '/home/work/myfs/etc/network/wifi/*'
+ rm -rf '/home/work/myfs/var/lib/connman/*'
+ get_filename
+ [[ datetime = \d\a\t\e\t\i\m\e ]]
++ date +%Y%m%d_%H%M
+ filename=snapshot-20231226_1934.iso
+ [[ yes = \y\e\s ]]
+ mkefi
+ uefi_opt='-eltorito-alt-boot -e boot/grub/efiboot.img -isohybrid-gpt-basdat -no-emul-boot'
++ mktemp -d /tmp/work_temp.XXXX
+ tempdir=/tmp/work_temp.MJgX
+ mkdir -p /tmp/work_temp.MJgX/boot/grub
+ cat
+ '[' -d /home/work/efi-files ']'
+ mkdir /home/work/efi-files
+ pushd /home/work/efi-files
+ '[' -d boot ']'
+ '[' -d efi ']'
+ mkdir -p boot/grub/x86_64-efi
+ mkdir -p efi/boot
+ cp /usr/lib/refractasnapshot/iso/isolinux/splash.png boot/grub/splash.png
++ ls /usr/lib/grub/x86_64-efi
++ grep .mod
++ sed s/.mod//
++ grep part_
+ for i in $(ls /usr/lib/grub/x86_64-efi | grep part_ | grep \.mod | sed 's/.mod//')
+ echo 'insmod part_acorn'
+ for i in $(ls /usr/lib/grub/x86_64-efi | grep part_ | grep \.mod | sed 's/.mod//')
+ echo 'insmod part_amiga'
+ for i in $(ls /usr/lib/grub/x86_64-efi | grep part_ | grep \.mod | sed 's/.mod//')
+ echo 'insmod part_apple'
+ for i in $(ls /usr/lib/grub/x86_64-efi | grep part_ | grep \.mod | sed 's/.mod//')
+ echo 'insmod part_bsd'
+ for i in $(ls /usr/lib/grub/x86_64-efi | grep part_ | grep \.mod | sed 's/.mod//')
+ echo 'insmod part_dfly'
+ for i in $(ls /usr/lib/grub/x86_64-efi | grep part_ | grep \.mod | sed 's/.mod//')
+ echo 'insmod part_dvh'
+ for i in $(ls /usr/lib/grub/x86_64-efi | grep part_ | grep \.mod | sed 's/.mod//')
+ echo 'insmod part_gpt'
+ for i in $(ls /usr/lib/grub/x86_64-efi | grep part_ | grep \.mod | sed 's/.mod//')
+ echo 'insmod part_msdos'
+ for i in $(ls /usr/lib/grub/x86_64-efi | grep part_ | grep \.mod | sed 's/.mod//')
+ echo 'insmod part_plan'
+ for i in $(ls /usr/lib/grub/x86_64-efi | grep part_ | grep \.mod | sed 's/.mod//')
+ echo 'insmod part_sun'
+ for i in $(ls /usr/lib/grub/x86_64-efi | grep part_ | grep \.mod | sed 's/.mod//')
+ echo 'insmod part_sunpc'
+ for i in efi_gop efi_uga ieee1275_fb vbe vga video_bochs video_cirrus jpeg png gfxterm
+ echo 'insmod efi_gop'
+ for i in efi_gop efi_uga ieee1275_fb vbe vga video_bochs video_cirrus jpeg png gfxterm
+ echo 'insmod efi_uga'
+ for i in efi_gop efi_uga ieee1275_fb vbe vga video_bochs video_cirrus jpeg png gfxterm
+ echo 'insmod ieee1275_fb'
+ for i in efi_gop efi_uga ieee1275_fb vbe vga video_bochs video_cirrus jpeg png gfxterm
+ echo 'insmod vbe'
+ for i in efi_gop efi_uga ieee1275_fb vbe vga video_bochs video_cirrus jpeg png gfxterm
+ echo 'insmod vga'
+ for i in efi_gop efi_uga ieee1275_fb vbe vga video_bochs video_cirrus jpeg png gfxterm
+ echo 'insmod video_bochs'
+ for i in efi_gop efi_uga ieee1275_fb vbe vga video_bochs video_cirrus jpeg png gfxterm
+ echo 'insmod video_cirrus'
+ for i in efi_gop efi_uga ieee1275_fb vbe vga video_bochs video_cirrus jpeg png gfxterm
+ echo 'insmod jpeg'
+ for i in efi_gop efi_uga ieee1275_fb vbe vga video_bochs video_cirrus jpeg png gfxterm
+ echo 'insmod png'
+ for i in efi_gop efi_uga ieee1275_fb vbe vga video_bochs video_cirrus jpeg png gfxterm
+ echo 'insmod gfxterm'
+ echo 'source /boot/grub/grub.cfg'
+ pushd /tmp/work_temp.MJgX
+ tar -cvf memdisk boot
+ grub-mkimage -O x86_64-efi -m memdisk -o bootx64.efi -p '(memdisk)/boot/grub' search iso9660 configfile normal memdisk tar cat part_msdos part_gpt fat ext2 ntfs ntfscomp hfsplus chain boot linux
+ popd
+ cp /tmp/work_temp.MJgX/bootx64.efi efi/boot
+ dd if=/dev/zero of=boot/grub/efiboot.img bs=1K count=1440
1440+0 Datensätze ein
1440+0 Datensätze aus
1474560 Bytes (1,5 MB, 1,4 MiB) kopiert, 0,0105001 s, 140 MB/s
+ /sbin/mkdosfs -F 12 boot/grub/efiboot.img
+ mkdir img-mnt
+ mount -o loop boot/grub/efiboot.img img-mnt
+ mkdir -p img-mnt/efi/boot
+ cp /tmp/work_temp.MJgX/bootx64.efi img-mnt/efi/boot/
+ cp /usr/lib/grub/x86_64-efi/acpi.mod /usr/lib/grub/x86_64-efi/adler32.mod /usr/lib/grub/x86_64-efi/affs.mod /usr/lib/grub/x86_64-efi/afs.mod /usr/lib/grub/x86_64-efi/afsplitter.mod /usr/lib/grub/x86_64-efi/ahci.mod /usr/lib/grub/x86_64-efi/all_video.mod /usr/lib/grub/x86_64-efi/aout.mod /usr/lib/grub/x86_64-efi/appleldr.mod /usr/lib/grub/x86_64-efi/archelp.mod /usr/lib/grub/x86_64-efi/ata.mod /usr/lib/grub/x86_64-efi/at_keyboard.mod /usr/lib/grub/x86_64-efi/backtrace.mod /usr/lib/grub/x86_64-efi/bfs.mod /usr/lib/grub/x86_64-efi/bitmap.mod /usr/lib/grub/x86_64-efi/bitmap_scale.mod /usr/lib/grub/x86_64-efi/blocklist.mod /usr/lib/grub/x86_64-efi/boot.mod /usr/lib/grub/x86_64-efi/bsd.mod /usr/lib/grub/x86_64-efi/bswap_test.mod /usr/lib/grub/x86_64-efi/btrfs.mod /usr/lib/grub/x86_64-efi/bufio.mod /usr/lib/grub/x86_64-efi/cat.mod /usr/lib/grub/x86_64-efi/cbfs.mod /usr/lib/grub/x86_64-efi/cbls.mod /usr/lib/grub/x86_64-efi/cbmemc.mod /usr/lib/grub/x86_64-efi/cbtable.mod /usr/lib/grub/x86_64-efi/cbtime.mod /usr/lib/grub/x86_64-efi/chain.mod /usr/lib/grub/x86_64-efi/cmdline_cat_test.mod /usr/lib/grub/x86_64-efi/cmp.mod /usr/lib/grub/x86_64-efi/cmp_test.mod /usr/lib/grub/x86_64-efi/command.lst /usr/lib/grub/x86_64-efi/configfile.mod /usr/lib/grub/x86_64-efi/config.h /usr/lib/grub/x86_64-efi/cpio_be.mod /usr/lib/grub/x86_64-efi/cpio.mod /usr/lib/grub/x86_64-efi/cpuid.mod /usr/lib/grub/x86_64-efi/crc64.mod /usr/lib/grub/x86_64-efi/cryptodisk.mod /usr/lib/grub/x86_64-efi/crypto.lst /usr/lib/grub/x86_64-efi/crypto.mod /usr/lib/grub/x86_64-efi/cs5536.mod /usr/lib/grub/x86_64-efi/ctz_test.mod /usr/lib/grub/x86_64-efi/datehook.mod /usr/lib/grub/x86_64-efi/date.mod /usr/lib/grub/x86_64-efi/datetime.mod /usr/lib/grub/x86_64-efi/diskfilter.mod /usr/lib/grub/x86_64-efi/disk.mod /usr/lib/grub/x86_64-efi/div.mod /usr/lib/grub/x86_64-efi/div_test.mod /usr/lib/grub/x86_64-efi/dm_nv.mod /usr/lib/grub/x86_64-efi/echo.mod /usr/lib/grub/x86_64-efi/efifwsetup.mod /usr/lib/grub/x86_64-efi/efi_gop.mod /usr/lib/grub/x86_64-efi/efinet.mod /usr/lib/grub/x86_64-efi/efi_uga.mod /usr/lib/grub/x86_64-efi/ehci.mod /usr/lib/grub/x86_64-efi/elf.mod /usr/lib/grub/x86_64-efi/eval.mod /usr/lib/grub/x86_64-efi/exfat.mod /usr/lib/grub/x86_64-efi/exfctest.mod /usr/lib/grub/x86_64-efi/ext2.mod /usr/lib/grub/x86_64-efi/extcmd.mod /usr/lib/grub/x86_64-efi/f2fs.mod /usr/lib/grub/x86_64-efi/fat.mod /usr/lib/grub/x86_64-efi/fdt.lst /usr/lib/grub/x86_64-efi/file.mod /usr/lib/grub/x86_64-efi/fixvideo.mod /usr/lib/grub/x86_64-efi/font.mod /usr/lib/grub/x86_64-efi/fshelp.mod /usr/lib/grub/x86_64-efi/fs.lst /usr/lib/grub/x86_64-efi/functional_test.mod /usr/lib/grub/x86_64-efi/gcry_arcfour.mod /usr/lib/grub/x86_64-efi/gcry_blowfish.mod /usr/lib/grub/x86_64-efi/gcry_camellia.mod /usr/lib/grub/x86_64-efi/gcry_cast5.mod /usr/lib/grub/x86_64-efi/gcry_crc.mod /usr/lib/grub/x86_64-efi/gcry_des.mod /usr/lib/grub/x86_64-efi/gcry_dsa.mod /usr/lib/grub/x86_64-efi/gcry_idea.mod /usr/lib/grub/x86_64-efi/gcry_md4.mod /usr/lib/grub/x86_64-efi/gcry_md5.mod /usr/lib/grub/x86_64-efi/gcry_rfc2268.mod /usr/lib/grub/x86_64-efi/gcry_rijndael.mod /usr/lib/grub/x86_64-efi/gcry_rmd160.mod /usr/lib/grub/x86_64-efi/gcry_rsa.mod /usr/lib/grub/x86_64-efi/gcry_seed.mod /usr/lib/grub/x86_64-efi/gcry_serpent.mod /usr/lib/grub/x86_64-efi/gcry_sha1.mod /usr/lib/grub/x86_64-efi/gcry_sha256.mod /usr/lib/grub/x86_64-efi/gcry_sha512.mod /usr/lib/grub/x86_64-efi/gcry_tiger.mod /usr/lib/grub/x86_64-efi/gcry_twofish.mod /usr/lib/grub/x86_64-efi/gcry_whirlpool.mod /usr/lib/grub/x86_64-efi/geli.mod /usr/lib/grub/x86_64-efi/gettext.mod /usr/lib/grub/x86_64-efi/gfxmenu.mod /usr/lib/grub/x86_64-efi/gfxterm_background.mod /usr/lib/grub/x86_64-efi/gfxterm_menu.mod /usr/lib/grub/x86_64-efi/gfxterm.mod /usr/lib/grub/x86_64-efi/gptsync.mod /usr/lib/grub/x86_64-efi/gzio.mod /usr/lib/grub/x86_64-efi/halt.mod /usr/lib/grub/x86_64-efi/hashsum.mod /usr/lib/grub/x86_64-efi/hdparm.mod /usr/lib/grub/x86_64-efi/hello.mod /usr/lib/grub/x86_64-efi/help.mod /usr/lib/grub/x86_64-efi/hexdump.mod /usr/lib/grub/x86_64-efi/hfs.mod /usr/lib/grub/x86_64-efi/hfspluscomp.mod /usr/lib/grub/x86_64-efi/hfsplus.mod /usr/lib/grub/x86_64-efi/http.mod /usr/lib/grub/x86_64-efi/iorw.mod /usr/lib/grub/x86_64-efi/iso9660.mod /usr/lib/grub/x86_64-efi/jfs.mod /usr/lib/grub/x86_64-efi/jpeg.mod /usr/lib/grub/x86_64-efi/json.mod /usr/lib/grub/x86_64-efi/kernel.img /usr/lib/grub/x86_64-efi/keylayouts.mod /usr/lib/grub/x86_64-efi/keystatus.mod /usr/lib/grub/x86_64-efi/ldm.mod /usr/lib/grub/x86_64-efi/legacycfg.mod /usr/lib/grub/x86_64-efi/legacy_password_test.mod /usr/lib/grub/x86_64-efi/linux16.mod /usr/lib/grub/x86_64-efi/linuxefi.mod /usr/lib/grub/x86_64-efi/linux.mod /usr/lib/grub/x86_64-efi/loadbios.mod /usr/lib/grub/x86_64-efi/loadenv.mod /usr/lib/grub/x86_64-efi/loopback.mod /usr/lib/grub/x86_64-efi/lsacpi.mod /usr/lib/grub/x86_64-efi/lsefimmap.mod /usr/lib/grub/x86_64-efi/lsefi.mod /usr/lib/grub/x86_64-efi/lsefisystab.mod /usr/lib/grub/x86_64-efi/lsmmap.mod /usr/lib/grub/x86_64-efi/ls.mod /usr/lib/grub/x86_64-efi/lspci.mod /usr/lib/grub/x86_64-efi/lssal.mod /usr/lib/grub/x86_64-efi/luks2.mod /usr/lib/grub/x86_64-efi/luks.mod /usr/lib/grub/x86_64-efi/lvm.mod /usr/lib/grub/x86_64-efi/lzopio.mod /usr/lib/grub/x86_64-efi/macbless.mod /usr/lib/grub/x86_64-efi/macho.mod /usr/lib/grub/x86_64-efi/mdraid09_be.mod /usr/lib/grub/x86_64-efi/mdraid09.mod /usr/lib/grub/x86_64-efi/mdraid1x.mod /usr/lib/grub/x86_64-efi/memdisk.mod /usr/lib/grub/x86_64-efi/memrw.mod /usr/lib/grub/x86_64-efi/minicmd.mod /usr/lib/grub/x86_64-efi/minix2_be.mod /usr/lib/grub/x86_64-efi/minix2.mod /usr/lib/grub/x86_64-efi/minix3_be.mod /usr/lib/grub/x86_64-efi/minix3.mod /usr/lib/grub/x86_64-efi/minix_be.mod /usr/lib/grub/x86_64-efi/minix.mod /usr/lib/grub/x86_64-efi/mmap.mod /usr/lib/grub/x86_64-efi/moddep.lst /usr/lib/grub/x86_64-efi/modinfo.sh /usr/lib/grub/x86_64-efi/monolithic /usr/lib/grub/x86_64-efi/morse.mod /usr/lib/grub/x86_64-efi/mpi.mod /usr/lib/grub/x86_64-efi/msdospart.mod /usr/lib/grub/x86_64-efi/mul_test.mod /usr/lib/grub/x86_64-efi/multiboot2.mod /usr/lib/grub/x86_64-efi/multiboot.mod /usr/lib/grub/x86_64-efi/nativedisk.mod /usr/lib/grub/x86_64-efi/net.mod /usr/lib/grub/x86_64-efi/newc.mod /usr/lib/grub/x86_64-efi/nilfs2.mod /usr/lib/grub/x86_64-efi/normal.mod /usr/lib/grub/x86_64-efi/ntfscomp.mod /usr/lib/grub/x86_64-efi/ntfs.mod /usr/lib/grub/x86_64-efi/odc.mod /usr/lib/grub/x86_64-efi/offsetio.mod /usr/lib/grub/x86_64-efi/ohci.mod /usr/lib/grub/x86_64-efi/part_acorn.mod /usr/lib/grub/x86_64-efi/part_amiga.mod /usr/lib/grub/x86_64-efi/part_apple.mod /usr/lib/grub/x86_64-efi/part_bsd.mod /usr/lib/grub/x86_64-efi/part_dfly.mod /usr/lib/grub/x86_64-efi/part_dvh.mod /usr/lib/grub/x86_64-efi/part_gpt.mod /usr/lib/grub/x86_64-efi/partmap.lst /usr/lib/grub/x86_64-efi/part_msdos.mod /usr/lib/grub/x86_64-efi/part_plan.mod /usr/lib/grub/x86_64-efi/part_sun.mod /usr/lib/grub/x86_64-efi/part_sunpc.mod /usr/lib/grub/x86_64-efi/parttool.lst /usr/lib/grub/x86_64-efi/parttool.mod /usr/lib/grub/x86_64-efi/password.mod /usr/lib/grub/x86_64-efi/password_pbkdf2.mod /usr/lib/grub/x86_64-efi/pata.mod /usr/lib/grub/x86_64-efi/pbkdf2.mod /usr/lib/grub/x86_64-efi/pbkdf2_test.mod /usr/lib/grub/x86_64-efi/pcidump.mod /usr/lib/grub/x86_64-efi/pgp.mod /usr/lib/grub/x86_64-efi/play.mod /usr/lib/grub/x86_64-efi/png.mod /usr/lib/grub/x86_64-efi/priority_queue.mod /usr/lib/grub/x86_64-efi/probe.mod /usr/lib/grub/x86_64-efi/procfs.mod /usr/lib/grub/x86_64-efi/progress.mod /usr/lib/grub/x86_64-efi/raid5rec.mod /usr/lib/grub/x86_64-efi/raid6rec.mod /usr/lib/grub/x86_64-efi/random.mod /usr/lib/grub/x86_64-efi/rdmsr.mod /usr/lib/grub/x86_64-efi/read.mod /usr/lib/grub/x86_64-efi/reboot.mod /usr/lib/grub/x86_64-efi/regexp.mod /usr/lib/grub/x86_64-efi/reiserfs.mod /usr/lib/grub/x86_64-efi/relocator.mod /usr/lib/grub/x86_64-efi/romfs.mod /usr/lib/grub/x86_64-efi/scsi.mod /usr/lib/grub/x86_64-efi/search_fs_file.mod /usr/lib/grub/x86_64-efi/search_fs_uuid.mod /usr/lib/grub/x86_64-efi/search_label.mod /usr/lib/grub/x86_64-efi/search.mod /usr/lib/grub/x86_64-efi/serial.mod /usr/lib/grub/x86_64-efi/setjmp.mod /usr/lib/grub/x86_64-efi/setjmp_test.mod /usr/lib/grub/x86_64-efi/setpci.mod /usr/lib/grub/x86_64-efi/sfs.mod /usr/lib/grub/x86_64-efi/shift_test.mod /usr/lib/grub/x86_64-efi/signature_test.mod /usr/lib/grub/x86_64-efi/sleep.mod /usr/lib/grub/x86_64-efi/sleep_test.mod /usr/lib/grub/x86_64-efi/smbios.mod /usr/lib/grub/x86_64-efi/spkmodem.mod /usr/lib/grub/x86_64-efi/squash4.mod /usr/lib/grub/x86_64-efi/strtoull_test.mod /usr/lib/grub/x86_64-efi/syslinuxcfg.mod /usr/lib/grub/x86_64-efi/tar.mod /usr/lib/grub/x86_64-efi/terminal.lst /usr/lib/grub/x86_64-efi/terminal.mod /usr/lib/grub/x86_64-efi/terminfo.mod /usr/lib/grub/x86_64-efi/test_blockarg.mod /usr/lib/grub/x86_64-efi/testload.mod /usr/lib/grub/x86_64-efi/test.mod /usr/lib/grub/x86_64-efi/testspeed.mod /usr/lib/grub/x86_64-efi/tftp.mod /usr/lib/grub/x86_64-efi/tga.mod /usr/lib/grub/x86_64-efi/time.mod /usr/lib/grub/x86_64-efi/tpm.mod /usr/lib/grub/x86_64-efi/trig.mod /usr/lib/grub/x86_64-efi/tr.mod /usr/lib/grub/x86_64-efi/true.mod /usr/lib/grub/x86_64-efi/udf.mod /usr/lib/grub/x86_64-efi/ufs1_be.mod /usr/lib/grub/x86_64-efi/ufs1.mod /usr/lib/grub/x86_64-efi/ufs2.mod /usr/lib/grub/x86_64-efi/uhci.mod /usr/lib/grub/x86_64-efi/usb_keyboard.mod /usr/lib/grub/x86_64-efi/usb.mod /usr/lib/grub/x86_64-efi/usbms.mod /usr/lib/grub/x86_64-efi/usbserial_common.mod /usr/lib/grub/x86_64-efi/usbserial_ftdi.mod /usr/lib/grub/x86_64-efi/usbserial_pl2303.mod /usr/lib/grub/x86_64-efi/usbserial_usbdebug.mod /usr/lib/grub/x86_64-efi/usbtest.mod /usr/lib/grub/x86_64-efi/video_bochs.mod /usr/lib/grub/x86_64-efi/video_cirrus.mod /usr/lib/grub/x86_64-efi/video_colors.mod /usr/lib/grub/x86_64-efi/video_fb.mod /usr/lib/grub/x86_64-efi/videoinfo.mod /usr/lib/grub/x86_64-efi/video.lst /usr/lib/grub/x86_64-efi/video.mod /usr/lib/grub/x86_64-efi/videotest_checksum.mod /usr/lib/grub/x86_64-efi/videotest.mod /usr/lib/grub/x86_64-efi/wrmsr.mod /usr/lib/grub/x86_64-efi/xfs.mod /usr/lib/grub/x86_64-efi/xnu.mod /usr/lib/grub/x86_64-efi/xnu_uuid.mod /usr/lib/grub/x86_64-efi/xnu_uuid_test.mod /usr/lib/grub/x86_64-efi/xzio.mod /usr/lib/grub/x86_64-efi/zfscrypt.mod /usr/lib/grub/x86_64-efi/zfsinfo.mod /usr/lib/grub/x86_64-efi/zfs.mod /usr/lib/grub/x86_64-efi/zstd.mod boot/grub/x86_64-efi/
cp: -r wurde nicht angegeben, daher wird das Verzeichnis '/usr/lib/grub/x86_64-efi/monolithic' ausgelassen
+ cp /usr/share/grub/unicode.pf2 boot/grub/font.pf2
++ pwd
+ chown -R 1000:1000 /home/work/efi-files
+ umount img-mnt
+ rmdir img-mnt
+ rm -rf /tmp/work_temp.MJgX
+ popd
+ rsync -avx /home/work/efi-files/boot /home/work/iso/
+ rsync -avx /home/work/efi-files/efi /home/work/iso/
+ cp /usr/lib/refractasnapshot/grub.cfg.template /home/work/iso/boot/grub/grub.cfg
+ add_extras
+ dir_prefix=pkglist
+ for dir in "$work_dir"/iso/"$dir_prefix"*
+ rm -r '/home/work/iso/pkglist*'
rm: das Entfernen von '/home/work/iso/pkglist*' ist nicht möglich: Datei oder Verzeichnis nicht gefunden
+ mkdir -p /home/work/iso/pkglist_snapshot-20231226_1934
+ dpkg -l
+ awk '{ print $2 }'
+ egrep 'ii|hi'
+ [[ -f /usr/share/doc/_Release_Notes/Release_Notes ]]
+ set_boot_options
+ '[' /usr/lib/refractasnapshot/iso = /usr/lib/refractasnapshot/iso ']'
+ sed -i 's:${DISTRO}:Devuan:g' /home/work/iso/isolinux/live.cfg
+ sed -i 's:${netconfig_opt}::g' /home/work/iso/isolinux/live.cfg
+ sed -i 's:${ifnames_opt}::g' /home/work/iso/isolinux/live.cfg
+ sed -i 's:${username_opt}::g' /home/work/iso/isolinux/live.cfg
+ [[ yes = \y\e\s ]]
+ sed -i 's:${DISTRO}:Devuan:g' /home/work/iso/boot/grub/grub.cfg
+ sed -i 's:${netconfig_opt}::g' /home/work/iso/boot/grub/grub.cfg
+ sed -i 's:${username_opt}::g' /home/work/iso/boot/grub/grub.cfg
+ sed -i 's:${ifnames_opt}::g' /home/work/iso/boot/grub/grub.cfg
+ [[ no = \y\e\s ]]
+ squash_filesystem
+ echo 'Squashing the filesystem...'
+ [[ no = \y\e\s ]]
+ mksquashfs myfs/ iso/live/filesystem.squashfs -noappend
+ [[ -n '' ]]
+ [[ no = \n\o ]]
+ rm -rf myfs
+ make_iso_fs
+ echo 'Creating CD/DVD image file...'
+ [[ yes = \y\e\s ]]
+ [[ -f /usr/lib/syslinux/mbr/isohdpfx.bin ]]
+ [[ -f /usr/lib/syslinux/isohdpfx.bin ]]
+ [[ -f /usr/lib/ISOLINUX/isohdpfx.bin ]]
+ isohybrid_opt='-isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin'
+ [[ -n liveiso ]]
+ xorriso -as mkisofs -r -J -joliet-long -l -iso-level 3 -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -partition_offset 16 -V liveiso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e boot/grub/efiboot.img -isohybrid-gpt-basdat -no-emul-boot -o /home/snapshot/snapshot-20231226_1934.iso iso/
xorriso 1.5.6 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev 'stdio:/home/snapshot/snapshot-20231226_1934.iso'
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 8735m free
xorriso : WARNING : -volid text does not comply to ISO 9660 / ECMA 119 rules
Added to ISO image: directory '/'='/home/work/iso'
xorriso : UPDATE :     329 files added in 1 seconds
xorriso : UPDATE :     329 files added in 1 seconds
xorriso : NOTE : Copying to System Area: 432 bytes from file '/usr/lib/ISOLINUX/isohdpfx.bin'
libisofs: NOTE : Automatically adjusted MBR geometry to 1016/121/32
libisofs: NOTE : Aligned image size to cylinder size by 338 blocks
xorriso : UPDATE :  1.12% done
xorriso : UPDATE :  10.83% done
xorriso : UPDATE :  30.82% done
xorriso : UPDATE :  46.08% done, estimate finish Tue Dec 26 19:44:55 2023
xorriso : UPDATE :  64.24% done, estimate finish Tue Dec 26 19:44:55 2023
xorriso : UPDATE :  80.15% done, estimate finish Tue Dec 26 19:44:56 2023
xorriso : UPDATE :  97.18% done
ISO image produced: 983488 sectors
Written to medium : 983488 sectors at LBA 0
Writing to 'stdio:/home/snapshot/snapshot-20231226_1934.iso' completed successfully.

+ [[ yes = \y\e\s ]]
+ cd /home/snapshot
+ sha256sum snapshot-20231226_1934.iso
+ cd /home/work
+ cleanup
+ [[ no = \n\o ]]
+ echo Cleaning...
+ cd /
+ rm -rf /home/work
+ rm -rf /tmp/extracted
+ final_message
+ echo -e '\n\tAll finished!\n'
+ exit 0

Offline

#8 2023-12-26 21:45:22

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

Re: Refracta not booting in VM

The Refracta iso not booting in VM is weird. Check the sha256sum to make sure the download was good. But that doesn't explain the other failures.

The script output suggests that you have a resume file in your initramfs. (remove_resume=yes) but I don't see a corresponding 'rm -f ...resume' in the section under "edit_initrd".  Run lsinitramfs | grep resume $initrd where $initrd is the full path to the initrd in the excalibur iso. If you mount the iso, it will be in $mountpoint/live/initrd.img. Or you could retrieve it from the build host (assuming you set save_work=yes in refractasnapshot.conf). It would be in /home/work/iso/live/initrd.img.

You could also look in the build system for /etc/initramfs-tools/conf.d/resume and see what's in it. If it exists, make sure it says RESUME=none inside or delete it, and then run update-initramfs -u You only need the resume file if you want to resume from disk hibernation, and you usually don't want that in your snapshot.

Offline

#9 2023-12-27 08:38:50

samhain
Member
Registered: 2017-04-03
Posts: 67  

Re: Refracta not booting in VM

So I redid every step ... result:

- refracta_12.0_nox_amd64-20230829_1853.iso boots, as you suggested it had the wrong checksum.
- RTAI and PREEMPT-RT don't boot in VM even after rebuilding. lsinitrd shows sane content.
- excalibur snapshot: lsinitrd just shows kernel microcode, nothing else.

It looks like my quck hack from https://dev1galaxy.org/viewtopic.php?pid=46256#p46256 is reponsible. The initrd is not unpacked correctly, so it's not rebuilt correctly. As refractasnapshop fails to unpack the initrd without the hack I'll need to dig deeper ...

Offline

#10 2023-12-27 12:09:31

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

Re: Refracta not booting in VM

There's a fix for refractasnapshot coming soon. Until then, another workaround is to remove the microcode package, make the snapshot iso, then install the microcode after you install a system on hardware. You could include the microcode packages in the iso to install them without a network connection if desired.

Offline

#11 2023-12-30 19:16:48

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

Re: Refracta not booting in VM

If you feel like testing, here's a modified refractasnapshot script that handles editing the initramfs better. I've tested it in a VM with encrypted lvm and then again in the same system after adding amd64-microcode and intel-microcode. I did this in daedalus, which is using zstd compression for the initramfs. Seems to work fine.

Copy the file, make it executable and run it from your current directory:

sudo ./refractasnapshot -d

(or as root without the sudo)
https://git.devuan.org/devuan/refractas … tasnapshot

Offline

#12 2024-01-01 10:24:33

samhain
Member
Registered: 2017-04-03
Posts: 67  

Re: Refracta not booting in VM

So I had some time beween fireworks and breakfast smile

These are 2 patches for /usr/bin/refractashapshot and /usr/bin/refractashapshot-gui. They take care of these things:
- unpacking the initramfs using `unmkinitramfs` instead of doing it manually.
- unite 'early' and 'main' directories, if firmware made things worse.
- support "cpio archive" if initramfs is uncompressed.

Patch for refractasnapshot:

--- /usr/bin/refractasnapshot-original	2024-01-01 09:09:11.664004107 +0100
+++ /usr/bin/refractasnapshot	2024-01-01 09:55:52.332110964 +0100
@@ -319,35 +319,14 @@
 	pushd /tmp/extracted

 	COMPRESSION=$(file -L "$initrd_image" | egrep -o 'gzip compressed|XZ compressed|cpio archive')
+	#COMPRESSION="XZ compressed"

-	if [ "$COMPRESSION" = "gzip compressed" ]; then
-		echo "Archive is gzip compressed..."
-		zcat "$initrd_image" | cpio -i
-
-	elif [ "$COMPRESSION" = "XZ compressed" ]; then
-		echo "Archive is XZ compressed..."
-		xzcat "$initrd_image" | cpio -d -i -m
-
-	elif [ "$COMPRESSION" = "cpio archive" ]; then
-		echo "Archive is cpio archive..."
-		(cpio -i ; zcat | cpio -i) < "$initrd_image"
-		exit_code="$?"
-		if [ "$exit_code" -ne 0 ] ; then
-			(cpio -i ; xzcat | cpio -i) < "$initrd_image"
-			exit_code="$?"
-			if [ "$exit_code" -ne 0 ] ; then
-				echo "Decompression error" && exit 1
-			else
-				COMPRESSION="XZ compressed"
-			fi
-		else
-			COMPRESSION="gzip compressed"
-		fi
-
-		echo "COMPRESSION is $COMPRESSION"
-
-	else
-		echo "Decompession error..." && exit 1
+	unmkinitramfs "$initrd_image" .
+        exit_code="$?"
+        [ -d early ] && ( mv early/* .; rmdir early )
+	[ -d main ]  && ( mv main/* .; rmdir main )
+	if [ "$exit_code" -ne 0 ] ; then
+		echo "Decompression error" && exit 1
 	fi

 	popd
@@ -395,6 +374,8 @@
 		find . -print0 | cpio -0 -H newc -o | gzip -c > ${work_dir}/iso/live/${initrd_image##*/}
 	elif [ "$COMPRESSION" = "XZ compressed" ] ; then
 		find . | cpio -o -H newc | xz --check=crc32 --x86 --lzma2=dict=512KiB > ${work_dir}/iso/live/${initrd_image##*/}
+	elif [ "$COMPRESSION" = "cpio archive" ] ; then
+		find . -print0 | cpio -0 -H newc -o > ${work_dir}/iso/live/${initrd_image##*/}
 	else
 		echo "Compression error..."
 		exit 1

Patch for refractasnapshot-gui:

--- /usr/bin/refractasnapshot-gui-original	2024-01-01 11:09:21.640279198 +0100
+++ /usr/bin/refractasnapshot-gui	2024-01-01 11:12:14.148285780 +0100
@@ -379,35 +379,14 @@
 	pushd /tmp/extracted

 	COMPRESSION=$(file -L "$initrd_image" | egrep -o 'gzip compressed|XZ compressed|cpio archive')
+	#COMPRESSION="XZ compressed"

-	if [ "$COMPRESSION" = "gzip compressed" ]; then
-		echo "Archive is gzip compressed..."
-		zcat "$initrd_image" | cpio -i
-
-	elif [ "$COMPRESSION" = "XZ compressed" ]; then
-		echo "Archive is XZ compressed..."
-		xzcat "$initrd_image" | cpio -d -i -m
-
-	elif [ "$COMPRESSION" = "cpio archive" ]; then
-		echo "Archive is cpio archive..."
-		(cpio -i ; zcat | cpio -i) < "$initrd_image"
-		exit_code="$?"
-		if [ "$exit_code" -ne 0 ] ; then
-			(cpio -i ; xzcat | cpio -i) < "$initrd_image"
-			exit_code="$?"
-			if [ "$exit_code" -ne 0 ] ; then
-				echo "Decompression error" && exit 1
-			else
-				COMPRESSION="XZ compressed"
-			fi
-		else
-			COMPRESSION="gzip compressed"
-		fi
-
-		echo "COMPRESSION is $COMPRESSION"
-
-	else
-		echo "Decompession error..." && exit 1
+	unmkinitramfs "$initrd_image" .
+	exit_code="$?"
+	[ -d early ] && ( mv early/* .; rmdir early )
+	[ -d main ]  && ( mv main/* .; rmdir main )
+	if [ "$exit_code" -ne 0 ] ; then
+		echo "Decompression error" && exit 1
 	fi

 	popd
@@ -455,6 +434,8 @@
 		find . -print0 | cpio -0 -H newc -o | gzip -c > ${work_dir}/iso/live/${initrd_image##*/}
 	elif [ "$COMPRESSION" = "XZ compressed" ] ; then
 		find . | cpio -o -H newc | xz --check=crc32 --x86 --lzma2=dict=512KiB > ${work_dir}/iso/live/${initrd_image##*/}
+	elif [ "$COMPRESSION" = "cpio archive" ] ; then
+		find . -print0 | cpio -0 -H newc -o > ${work_dir}/iso/live/${initrd_image##*/}
 	else
 		echo "Compression error..."
 		exit 1

Last edited by samhain (2024-01-01 12:11:24)

Offline

#13 2024-03-02 11:18:56

samhain
Member
Registered: 2017-04-03
Posts: 67  

Re: Refracta not booting in VM

Today I tried the new refractasnapshot  from excalibur repository (10.4.0). It still cannot handle the standard initrd from the excalibur kernel --> creation of initrd "works", but the created initrd is not bootable. Problem is still the same as described above, which is handle_cpio_extraction only extracts the microcode, not the initrd:

cpio_extracted/
├── kernel
│   └── x86
│       └── microcode
│           └── GenuineIntel.bin
└── main_filesystem

I still dont understand why the extraction of the initrd is not handled by "unmkinitramfs".

Anyway, here comes the patch to make refractasnapshot work with stock devuan kernel and uncompressed initrd (note:I don't care about refractasnapshot-gui - you'd need about the same patches there):

--- /usr/bin/refractasnapshot-original	2024-03-02 12:37:19.027945614 +0100
+++ /usr/bin/refractasnapshot	2024-03-02 13:44:19.447975320 +0100
@@ -330,57 +330,6 @@
 }

-handle_cpio_extraction () {
-	#
-	# Handle newer kernels, whose initrd might have the "actual"
-	# filesystem concatenated. If so, temporarily save the original
-	# initrd filename and work with the "real" filesystem image.
-	#
-	mkdir -p /tmp/cpio_extracted
-	pushd /tmp/cpio_extracted
-
-	local size=$(du -sb $initrd_image | cut -f 1)
-	local cpio_extracted_size=$(cpio -iF $initrd_image 2>&1 | cut -d ' ' -f 1)
-
-	if [[ $cpio_extracted_size < $size ]]; then
-		dd if=$initrd_image of=main_filesystem skip=$cpio_extracted_size
-		cpio_initrd_image=$initrd_image
-		initrd_image="$(pwd)/main_filesystem"
-	fi
-
-	set_initrd_compression_type
-
-	popd
-}
-
-
-cleanup_cpio_extraction () {
-	#
-	# Create the final CPIO archive, whose structure should match that
-	# of the original initrd image. Remove old files/variables.
-	#
-	pushd /tmp/cpio_extracted
-
-	rm main_filesystem || ( \
-		echo "Error while removing extracted filesystem."
-		echo "Try `rm /etc/cpio_extracted/main_filesystem` manually."
-		exit 1
-	)
-	find . | cpio --create --format='newc' > rebuilt_cpio
-	cat ${work_dir}/iso/live/${initrd_image##*/} >> rebuilt_cpio
-
-	rm ${work_dir}/iso/live/${initrd_image##*/}
-	initrd_image=$cpio_initrd_image
-	unset cpio_initrd_image
-
-	mv rebuilt_cpio ${work_dir}/iso/live/${initrd_image##*/}
-
-	popd
-	if [ -d "/tmp/cpio_extracted" ]; then
-		rm -rf /tmp/cpio_extracted
-	fi
-}
-

 extract_initrd () {

@@ -389,26 +338,13 @@

 	set_initrd_compression_type

-	if [ "$initrd_compression" == "cpio archive" ]; then
-		echo "cpio archive found: Searching for its real filesystem..."
-		unset initrd_compression
-		handle_cpio_extraction
-	fi
-
-	if [ "$initrd_compression" == "Zstandard compressed" ]; then
-		echo "Archive is zstd compressed..."
-		zstd --decompress --stdout "$initrd_image" | \
-			cpio --extract --make-directories --preserve-modification-time
-
-	elif [ "$initrd_compression" == "gzip compressed" ]; then
-		echo "Archive is gzip compressed..."
-		zcat "$initrd_image" | cpio -i
-
-	elif [ "$initrd_compression" == "XZ compressed" ]; then
-		echo "Archive is XZ compressed..."
-		xzcat "$initrd_image" | cpio -d -i -m
-
-	fi
+	unmkinitramfs "$initrd_image" .
+	for i in main early; do
+		if [ -d $i ]; then
+			mv $i/* .
+			rmdir $i
+		fi
+	done

 	popd

@@ -450,7 +386,10 @@

 	pushd /tmp/extracted

-	if [ "$initrd_compression" == "gzip compressed" ]; then
+	if [ "$initrd_compression" == "cpio archive" ]; then
+		find . -print0 | cpio -0 -H newc -o > ${work_dir}/iso/live/${initrd_image##*/}
+
+	elif [ "$initrd_compression" == "gzip compressed" ]; then
 		find . -print0 | cpio -0 -H newc -o | gzip -c > ${work_dir}/iso/live/${initrd_image##*/}

 	elif [ "$initrd_compression" == "XZ compressed" ] ; then
@@ -464,10 +403,6 @@
 		exit 1
 	fi

-	if [ $cpio_initrd_image ]; then
-		cleanup_cpio_extraction
-	fi
-
 	popd

 	rm -rf /tmp/extracted

Last edited by samhain (2024-03-02 13:37:35)

Offline

Board footer