Author Topic: Noob questions: plopkexec entry for grub2 AND/OR running plopkexec with kexec  (Read 314 times)

prenex

  • Newbie
  • *
  • Posts: 13
Hello!

TL;DR I have two questions:

1) Can anyone show an example about how to install plopkexec into an existing grub2 as an extra entry?
2) Is it possible to run plopkexec with kexec itself? Can anyone show an example call for this latter?
+) If you think I am doing something dumb just tell me what I should do instead :-)

Rationale:

I have a laptop that cannot boot from its internal SD card reader and now has an archlinux32 installation that is fast for all things except gaming as it seems the latest drivers dropped 3D performance by 50-100%... Earlier I had an ubuntu 16.04 with good-enough 3D but it is always best to update the system or make it more light. I have failed miserably with updating to 18.04 as they tend to not test stuff as 32 bit is not supported anymore so I changed to arch32 just to find out that despite there is 3D acceleration it is too slow. Then came an idea: why don't just install a really old kernel and a really old system for which I have fglrx driver - just for playing and 3D work - and keep the original system as-is if the open drivers slowed down?

This is how I have found "kexec" originally, but from there I have found your plopkexec.

The "old" kernel I want to change into is 2.6 (really old!) and it also can do kexec already but as far as I see the target kernel does not need to know kexec to be able to kexec-ed into.

This is what I am trying:
- I have installed a really old ubuntu 8.04 on an USB stick (32bit like my machine)
- I can boot from this on a PC, but my laptop cannot boot from it. Interesting as it can boot from the arch stick I made... no UEFI though. No problem as I will install it on an internal SD card anyways.
- I have tried various kexec towards this usb key without much success (I had no success with the arch usb loader neither despite that works by bios too)
- I just want a way to start the old kerneled operating system from the new one when I want it.
- My machine cannot boot from sd card, but who cares if there is plopkexec :-)


So my plan is to first install plopexec as a menu entry in the existing grub (I have just spent days to set up arch properly so I prefer not to mess up things and this looks failsafe) and maybe even better start your app using kexec myself from a running system.

I understand that it is redundant to use kexec to run plopkexec that will indeed use kexec, but I like the menu you are providing and all the functions I see on screenshots :-)

My problem is that I find examples nowhere... I understand the concepts, but not deeply enough to write them :-(

prenex

  • Newbie
  • *
  • Posts: 13
This is what I am thinking so far for adding plopkexec in grub2, but it seems messy to me:

Code: [Select]
menuentry "Other Linux" {
#set root=(hd0,2) # I do not think I should set anything here should I?
linux /boot/plopkexec          #(add other options here as required)
initrd /boot/plopkexec.img  #(if the other kernel uses/needs one)
}

I am especially unsure about the initrd part and if I need to set some root or whatever....

prenex

  • Newbie
  • *
  • Posts: 13
Pfff murphy's law stricked as usual  ;D

Just after asking, I have found the german page here:

https://www.plop.at/de/ploplinux/desktop/grub2.html

Anyways. I was trying also to run plopkexec with kexec without luck so I am also interested in that part ;-)

These are the stuff I have tried for kexec starting:

Code: [Select]
sudo ./kexec -l ./plopkexec

sudo  ./kexec -l /home/prenex/install/grub4dos/grub4dos-0.4.4/grub.exe --initrd=/home/prenex/install/kexec-tools/build/sbin/plopkexec.iso --command-line="--config-file=debug on; map --mem (rd)+1 (0xff); map --hook; chainloader (0xff)"

sudo  ./kexec -l /home/prenex/install/grub4dos/grub4dos-0.4.4/grub.exe --initrd=/home/prenex/install/kexec-tools/build/sbin/plopkexec.iso

sudo  ./kexec -l /home/prenex/install/grub4dos/grub4dos-0.4.4/grub.exe --initrd=/home/prenex/install/kexec-tools/build/sbin/plopkexec.img

Of course always followed by a ./kexec -e command. The kexec-tools I have compiled on my own but haven't installed it system-wide yet so that is why I am using "./" everywhere so far. The files I have downloaded from your page but I haven't compiled them as I have very latest gcc in arch and I read sometimes it cause problem and I can be happy with prebuilt ones if I they work. If this is the problem of course I will compile plopkexec too ;-)

prenex

  • Newbie
  • *
  • Posts: 13
Also I was finally able to run plopkexec from my grub menu, but it does not find any linuxes :-(

I can plug in an SD card, an USB stick with linux and of course have my arch32 on the same hdd where plopkexec is in the boot folder, but it is not finding any of these... I am not sure about what is going on. I see from the logs that it sees mmblk01 and stuff like that. Also rarely (1-2 times as far as I was trying) I got a kernel panic when I removed the usb stick while plopkexec is running. Once it paniced without me touching it, but otherwise only when I plugged out something.

I was trying with the version prebuilt on your page. I will try building my own if it is not taking too long. Should I send you some logs? Can I save the logs somewhere or I need to photo them? :-)

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2413
  • a command shell is enough to do amazing things
Hello,

as you already figured out,
Code: [Select]
sudo ./kexec -l ./plopkexec
sudo ./kexec -e

should work. initrd is not required. Are there any messages after "kexec -e"?

You should also try a systemwide installation.



Also I was finally able to run plopkexec from my grub menu, but it does not find any linuxes :-(

I can plug in an SD card, an USB stick with linux and of course have my arch32 on...

The easiest would be to create a custom plopkexec.cfg with your kernel settings.

Best regards
Elmar

prenex

  • Newbie
  • *
  • Posts: 13
Hello!

When I do a

Code: [Select]
sudo ./kexec -l ./plopkexec
sudo ./kexec -e

My system hangs without doing anything. I see however that for some reason I can change the caps-lock key and the leds light up so something runs - I know from early assembly dev days that the leds of keyboard change only when a program changes them so something runs haha.

FYI: When I enter the sudo ./kexec commands above I am already out from X and run it from a plain terminal as I don't have too much experience with kexec so this seemed to be the safest.

Quote
The easiest would be to create a custom plopkexec.cfg with your kernel settings.

I am not even sure if the drive is really mounted as I was just playing a very limited time around in the terminal, but I see: I will try to create a plopexec.cfg and see if it works or ask if it isn't.

Btw I could not build the app myself as I am having a really hard time with the added busybox because it needs librpc but I only have libtirpc and I was not even having a static lib of that, so I had to build it and fail miserably haha. Is the binary the same as the last source on the page? I guess it does not count so much that I cannot compile it as it is completely self-contained and a static binary.

prenex

  • Newbie
  • *
  • Posts: 13
PS.: I will try the kexec way of running once again as I think it prints out one line, but it is just an informative message and I cannot copy it because the machine hangs and I have to turn it off-on...

prenex

  • Newbie
  • *
  • Posts: 13
PS2.: I was trying the grub.exe way only because if I just run

Code: [Select]
./kexec -l /path/to/grub.exe
./kexec -e

Then I got something up and running. I was not really able to do anything, but something started up surely and I can enter some grub-like commands like "help". Other than that I had no luck kexec-ing into anything so far :-(

prenex

  • Newbie
  • *
  • Posts: 13
Okay... This is what happens:

Code: [Select]
sudo ./kexec -l ./plopkexec
sudo ./kexec -e
[ 8458.389930] kexec_core: Starting new kernel
_

At the '_' sign the machine seems to be frozen completely. At this point I was able to press caps-lock or num-lock several times and the leds have changed. Also I had the idea to enter "help" (despite I do not see anything written) and press enter. After waiting enough time I see the "caps-lock" led continuously blinking in the way it was blinking before when I was starting plopkexec from the grub menu and it had a kernel panic so I guess there was some kernel panic in the background maybe if I wait enough?

prenex

  • Newbie
  • *
  • Posts: 13
Oh... I was so wrong... the machine is not "frozen", but I am in a different video mode hahahhaa

I mean... using kexec to run plopkexec seemed to froze down only because the kernel is having a graphic mode using modesetting even if I am in the "seemingly text terminal". I am sure that plopkexec is running in the background after this operation because in case I press "R" for reboot, it indeed reboots the machine!!!

Before realizing this I have even "stole" your kexec binary when running plopkexec from grub and mounting one of the usb keys. I played around a bit in the terminal and there I can mount a drive and also I can kexec it - but similarly it is "frozen" (I guess something does not show because video mode is bad once again).

I do not know how people are using this, but there should be a way to set maybe 80x25 directly in a proper way? Or what should I do to see the started things?

So it is because of statefullness of the VGA card it seems...

prenex

  • Newbie
  • *
  • Posts: 13
Supposedly there is a "--reuse-video-type" but I have no idea where I am supposed to add that (I only see it as a recent change in git log).

Also I see "--reset-vga" which just doesn't seem to work. So far the only thing that returns a visible output is grub.exe as I told you before, but it seems maybe kernels and even plopkexec starts just it is not visible what I am doing.

What I experience is rerally similar to this error:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=659191

Early KMS might not help in my case because my intention is actually to run a really old (2.6) kernel from a secondary SD card in my machine so I doubt I can add an early KMS to that old kernel... Also I don't see much value in adding an early KMS into plopkexec generally because it seems wrong to put in all the drivers for every possible card :-). Also I kind of feel that when I ran plopexec from grub and mounted a system just to kexec it manually from the terminal thing froze the same way so ah..... this is just a bit complicated...

I have a Mobility radeon 200M card using the open source radeon driver and KMS enabled on arch linux.

PS.: Maybe I will go back to the "grub.exe" approach as for some random reason it not only starts up, but actually I can see what I am writing. I do not know how they are able to do so though...

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2413
  • a command shell is enough to do amazing things
Beside plopkexec:
I have a laptop that cannot boot from its internal SD card reader and now has an archlinux32 installation that is fast for all things except gaming as it seems the latest drivers dropped 3D performance by 50-100%... Earlier I had an ubuntu 16.04 with good-enough 3D but it is always best to update the system or make it more light. I have failed miserably with updating to 18.04 as they tend to not test stuff as 32 bit is not supported anymore so I changed to arch32 just to find out that despite there is 3D acceleration it is too slow. Then came an idea: why don't just install a really old kernel and a really old system for which I have fglrx driver - just for playing and 3D work - and keep the original system as-is if the open drivers slowed down?

I am wondering about the performance drop. Have you tried to install the latest driver from the AMD website instead of the repository driver?

prenex

  • Newbie
  • *
  • Posts: 13
The performance drop is from 50-100% using the open drivers. Before it was playable but had glitches with rome 1 total war making it unplayable so the old fglrx might help with this too.

The latest driver from áti website is catalyst 9.2 for my card. No newer catalyst support it anymore and i had to hunt its package from a russian mirror as ati does removed it from the page.

Btw i have a long debugging i have documented on phoronix forums and concluded the slowdown is coming from mesa or x update and not kernel modules. I can link if you are interested. These days i am trying to apply reverts to mesa code according profiler outputs...

For this reason i put kexecing aside a bit. Also ubuntu 8.04 does not boot from usb on my laptop if i install it on an other machine so i might need to install it on the laptop (or install an old arch maybe). Arch has nice repo archives so that might help me later. That is how i downgraded mesa+x too...

prenex

  • Newbie
  • *
  • Posts: 13
So the drop is between the old open and new open driver, but the closer one is only available for an ancient 2.x kernel and hanga with newer. That is why i wanted to have an old system to the side even if i get back the good performance with the new open mesa after patched there might be glitches that the old closer driver handles better...

prenex

  • Newbie
  • *
  • Posts: 13
Closer -> closed source