Cannot reboot from busybox

IraqiGeek geek at IraqiGeek.com
Fri Dec 23 05:57:18 UTC 2005


On Friday, December 23, 2005 1:21 AM GMT,
Rob Landley <rob at landley.net> wrote:

> On Thursday 22 December 2005 09:46, IraqiGeek wrote:
>> I am doing all the testing on a VMware virtual machine, no ACPI, and
>> no buggy BIOS are involved. reboot doesnt hang, it just does nothing.
> 
> I prefer qemu myself.
> 
> Try this:
> 
> #include <sys/reboot.h>
> 
> int main(int argc, char *argv[])
> {
>  reboot(RB_POWER_OFF);
> }
> 
> Compile it and run it as root.  That should halt and power off
> (meaning vmware should exit).  If that compiles and runs but doesn't
> work, it's probably vmware.  If it works, it's busybox init being
> horked again. 

I named the file testprog.c, compiled like this:

cc -c testprog.c

I got testprog.o, but when I try to link:

ld testprog.o

I get the following:

ld: warning: cannot find entry _start; defaulting to 08048094
testprog.o(.text+0x24): In function 'main'
testprog.c: undefined reference to 'reboot'

reboot.h is located in /usr/include/sys in my LFS development system.

Here is a copy of my busybox .config file:

#
# Automatically generated make config: don't edit
#
HAVE_DOT_CONFIG=y

#
# General Configuration
#
# CONFIG_FEATURE_BUFFERS_USE_MALLOC is not set
CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y
# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set
CONFIG_FEATURE_VERBOSE_USAGE=y
# CONFIG_FEATURE_INSTALLER is not set
# CONFIG_LOCALE_SUPPORT is not set
CONFIG_FEATURE_DEVFS=y
CONFIG_FEATURE_DEVPTS=y
# CONFIG_FEATURE_CLEAN_UP is not set
CONFIG_FEATURE_SUID=y
# CONFIG_FEATURE_SUID_CONFIG is not set
# CONFIG_SELINUX is not set

#
# Build Options
#
# CONFIG_STATIC is not set
# CONFIG_LFS is not set
# USING_CROSS_COMPILER is not set
EXTRA_CFLAGS_OPTIONS=""

#
# Installation Options
#
# CONFIG_INSTALL_NO_USR is not set
PREFIX="./_install"

#
# Archival Utilities
#
# CONFIG_AR is not set
CONFIG_BUNZIP2=y
CONFIG_CPIO=y
# CONFIG_DPKG is not set
# CONFIG_DPKG_DEB is not set
CONFIG_GUNZIP=y
# CONFIG_FEATURE_GUNZIP_UNCOMPRESS is not set
CONFIG_GZIP=y
# CONFIG_RPM2CPIO is not set
CONFIG_RPM=y
CONFIG_TAR=y
CONFIG_FEATURE_TAR_CREATE=y
CONFIG_FEATURE_TAR_BZIP2=y
CONFIG_FEATURE_TAR_FROM=y
CONFIG_FEATURE_TAR_GZIP=y
# CONFIG_FEATURE_TAR_COMPRESS is not set
# CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY is not set
CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
CONFIG_FEATURE_TAR_LONG_OPTIONS=y
# CONFIG_UNCOMPRESS is not set
CONFIG_UNZIP=y

#
# Common options for cpio and tar
#
# CONFIG_FEATURE_UNARCHIVE_TAPE is not set

#
# Coreutils
#
CONFIG_BASENAME=y
# CONFIG_CAL is not set
CONFIG_CAT=y
CONFIG_CHGRP=y
CONFIG_CHMOD=y
CONFIG_CHOWN=y
CONFIG_CHROOT=y
CONFIG_CMP=y
CONFIG_CP=y
CONFIG_CUT=y
CONFIG_DATE=y

#
# date (forced enabled for use with watch)
#
CONFIG_FEATURE_DATE_ISOFMT=y
CONFIG_DD=y
CONFIG_DF=y
CONFIG_DIRNAME=y
# CONFIG_DOS2UNIX is not set
CONFIG_DU=y
CONFIG_FEATURE_DU_DEFALT_BLOCKSIZE_1K=y
CONFIG_ECHO=y
CONFIG_FEATURE_FANCY_ECHO=y
CONFIG_ENV=y
CONFIG_EXPR=y
CONFIG_FALSE=y
# CONFIG_FOLD is not set
CONFIG_HEAD=y
CONFIG_FEATURE_FANCY_HEAD=y
# CONFIG_HOSTID is not set
CONFIG_ID=y
CONFIG_INSTALL=y
CONFIG_LENGTH=y
CONFIG_LN=y
# CONFIG_LOGNAME is not set
CONFIG_LS=y
CONFIG_FEATURE_LS_FILETYPES=y
CONFIG_FEATURE_LS_FOLLOWLINKS=y
CONFIG_FEATURE_LS_RECURSIVE=y
CONFIG_FEATURE_LS_SORTFILES=y
CONFIG_FEATURE_LS_TIMESTAMPS=y
CONFIG_FEATURE_LS_USERNAME=y
CONFIG_FEATURE_LS_COLOR=y
# CONFIG_MD5SUM is not set
CONFIG_MKDIR=y
# CONFIG_MKFIFO is not set
CONFIG_MKNOD=y
CONFIG_MV=y
# CONFIG_OD is not set
# CONFIG_PRINTF is not set
CONFIG_PWD=y
CONFIG_REALPATH=y
CONFIG_RM=y
CONFIG_RMDIR=y
CONFIG_SEQ=y
# CONFIG_SHA1SUM is not set
CONFIG_SLEEP=y
# CONFIG_FEATURE_FANCY_SLEEP is not set
CONFIG_SORT=y
CONFIG_STTY=y
CONFIG_SYNC=y
CONFIG_TAIL=y
CONFIG_FEATURE_FANCY_TAIL=y
CONFIG_TEE=y
CONFIG_FEATURE_TEE_USE_BLOCK_IO=y
# CONFIG_TEST is not set
CONFIG_TOUCH=y
# CONFIG_TR is not set
CONFIG_TRUE=y
CONFIG_TTY=y
CONFIG_UNAME=y
CONFIG_UNIQ=y
CONFIG_USLEEP=y
# CONFIG_UUDECODE is not set
# CONFIG_UUENCODE is not set
CONFIG_WATCH=y
CONFIG_WC=y
CONFIG_WHO=y
CONFIG_WHOAMI=y
# CONFIG_YES is not set

#
# Common options for cp and mv
#
# CONFIG_FEATURE_PRESERVE_HARDLINKS is not set

#
# Common options for ls and more
#
CONFIG_FEATURE_AUTOWIDTH=y

#
# Common options for df, du, ls
#
CONFIG_FEATURE_HUMAN_READABLE=y

#
# Console Utilities
#
CONFIG_CHVT=y
CONFIG_CLEAR=y
CONFIG_DEALLOCVT=y
# CONFIG_DUMPKMAP is not set
# CONFIG_LOADFONT is not set
# CONFIG_LOADKMAP is not set
# CONFIG_OPENVT is not set
CONFIG_RESET=y
# CONFIG_SETKEYCODES is not set

#
# Debian Utilities
#
CONFIG_MKTEMP=y
# CONFIG_PIPE_PROGRESS is not set
CONFIG_READLINK=y
CONFIG_RUN_PARTS=y
# CONFIG_START_STOP_DAEMON is not set
# CONFIG_WHICH is not set

#
# Editors
#
CONFIG_AWK=y
# CONFIG_FEATURE_AWK_MATH is not set
# CONFIG_PATCH is not set
CONFIG_SED=y
CONFIG_VI=y
CONFIG_FEATURE_VI_COLON=y
CONFIG_FEATURE_VI_YANKMARK=y
CONFIG_FEATURE_VI_SEARCH=y
CONFIG_FEATURE_VI_USE_SIGNALS=y
CONFIG_FEATURE_VI_DOT_CMD=y
CONFIG_FEATURE_VI_READONLY=y
CONFIG_FEATURE_VI_SETOPTS=y
CONFIG_FEATURE_VI_SET=y
CONFIG_FEATURE_VI_WIN_RESIZE=y
CONFIG_FEATURE_VI_OPTIMIZE_CURSOR=y

#
# Finding Utilities
#
CONFIG_FIND=y
CONFIG_FEATURE_FIND_MTIME=y
CONFIG_FEATURE_FIND_PERM=y
CONFIG_FEATURE_FIND_TYPE=y
# CONFIG_FEATURE_FIND_XDEV is not set
# CONFIG_FEATURE_FIND_NEWER is not set
# CONFIG_FEATURE_FIND_INUM is not set
CONFIG_GREP=y
CONFIG_FEATURE_GREP_EGREP_ALIAS=y
CONFIG_FEATURE_GREP_FGREP_ALIAS=y
CONFIG_FEATURE_GREP_CONTEXT=y
CONFIG_XARGS=y
# CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION is not set
CONFIG_FEATURE_XARGS_SUPPORT_QUOTES=y
CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT=y
CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y

#
# Init Utilities
#
CONFIG_INIT=y
CONFIG_FEATURE_USE_INITTAB=y
CONFIG_FEATURE_INITRD=y
# CONFIG_FEATURE_INIT_COREDUMPS is not set
CONFIG_FEATURE_INIT_SWAPON=y
CONFIG_FEATURE_EXTRA_QUIET=y
CONFIG_HALT=y
CONFIG_POWEROFF=y
CONFIG_REBOOT=y
# CONFIG_MESG is not set

#
# Login/Password Management Utilities
#
# CONFIG_USE_BB_PWD_GRP is not set
CONFIG_ADDGROUP=y
CONFIG_DELGROUP=y
CONFIG_ADDUSER=y
CONFIG_DELUSER=y
CONFIG_GETTY=y
CONFIG_FEATURE_UTMP=y
CONFIG_FEATURE_WTMP=y
CONFIG_LOGIN=y
CONFIG_FEATURE_SECURETTY=y
CONFIG_PASSWD=y
CONFIG_SU=y
CONFIG_SULOGIN=y
# CONFIG_VLOCK is not set

#
# Common options for adduser, deluser, login, su
#
CONFIG_FEATURE_SHADOWPASSWDS=y

#
# Miscellaneous Utilities
#
# CONFIG_ADJTIMEX is not set
CONFIG_CROND=y
# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set
CONFIG_CRONTAB=y
# CONFIG_DC is not set
# CONFIG_DEVFSD is not set
CONFIG_LAST=y
# CONFIG_HDPARM is not set
# CONFIG_MAKEDEVS is not set
# CONFIG_MT is not set
# CONFIG_RX is not set
# CONFIG_STRINGS is not set
CONFIG_TIME=y
# CONFIG_WATCHDOG is not set

#
# Linux Module Utilities
#
# CONFIG_INSMOD is not set
# CONFIG_LSMOD is not set
# CONFIG_MODPROBE is not set
# CONFIG_RMMOD is not set

#
# Networking Utilities
#
# CONFIG_FEATURE_IPV6 is not set
# CONFIG_ARPING is not set
CONFIG_FTPGET=y
CONFIG_FTPPUT=y
CONFIG_HOSTNAME=y
# CONFIG_HTTPD is not set
CONFIG_IFCONFIG=y
CONFIG_FEATURE_IFCONFIG_STATUS=y
# CONFIG_FEATURE_IFCONFIG_SLIP is not set
# CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set
# CONFIG_FEATURE_IFCONFIG_HW is not set
# CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS is not set
# CONFIG_IFUPDOWN is not set
CONFIG_INETD=y
CONFIG_FEATURE_INETD_SUPPORT_BILTIN_ECHO=y
CONFIG_FEATURE_INETD_SUPPORT_BILTIN_DISCARD=y
CONFIG_FEATURE_INETD_SUPPORT_BILTIN_TIME=y
CONFIG_FEATURE_INETD_SUPPORT_BILTIN_DAYTIME=y
CONFIG_FEATURE_INETD_SUPPORT_BILTIN_CHARGEN=y
CONFIG_IP=y
CONFIG_FEATURE_IP_ADDRESS=y
CONFIG_FEATURE_IP_LINK=y
CONFIG_FEATURE_IP_ROUTE=y
CONFIG_FEATURE_IP_TUNNEL=y
CONFIG_IPCALC=y
# CONFIG_FEATURE_IPCALC_FANCY is not set
# CONFIG_IPADDR is not set
# CONFIG_IPLINK is not set
# CONFIG_IPROUTE is not set
# CONFIG_IPTUNNEL is not set
# CONFIG_NAMEIF is not set
CONFIG_NC=y
CONFIG_NETSTAT=y
CONFIG_NSLOOKUP=y
CONFIG_PING=y
CONFIG_FEATURE_FANCY_PING=y
CONFIG_ROUTE=y
CONFIG_TELNET=y
CONFIG_FEATURE_TELNET_TTYPE=y
CONFIG_FEATURE_TELNET_AUTOLOGIN=y
# CONFIG_TELNETD is not set
# CONFIG_TFTP is not set
CONFIG_TRACEROUTE=y
# CONFIG_FEATURE_TRACEROUTE_VERBOSE is not set
CONFIG_VCONFIG=y
CONFIG_WGET=y
CONFIG_FEATURE_WGET_STATUSBAR=y
CONFIG_FEATURE_WGET_AUTHENTICATION=y
# CONFIG_FEATURE_WGET_IP6_LITERAL is not set

#
# udhcp Server/Client
#
# CONFIG_UDHCPD is not set
# CONFIG_UDHCPC is not set

#
# Process Utilities
#
CONFIG_FREE=y
CONFIG_KILL=y
CONFIG_KILLALL=y
CONFIG_PIDOF=y
CONFIG_PS=y
CONFIG_RENICE=y
CONFIG_TOP=y
FEATURE_CPU_USAGE_PERCENTAGE=y
CONFIG_UPTIME=y
CONFIG_SYSCTL=y

#
# Another Bourne-like Shell
#
# CONFIG_FEATURE_SH_IS_ASH is not set
# CONFIG_FEATURE_SH_IS_HUSH is not set
# CONFIG_FEATURE_SH_IS_LASH is not set
# CONFIG_FEATURE_SH_IS_MSH is not set
CONFIG_FEATURE_SH_IS_NONE=y
# CONFIG_ASH is not set
# CONFIG_HUSH is not set
# CONFIG_LASH is not set
# CONFIG_MSH is not set

#
# System Logging Utilities
#
CONFIG_SYSLOGD=y
CONFIG_FEATURE_ROTATE_LOGFILE=y
CONFIG_FEATURE_REMOTE_LOG=y
# CONFIG_FEATURE_IPC_SYSLOG is not set
CONFIG_KLOGD=y
CONFIG_LOGGER=y

#
# Linux System Utilities
#
CONFIG_DMESG=y
# CONFIG_FBSET is not set
# CONFIG_FDFLUSH is not set
# CONFIG_FDFORMAT is not set
CONFIG_FDISK=y
FDISK_SUPPORT_LARGE_DISKS=y
CONFIG_FEATURE_FDISK_WRITABLE=y
# CONFIG_FEATURE_AIX_LABEL is not set
# CONFIG_FEATURE_SGI_LABEL is not set
# CONFIG_FEATURE_SUN_LABEL is not set
# CONFIG_FEATURE_OSF_LABEL is not set
# CONFIG_FEATURE_FDISK_ADVANCED is not set
CONFIG_FREERAMDISK=y
# CONFIG_FSCK_MINIX is not set
# CONFIG_MKFS_MINIX is not set
# CONFIG_GETOPT is not set
# CONFIG_HEXDUMP is not set
# CONFIG_HWCLOCK is not set
# CONFIG_LOSETUP is not set
# CONFIG_MKSWAP is not set
CONFIG_MORE=y
CONFIG_FEATURE_USE_TERMIOS=y
# CONFIG_PIVOT_ROOT is not set
# CONFIG_RDATE is not set
# CONFIG_SWAPONOFF is not set
CONFIG_MOUNT=y
CONFIG_NFSMOUNT=y
CONFIG_UMOUNT=y
CONFIG_FEATURE_MOUNT_FORCE=y

#
# Common options for mount/umount
#
CONFIG_FEATURE_MOUNT_LOOP=y
CONFIG_FEATURE_MTAB_SUPPORT=y
CONFIG_FEATURE_MTAB_FILENAME="/etc/mtab"

#
# Debugging Options
#
# CONFIG_DEBUG is not set


Regards,
IraqiGeek
www.iraqigeek.com





More information about the busybox mailing list