Visualizzazione dei risultati da 1 a 9 su 9
  1. #1

    busybox aggiungere comandi al boot

    Ciao a tutti,
    ho fatto un'accesso a un piccolo lettore multimediale in telnet e vedo che è stato messo un busybox, io non ne capisco molto, ma volevo chiedere se qualcuno sa dirmi come posso inserire un comando che venga eseguito direttamente al momento del boot...nel senso che per avviare un client ftp devo farlo manualmente, invece vorrei che lo start avvenisse in automatico...qualcuno sa aiutarmi?
    Luca Bottoni's World
    www.bottonisworld.com

  2. #2
    se e' in ROM ....

    come fai a memorizzarlo ?

  3. #3
    bhe se esiste (credo di si) un file che dice quali servizi avviare all'avvio è sicuramente scrivibile in una piccola memoria, perchè i file di configurazione del server ftp/samba/torrent li ho modificati senza problemi...il problema è capire nel busybox dove avviene il boot e poi inserire un comando di start
    Luca Bottoni's World
    www.bottonisworld.com

  4. #4
    busybox e' una shell ristretta

    se hai una struttura unix

    dovresti trovare in /etc

    un file "inittab" o file "rc....."

    dovrebbero esserci gli script di avvio

  5. #5
    si ho già cercato, ma non ho trovato ne un runlevel ne il file inittab, guarda ti mostro il contenuto di /etc

    drwxrwxrwx 1 root root 2048 Sep 21 2009 .
    drwxr-xr-x 1 root root 2048 Jan 19 2010 ..
    lrwxrwxrwx 1 root root 27 Jan 19 2010 dctcs.conf -> ../usr/local/etc/dctcs.conf
    drwxrwxrwx 1 root root 2048 Sep 1 2009 dvdplayer
    -rwxrwxrwx 1 root root 342 Sep 1 2009 fstab
    lrwxrwxrwx 1 root root 22 Jan 19 2010 group -> ../usr/local/etc/group
    -rwxrwxrwx 1 root root 6 Sep 1 2009 hostname
    -rwxrwxrwx 1 root root 20 Sep 1 2009 hosts
    -rwxrwxrwx 1 root root 385 Sep 1 2009 httpd.conf
    -rwxrwxrwx 1 root root 460 Sep 1 2009 inetd.conf
    drwxrwxrwx 1 root root 2048 Sep 1 2009 init.d
    lrwxrwxrwx 1 root root 28 Jan 19 2010 ld.so.cache -> ../usr/local/etc/ld.so.cache
    lrwxrwxrwx 1 root root 27 Jan 19 2010 ld.so.conf -> ../usr/local/etc/ld.so.conf
    lrwxrwxrwx 1 root root 14 Jan 19 2010 mtab -> ../proc/mounts
    lrwxrwxrwx 1 root root 23 Jan 19 2010 passwd -> ../usr/local/etc/passwd
    lrwxrwxrwx 1 root root 24 Jan 19 2010 passwd- -> ../usr/local/etc/passwd-
    -rwxrwxrwx 1 root root 80 Sep 1 2009 ppscdn_config.ini
    lrwxrwxrwx 1 root root 24 Jan 19 2010 profile -> ../usr/local/etc/profile
    drwxrwxrwx 1 root root 2048 Sep 1 2009 reexec_init
    lrwxrwxrwx 1 root root 26 Jan 19 2010 resolv.conf -> /usr/local/etc/resolv.conf
    -rwxrwxrwx 1 root root 20373 Sep 1 2009 services
    -rwxrwxrwx 1 root root 7 Sep 1 2009 system_svn_version
    -rwxrwxrwx 1 root root 1893 Sep 1 2009 udhcpc.script
    Luca Bottoni's World
    www.bottonisworld.com

  6. #6
    guarderei in:

    init.d

    reexec_init

    services

  7. #7
    ok, se puoi seguirmi


    # ls -la /etc/reexec_init/
    drwxrwxrwx 1 root root 2048 Sep 1 2009 .
    drwxrwxrwx 1 root root 2048 Sep 21 2009 ..
    -rwxrwxrwx 1 root root 523 Sep 1 2009 fstab
    -rwxrwxrwx 1 root root 1620 Sep 1 2009 init.script
    -rwxrwxrwx 1 root root 123 Sep 1 2009 lock_usbdisk
    -rwxrwxrwx 1 root root 270 Sep 1 2009 rcS
    # ls -la /etc/init.d/
    drwxrwxrwx 1 root root 2048 Sep 1 2009 .
    drwxrwxrwx 1 root root 2048 Sep 21 2009 ..
    -rwxrwxrwx 1 root root 227 Sep 1 2009 S50inetd
    -rwxrwxrwx 1 root root 1752 Sep 1 2009 mount.rcS
    -rwxrwxrwx 1 root root 76 Sep 1 2009 rcS
    -rwxrwxrwx 1 root root 1816 Sep 1 2009 rcS1
    -rwxrwxrwx 1 root root 2821 Sep 1 2009 syslog.rcS
    services è un file dove vedo avvengono le associazioni delle label con le porte...esempio telnet 23/tcp
    Luca Bottoni's World
    www.bottonisworld.com

  8. #8
    dentro init.d ho 2 file che potrebbero essere quello che si cerca

    init.script
    ------------------------
    #!/bin/sh
    # This script is used to do some things before changing root to ram. It will try to
    # move mount points of usbdisk to new root, and then execute "loader_a" to install
    # firmware that resides in some usbdisk or on the internet.
    #
    # Use "kill -6 1" to trigger busybox to execute this script and then execute new init
    # in ram.

    # Ramfs can use more memory
    echo 1 > /sys/realtek_boards/update

    # If we echo lock_usbdisk script to /tmp, it cannot work. This is pretty strange.
    #echo -e "#!/bin/sh\n\nwhile [ -f /tmp/usbdisk_lock ]; do\n\ttrue;\ndone\n\n" > /tmp/lock_usbdisk
    #chmod a+x /tmp/lock_usbdisk
    cp /etc/reexec_init/lock_usbdisk /tmp/
    touch /tmp/usbdisk_lock

    #swapoff /mnt/rd/swap.img

    # Keep usbdisk mounts
    for Dir in `ls /mnt/usbmounts/`; do
    cd /mnt/usbmounts/$Dir; /tmp/lock_usbdisk&
    done
    cd /mnt/rd; /tmp/lock_usbdisk&
    cd /tmp; umount -a; rm /tmp/usbdisk_lock; cd /

    mount -t ramfs ramfs /mnt/hda
    cd /mnt/hda; cp -a /lib /bin /sbin /etc .
    mkdir -p /mnt/hda/usr/local; cd /mnt/hda/usr; cp -a /usr/bin /usr/sbin .; cd /mnt/hda/usr/local/; cp -a /usr/local/sbin .
    rm -rf /mnt/hda/lib/modules
    cd /mnt/hda; cp /etc/reexec_init/rcS etc/init.d/; cp /etc/reexec_init/fstab etc/
    mkdir -p /mnt/hda/tmp /mnt/hda/proc /mnt/hda/sys
    mkdir -p /mnt/hda/mnt/old /mnt/hda/mnt/rd
    cp /tmp/installing_source /mnt/hda/tmp/

    # Move usbdisk mounts
    for Dir in `ls /mnt/usbmounts/`; do
    mkdir -p /mnt/hda/mnt/usbmounts/$Dir
    mount --move /mnt/usbmounts/$Dir /mnt/hda/mnt/usbmounts/$Dir
    done
    mv /tmp/* /mnt/hda/tmp
    mount --move /mnt/rd /mnt/hda/mnt/rd
    pivot_root /mnt/hda /mnt/hda/mnt/old
    mkdir dev; mount -t devfs devfs dev
    rcS
    #!/bin/sh

    umount /mnt/old/dev # It seems that dev may not be unloaded successfully.
    umount /mnt/old/tmp /mnt/old
    mount -a

    read FIRM_URL < /tmp/installing_source

    if [ "$FIRM_URL" != "" ]; then
    loader_a -t $FIRM_URL
    else
    loader_a
    fi

    echo "Welcome to Realtek Linux"
    Luca Bottoni's World
    www.bottonisworld.com

  9. #9
    prova dentro rcS

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.