Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add loopback.cfg #243

Open
probonopd opened this issue Jun 20, 2019 · 13 comments
Open

Please add loopback.cfg #243

probonopd opened this issue Jun 20, 2019 · 13 comments
Assignees

Comments

@probonopd
Copy link

probonopd commented Jun 20, 2019

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

@probonopd
Copy link
Author

probonopd commented Jul 20, 2019

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.

@queeup
Copy link

queeup commented May 2, 2020

No loopback on 20.04 either. 😞

@space88man
Copy link

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=}

@probonopd
Copy link
Author

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

@space88man
Copy link

space88man commented Sep 3, 2020

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?

@jrudolph
Copy link

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.

@probonopd
Copy link
Author

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

@Oifan
Copy link

Oifan commented Oct 7, 2021

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

@jackpot51
Copy link
Member

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

@VPraharsha03
Copy link

VPraharsha03 commented Nov 8, 2021

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
Copy link

Oifan commented Nov 17, 2021

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

@VPraharsha03
Copy link

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

@space88man
Copy link

space88man commented Dec 6, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants