PDA

View Full Version : customized cheat codes



Harry Kuhman
11-16-2004, 11:25 PM
Since 3.3, I have had to use cheat codes to boot my notebook. 3.1 still boots fine with no codes (other than a NIC issue I've discussed elsewhere.) I couldn't even figure out what codes I needed for about 6 months (it took two together to get things working, either by iitself just caused the notebook to hang). I'm apparently not alone in this, reading over the forums, most users seem to expect to need to use cheat codes, even though it must frustrate most new users who expect to just insert and boot the "Live CD".

I have to say I really like the Kanotix boot menu. At least it gives several common cheat codes right in the menu. It is much more user friendly than the Knoppix cheat code approach.

However, I do use Knoppix and I do have to type in a long string of cheat codes every time I boot off of CD. I haven't gotten to the point of remastering. I don't even know if I can remaster without installing to hard disk, and I'm not in a position to install to hard disk. However, I would very much like to get past having to type in the cheat codes every time I boot.

Here's my idea:

I think it would be great if Knoppix included a boot line of default cheat codes that could be edited right in the iso file with a hex editor. This line would start as just knoppix and a string of spaces after it, but any user who knows how to work a hex editor could change the start up string for his own iso to any cheat codes he needed. Sure, hex editing isn't for everyone, but it would be much simpler than what I'm seeing involved in remastering (or even in installing to hard disk). If such a line were available in Knoppix and there were an easy way to find it, then a lot of the burden of using cheat codes would go away. This doesn't solve anything for the new guy who hopes to put a Knoppix CD in his system and see it boot and run without his needing to coach it along, but at least once we figure out how to get Knoppix started on our particular machine we could go back and make a relatively simple edit to the iso and then have a CD that would boot on that system without typing in stuff every time.

j.drake
11-17-2004, 04:45 PM
I have to say I really like the Kanotix boot menu. At least it gives several common cheat codes right in the menu. It is much more user friendly than the Knoppix cheat code approach.

I like Kanotix too, but one of its disadvantages is that the unlisted cheatcodes are not accessible in a live CD context. Take a basic PMI, for example. You have a persistent home and configurations established, and you want to use tohd and fromhd. None of these boot codes (tohd, fromhd, home=, config=) are on the menu, and, AFAICT, I don't see any place on the boot screen for entering them. Consequently, in the liveCD or basic PMI context, you cannot access your files, configs, or KLIKed programs - every boot is Groundhog Day. When I posted the question of how to enter these bootcodes in the Kanotix forum, Kano replied that I needed to edit the GRUB menu. Well, that's fine, and I certainly like that approach, but it seems rather inaccessible to people who are just learning, and using PMI or liveCD to learn the ropes.

So, I don't want Knoppix users to lose their ability to type in boot codes on the fly, and I really don't see hex editing as a viable alternative (It certainly isn't for me). But I do like the idea of editing the GRUB menu, and having at least some of the boot codes available by mouse click.

jd

Markus
11-17-2004, 06:59 PM
I think it would be great if Knoppix included a boot line of default cheat codes that could be edited right in the iso file with a hex editor. Not a bad idea at all, but how about a customisable bootfloppy that would be made after booting which would then transfer the used cheatcode string to the bootfloppy. A USB stick could be used as well. Not as handy as customising the CD of course but a bit easier.


I like Kanotix too, but one of its disadvantages is that the unlisted cheatcodes are not accessible in a live CD context. Take a basic PMI, for example. You have a persistent home and configurations established, and you want to use tohd and fromhd. None of these boot codes (tohd, fromhd, home=, config=) are on the menu, and, AFAICT, I don't see any place on the boot screen for entering them. Ok, I might be missing something again but what I do when booting Kanotix is highlight the default EN menuitem and then manually edit the boot line at the bottom where all cheatcodes are displayed.

j.drake
11-17-2004, 07:44 PM
Ok, I might be missing something again but what I do when booting Kanotix is highlight the default EN menuitem and then manually edit the boot line at the bottom where all cheatcodes are displayed.

No, I think I did. I was looking for a place to type in cheatcodes, BEFORE highlighting, and couldn't find it. I'll take another look. Hopefully, I will find it as you described. Thanks for the clarification.

jd

Harry Kuhman
11-17-2004, 09:52 PM
..... and I really don't see hex editing as a viable alternative (It certainly isn't for me). But I do like the idea of editing the GRUB menu,.........
I've still been thinking about this, and the more I think about it the more I like it. Hex editing isn't all that bad (for many years I would install official fixes for several companies I worked for by patching in just this way. Later I started receiving update tapes that did the same thing, they just installed by patching over existing locations in a program file, which is where the term patches comes from.) While I can see that one might consider hex editing of the iso file something they don't want tp bring up for the very first time user or for Grandma, it is really a lot simpler than remastering (and that's certainly true from the maze of remastering problems I've read about here).

But here are a few additional thoughts on this. I think cheat codes would be a great place to start (since, as I stated, cheat codes seem to becoming the rule rather than the exception any more for Live CD users of Knoppix). But the concept could certainly be extended to other areas as well: If the strings can be found then may features could be changed, especially if it was planned for and there was a little padding left in to allow for longer strings. Things in the compressed clopp file whouldn't be available to be changed this way, but the stuff outside of it if fair game. Even with very limited knowledge of Linux structure, I can see that one should be able to build a CD with custom cheat codes, the ability to point to a start-up script (on a hard drive partition or USB key), point to new wallpaper or start-up sound, and more. I don't really have a good grasp of what configuration file controls what, and which are created on the fly and which might be already on the CD and editable, but I think there is a lot of potential here. And even if it was just to let us not have to type in a long cheat code each time we boot, that should be well worth the minor effort.

While hex editing is certainly the way this would and should start (if you can't hex edit then you don't have to do this, you still have everything you have now). But once this gets started, it would be extremely easy to write an application that could be used in place of a general purpose hex editor to do the same things. A very simple C prorgam could open and edit the right locations and let the user make changes in text rather than hex (or in whatever format the field in question needed). Such an appliaction would be easy to make available for both Linux and Windows users, allowing lots of people to make these changes to their iso files before burning them (heck, the application would even change some ID in the file making it easy to see that you had a customized version of Knoppix). Heck, I already have a very bad pun picked out for the name of the program, and I would be glad to write it.

Hex editing is by far simpler than repartitioning, installing lilo or otherwise dealing with the MBR, and may other things we seem to expect average users to do. It certainly is a reasonable way to try to start this. I would only ask that the developers create some defauls cheat code string (like "knoppix") with lots of space characters padded to the end of it to allow for the cheat codes to be padded in. And, of course, some clue as to where to look for it might be nice, since I susppect the string knoppix appears more than once in the iso.

Fabianx
11-26-2004, 05:09 PM
Hi,

actually Hex editing is possible.

Actually there was a tool called knoppix-customize to change cheatcodes in the original ISO-file.

But not many ppl used it. It does no longer work with isolinux, but Kester said it would be quite easily possible to change it for the new isolinux.cfg file.

Just search for example for "quiet".

You even have some "offset", which you can use for your custom lines.

cu

Fabian

Harry Kuhman
11-26-2004, 05:34 PM
actually Hex editing is possible.......
Yea. I haven't given up on this, although some home repair problems are taking away a lot of my time at the moment. I did find the isolinux.cfg file within the iso and it's clear that it could be edited to do a lot of what I would want (I expect there are other place in the iso that would be interesting to edit too). Unfortunately, the hex editor I was using didn't like editing a 700 meg file with my 512 meg ram system one bit, so my next step will be to shop around for a hex editor that can better deal with files this size. In the end I expect I'll want to put some tool together to let someone just drop in another cfg file, or to edit what's there in text rather than in hex, but for the proof of concept finding a large file friendly hex editor is a logical step.

Sorry to hear the original program to do this is no longer maintained. Was the source ever made available? I can certainly see that it might be for a small sub-set of users, but it still seems worth while. And with versions since 3.3 seeming to need cheat codes on many systems that would boot prior versions with no problems, maybe more people would get use out of it. Myself, I would rather see the hardware detection take a more fail-safe approach and let the live CD boot on more systems without needing cheat codes (even if it did so at less than the performance that more agressive setings might give you), but things don't seem headed in that direction.

Fabianx
11-26-2004, 06:10 PM
>Yea. I haven't given up on this, although some home repair problems are taking away a lot of
>my time at the moment. I did find the isolinux.cfg file within the iso and it's clear that it
>could be edited to do a lot of what I would want (I expect there are other place in the iso
>that would be interesting to edit too). Unfortunately, the hex editor I was using didn't like
>editing a 700 meg file with my 512 meg ram system one bit, so my next step will be to shop

... vi(m) can for example ...

>Sorry to hear the original program to do this is no longer maintained. Was the source ever
> made available?

Of course! It should not be so difficult to change it.

> I can certainly see that it might be for a small sub-set of users, but it still seems worth
> while.

Of course. Its just that Kester had no time.

> And with versions since 3.3 seeming to need cheat codes on many systems that
> would boot prior versions with no problems, maybe more people would get use out of it.

Well its mostly the "fault" of Kanotix and me. Since 3.4 Klaus enabled ACPI, APIC and so on ...

>Myself, I would rather see the hardware detection take a more fail-safe approach and let
> the live CD boot on more systems without needing cheat codes (even if it did so at less
> than the performance that more agressive setings might give you),
> but things don't seem headed in that direction.

If it were for Klaus alone, they would and I must say I tend to agree to you.

But:

It _is_ nicer for most ppl to plug it in and to have dma enabled though _some_ machines don't boot with dma enabled.

And dma is a really big performance factor.

Do you really want to disalbe dma again?

Why do you think Knoppix still has the alsa chatcode and not enabled by default?

IT _is_ a problem ...

Perhaps with the new (Kanotix like) menu settings, we can have an item like:

Boot old-fashioned way ...

cu

Fabian

Fabianx
11-26-2004, 07:40 PM
Hi,

ok I spent some more time and looked a bit on knoppix-customize, which was to difficult to change.

Then I searched for tools to change iso files and found none (at least for linux for Windows there are plenty).

So I changed one :-).

I found the tool isoinfo, which was able to extract files and I changed it to be able to replace equally sized files. (And so far its just working ... :-) )

You can get a binary from http://debian.tu-bs.de/knoppix/experiments/iso-customize/isoinfo

If you want so see what I changed, please take a look at:

http://debian.tu-bs.de/knoppix/experiments/iso-customize/isoinfo.c.diff

I'll try to get it into the official software package, but Joerg Schilling is known to be a very
sophisticated person, so it won't be easy.

Perhaps I can encourage him to make full featured iso tools, though.

Usage is like:



./isoinfo -i test.iso -J -x /boot/isolinux/boot.msg > boot.msg
vi boot.msg
./isoinfo -i test.iso -J -r /boot/isolinux/boot.msg < boot.msg


I know this is just a bad hack, but a quite good working one. ;-)

cu

Fabian

Harry Kuhman
11-27-2004, 03:04 AM
....Perhaps with the new (Kanotix like) menu settings, we can have an item like:

Boot old-fashioned way ...

cu

Fabian
Yea, I like the Kanotix boot menu and it would be a nice enhancement for Knoppix. I would hope there wouild be many options, from agressive to very conservative. Would do a lot to help new users, who seem to be trying the new versions but don't know what codes they need to use. It was a problem for me too, I had been using the live CD since 3.1, but suddenly the new versions would not boot for me, and it took me about 6 months of on and off testing before I found that I needed not one but two cheat codes combined for my laptop to boot into the new distros.

Really appreciate your feedback Fabian (as well as your contributions to Knoppix). Thanks.

Fabianx
11-27-2004, 03:26 AM
Really appreciate your feedback Fabian (as well as your contributions to Knoppix). Thanks.

Have you seen or tested the new program I did make?

See one post above your one (the isoinfo one).

Do you think this would be enough to write some nice dialogs for knoppix-customize.

cu

Fabian

Harry Kuhman
11-27-2004, 03:58 AM
Have you seen or tested the new program I did make?

See one post above your one (the isoinfo one).

Do you think this would be enough to write some nice dialogs for knoppix-customize.

cu

Fabian

I saw the post, will follow it up. Still trying to read a lot of other forums I've fallen begind on, but the information was not ignored. The tool to replace ISO parts seems great. I can certainly live with the same size issue. The thought Perhaps I can encourage him to make full featured iso tools, though. would be a fantastic thing to have.

One more thought, it would be nice if it (or any Live CD) could include the debian package mbr. It looks like an important tool for some things (like USB flash device booting).

I'm too green to make a judgement yet on if it would be enough to write some nice dialogs for knoppix-customize, but that's certainly an approach to consider. Looks like it should do a lot, but I need to get a lot more hands on before I would make any conclusion. Thanks for pointing me in this direction though.

Fabianx
11-27-2004, 02:32 PM
[...]
One more thought, it would be nice if it (or any Live CD) could include the debian package mbr. It looks like an important tool for some things (like USB flash device booting).

I'm too green to make a judgement yet on if it would be enough to write some nice dialogs for knoppix-customize, but that's certainly an approach to consider. Looks like it should do a lot, but I need to get a lot more hands on before I would make any conclusion. Thanks for pointing me in this direction though.

To your first question: lilo -M /dev/hda does basically do the same as the mbr package. (Boots the active partition)

To your second one:

Well, I'm still thinking about a good GUI how to do it, but I can think of a good thing yet, because the linuxrc format is quite complex.

Perhaps like:

Choose which entry you want to choose:

default
linux26
[...]
expert
all

While selecting a single entry gives you the corresponding line and all lets you just add a cheatcode to all lines or remove one from all lines (Yo then have to know which one you want to add or remove though)

Would this be an idea?

GUI-startup would be:

- Select ISO-Image

Then a menu:

- Change cheatcodes
- Show current isolinux.cfg
- Write back isolinux.cfg
- Quit

Any more options needed from a users perspective?

cu

Fabian

Harry Kuhman
11-27-2004, 09:22 PM
WOW, sounds sweet!



GUI-startup would be:

- Select ISO-Image

Then a menu:

- Change cheatcodes
- Show current isolinux.cfg
- Write back isolinux.cfg
- Quit

Any more options needed from a users perspective?

I can see one more option that likely would be handy:
- restore isolinux.cfg from CDROM defaults

Fabianx
11-27-2004, 09:35 PM
WOW, sounds sweet!

I can see one more option that likely would be handy:
- restore isolinux.cfg from CDROM defaults

Well there is a problem with that ...

When you write back your changes, the script can no longer restore the defaults ...

Well I guess just giving an error message (if nothing has changed) is sufficient ...

What do you think?

cu

Fabian

Harry Kuhman
11-27-2004, 10:06 PM
Well there is a problem with that ...

When you write back your changes, the script can no longer restore the defaults ...

Well I guess just giving an error message (if nothing has changed) is sufficient ...

What do you think?

I'm confused, but that seems to be a common state for me lately. I had expected that, as long as the user were running from CD, the original information would still be there on the CD and could be used to recover from any bad isolinux.cfg that the user made. I'm not following why isolinux.cfg can't be restored. I'm not saying that it's a serious problem for me, but my impression was that people like you and Klaus wanted to be sure users would not screw themselves up in ways that would prevent the CD from booting (which I'm told is why home=scan and config=scan are not defaults, although I hope they find their way into the new menu).

Fabianx
11-27-2004, 10:57 PM
Well there is a problem with that ...

When you write back your changes, the script can no longer restore the defaults ...

Well I guess just giving an error message (if nothing has changed) is sufficient ...

What do you think?

I'm confused, but that seems to be a common state for me lately. I had expected that, as long as the user were running from CD, the original information would still be there on the CD and could be used to recover from any bad isolinux.cfg that the user made.

I'm not following why isolinux.cfg can't be restored. I'm not saying that it's a serious problem for me, but my impression was that people like you and Klaus wanted to be sure users would not screw themselves up in ways that would prevent the CD from booting (which I'm told is why home=scan and config=scan are not defaults, although I hope they find their way into the new menu).

Well you could be running the script not only from CD, but also from Windows or from another Linux system, where you do not have a isolinux.cfg. So I thought restoring the image would mean: Just grab the old isolinux.cfg from the ISO-image, when the user has made changes, but does not like his changes. (Instead of having to restart the program)

home=scan and myconfig=scan are not default, because:

Think of following szenario:

Mr. Evil has forgotten his USB-Stick in your computer, which by coincidence has a knoppix.sh, which does do: dd if=/dev/zero of=/dev/hda ...

And Mr. Evil uses that USB stick sometimes with a special Knoppix to delete machines, but he never imagined that it would delete your machine. He is sooo sorry ...

;-)

Ok, the same applies to unpacking just some config files ...

This is the reason, but if a user chooses:

Use knoppix.sh config script its _his_ choice and his
responsibility.

If we make it default, its our responsibility.

I hope you understand now ...

I'm working on the new menu ...

cu

Fabian