Ask your questions here.
Post a reply

Re: Load to RAM option at Boot

Fri Jan 27, 2017 12:46 pm

Nice, thanks!

Um, it's not working here. Using live-boot 4.2.0. It says "Copying squashfs to RAM" then drops to Busybox.
Then:
rsync: mkdir "/live/medium_swap//r8_amd64/live" failed. No such file or directory (2)

If I remove the leading slash on live-media-path=/r8_amd64/live then I get the same error without the double-slash.

Also tried a few variants of toram=something, but that gives me kernel panic, and it isn't documented in the live-boot man page. (but it's in 9990-cmdline-old)

Re: Load to RAM option at Boot

Fri Jan 27, 2017 1:35 pm

Code:
tree '/media/sdb1/refracta8'
/media/sdb1/refracta8
├── bookmarks-2016-12-10.json
├── filesystem.squashfs
├── hooks
│   ├── 01hook1.sh
│   ├── 02hook2.sh
│   └── 03wireless.sh
├── hookscript
├── initrd.custom3.gz
├── initrd.custom4.gz
├── initrd.img
├── initrd.test1.img
├── persistence
├── refracta8_xfce_i386-20161014_1432.iso
└── vmlinuz

1 directory, 13 files

Not using a "/live" directory. My relevant syslinux.cfg entry:

Code:
label refracta8-32 (from squash)
  menu refracta8-32 (from squash)
  kernel /refracta8/vmlinuz
  append initrd=/refracta8/initrd.custom4.gz live-media-path=/refracta8/ boot=live union=aufs lang=en_GB swap toram debug

Post back how your layout and cfg entry is done. Double slashes seem not to matter.

Re: Load to RAM option at Boot

Fri Jan 27, 2017 1:57 pm

The /boot, /efi and /isolinux don't get used. Those directories exist in the root of the usb.
Code:
/media/pnytest/r8_amd64/
├── boot
│   └── grub
├── efi
│   └── boot
├── isolinux
├── live
│   ├── filesystem.squashfs
│   ├── initrd.img
│   ├── initrd.toram
│   ├── memtest
│   └── vmlinuz
└── pkglist_refracta8_xfce_amd64-20161013_1314


Booting grub on uefi with the following (with or without union=aufs gives same error.):
Code:
menuentry "r8_amd64 toram" {
    set gfxpayload=keep
    linux   /r8_amd64/live/vmlinuz  boot=live union=aufs toram   live-media-path=/r8_amd64/live   
    initrd  /r8_amd64/live/initrd.toram
}

Re: Load to RAM option at Boot

Fri Jan 27, 2017 2:55 pm

Using your configs and /live I get the same error.. but it works without /live. ?

Re: Load to RAM option at Boot

Fri Jan 27, 2017 3:06 pm

Same here. I moved everything up from live and fixed the menu to match, and it boots fine. Thanks.

I think the only reason I'm using a live dir is for refracta2usb backward compatibility with a standard single-boot debian-live usb configuration. I can probably change that now, and it should make the coding a little simpler. It's already that way when you use findiso.

Oh, does the modded live-boot script still work with the standard configuration? I can try that next.

Edit: Yes, it works when kernel, initrd and squash are in /live and /live is in the root of the usb.

Nice job, dzz!

Re: Load to RAM option at Boot

Fri Jan 27, 2017 5:18 pm

rsync puked because the target directory ${copyto}/${LIVE_MEDIA_PATH} didn't exist at that point.

Adding this line to the patched script, (just before line 112, the rsync command) solved it:

Code:
mkdir -p "${copyto}/${LIVE_MEDIA_PATH}"

Note, this patch as-is might break other live-boot options e.g. custom hook scripts won't get copied. Not tried yet using a persistence file.

Using dir/live for refracta2usb does make sense, keeps the iso structure as-original, although I prefer "findiso".

Re: Load to RAM option at Boot

Fri Jan 27, 2017 5:46 pm

WOW! I didn't realize what a can of worms I opened!

Thanks for everything everyone!

Re: Load to RAM option at Boot

Fri Jan 27, 2017 6:19 pm

It's ok, miyo, this is an old issue that I'm happy to see get solved.

dzz, could this be a separate live-boot script and change the command option from 'toram' to something else so that it won't interfere? toram1 or toram-squash maybe?

Re: Load to RAM option at Boot

Fri Jan 27, 2017 7:35 pm

dzz wrote:rsync puked because the target directory ${copyto}/${LIVE_MEDIA_PATH} didn't exist at that point.

Adding this line to the patched script, (just before line 112, the rsync command) solved it:

Code:
mkdir -p "${copyto}/${LIVE_MEDIA_PATH}"



I'm not sure where you mean. My script only has 103 lines, because I removed the commented lines. I added the mkdir before the first rsync.
Code:
      else
         if [ -x /bin/rsync ]
         then
            echo " * Copying squashfs to RAM" 1>/dev/console
            mkdir -p ${copyto}/${LIVE_MEDIA_PATH}       #   <--- added this line
            rsync -a --progress ${copyfrom}/${LIVE_MEDIA_PATH}/*.squashfs ${copyto}/${LIVE_MEDIA_PATH}/ 1>/dev/console  # "cp -a" from busybox also copies hidden files
         else
            [b]mkdir -p ${copyto}/${LIVE_MEDIA_PATH}[/b]
            cp -a ${copyfrom}/${LIVE_MEDIA_PATH}/* ${copyto}/${LIVE_MEDIA_PATH}
            if [ -e ${copyfrom}/${LIVE_MEDIA_PATH}/.disk ]
            then
               cp -a ${copyfrom}/${LIVE_MEDIA_PATH}/.disk ${copyto}
            fi
         fi


But it only gets to initramfs prompt. This was for putting the files back in /r8_amd64/live, right?

Re: Load to RAM option at Boot

Fri Jan 27, 2017 10:00 pm

For clarity, the modified script: https://paste.debian.net/911009/ (wow, they let me post it!). I don't know why it didn't work for you, looks like you did the right change.

You need to extract the initrd, replace both /bin/boot/9990-toram-todisk.sh and /bin/boot/9990-toram-todisk.sh with the modified version (chmod +x), rebuild initrd and use it to boot with.

This one works here whether live-media-path is dir_whatever/live/ or just dir_whatever/ .. (adjust syslinux.cfg to suit)

You sometimes need to do some work in busybox to debug this stuff. If you add "debug" to cmdline you get a "boot.log" which you can read with "less" or mount a drive and copy for later inspection.

Doing a separate script would be more difficult, they interact with others (mostly 9990-main and 9990-misc-helpers). It's just for a custom live initrd, (like we did to get a persistence file working without extra partitions) No need to modify the installed live-boot. By contrast live-config is actually designed to support individual custom scripts.

miyolinux, it's fine, no can of worms! Some of us actually enjoy hacking this stuff! Keeps me out of the pub. You can help test if you want.
Post a reply