LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
Search this Thread
Old 11-10-2006, 10:20 PM   #1
raklo
Member
 
Registered: Apr 2006
Posts: 143

Rep: Reputation: 15
/sbin/reboot of busybox filesystem does not work


hi,
i 've created a filesystem from buildroot for an x86 based board ,for which i m using 2.6.11.1 custom compiled kernel.
but when i enter
#reboot

the kernel poweroff's the computer and leaves the control,the computer in a shutdown mode.

how to get /sbin/reboot
the /sbin/reboot binary should be using uclibc libraries as
the filesystem created by buildroot ,only allows binaries compiled using uclibc libraries.

ANY INPUT IS APPRECIATED
regards
rakesh
 
Old 11-11-2006, 07:12 AM   #2
raskin
Senior Member
 
Registered: Sep 2005
Location: Russia
Distribution: NixOS (http://nixos.org)
Posts: 1,893

Rep: Reputation: 68
Well, does your kernel has either acpi or apm included?
 
Old 11-13-2006, 04:08 AM   #3
raklo
Member
 
Registered: Apr 2006
Posts: 143

Original Poster
Rep: Reputation: 15
the kernel has ACPI included.

so shud i remove that option??

thanx in advance
regards
rakesh
 
Old 11-13-2006, 12:56 PM   #4
raskin
Senior Member
 
Registered: Sep 2005
Location: Russia
Distribution: NixOS (http://nixos.org)
Posts: 1,893

Rep: Reputation: 68
No. If it was off, it would stop everything from working.

I guess strace is no option.. Maybe uclibc does not have the wrapper for reboot system call. What does nm say about it ?
 
Old 11-13-2006, 10:25 PM   #5
raklo
Member
 
Registered: Apr 2006
Posts: 143

Original Poster
Rep: Reputation: 15
just now,i came to know that though i had included certain options on ACPI during

#make menuconfig

and compiled the kernel,when i boot into the kernel there
is no folder made in /proc ,i.e /proc/acpi is not there which is there in other systems that have reboot working properly

so ,is it necessary that /proc/acpi shd be there to enable
proper rebooting??

i'm thinking of enabling everything related to acpi in
menuconfig options,wd that serve the purpose???

also i dont have /sys directory made in the boot filesystem ,does the absence of /sys/power affect my case in anyway??

thanx for ur replies,raskin

regards
rakesh

Last edited by raklo; 11-14-2006 at 12:03 AM.
 
Old 11-14-2006, 01:19 PM   #6
raskin
Senior Member
 
Registered: Sep 2005
Location: Russia
Distribution: NixOS (http://nixos.org)
Posts: 1,893

Rep: Reputation: 68
Well, a program may try to write to /proc/acpi/... or to /sys/power/... .To enable them, you need to build procfs and sysfs into kernel, and mount them (look at any other fstab for parameters). But checking reboot() syscall will also be interesting.
 
Old 11-15-2006, 03:00 AM   #7
raklo
Member
 
Registered: Apr 2006
Posts: 143

Original Poster
Rep: Reputation: 15
i m using filesystem created by buildroot,by default the buildroot does make /proc,i.e it has procfs filesystem,
but it does not make /sys,i.e it does not have sysfs.

as far as i know,sysfs was introduced in the 2.6 and later kernels,so does that mean that my buildroot is older or i shud do something else to create sysfs??????

i dont know how to see which version of buildroot i m using, as i dont have the tar with me rite now,but the busybox command that buildroot gives me shows v1.1.0(if it is of some help to u)

thanx again for all the help
regards
rakesh
 
Old 11-15-2006, 09:11 AM   #8
raskin
Senior Member
 
Registered: Sep 2005
Location: Russia
Distribution: NixOS (http://nixos.org)
Posts: 1,893

Rep: Reputation: 68
And is /proc mounted? And it is possible that you have an older kernel without sysfs.. But this should not be a problem.
 
Old 11-15-2006, 09:44 PM   #9
raklo
Member
 
Registered: Apr 2006
Posts: 143

Original Poster
Rep: Reputation: 15
as i said,my system has procfs,but no sysfs, and the kernel im using is 2.6.11.1,so i dont think it is older andkernel is the problem.

do u think buildroot may be the source of problem??

nything else that i shd try???
regards
rakesh
 
Old 11-16-2006, 02:51 PM   #10
raskin
Senior Member
 
Registered: Sep 2005
Location: Russia
Distribution: NixOS (http://nixos.org)
Posts: 1,893

Rep: Reputation: 68
Oops.. I asked a silly question.. Sorry.
Boot,

mkdir /proc
mount procfs -t proc /proc

Does this change anything?
Also find corresponding libc, and run nm on it:
nm libc6.so | grep reboot

I don't know uclibc naming convention about libc.so or something..
 
Old 11-16-2006, 10:51 PM   #11
raklo
Member
 
Registered: Apr 2006
Posts: 143

Original Poster
Rep: Reputation: 15
as i say again,my system already has procfs,and as u said to mount procfs(mkdir /proc .......)
i did the same with sysfs in my system,i.e embedded board
but it seems sysfs is not been mounted,and kernel is 2.6.11.1 and it has sysfs support.

as u said regarding nm,when i do
#nm /lib/libc.so.6 |grep reboot
000c05c0 T reboot
but when i do the same with uclibc library libc.so.0,it says
#nm /lib/libc.so.0 |grep reboot
no symbols

also yesterday i wrote a simple C prog,and when i executed it on my pc,it rebooted the system but when i executed
it on the embedded board,it did shutdown the system but did not reboot it.

thanx
regards
rakesh
 
Old 11-16-2006, 11:07 PM   #12
raskin
Senior Member
 
Registered: Sep 2005
Location: Russia
Distribution: NixOS (http://nixos.org)
Posts: 1,893

Rep: Reputation: 68
Well, I'm afraid that's the reason. /sbin/reboot tries to execute reboot() call from library. But there is no.. It is smart enough not to fail just on start, and it manages to shutdown the software part, but it can do nothing about hardware. Maybe you could build a static version or something.
 
Old 11-17-2006, 02:55 AM   #13
raklo
Member
 
Registered: Apr 2006
Posts: 143

Original Poster
Rep: Reputation: 15
hi,
#nm /lib/libc.so.0
does not show any symbols,not only reboot but ANY.
but when libc.so.0 is installed in my embedded board it is working perfectly and gives me all working commands.

if there is no symbol in libc.so.0(uclibc),then how does
the commands on the board work,and the board doesnt have libc.so.6(glibc),it only has uclibc.

also u had said to build a static version..so cud you elaborate on that?????

thanx again
regards
rakesh
 
Old 11-17-2006, 12:30 PM   #14
rick.2g
Member
 
Registered: Sep 2005
Posts: 41

Rep: Reputation: 15
actually, I think this may be a linux issue, not uClibc or fs. Check to make sure that the mach_reset() function is being set for your arch. I think a few embedded systems are still incomplete in this regard.

Are you using linux or uClinux?
 
Old 11-17-2006, 02:15 PM   #15
raskin
Senior Member
 
Registered: Sep 2005
Location: Russia
Distribution: NixOS (http://nixos.org)
Posts: 1,893

Rep: Reputation: 68
Then I've made a mistake.. And objdump also gives no symbols? And about static version - you will need some object file with reboot() call which you will add during linking (but you'll have to edit source, or at least configure output) to resolve function reboot().

And maybe rick.2g is right also.. It will break what I think of also..
 
  


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Filesystem set to read-only after reboot (RHEL3 ES) FishR Red Hat 7 02-17-2006 06:38 AM
"**** /sbin/dhcpcd: not running" messages on shutdown/reboot Nylex Slackware 2 01-22-2006 09:12 AM
No keyboard/mouse after reboot. Requires second reboot to work. rottie Linux - Hardware 6 01-16-2006 05:04 AM
fsck on root filesystem without reboot? Barx Linux - General 3 03-29-2005 03:55 AM
Filesystem check on reboot? augamecock Linux - General 4 04-09-2002 01:51 PM


All times are GMT -5. The time now is 11:10 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration