Link to home
Start Free TrialLog in
Avatar of kemmons
kemmons

asked on

Linux Boot Process mods

Hello,

I am installing one of those infamous car mp3 players, for of course, the linux operating system. I am not satisfied with any of the pre-canned solutions offered (CAJUN, etc.) So basically I am on my own here.

I am currently using MAndrake 6.5 and am upgrading to mandrake 7.2 soon.

I want to use LILO to pass an environment variable at startup with the default boot configuration (This will equate to "Quick boot, autologin, and load music player") This environment variable will then be tested for somewhere in the boot process in order to decide whether or not to load unnecessary services. (for instance, I wouldn't load networking, Samba, etc. when I just want to play music.) Could this all be done using an unassigned runmode and having Inittab check for the environment variable and boot to the alternative runmode when the variable is present?? I would really prefer if I could do this all in a different runmode, because then (I think) it would mean a modification of inittab and the addition of rcx.d files for the additional runmode.  The reason for all this mess is that I would like to boot the standard mandrake installation using runmode 3 when I have a keyboard and mouse plugged in. All I would have to do is type in something like "linux full" or something like that at LILO and then it would boot like it did out of the box.

Another consideration is that I would like to have the computer autologin as some user (superuser is OK) when performing the quick, music boot, because I will want to run an X server and launch something like Xmms eventually. (Right now I am just using command line mpg123.) If anyone could instruct me on how to start an x session and fire up a program like XMMS then I would be greatful (I want quick and dirty ... no window managers if possible!!)

While we are at it, does anyone know how to run a process that has direct control of hardware (parallel port and stuff??) someone told me you could run a process as root and this is valid, is that true?? how do you do it??

Thanks, since this question has multiple parts I am upping the point value.
Avatar of jjw_2000
jjw_2000

Concerning the last part of your question (the first parts are way beyond me):

a reference to look at would be Rubini's Linux Device Drivers (O'Reilly). While I do not think that the book is as good as it is touted to be (I find the author's skill with the language -- English -- lacking), I seem to recall that a fairly large section of it is devoted to programming the parallel port.

Running as root is necessary in order to gain access to I/O ports in Linux. User processes without root permissions are denied access to I/O ports. Processes running as root may bypass this restriction using calls to iopl() or ioperm(). A call to the former changes the privelege level of the running process so that it may access ALL I/O ports without restriction. A call to ioperm(x) by a root process results in that process being granted unrestricted access to ONLY THAT I/O port.

(I am a little unsure as to the accuracy of the comments above...for a more definitive, and probably more accurate, description of the following reference the man pages for iopl and ioperm).
well, here's what i know broken down:

you asked:
LILO to pass an environment variable

try this,
lilo already supports passing the runlevel on the lilo prompt. try 'linux 1', 'linux 3'... etc. without the quotes of course. that corresponds to the runlevels. so that means that you could do your configurations for init accordingly and you're all set there.


you asked:
X server and launch something like Xmms eventually. (Right now I am just using command line mpg123.) If anyone could instruct me on how to start an x session and fire up a program like XMMS then I would be greatful (I want quick and dirty ... no window managers if possible!!)


you have to run a window manager -- any window manager if you want to see anything that remotely resembles X-windows on your monitor. but despair not. try using fvwm. it is extreamly configurable. you can even set it up so that you just see the barebones white-wire-mesh type thingy only and nothing else. here's how...
when you type startx (i'll tell you how to get straight into it from boot in a second), the startx launches a server, then tries to launch a windows manager. it first looks for a file called .xinitrd in your home directory, if not found, it looks for it in /etc/ directory. easiest way to get fvwm working is to just install it and then copy the xinitrd file from /etc/ directory into your home directory as .xinitrc (note the dot.) open it in an editor of your choice and then delete all the unnecessary stuff from it. there are plenty of helpful comments on what each line in there does. then just add the command line for xmms in that file and youre' all set. it's been a while i've used fvwm so i don't remember the file contents itself. if something goes wrong and you can't get out of Xwindows, just hold ctrl-alt-backspace and that kills the Xserver. with a little tweaking, you should be able to get it the way you want. rinse and repeat. basically the idea is that startx finds out what window manager and what startup programs you want to run from the .xinitrc file. edit it and you're all set. for kde, the .xinitrc files has the line 'startkde' since kde takes care of your desktop etc. fvwm needs it in the xinitrc file. that's how you'd tell it to start xmms and nothing else.


third,
to boot straight into windows, edit the file /etc/inittab and look for a line that looks like:
id:3:initdefault:

(i'm using the runlevel 3 as my default, yours might be different.)

delete the three and put in the runlevel you want to boot into by default. most people use 5 for a 'windows' boot. you also need to setup some sort of windows-login-manager. kdm, gdm etc... see the howtos since it can get quite complex.


lastly, as far as i know, you need to log in. i don't know of a way to bypass the login unless you do some fancy stuff with the PAM.
Avatar of kemmons

ASKER

Thanks, Aaryal.

This pretty much does it for the Xwindows stuff. Unfortunately I have to still figure out how to not have a login. This application has no keyboard, so a login is going to be tough!!

:o)

I know you can do it because MAndrake 7.2 (which I tried and did not like) has an option on setup to log in as a chosen user (it boots into runlevel 5). Maybe I could see how they did it (not likely I would figure it out though)

Do you recomment fvwm or fvwm95 (I forget which is which)

Thanks,

~Ken
fvwm95 is (as far as i know) just fvwm with an xinitrc file that makes it act like win95. ie. all the windows components are defined in that xinitrc file. so you should be fine with either. i would suggest fvwm since there might be something else to it that i don't know of. but since you're going to replace the .xinitrc anyways....

sorry i can't help you with the password thingy since i don't know it. look into PAM. the documentation is bound to lead you to what you're looking for. PAM stands for Pluggable Authentication Module.

later.
to boot without password, logins etc... boot into runlevel one. copy your scripts from rc3.d into rc1.d.

that might get you around having to log in. if you try linux 1 at the lilo prompt and it doesn't come up with the login prompt, you're all set.

how 'bout grading this thing sometime soon dude?
ASKER CERTIFIED SOLUTION
Avatar of aaryal
aaryal

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks.. :)