LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-19-2009, 08:48 AM   #1
Mardok
LQ Newbie
 
Registered: May 2009
Posts: 4

Rep: Reputation: 0
Compiling a linux kernel to run a command and quit


Hello everyone

I'm attempting to create a Linux box that will be compatible with Macintosh's Netboot.

http://www.afp548.com/article.php?st...61220102102611

If the Mac is able to find the Linux box over Netboot, I'd like to be able to boot the Macintosh into a PPC Linux kernel. However, I want the kernel to run a command at boot time and quit instead of logging into a terminal.

Does anyone know how to create a custom Linux kernel to just boot, run a command, and quit?
 
Old 05-20-2009, 02:26 AM   #2
pcardout
Member
 
Registered: Jun 2003
Location: Socorro, New Mexico
Distribution: Debian ("jessie", "squeeze"), Linux Mint (Serena), XUbuntu
Posts: 221

Rep: Reputation: 24
Are you sure you need a custom kernel? Linux is meant to be heavily configured. Read about the init process
for Debian.

Quote:
richard@elrond:/etc/rc2.d$ more README
The scripts in this directory are executed each time the system enters
this runlevel.

The scripts are all symbolic links whose targets are located in
/etc/init.d/ .

To disable a service in this runlevel, rename its script in this directory
so that the new name begins with a 'K' and a two-digit number, where the
number is the difference between the two-digit number following the 'S'
in its current name, and 100. To re-enable the service, rename the script
back to its original name beginning with 'S'.

For a more information see /etc/init.d/README.
You can insert you own "S" script that does whatever you want and probably even includes the command "runlevel 0" or some such
which means "shut down after you run me".
 
Old 05-20-2009, 08:08 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
The kernel makes your hardware work with the OS.
The kernel do not and cannot make commands.

Commands : See post #2, pcardout.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SDL quit compiling graciejj_82 Programming 5 04-02-2006 10:40 AM
Compiling kernel with Gentoo -- wrong command Penguin of Wonder Linux - Distributions 2 01-05-2006 08:25 PM
Howto run a program for 15 seconds and let it quit itself. bglnelissen Programming 3 03-16-2005 09:37 AM
how can I quit the desktop, to run shell only? noot Linux - Newbie 4 05-07-2004 01:03 PM
kernel making me quit linux DAChristen29 Linux - Software 8 12-31-2002 01:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration