View Single Post
Old 05-16-2013, 11:34 AM   #23
Grunge
Member
Grunge can eat soup with a fork.Grunge can eat soup with a fork.Grunge can eat soup with a fork.Grunge can eat soup with a fork.Grunge can eat soup with a fork.Grunge can eat soup with a fork.Grunge can eat soup with a fork.Grunge can eat soup with a fork.Grunge can eat soup with a fork.Grunge can eat soup with a fork.Grunge can eat soup with a fork.
 
Posts: 12
Karma: 9172
Join Date: Apr 2013
Device: Kobo Touch
failed to run run.sh from external sd

Quote:
Now when I insert a MicroSD card with a run.sh script on it, it will automatically run the script! This way I can start up nickel normally when the device boots, but kill it in run.sh if I need to. Also, the device reboots when the SD card is removed... this is for convenience.
Hia i tried to do the same... but failed --> Update: solved.

so i modified the rootfs/usr/local/Kobo/udev/sd to run run.sh of the external card like this: (exec because there is no run flags on fat32)
Code:
if [ "$DEV" == "$DEVNAME" ]; then
	if [ "$ACTION" == "add" ]; then
		dosfsck -a -w $DEVNAME
#mount write, exec
		mount -w -t vfat -o user,exec,shortname=mixed $DEVNAME /mnt/sd
		if [ $? != 0 ]; then
#			mount -r $DEVNAME /mnt/sd
			if [ $? != 0 ]; then
				echo sd mount fail $DEVNAME >> /tmp/nickel-hardware-status &
			else
				echo sd $ACTION $DEVNAME >> /tmp/nickel-hardware-status &
			fi
		else
			echo sd $ACTION $DEVNAME >> /tmp/nickel-hardware-status &
		fi
		/mnt/sd/run.sh
	fi
fi

but it never executes my run.sh on the external card.

So my next step is to get usb terminal so i can start to do anything... i'm a bit stuck and loose way to much of my free time with guessing what could go on in this blackbox.

run.sh
#!/bin/bash

LOGFILE=/mnt/sd/log.txt

log(){
echo "$(date +%c) $*" >>$LOGFILE
}

log "run.sh started."
log "kill nickel..."

#end the party
killall nickel

log "insmod.."

#insmod usb ethernet

/bin/busybox insmod /drivers/ntx508/usb/gadget/arcotg_udc.ko
/bin/busybox insmod /drivers/ntx508/usb/gadget/g_ether.ko

log "set ip to usb..."

#set ip to usb ethernet
ifconfig usb0 192.168.2.2

log "run.sh end."

i also tried to change inittab/rcS direct to not execute nickel and hindenburg and do direct
/bin/busybox insmod /drivers/ntx508/usb/gadget/arcotg_udc.ko
/bin/busybox insmod /drivers/ntx508/usb/gadget/g_ether.ko
but i couldn't find the usb device on the pc. (linux, lsusb).

SOLVED
took it home where i have unsecure wifi (non enterprise+cert) and here is was easy to log in to wifi and figure out what was wrong.
All fine now, just replaced all files in usb/gadget/ by does from the update package, fixed a typo i had and thats it. connecting fine.

so whats next for me, ssh?
any advice for the novice?

i have also to cross compile cutycapt, but failed already with the kernel ;-/
whats the best build environment?

Last edited by Grunge; 05-16-2013 at 03:37 PM. Reason: problem solved
Grunge is offline   Reply With Quote