Cheat Codes in a Text File


Forum: DSL Ideas and Suggestions
Topic: Cheat Codes in a Text File
started by: fodder

Posted by fodder on June 13 2006,18:09
I'm fairly new to DSL so it's very possible that this has been discussed (although I did a forum search and it came up empty) so please excuse me if I'm repeating someone.

My suggestion is to add a simple text file placed in the / directory of any boot device (USB, LiveCD, HD, etc.) that would contain the boot up cheat codes.  DSL would simply look for the existance of that file and boot off those codes if nothing was manually typed in at the boot up screen.

This would eliminate having to remaster a USB thumbdrive or CD each time you want to make any changes.  You could simply edit that text file.

Thoughts?

Posted by cmanb on June 14 2006,01:47
Well, if you're using qemu to boot embedded, then you can save your favorite cheatcodes in the "dsl-windows.bat" or the "dsl-linux.sh".

From a CD, though, I don't know.  I guess I'm content to type "dsl qemu frugal mydsl=harddisk restore=harddisk" each time.

Good idea though.

Posted by fodder on June 14 2006,06:39
Quote (cmanb @ June 13 2006,21:47)
I guess I'm content to type "dsl qemu frugal mydsl=harddisk restore=harddisk" each time.

The main thing for me is changing setups...I have a fileserver that I like to run on it's own - no mouse, keyboard, or monitor.  (It runs SSH and a VNC client at boot up for external access.)
However, I just added some memory so now I can run DSL "toram".  Unfortunately, that requires the remaster.   :D

One cool thing I just discovered is that after burning the DSL image to a CD-R, you can still add mydsl files and add or replace an old backup file as a multisession burn.  That's what made me think of the cheat code text file - because you can replace existing files, sort of like upgrading firmware.  :)

Posted by Zucca on June 14 2006,07:08
Quote
My suggestion is to add a simple text file placed in the / directory of any boot device (USB, LiveCD, HD, etc.) that would contain the boot up cheat codes.

That kind of feature is only possible if
a) you simply set your computer to start from you hd (or floppy, or usb device) that contains bootloader that loads kernel from dsl cd and reads the boot commands from your hd.
b) (future?) dsl bootloader feature could first check your USB stick and hd for a text file containing boot cmds...

Hmm... and then wait if user wants to add his/her own boot cmds. If timeouts then uses the cmd from that file. If file doesn't exist then would use default from cd.

Posted by rm101520271 on June 29 2006,23:57
Just a thought,

There is a file in the root directory of whatever you boot from called syslinux.cfg

If you edit it either in DSL or on another machine, the second line (which starts APPEND) contains all of the cheat codes passed by default if you don't press anthing, there is a timeout there as well which you could reduce a bit if you wanted.

If you added or substiuted your cheat codes in there, it would do what I think you are suggesting.

Just a word of warning though, if you reduce the timeout too much or set some silly cheat codes, you could make DSL not load so don't mess around too much if you couldn't change it back again on another machine easily!

Enjoy!

Posted by mikshaw on June 30 2006,02:54
rm101520271's idea is about all you can do.  kernel parameters are set once and stick permanently...the only way to change them other than by typing in boot options at runtime is to change the bootloader, which is stored in the boot directory of the cd.  Unless you want to rewrite and recompile the bootloader, you will always need to recreate the CD each time you make a change to its defaults.

frugal harddrive install with grub makes this a very easy and flexible process.

Posted by fodder on June 30 2006,16:36
Quote (mikshaw @ June 29 2006,22:54)
rm101520271's idea is about all you can do.


mikshaw,
Exactly!  That's why I thought it would be a great addition to a future release.  :)

rm101520271,
I cannot for the life of me find the file you are talking about.  I just burned the .iso of 3.0.1 and here is all that is in the root of the CD:

Code Sample
/boot (directory)
/KNOPPIX (directory)
/lost+found (directory)
index.html


I cannot find it in any of the directories either.  I have looked on the CD using DSL (3.0.1, emelfm as a superuser, hidden files shown) and using an XP machine.  Has the file been moved in this release?  Or am I just totally misunderstanding you?  :D

Posted by mikshaw on June 30 2006,17:29
However, in order to for it to work the DSL devs would need to modify and recompile 4 bootloaders (grub, lilo, isolinux, and syslinux), and possibly do the same to the kernel. That's a pretty big task for such a small function that can be more easily accomplished by individual users.

The bootloader's config is (on the cdrom) /boot/isolinux/isolinux.cfg for a standard CD. This file can be modified without the need to remaster the KNOPPIX file, and the process of rebuilding the ISO is made more friendly by using the mkmydsl script (make myDSL cd remaster).

Posted by fodder on July 02 2006,05:32
Quote (mikshaw @ June 30 2006,13:29)

The bootloader's config is (on the cdrom) /boot/isolinux/isolinux.cfg for a standard CD. This file can be modified without the need to remaster the KNOPPIX file, and the process of rebuilding the ISO is made more friendly by using the mkmydsl script (make myDSL cd remaster).

THANKS, mikshaw and rm101520271!

That is exactly the kind of thing I was thinking of.  Thanks for letting me know that it already exists.  :)

Posted by fodder on May 18 2007,19:38
Hi all,

I know this has been awhile, been busy with other things, but I just thought I should update this topic.

Unfortunately, isolinux.cfg file does not work for the cheatcodes that I was trying (nodhcp, toram, host, etc.)

So I guess this still is a "Suggestion" for future releases.  I wish I could help to implement, but my Linux knowledge is still in it's infancy - perhaps in a few months...:-)

Anyway, I've thought a little more about the process and it might be a better option to just add a new cheatcode that would cause DSL to look in a specific place for a text file with cheatcodes.  The point would be, you remaster a cd with only one cheatcode, like: "mycheatcodes=cdrom".  Then you can change that cheatcode text file as much as you want by simply overwriting the old file without having to completely remaster your CD.  I think this could be an invaluable tool to further the flexibility of DSL.

Any thoughts?

Posted by ^thehatsrule^ on May 18 2007,23:58
Editing isolinux.cfg should work.  Possibly you did it incorrectly?
How are you editing it and running it?

Posted by fodder on May 19 2007,01:03
Quote (^thehatsrule^ @ May 18 2007,19:58)
How are you editing it and running it?

I put the CD-R in my XP machine, copy /boot/isolinux/isoliux.cfg to my hard drive, then add my cheat codes to end of this line:
Code Sample

APPEND ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 initrd=minirt24.gz nomce noapic quiet

Then write the file back to the CD (mulitsession burn that overwrites the old file.)  (I add myDSL extensions to the CD the same way.)

DSL boots just like normal, as if the file hasn't been changed, but I can look at it in DSL (Beaver) and verify that it does, in fact have the new cheatcodes in the APPEND line.

Am I editing the wrong line?  ???

Posted by ^thehatsrule^ on May 19 2007,02:30
Yes that should be the right line... is that under "default" bootlabel? (And that you're booting by just pressing enter?)

If so, then perhaps the old isolinux.cfg is being read (possibility due to the bootloader reading the first/original track only).

Posted by fodder on May 19 2007,03:33
Quote (^thehatsrule^ @ May 18 2007,22:30)
Yes that should be the right line... is that under "default" bootlabel? (And that you're booting by just pressing enter?)

If so, then perhaps the old isolinux.cfg is being read (possibility due to the bootloader reading the first/original track only).

Ah...that would make sense....yes I'm editing the one under "DEFAULT linux24".

...I could probably solve this by using a CD-RW?  Because wouldn't it actually overwrite the old data, instead of just creating a new file on a later track?  I'll go pick some up and give it a try.  :)

Posted by ^thehatsrule^ on May 20 2007,02:24
Well, I suppose that depends on how you format your cd... and if it's still readable natively, etc.

I'd just recommend you to edit the .iso directly.

Posted by fodder on May 22 2007,00:24
Quote (^thehatsrule^ @ May 19 2007,22:24)
Well, I suppose that depends on how you format your cd... and if it's still readable natively, etc.

I'd just recommend you to edit the .iso directly.

Let me just say, ^thehatsrule^, that you have been a huge help.  Thanks so much for the thoughts.

You are correct, editing the .iso (using ISO Master) did the trick.  All cheatcodes added to the default APPEND line work like a freaking charm!

The cheatcodes I am using are: toram nodhcp noeject host=xxxx restore=cdrom mydsl=cdrom

I did run into one issue with DSL 3.3 not liking the "mydsl=cdrom" cheatcode.  During the boot process, it would install the extensions correctly, but then give the following errors:
Quote
mount: /dev/cdrom already mounted or /mnt/auto/cdrom busy
mount: according to mtab, /dev/scd0 is already mounted on /mnt/auto/cdrom
Unable to mount device cdrom
Press enter to continue:

It is critical that my machine be able to reboot without a keyboard attached so I just tried an older version (DSL 2.4) and it worked fine.  Maybe after mounting the CD to install the extensions the CD needs to be unmounted and that got changed somewhere between 2.4 and 3.3.  I also seem to remember that 2.4 would automatically scan the CD for extensions and install if it found any, even without the cheatcode - so maybe that's why it's working.

In any case, my problem is solved - thanks to everyone for their help!

Posted by ^thehatsrule^ on May 22 2007,01:14
Yes... you don't need to use that cheatcode as the mydsl directory on the cd will automatically be checked by default.
Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.