
Iniciado por
Roberto1979
Hola carva, aunq no he tenido tiempo de leer todo el hilo, he visto q indicas q en el fichero de arranque incorporas unos alias . Te queria preguntar cualnes dicho fichero, en el cual incorporas los alias q comentas. En su dia yo estuve buscando para incorporar el demonio httpd en el y q arrancase automsticamente al encender el disco, no obstante todos los ficheros q encontre q ejecutaba al iniciar eran de solo lectura y no podia escribiren ellos. Asi q puedes indicsrme q fichero usas tu??
Un saludo.
Hola Roberto, los ficheros que uso (son dos) están en el directorio /usr/local/etc
Y son el rcS y el profile.
Para arrancar el demonio httpd hay que usar el rcS, te pongo un ejemplo de los míos.
Primero el rcS
Código:
#!/bin/sh
#ifconfig eth0 192.168.0.2 netmask 255.255.0.0
#route add default gw 192.168.0.1
#mount -t nfs -o nolock 192.168.0.1:/nfs/rootfs /mnt
dd if=/Test.fat of=/dev/rd/0
mount -t vfat /dev/rd/0 /mnt/rd
swapon /mnt/rd/swap.img
#/sbin/modprobe sata_mars &
#rm -f /usr/local/etc/dvdplayer/VenusSetup.dat
if [ -f /usr/local/etc/sata_port1 ]; then
echo @@@@load sata1@@@@
rm /usr/local/etc/libata.ko
rm /usr/local/etc/sata_mars.ko
ln -s /usr/bin/libata_1.ko /usr/local/etc/libata.ko
ln -s /usr/bin/sata_mars_1.ko /usr/local/etc/sata_mars.ko
else
echo @@@@load sata by default@@@@
fi
insmod /usr/local/etc/libata.ko
insmod /usr/local/etc/sata_mars.ko &
# try to load the external images
# assumed the 1st partition of disc is NTFS
mount -t ufsd -o force -o sparse -o rw -o nls=utf8 -o umask=0000 /dev/sda1 /mnt/hdb
if [ $? -ne 0 ]; then
echo mount failed
else
if [ -d /mnt/hdb/external_bitmaps ] && [ -f /mnt/hdb/external_bitmaps/IMAGE_GUIDE_AVHDD_BG.bmp ]; then
mount -o bind /mnt/hdb/external_bitmaps /usr/local/bin/Resource/bmp
if [ -d /mnt/hdb/www ] && [ -f /mnt/hdb/www/index.html ]; then
mount -o bind /mnt/hdb/www /usr/local/bin/Resource/www
fi
else
if [ -d /mnt/hdb/www ] && [ -f /mnt/hdb/www/index.html ]; then
mount -o bind /mnt/hdb/www /usr/local/bin/Resource/www
else
umount /mnt/hdb
fi
fi
fi
ln -s /dev/cdroms/cdrom0 /dev/cdrom0
ln -s /dev/cdrom0 /dev/dvd
ln -s /mnt/dvdvr /dev/dvdvr
########## <CUSTOM01
# Create dir for cron
mkdir -p /var/spool/cron/crontabs
# Link permanent file to cron default dir
ln -sf /usr/local/etc/opt/var/cron/crontabs/root /var/spool/cron/crontabs/root
# Start cron daemon
#/usr/local/etc/opt/sbin/cron
/usr/local/etc/opt/sbin/crond
########## CUSTOM01>
# This variable tells DvdPlayer the firmware URL for internet updating
LIVEUPDATE_URL=
DEFAULT_AP_DIR=/usr/local/bin
/usr/sbin/httpd -h /usr/local/bin/Resource/www -p 80
########## <CUSTOM02
touch /tmp/command_sender.txt
#touch /tmp/DvdPlayer.log
########## CUSTOM02>
CHIPSET="RTD1283"
if [ $CHIPSET = "RTD1183" ]; then
echo "RTD1183 sleep 3"
sleep 3
fi
if [ -f $DEFAULT_AP_DIR/DvdPlayer ] && [ -x $DEFAULT_AP_DIR/DvdPlayer ]; then
cd $DEFAULT_AP_DIR
if [ -f $DEFAULT_AP_DIR/RootApp ] && [ -x $DEFAULT_AP_DIR/RootApp ]; then
echo Running dvdplayer with RootApp
########## <CUSTOM02
# ./RootApp DvdPlayer&
tail -f /tmp/command_sender.txt | ./RootApp DvdPlayer&
########## CUSTOM02>
else
echo Running dvdplayer
########## <CUSTOM02
# ./DvdPlayer&
tail -f /tmp/command_sender.txt | ./DvdPlayer&
########## CUSTOM02>
fi
else
/etc/dvdplayer/script/run_tail
fi
########## <CUSTOM02
echo " " >> /tmp/command_sender.txt
echo "#" >> /tmp/command_sender.txt
echo "$" >> /tmp/command_sender.txt
########## CUSTOM02>
#Nand doesn't have signature
#SIGNATURE=`dd if=/dev/mtdblock/0 bs=8 count=1`
#if [ "$SIGNATURE" != "VERONA__" ]; then
# echo This is not the first time booting up. No need to write the magic into flash
# let size="0x"`grep mtd3 /proc/mtd | cut -d " " -f2`
# let size=size-0x120000
# let size=size+130816
# let size=size/4
# MAGIC=`dd if=/dev/mtdblock/3 bs=4 skip=$size count=1`
# if [ "$MAGIC" = "babe" ]; then
# echo This is not the first time booting up. No need to write the magic into flash
# else
# dd if=/usr/local/etc/magic of=/dev/mtdblock/3 bs=4 seek=$size count=1
# echo This is the first time booting up. Write the magic into flash
# fi
#fi
echo 2 /tmp/hdd/volumes/HDD1/ > /sys/realtek_boards/misc_operations
Pero OJO, ten cuidado no pongas todo lo que yo tengo aquí sin saber lo que estás haciendo, porque para que esto funcione yo he tenido que instalar cosas previamente en el equipo.
Como puedes ver hay una línea (marcada en rojo) que arranca el demonio httpd.
Ahora pongo el fichero donde están los alias: el fichero profile
Código:
# /etc/profile
# System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc
pathmunge () {
if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then
if [ "$2" = "after" ] ; then
PATH=$PATH:$1
else
PATH=$1:$PATH
fi
fi
}
# Path manipulation
if [ `id -u` = 0 ]; then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
fi
pathmunge /usr/local/bin
########## <CUSTOM01
# Add path to installed packages
pathmunge /usr/local/etc/opt/sbin
pathmunge /usr/local/etc/opt/bin
########## CUSTOM01>
# No core files by default
#ulimit -S -c 0 > /dev/null 2>&1
#limit coredumpsize unlimited
#USER="`id -un`"
#LOGNAME=$USER
#MAIL="/var/spool/mail/$USER"
HOSTNAME=`/bin/hostname`
HISTSIZE=1000
TERM=vt320
#LD_LIBRARY_PATH="/lib:/usr/lib"
#if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
# INPUTRC=/etc/inputrc
#fi
#export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC
export PATH HOSTNAME HISTSIZE TERM
#for i in /etc/profile.d/*.sh ; do
# if [ -r "$i" ]; then
# . $i
# fi
#done
#unset i
unset pathmunge
export TZ=CST+0:00:00
########## <CUSTOM02
# Set alias and variables
#alias open="eject /dev/cdroms/cdrom0"
#alias close="eject -t /dev/cdroms/cdrom0"
alias ls="ls --color"
alias ll="ls -la"
alias getdb="cp /usr/local/etc/dvdplayer/schedule_*.db /tmp/hdd/volumes/HDD1/BT"
alias setdb="cp /tmp/hdd/volumes/HDD1/BT/schedule_*.db /usr/local/etc/dvdplayer"
alias usboff="umount -f /tmp/usbmounts/sdb1"
alias usbon="/usr/local/bin/package/script/configsamba"
alias usbrw="mount -o remount rw /tmp/usbmounts/sdb1"
alias paver="mv /tmp/usbmounts/sdb1/REC/*ts /tmp/hdd/volumes/HDD1/ParaVer&"
alias verlo='watch -n 60 "ls -lche /tmp/usbmounts/sdb1/REC; ls -lche /tmp/hdd/volumes/HDD1/ParaVer"'
ETC=/usr/local/etc
EPG=/usr/local/etc/dvdplayer/schedule_record.db
BT=/tmp/hdd/volumes/HDD1/BT
REC=/tmp/hdd/volumes/HDD1/REC
USB=/tmp/usbmounts/sdb1/REC
VER=/tmp/hdd/volumes/HDD1/ParaVer
export ETC EPG BT REC USB VER
########## CUSTOM02>
ulimit -c unlimited
Como ves tengo una serie de alias y de variables que yo uso muy a menudo.
Si controlas linux, ahí puedes poner los comandos mas complicados que uses frecuentemente.
Saludos