LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   /sbin/reboot of busybox filesystem does not work (https://www.linuxquestions.org/questions/linux-kernel-70/sbin-reboot-of-busybox-filesystem-does-not-work-500491/)

raklo 11-10-2006 10:20 PM

/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

raskin 11-11-2006 07:12 AM

Well, does your kernel has either acpi or apm included?

raklo 11-13-2006 04:08 AM

the kernel has ACPI included.

so shud i remove that option??

thanx in advance
regards
rakesh

raskin 11-13-2006 12:56 PM

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 ?

raklo 11-13-2006 10:25 PM

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

raskin 11-14-2006 01:19 PM

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.

raklo 11-15-2006 03:00 AM

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

raskin 11-15-2006 09:11 AM

And is /proc mounted? And it is possible that you have an older kernel without sysfs.. But this should not be a problem.

raklo 11-15-2006 09:44 PM

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

raskin 11-16-2006 02:51 PM

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..

raklo 11-16-2006 10:51 PM

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

raskin 11-16-2006 11:07 PM

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.

raklo 11-17-2006 02:55 AM

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

rick.2g 11-17-2006 12:30 PM

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?

raskin 11-17-2006 02:15 PM

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..


All times are GMT -5. The time now is 05:41 PM.