Welcome
Welcome to refracta

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today!

Load to RAM option at Boot

Ask your questions here.

Re: Load to RAM option at Boot

Postby fsmithred » 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)
User avatar
fsmithred
 
Posts: 2101
Joined: Wed Mar 09, 2011 9:13 pm

Re: Load to RAM option at Boot

Postby dzz » Fri Jan 27, 2017 1:35 pm

Code: Select all
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: Select all
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.
dzz
 
Posts: 647
Joined: Wed Apr 27, 2011 11:53 am
Location: Devon, England

Re: Load to RAM option at Boot

Postby fsmithred » 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: Select all
/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: Select all
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
}
User avatar
fsmithred
 
Posts: 2101
Joined: Wed Mar 09, 2011 9:13 pm

Re: Load to RAM option at Boot

Postby dzz » Fri Jan 27, 2017 2:55 pm

Using your configs and /live I get the same error.. but it works without /live. ?
dzz
 
Posts: 647
Joined: Wed Apr 27, 2011 11:53 am
Location: Devon, England

Re: Load to RAM option at Boot

Postby fsmithred » 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!
User avatar
fsmithred
 
Posts: 2101
Joined: Wed Mar 09, 2011 9:13 pm

Re: Load to RAM option at Boot

Postby dzz » 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: Select all
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".
dzz
 
Posts: 647
Joined: Wed Apr 27, 2011 11:53 am
Location: Devon, England

Re: Load to RAM option at Boot

Postby miyolinux » Fri Jan 27, 2017 5:46 pm

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

Thanks for everything everyone!
miyolinux
 
Posts: 40
Joined: Tue Oct 25, 2016 2:45 am

Re: Load to RAM option at Boot

Postby fsmithred » 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?
User avatar
fsmithred
 
Posts: 2101
Joined: Wed Mar 09, 2011 9:13 pm

Re: Load to RAM option at Boot

Postby fsmithred » 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: Select all
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: Select all
      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?
User avatar
fsmithred
 
Posts: 2101
Joined: Wed Mar 09, 2011 9:13 pm

Re: Load to RAM option at Boot

Postby dzz » 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.
dzz
 
Posts: 647
Joined: Wed Apr 27, 2011 11:53 am
Location: Devon, England

PreviousNext

Return to Help

Who is online

Users browsing this forum: No registered users and 0 guests

cron
suspicion-preferred