pop-os/iso

Please add loopback.cfg

probonopd opened this issue ยท 13 comments

Issue/Bug Description:

Please add a loopback.cfg like Ubuntu ISOs do. This will allow one to boot the ISO from hard disk in an easy way.

Other Notes:

https://www.supergrubdisk.org/wiki/Loopback.cfg

Ran into this again today. Please add loopback.cfg. I had to use an entire USB drive today just to boot Pop!OS, whereas I'd have loved to just add it to GRUB like shown above.

No loopback on 20.04 either. ๐Ÿ˜ž

Pop_OS! ISO Casper doesn't containing parsing for iso-scan/filename=.

# on Pop_OS! initrd.gz
$ grep -r 'iso-scan' init scripts/
$

# on Ubuntu Desktop initrd.gz
$ grep -r 'iso-scan' init scripts/
scripts/casper-premount/20iso_scan:        iso-scan/filename=*)
scripts/casper-premount/20iso_scan:            iso_path=${x#iso-scan/filename=}

Thanks for checking @space88man. Then it should be brought over from Ubuntu. It's in the package https://packages.ubuntu.com/eoan/lupin-casper.

TL;DR you need a slightly modified initrd.gz to run in ISO-on-HDD mode by adding casper's iso-scan scripts.

Tested - I extracted initrd.gz and add /scripts/casper-premount/* and /scripts/lupin-helpers from the Ubuntu desktop ISO then rebuilt initrd.gz.

Instead of using GRUB's loopback, I pulled vmlinuz and the new initrd.gz to the HDD and referenced them in the GRUB menu entry in place of (loop)/casper/vmlinuz etc. Now

... boot=casper iso-scan/filename=/pop-os_20.04_amd64_intel_13.iso uuid=2020-08-31-22-41-10-00 ...

works and Pop_OS! is able to run in ISO-on-HDD mode. I add the uuid= to be doubly sure, since my HDD has partitions with extracted ISOs for Ubuntu, KDE Neon, etc โ€” didn't want casper to choose the wrong live image.

Off-topic: How did Pop_OS! 20.04 run on my Renoir APU when KDE Neon (latest 5.4.0) wouldn't and required nomodeset?

TL;DR you need a slightly modified initrd.gz to run in ISO-on-HDD mode by adding casper's iso-scan scripts.

That works indeed. After adding 20isoscan to scripts/casper-premount, I also had to add an entry to the scripts/casper-premount/ORDER file.

So, can a loopback.cfg be added to the official ISOs please?

Oifan commented

I highly doubt Pop!_OS will have a working loopback.cfg this year.

This seems like something any one of you could help fix with a PR. Add lupin-casper to the LIVE_PKGS in each config/pop-os file and create loopback.cfg in mk/iso.mk

TL;DR you need a slightly modified initrd.gz to run in ISO-on-HDD mode by adding casper's iso-scan scripts.

Tested - I extracted initrd.gz and add /scripts/casper-premount/* and /scripts/lupin-helpers from the Ubuntu desktop ISO then rebuilt initrd.gz.

Instead of using GRUB's loopback, I pulled vmlinuz and the new initrd.gz to the HDD and referenced them in the GRUB menu entry in place of (loop)/casper/vmlinuz etc. Now

... boot=casper iso-scan/filename=/pop-os_20.04_amd64_intel_13.iso uuid=2020-08-31-22-41-10-00 ...

works and Pop_OS! is able to run in ISO-on-HDD mode. I add the uuid= to be doubly sure, since my HDD has partitions with extracted ISOs for Ubuntu, KDE Neon, etc โ€” didn't want casper to choose the wrong live image.

Off-topic: How did Pop_OS! 20.04 run on my Renoir APU when KDE Neon (latest 5.4.0) wouldn't and required nomodeset?

@space88man @jrudolph can you share the full list of commands you used to extract & re-compress the gz because i'm missing some of the files when decompressing and on re-compressing; they aren't identical on comparing (i'm doing it for pop os 19.04)

Oifan commented

Following commands assume the content of initrd.gz is (will be) in the current directory (taken from Slackware + kernel.org):

  • extract: gzip -cd /tmp/initrd.gz | cpio -imd
  • compress: find . | cpio -o -H newc | gzip -9c > /tmp/initrd-new.gz

Following commands assume the content of initrd.gz is (will be) in the current directory (taken from Slackware + kernel.org):

  • extract: gzip -cd /tmp/initrd.gz | cpio -imd
  • compress: find . | cpio -o -H newc | gzip -9c > /tmp/initrd-new.gz

@Oifan Extraction follows a different sequence of cpio and gzip commands, but this can be avoided and directly unmkinitramfs can be used to extract everything in a go easily....

problem is some of the files do not get extracted (i've tried on different filesystems - NTFS & ext3 but they don't extract) - these files are from lib\firmware\radeon\

not sure if others have faced this issue or not

For reference Pop_OS! 21.04 build 10; build initrd with iso-scan capability:

# figure out the sizes of microcode for skip=NNNN and count=NNNN needed later
dd if=SRC/initrd.gz | cpio -it # will show size of microcode 1, say 62
.
kernel
kernel/x86
kernel/x86/microcode
kernel/x86/microcode/AuthenticAMD.bin
62 blocks

dd if=SRC/initrd.gz skip=62 | cpio -it # will show size of microcode 2, say 9004
kernel
kernel/x86
kernel/x86/microcode
kernel/x86/microcode/.enuineIntel.align.0123456789abc
kernel/x86/microcode/GenuineIntel.bin
9004 blocks

In the following comands we assume 9066 blocks for prepended microcode.

# extract initrd, need to skip AMD(62 blocks)/Intel microcode(9004 blocks)
# YMMV as the block sizes will change
dd if=SRC/initrd.gz skip=9066 | cpio -imd

# now fixup scripts/casper-premount/{20iso_scan,ORDER} scripts/lupin-helpers
# from ubuntu 21.10 (has an extra unneeded 30* script so adjust ORDER accordingly)

# reconstruct a initrd with microcode prepended
dd if=SRC/initrd.gz count=9066 > DEST/initrd-new.gz
find . | cpio -o -H newc | lz4 -l -c >> DEST/initrd-new.gz

The /scripts/casper/pre-mount/ORDER file:

/scripts/casper-premount/10driver_updates "$@"
[ -e /conf/param.conf ] && . /conf/param.conf
/scripts/casper-premount/20iso_scan "$@"
[ -e /conf/param.conf ] && . /conf/param.conf

Files after copying stuff from the Ubuntu 21.10 initrd:

$ ls   scripts/lupin-helpers scripts/casper-premount/
scripts/lupin-helpers

scripts/casper-premount/:
10driver_updates  20iso_scan  ORDER