在客制化image中作資料copy的動作-有人遇過這樣的問題嗎

中文QNX 讨论: 欢迎大家灌水,讨论有关QNX 问题。
回复
robby0524
Senior Member
帖子: 38
注册时间: 周一 6月 19, 2006 4:14 pm

在客制化image中作資料copy的動作-有人遇過這樣的問題嗎

帖子 robby0524 » 周一 4月 23, 2007 10:40 am

我的image boot可以正常開機及使用 ftp 與 telnet 的功能,但是我想在flash HD(size=1G)中互相copy資料,但是目前卻無法如此做,不知道是不是 image設定的問題嗎?我的程式與 error massage如下: 如有人遇過,可以告訴我如何解決,謝謝!

Error message:

# cp /bin/ls /tmp It is normal!

#cp /bin/ls /bin
cp: Can’t open destination file (/bin//ls):No such file or directory




code:

[virtual=x86,bios +compress] .bootstrap = {
#[virtual=x86,bios] .bootstrap = {
startup-bios
PATH=/proc/boot procnto-smp
}

[+script] startup-script = {
display_msg "Welcome to QNX Neutrino on an PC compatible BIOS system for SMP"
seedres
pci-bios &
waitfor /dev/pci
# Start 1 keyboard console
# devc-con -n8 &
#20070202
devc-con -e &
#**************
# Start serial A driver
waitfor /dev/con1
reopen /dev/con1
#reopen
devc-ser8250 -e -b38400
waitfor /dev/ser1
pipe
#touch /tmp/syslog
syslogd
slogger
# scan IDE machine
devb-eide
#devb-eide blk cache=5M
waitfor /dev/hd0
mount /dev/hd0 /
devc-pty

##### /*USB driver**/
display_msg "Start USB driver...."
on -C 1 /sbin/io-usb -duhci -dohci -dehci
waitfor /dev/io-usb/io-usb 4

display_msg "Start network interface"
#**************************************************************************************************

multi net card in the same /dev/io-net -> Test OK 20070115
io-net -dvia-rhine -dasix -di82544 -di82544 -ptcpip
waitfor /dev/socket
ifconfig en0 10.153.29.95 netmask 255.255.255.0
ifconfig en1 10.153.29.94 netmask 255.255.255.0
ifconfig en2 192.168.0.124 netmask 255.255.255.0
ifconfig en3 10.153.29.124 netmask 255.255.255.0
waitfor /dev/socket
inetd &

qconn &

display_msg "Network interface initial finish"
waitfor /dev/ptyp0 4
display_msg "Startup Finish"
[+session] PATH=/bin:/proc/boot esh &
}

# Make /tmp point to the shared memory area...
[type=link] /tmp=/dev/shmem

# Programs require the runtime linker (ldqnx.so) to be at
# a fixed location
[type=link] /usr/lib/ldqnx.so.2=/proc/boot/libc.so
#[type=link] /bin/sh=/bin/ksh

[type=link] /bin/sh=/bin/esh

#[type=link] /dev/socket=/dev/socket

# We use the "c" shared lib (which also contains the
# runtime linker)
libc.so
libm.so
libsocket.so
npm-tcpip.so
npm-tcpip-v4.so
#npm-ttcpip.so
#npm-pppmgr.so

#devn-ne2000.so
#D-link net card LIB
devn-via-rhine.so

#RTL net card LIB
devn-rtl.so


devn-i82544.so
io-blk.so
fs-qnx4.so
cam-disk.so
libcam.so

#####/*uncomment for USB driver*/
libusbdi.so
devu-uhci.so
devu-ohci.so
devu-ehci.so
devn-asix.so
######/*end USB driver*/

# The files above this line can be shared by multiple
# processes
[data=c]
devc-con
devc-ser8250
devc-pty
pci-bios
seedres
mqueue
pipe
io-net
/bin/echo=echo
/bin/stty=stty
#/dev/socket=/dev/socket
cat
tail
pci
#chat
ifconfig
ping
syslogd
#touch
slogger
ls
qconn
pidin
pdebug
slay
mount
devb-eide
ftp
inetd
shutdown
sin
use
esh
mount
sloginfo
telnet
#20070203
on
more
grep
nicinfo
#####/*USB*/
io-usb
usb
#####/*end USB*/

#./modem_ans_ppp.sh

#Services (telnetd etc) config

/usr/sbin/telnetd=telnetd
/usr/sbin/ftpd=ftpd
#/usr/sbin/pppd=pppd
/bin/login=login
/bin/sh=esh

/sbin/io-net=io-net

/sbin/io-usb=io-usb
/bin/on=on

/etc/ppp/chap-secrets = {
# Client Server Secret Addrs
#########################################
* * "password" *
}
/etc/syslog.conf = {
*.* /tmp/syslog
*.* /.../....
}

# Inetd config Files
/etc/services= /etc/services
/etc/protocols= /etc/protocols
/etc/termcap= /etc/termcap
/etc/passwd= /etc/passwd
/etc/default/login= /etc/default/login
/etc/resolv.conf= /etc/resolv.conf
/etc/shadow = /etc/shadow
#061218-ftp
#/home/sam = /home/sam

/etc/inetd.conf = {
telnet stream tcp nowait root /usr/sbin/telnetd in.telnetd
ftp stream tcp nowait root /usr/sbin/ftpd in.ftpd
-l
}


#061218-ftp deline
/etc/services={
ftp 21/tcp
telnet 23/tcp
}

/etc/ftpusers={

}


/etc/shadow={
root:CDIdxOja3k5lk:1166770462:0:0
}

/etc/passwd={
root::0:0:Superuser:/:/bin/sh
ftp:x:14:80:FTP User:/:
ftplogin:x:0:0::/:/bin/sh
}

產生image與loader的步驟:
#mkifs my.build my.ifs
#dinit -h -R -f my.ifs /dev/hd1
#dloader /dev/hd1 /usr/.../..pc2

xtang
Moderator
帖子: 1816
注册时间: 周五 9月 12, 2003 4:14 am
来自: China

帖子 xtang » 周一 4月 23, 2007 5:11 pm

1)  "#cp /bin/ls /bin",你是想干什么?把ls拷贝到自身?

2)  IDE 硬盘的mount,你的做法是:

# scan IDE machine
devb-eide
#devb-eide blk cache=5M
waitfor /dev/hd0
mount /dev/hd0 /

你确信这是你要的吗?通常一个QNX分区是这样mount的。

# scan IDE machine
devb-eide
#devb-eide blk cache=5M
waitfor /dev/hd0t79
mount /dev/hd0t79 /

robby0524
Senior Member
帖子: 38
注册时间: 周一 6月 19, 2006 4:14 pm

帖子 robby0524 » 周四 4月 26, 2007 8:05 am

"#cp /bin/ls /bin",這個部份我打錯了,正確應是 "#cp /bin/ls /usr"
我目前是可以access了,但是
1、若只有一個flash HD,只能作為一個分區嗎?
2、我在loader image時,flash HD的代號是"/dev/hd0",我可改為"/dev/hd0t79"嗎? (因為想清楚的看到type)
3、若是usb開機,亦是用mount嗎?

回复