wget cant find .listing? - linux

I want do download a whole directory from a FileZilla FTP server.
I use
wget -r --user=XXXX --password='XXXX' ftp://XXXXXX.org:XX/Fertig/XXXXXX/
the error says:
--2018-12-16 21:19:55-- ftp://XXX.org:XX/XXX/
=> »XXXXX.org:XXXX/XXX/.listing«
Auflösen des Hostnamens »XXXX.org (XXXX.org)« … XXXXXXXXX
Verbindungsaufbau zu XXX.org (XXX.org)|XXXXX|:XXX … verbunden.
Anmelden als XXX … Angemeldet!
==> SYST ... fertig. ==> PWD ... fertig.
==> TYPE I ... fertig. ==> CWD (1) /XXX ... fertig.
==> PASV ... fertig. ==> LIST ... fertig.
XXXX.org:XXX/XXX: Datei oder Verzeichnis nicht gefundenXXXX.org:XX/XXXX/.listing: Datei oder Verzeichnis nicht gefunden
when i want to download a single file, it works, but only a recursive directory fails...

chmod 777 /media/usbdisk... now it works.
acess were denided.

Related

do_compile fails when building an image using the yocto-project "no such file or directory"

I tried to append a layer from git (https://github.com/sigysmund/meta-lora-net) to my Image and whenever I try to bitbake one of the recipes (the other worked), I get this error message:
ERROR: lora-pkt-fwd-4.0.1-r0 do_configure: oe_runmake failed
ERROR: lora-pkt-fwd-4.0.1-r0 do_configure: Function failed: do_configure (log file is located at /home/kilian/mlinux-4.x/build/tmp/work/arm926ejste-mlinux-linux-gnueabi/lora-pkt-fwd/4.0.1-r0/temp/log.do_configure.23440)
ERROR: Logfile of failure stored in: /home/kilian/mlinux-4.x/build/tmp/work/arm926ejste-mlinux-linux-gnueabi/lora-pkt-fwd/4.0.1-r0/temp/log.do_configure.23440
(see last part for full message)
I have already tried to edit the bb file.
I changed the DEPENDS to "lora-gateway pkgconfig" instead of just the name since I read on another thread, that this can produce Issues but it didn't help.
This is the bb file of the recipe:
SUMMARY = "LoRa network packet forwarder project"
SECTION = "libs/network"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=22af7693d7b76ef0fc76161c4be76c45"
SRC_URI = "https://github.com/Lora-net/packet_forwarder/archive/v${PV}.tar.gz"
SRC_URI[md5sum] = "a1f942e0cc7b02d604b11c8cb5f2a029"
SRC_URI[sha256sum] = "e68fadf6f1d2e5e7b601e504d5efb48b0a8f374c2c29c0476ab2fe9db68d33ae"
#old: DEPENDS += "lora-gateway"
# since new release of yocto you should add pkg-config
DEPENDS += "lora-gateway pkgconfig"
S = "${WORKDIR}/packet_forwarder-${PV}"
CFLAGS_append = "-I ${includedir}/libloragw -I ${S}/lora_pkt_fwd/inc -I ${S}/util_tx_test/inc "
do_configure_prepend() {
export LGW_PATH="${STAGING_LIBDIR}/libloragw"
}
do_compile_prepend() {
export LGW_PATH="${STAGING_LIBDIR}/libloragw"
}
do_install() {
install -d ${D}${bindir}
install -d ${D}${docdir}/lora-pkt-fwd/conf
install ${B}/lora_pkt_fwd/lora_pkt_fwd ${D}${bindir}
install ${B}/util_*/util_* ${D}${bindir}
install -D -m 0644 ${S}/PROTOCOL.TXT ${D}${docdir}/lora-pkt-fwd/PROTOCOL.TXT
install -D -m 0644 ${S}/lora_pkt_fwd/readme.md ${D}${docdir}/lora-pkt-fwd/readme.md
install -D -m 0644 ${S}/lora_pkt_fwd/global_conf.json ${D}${docdir}/lora-pkt-fwd/global_conf.json
install -D -m 0644 ${S}/lora_pkt_fwd/local_conf.json ${D}${docdir}/lora-pkt-fwd/local_conf.json
install -D -m 0755 ${S}/lora_pkt_fwd/update_gwid.sh ${D}${docdir}/lora-pkt-fwd
install -D -m 0644 ${S}/lora_pkt_fwd/cfg/*.json.* ${D}${docdir}/lora-pkt-fwd/conf
rm -f ${D}${bindir}/util_tx_test
rm -f ${D}${bindir}/.debug/util_tx_test
}
PACKAGE_DEBUG_SPLIT_STYLE = "debug-without-src"
PACKAGES = "${PN}-dbg ${PN} ${PN}-doc"
# Avoid QA Issue: No GNU_HASH in the elf binary
INSANE_SKIP_${PN} = "ldflags"
FILES_${PN}-dbg = " \
${bindir}/.debug \
"
FILES_${PN} = " \
${bindir}/* \
"
FILES_${PN}-doc = " \
${docdir} \
"
the full error is:
ERROR: lora-pkt-fwd-4.0.1-r0 do_configure: oe_runmake failed
ERROR: lora-pkt-fwd-4.0.1-r0 do_configure: Function failed: do_configure (log file is located at /home/kilian/mlinux-4.x/build/tmp/work/arm926ejste-mlinux-linux-gnueabi/lora-pkt-fwd/4.0.1-r0/temp/log.do_configure.23440)
ERROR: Logfile of failure stored in: /home/kilian/mlinux-4.x/build/tmp/work/arm926ejste-mlinux-linux-gnueabi/lora-pkt-fwd/4.0.1-r0/temp/log.do_configure.23440
Log data follows:
| DEBUG: Executing python function sysroot_cleansstate
| DEBUG: Python function sysroot_cleansstate finished
| DEBUG: Executing shell function do_configure
| NOTE: make clean
| ERROR: oe_runmake failed
| make clean -e -C lora_pkt_fwd
| make[1]: Entering directory `/home/kilian/mlinux-4.x/build/tmp/work/arm926ejste-mlinux-linux-gnueabi/lora-pkt-fwd/4.0.1-r0/packet_forwarder-4.0.1/lora_pkt_fwd'
| Makefile:17: /home/kilian/mlinux-4.x/build/tmp/sysroots/mtcdt/usr/lib/libloragw/library.cfg: No such file or directory
| make[1]: *** No rule to make target `/home/kilian/mlinux-4.x/build/tmp/sysroots/mtcdt/usr/lib/libloragw/library.cfg'. Stop.
| make[1]: Leaving directory `/home/kilian/mlinux-4.x/build/tmp/work/arm926ejste-mlinux-linux-gnueabi/lora-pkt-fwd/4.0.1-r0/packet_forwarder-4.0.1/lora_pkt_fwd'
| make: *** [clean] Error 2
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_configure (log file is located at /home/kilian/mlinux-4.x/build/tmp/work/arm926ejste-mlinux-linux-gnueabi/lora-pkt-fwd/4.0.1-r0/temp/log.do_configure.23440)
ERROR: Task (/home/kilian/mlinux-4.x/layers/meta-custom/recipes-wireless/lora-pkt-fwd/lora-pkt-fwd_4.0.1.bb:do_configure) failed with exit code '1'
NOTE: Tasks Summary: Attempted 1590 tasks of which 1580 didn't need to be rerun and 1 failed.
Summary: 1 task failed:
/home/kilian/mlinux-4.x/layers/meta-custom/recipes-wireless/lora-pkt-fwd/lora-pkt-fwd_4.0.1.bb:do_configure
Summary: There was 1 WARNING message shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
I know that is has got something to do with the libloragw/library.cfg file but since that is imported and I don't know enough about these scripts, I can't find the error.
Any hint is really appreciated!
P.s I didn't include the logfiles since everything in there is already in the Log data follows part of the error. If you need it I can upload it.
Edit:
Thank you jku, appending CLEANBROKEN = "1" fixed this error.
Sadly I am getting a new one:
ERROR: lora-pkt-fwd-4.0.1-r0 do_compile: oe_runmake failed
ERROR: lora-pkt-fwd-4.0.1-r0 do_compile: Function failed: do_compile (log file is located at /home/kilian/mlinux-4.x/build/tmp/work/arm926ejste-mlinux-linux-gnueabi/lora-pkt-fwd/4.0.1-r0/temp/log.do_compile.24486)
ERROR: Logfile of failure stored in: /home/kilian/mlinux-4.x/build/tmp/work/arm926ejste-mlinux-linux-gnueabi/lora-pkt-fwd/4.0.1-r0/temp/log.do_compile.24486
Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: make -j 2
| ERROR: oe_runmake failed
| make all -e -C lora_pkt_fwd
| make[1]: Entering directory `/home/kilian/mlinux-4.x/build/tmp/work/arm926ejste-mlinux-linux-gnueabi/lora-pkt-fwd/4.0.1-r0/packet_forwarder-4.0.1/lora_pkt_fwd'
| Makefile:17: /home/kilian/mlinux-4.x/build/tmp/sysroots/mtcdt/usr/lib/libloragw/library.cfg: No such file or directory
| make[1]: *** No rule to make target `/home/kilian/mlinux-4.x/build/tmp/sysroots/mtcdt/usr/lib/libloragw/library.cfg'. Stop.
| make[1]: Leaving directory `/home/kilian/mlinux-4.x/build/tmp/work/arm926ejste-mlinux-linux-gnueabi/lora-pkt-fwd/4.0.1-r0/packet_forwarder-4.0.1/lora_pkt_fwd'
| make: *** [all] Error 2
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /home/kilian/mlinux-4.x/build/tmp/work/arm926ejste-mlinux-linux-gnueabi/lora-pkt-fwd/4.0.1-r0/temp/log.do_compile.24486)
So there is still a problem with the libloragw/library.cfg file
I did check and there is such a file in the recipe given by the DEPENDS variable so I guess that including that and the corresponding commands don't work
CFLAGS_append = "-I ${includedir}/libloragw -I ${S}/lora_pkt_fwd/inc -I ${S}/util_tx_test/inc "
do_configure_prepend() {
export LGW_PATH="${STAGING_LIBDIR}/libloragw"
}
do_compile_prepend() {
export LGW_PATH="${STAGING_LIBDIR}/libloragw"
}
But I still don't know what to edit so any help is precious.
| DEBUG: Executing shell function do_configure
| NOTE: make clean
| ERROR: oe_runmake failed
| make clean -e -C lora_pkt_fwd
Yocto/OpenEmbedded tries to run "make clean" during configure to ensure a reproducible build but this particular project fails to do so cleanly. You can either fix the project (patching the Makefile) or add
CLEANBROKEN = "1"
in the recipe: this way OpenEmbedded won't run make clean on configure.

After upgrade from Ubuntu 18.04 to 18.10, I get a Sendmail-Base Error

After upgrading from ubuntu 18.04 to ubuntu 18.10 I am receiving the following error when write something like sudo apt-get upgrade or sudo apt-get install git. I get this error:
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.
Statusinformationen werden eingelesen.... Fertig
git ist schon die neueste Version (1:2.19.1-1ubuntu1).
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 40 nicht aktualisiert.
4 nicht vollständig installiert oder entfernt.
Nach dieser Operation werden 0 B Plattenplatz zusätzlich benutzt.
Möchten Sie fortfahren? [J/n] j
sendmail-base (8.15.2-11) wird eingerichtet ...
Saving current /etc/mail/sendmail.mc,cf to /var/backups
update-inetd: warning: cannot add service, /etc/inetd.conf does not exist
update-inetd: warning: cannot add service, /etc/inetd.conf does not exist
update-inetd: warning: cannot add service, /etc/inetd.conf does not exist
update-inetd: error: --group is only relevant with --add
dpkg: Fehler beim Bearbeiten des Paketes sendmail-base (--configure):
Unterprozess installed sendmail-base package post-installation script gab den Fehler-Ausgangsstatus 255 zurück
dpkg: Abhängigkeitsprobleme verhindern Konfiguration von sendmail-bin:
sendmail-bin hängt ab von sendmail-base (= 8.15.2-11); aber:
Paket sendmail-base ist noch nicht konfiguriert.
dpkg: Fehler beim Bearbeiten des Paketes sendmail-bin (--configure):
Abhängigkeitsprobleme - verbleibt unkonfiguriert
dpkg: Abhängigkeitsprobleme verhindern Konfiguration von sensible-mda:
sensible-mda hängt ab von sendmail-bin | mail-transport-agent; aber:
Paket sendmail-bin ist noch nicht konfiguriert.
Paket mail-transport-agent ist nicht installiert.
Paket sendmail-bin, das mail-transport-agent bereitstellt, ist noch nicht konfiguriert.
dpkg: Fehler beim Bearbeiten des Paketes sensible-mda (--configure):
Abhängigkeitsprobleme - verbleibt unkonfiguriert
dpkg: Abhängigkeitsprobleme verhindern Konfiguration von sendmail:
sendmail hängt ab von sendmail-base; aber:
Paket sendmail-base ist noch nicht konfiguriert.
sendmail hängt ab von sendmail-bin; aber:
Paket sendmail-bin ist noch nicht konfiguriert.
sendmail hängt ab von sensible-mda; aber:
Paket sensible-mda ist noch nicht konfiguriert.
dpkg: Fehler beim Bearbeiten des Paketes sendmail (--configure):
Abhängigkeitsprobleme - verbleibt unkonfiguriert
Fehler traten auf beim Bearbeiten von:
sendmail-base
sendmail-bin
sensible-mda
sendmail
E: Sub-process /usr/bin/dpkg returned an error code (1)
Before the update everything works fine.
Can anyone help me, please?
Yeah, thats it. I followed the instruction of one user that has commented at this forum. When someone has the same problem:
Only Replace:
update-inetd --group MAIL --disable smtp,smtps,submission;
with:
update-inetd --disable smtp,smtps,submission;
in file /var/lib/dpkg/info/sendmail-base.prerm
Thanks Karsten Koop!

Reverse engineer firmware image and rebuild Linux kernel for TI-AR7

I am trying to build my own Linux derivative to run on an TI-AR7 board. I took the board from an old Telekom Speedport W 501V router. To understand how firmware is flashed onto the device I have downloaded the most recent official firmware. Using the Linux file command I determined the image is a tar archive, which can be extracted easily.
ubuntu#ip-172-31-23-210:~/reverse$ ls
fw_speedport_w501v_v_28.04.38.image
ubuntu#ip-172-31-23-210:~/reverse$ file fw*
fw_speedport_w501v_v_28.04.38.image: POSIX tar archive (GNU)
ubuntu#ip-172-31-23-210:~/reverse$ tar -xvf fw*
./var/
./var/tmp/
./var/tmp/kernel.image
./var/tmp/filesystem.image
./var/flash_update.ko
./var/flash_update.o
./var/info.txt
./var/install
./var/chksum
./var/regelex
./var/signature
ubuntu#ip-172-31-23-210:~/reverse$
According to a wiki (Firmware-Image) that I have found, ./var/tmp/kernel.image contains the actual firmware. During the update process this image is written to the mtd1 device. As stated in the wiki (LZMA-Kernel) the lzma compressed kernel starts with the magic number 0xfeed1281. A hexdump of kernel.image contains that number at its beginning.
ubuntu#ip-172-31-23-210:~/reverse/var/tmp$ hexdump -n 4 kernel.image
0000000 1281 feed
0000004
ubuntu#ip-172-31-23-210:~/reverse/var/tmp$
The following script given on the last wiki entry should decompress the kernel.
#! /usr/bin/perl
use Compress::unLZMA;
use Archive::Zip;
open INPUT, "<$ARGV[0]" or die "can't open $ARGV[0]: $!";
read INPUT, $buf, 4;
$magic = unpack("V", $buf);
if ($magic != 0xfeed1281) {
die "bad magic";
}
read INPUT, $buf, 4;
$len = unpack("V", $buf);
read INPUT, $buf, 4*2; # address, unknown
read INPUT, $buf, 4;
$clen = unpack("V", $buf);
read INPUT, $buf, 4;
$dlen = unpack("V", $buf);
read INPUT, $buf, 4;
$cksum = unpack("V", $buf);
printf "Archive checksum: 0x%08x\n", $cksum;
read INPUT, $buf, 1+4; # properties, dictionary size
read INPUT, $dummy, 3; # alignment
$buf .= pack('VV', $dlen, 0); # 8 bytes of real size
#$buf .= pack('VV', -1, -1); # 8 bytes of real size
read INPUT, $buf2, $clen;
$crc = Archive::Zip::computeCRC32($buf2);
printf "Input CRC32: 0x%08x\n", $crc;
if ($cksum != $crc) {
die "wrong checksum";
}
$buf .= $buf2;
$data = Compress::unLZMA::uncompress($buf);
unless (defined $data) {
die "uncompress: $#";
}
open OUTPUT, ">$ARGV[1]" or die "can't write $ARGV[1]";
print OUTPUT $data;
#truncate OUTPUT, $dlen;
To use the script you may need to install Compress::unLZMA and Archive::Zip perl modules.
ubuntu#ip-172-31-23-210:~/reverse/var/tmp$ tar -xvf Compress*
Compress-unLZMA-0.04/
Compress-unLZMA-0.04/Makefile.PL
Compress-unLZMA-0.04/ppport.h
Compress-unLZMA-0.04/Changes
Compress-unLZMA-0.04/lzma_sdk/
[...]
ubuntu#ip-172-31-23-210:~/reverse/var/tmp$ cd Compress*
ubuntu#ip-172-31-23-210:~/reverse/var/tmp/Compress-unLZMA-0.04$ perl Makefile.PL
Checking if your kit is complete...
Looks good
Writing Makefile for Compress::unLZMA
Writing MYMETA.yml and MYMETA.json
ubuntu#ip-172-31-23-210:~/reverse/var/tmp/Compress-unLZMA-0.04$ make
cp lib/Compress/unLZMA.pm blib/lib/Compress/unLZMA.pm
/usr/bin/perl /usr/share/perl/5.18/ExtUtils/xsubpp -typemap /usr/share/perl/5.18/ExtUtils/typemap unLZMA.xs > unLZMA.xsc && mv unLZMA.xsc unLZMA.c
cc -c -I. -Ilzma_sdk/Source -D_REENTRANT -D_GNU_SOURCE
[...]
ubuntu#ip-172-31-23-210:~/reverse/var/tmp/Compress-unLZMA-0.04$ sudo make install
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /usr/local/lib/perl/5.18.2/auto/Compress/unLZMA/unLZMA.bs
Installing /usr/local/lib/perl/5.18.2/auto/Compress/unLZMA/unLZMA.so
Installing /usr/local/lib/perl/5.18.2/Compress/unLZMA.pm
Installing /usr/local/man/man3/Compress::unLZMA.3pm
Appending installation info to /usr/local/lib/perl/5.18.2/perllocal.pod
ubuntu#ip-172-31-23-210:~/reverse/var/tmp/Compress-unLZMA-0.04$ # same for Archive::Zip module
After installing these dependencies the script decompressed the kernel successfully.
ubuntu#ip-172-31-23-210:~/reverse/var/tmp$ ./decompress.pl kernel.image kernel.decompressed
Archive checksum: 0x29176e12
Input CRC32: 0x29176e12
ubuntu#ip-172-31-23-210:~/reverse/var/tmp$
But what kind of file is kernel.decompressed and how do I generate a similar file from my Linux kernel source? I continued analyzing it using file and binwalk.
ubuntu#ip-172-31-23-210:~/reverse/var/tmp$ file kernel.decompressed
kernel.decompressed: data
ubuntu#ip-172-31-23-210:~/reverse/var/tmp$ binwalk kernel.decompressed
DECIMAL HEXADECIMAL DESCRIPTION
--------------------------------------------------------------------------------
1509632 0x170900 Linux kernel version "2.6.13.1-ohio (686) (gcc version 3.4.6) #9 Wed Apr 4 13:48:08 CEST 2007"
1516240 0x1722D0 CRC32 polynomial table, little endian
1517535 0x1727DF Copyright string: "Copyright 1995-1998 Mark Adler "
1549488 0x17A4B0 Unix path: /usr/gnemul/irix/
1550920 0x17AA48 Unix path: /usr/lib/libc.so.1
1618031 0x18B06F Neighborly text, "neighbor %.2x%.2x.%.2x:%.2x:%.2x:%.2x:%.2x:%.2x lost on port %d(%s)(%s)"
1966080 0x1E0000 gzip compressed data, maximum compression, from Unix, last modified: 2007-04-04 11:45:13
ubuntu#ip-172-31-23-210:~/reverse/var/tmp$
So the Linux kernel starts at 1509632 and ends at 1516240. What kind of data is stored in front the Linux kernel (0 to 1509632)? I extracted the kernel and that piece of unknown data using dd.
ubuntu#ip-172-31-23-210:~/reverse/var/tmp$ dd if=kernel.decompressed of=unknown.data bs=1 count=1509632
1509632+0 records in
1509632+0 records out
1509632 bytes (1.5 MB) copied, 1.62137 s, 931 kB/s
ubuntu#ip-172-31-23-210:~/reverse/var/tmp$ dd if=kernel.decompressed of=kernel bs=1 skip=1509632 count=6608
6608+0 records in
6608+0 records out
6608 bytes (6.6 kB) copied, 0.0072771 s, 908 kB/s
ubuntu#ip-172-31-23-210:~/reverse/var/tmp$
I need to ask again: What kind of file is kernel and how do I generate a similar file from my Linux kernel source? I used xxd and strings to look at the file more closely.
ubuntu#ip-172-31-23-210:~/reverse/var/tmp$ xxd -l 100 kernel
0000000: 4c69 6e75 7820 7665 7273 696f 6e20 322e Linux version 2.
0000010: 362e 3133 2e31 2d6f 6869 6f20 2836 3836 6.13.1-ohio (686
0000020: 2920 2867 6363 2076 6572 7369 6f6e 2033 ) (gcc version 3
0000030: 2e34 2e36 2920 2339 2057 6564 2041 7072 .4.6) #9 Wed Apr
0000040: 2034 2031 333a 3438 3a30 3820 4345 5354 4 13:48:08 CEST
0000050: 2032 3030 370a 0000 0000 0000 0000 0000 2007...........
0000060: 0000 0000 ....
ubuntu#ip-172-31-23-210:~/reverse/var/tmp$ strings kernel
Linux version 2.6.13.1-ohio (686) (gcc version 3.4.6) #9 Wed Apr 4 13:48:08 CEST 2007
do_be
do_bp
do_tr
do_ri
do_cpu
nmi_exception_handler
do_ade
emulate_load_store_insn
do_page_fault
context_switch
__put_task_struct
do_exit
local_bh_enable
run_workqueue
2.6.13.1-ohio gcc-3.4
enable_irq
__free_pages_ok
free_hot_cold_page
prep_new_page
kmem_cache_destroy
kmem_cache_create
pageout
vunmap_pte_range
vmap_pte_range
__vunmap
__brelse
sync_dirty_buffer
bio_endio
queue_kicked_iocb
proc_get_inode
remove_proc_entry
sysfs_get
sysfs_fill_super
kref_get
kref_put
0123456789abcdefghijklmnopqrstuvwxyz
0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ
vsnprintf
{zt^f
pw0Gm
0cIZ-
68BG+
QC]S%
v,;Zk
ubuntu#ip-172-31-23-210:~/reverse/var/tmp$
This Github repository contains the extracted files to use for further analysis.

Bash Script for find a Script in a path and launch that another script

Look , i have this script , its for find , a Script inside a "path" , and launch the another script called ".Iniciar"
#!/bin/sh
# La Funcion de este Script es encontrar el directorio
# Real donde se encuentra el programa
# La Version Original es de :
# 17 de Febrero del 2000 - Sam Lantinga, Loki Entertainment Software
# Esta Version Ha sido Traducida por
# Inukaze De Venezuela
# Sitio : http://inukaze.wordpress.com
Encontrar_Ruta()
{
ruta_completa="`echo $1 | grep /`"
if [ "$ruta_completa" = "" ]; then
oIFS="$IFS"
IFS=:
for path in $PATH
do if [ -x "$path/$1" ]; then
if [ "$path" = "" ]; then
path="."
fi
ruta_completa="$path/$1"
break
fi
done
IFS="$oIFS"
fi
if [ "$ruta_completa" = "" ]; then
ruta_completa="$1"
fi
if [ -L "$ruta_completa" ]; then
ruta_completa=`ls -l "$ruta_completa" |sed -e 's/.* -> //' |sed -e 's/\*//'`
fi
dirname $ruta_completa
}
if [ "${RUTA_DEL_SOFTWARE}" = "" ]; then
RUTA_DEL_SOFTWARE="`Encontrar_Ruta $0`"
fi
LD_LIBRARY_PATH=.:${RUTA_DEL_SOFTWARE}:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH
if [ -x "${RUTA_DEL_SOFTWARE}/.Iniciar" ]
then
cd "${RUTA_DEL_SOFTWARE}/"
exec "./.Iniciar" $*
fi
echo "No Puedo ejecutar este Software. Esta bien escrito el Script de Inicio?"
exit 1
Ok , the thing its this works with path without spaces , well , im trying to run from
path "/media/Compartido/Juegos/Emuladores & Roms/MS-D.O.S/Aladdin"
for example when my terminal is in the folder "Desktop"
$ cd $HOME/Desktop
$ sh "/media/Compartido/Juegos/Emuladores & Roms/MS-D.O.S/Aladdin"/Iniciar
No Puedo ejecutar este Software. Esta bien escrito el Script de Inicio?
I can't launch it
But if i copy the folder to "/media/Shared/Games/MS-D.O.S/Aladdin"
[ inukaze | 23-09-2014 | 08:55 pm ]
[Desktop]$ sh "/media/Shared/Games/MS-D.O.S/Aladdin"/Iniciar
Encontrado el Archivo de Configuracion para : Aladdin
DOSBox version 0.74
Copyright 2002-2010 DOSBox Team, published under GNU GPL.
---
CONFIG:Loading primary settings from config file Aladdin.conf
MIXER:Got different values from SDL: freq 22050, blocksize 256
ALSA:Can't subscribe to MIDI port (65:0) nor (17:0)
MIDI:Opened device:none
Two or more joysticks reported, initializing with 2axis
Using joystick USB Gamepad with 2 axes, 10 buttons and 0 hat(s)
Using joystick Xbox Gamepad (userspace driver) with 6 axes, 11 buttons and 1 hat(s)
and trying with "zsh" from original location
[ inukaze | 23-09-2014 | 08:58 pm ]
[Desktop]$ zsh "/media/Compartido/Juegos/Emuladores & Roms/MS-D.O.S/Aladdin"/Iniciar
Encontrado el Archivo de Configuracion para : Aladdin
DOSBox version 0.74
Copyright 2002-2010 DOSBox Team, published under GNU GPL.
---
CONFIG:Loading primary settings from config file Aladdin.conf
MIXER:Got different values from SDL: freq 22050, blocksize 256
ALSA:Can't subscribe to MIDI port (65:0) nor (17:0)
MIDI:Opened device:none
Two or more joysticks reported, initializing with 2axis
Using joystick USB Gamepad with 2 axes, 10 buttons and 0 hat(s)
Using joystick Xbox Gamepad (userspace driver) with 6 axes, 11 buttons and 1 hat(s)
this works too , but i wanna ran from bash / sh
Thank you for any help.
If paths with spaces cause problems that always means you haven't used enough quoting.
Specifically you are using variables that can contain spaces without "quoting" them.
For example in the following line.
RUTA_DEL_SOFTWARE="`Encontrar_Ruta $0`"
You don't quote $0. So when you run sh "/media/Compartido/Juegos/Emuladores & Roms/MS-D.O.S/Aladdin"/Iniciar despite quoting the path as the argument there when you use that path (as $0) in the line above what the shell sees is:
RUTA_DEL_SOFTWARE="`Encontrar_Ruta '/media/Compartido/Juegos/Emuladores' '&' 'Roms/MS-D.O.S/Aladdin/Iniciar'`"
which then doesn't set $1 correctly in your function.
So to sum up: Use more quotes.

NPM on Cygwin: unexpected end of file

I am trying to use NPM on cygwin, but keep getting following errors:
ERR! tar "-mvxpf" "-" "--no-same-owner" "-C" "/tmp/npm-1305893882865/1305893885765-0.008730818051844835/contents/___package.npm" tar: Unexpected EOF in archive
ERR! tar "-mvxpf" "-" "--no-same-owner" "-C" "/tmp/npm-1305893882865/1305893885765-0.008730818051844835/contents/___package.npm" tar: Unexpected EOF in archive
ERR! tar "-mvxpf" "-" "--no-same-owner" "-C" "/tmp/npm-1305893882865/1305893885765-0.008730818051844835/contents/___package.npm" tar: Error is not recoverable: exiting now
ERR! tar "-mvxpf" "-" "--no-same-owner" "-C" "/tmp/npm-1305893882865/1305893885765-0.008730818051844835/contents/___package.npm"
ERR! Failed unpacking /tmp/npm-1305893882865/1305893885765-0.008730818051844835/tmp.tgz
ERR! couldn't unpack /tmp/npm-1305893882865/1305893885765-0.008730818051844835/tmp.tgz to /tmp/npm-1305893882865/1305893885765-0.008730818051844835/contents
verbose about to build /home/Tema/node_modules/express
ERR! error installing express#2.3.5 Error: Failed tar "-mvxpf" "-" "--no-same-owner" "-C" "/tmp/npm-1305893882865/1305893885765-0.008730818051844835/contents/___package.npm"
There are couple advices I googled (npm cache clean and rebaseall), but nothing helped. So, is there any way to use NPM in Cygwin?
Blow the tmp directory away
rm -R /tmp/*
Clear npm's cache
npm cache clean
Exit out of your current shell and start a ash or dash shell up (from in cygwin/bin)
In the ash (or dash) shell execute the rebaseall command.
/bin/rebaseall -v
Exit out and restart a new bash shell.
Try your npm command again.
npm install <package>
I have the same issue myself very often.
I don't know how to fix it, however I do know that the error happens irregularly. If you try to install the npm package again, it may work. Just keep retrying and it will work eventually.
When it gets stuck at 100% cpu, just cancel it (ctrl+c) and try again. Also, don't switch to another window while you are installing a package.
You can also just manually install the package with wget and tar inside the node_modules folder.
Try to remove temp files with this command:
$ rm /tmp/npm-*
then install again. worked for me.
small patch for /usr/local/lib/node_modules/npm/lib/utils/tar.js
--- tar.js.old 2011-07-15 15:23:09.205440100 +0700
+++ tar.js 2011-07-15 15:25:58.327113300 +0700
## -20,6 +20,7 ##
, relativize = require("./relativize")
, cache = require("../cache")
, excludes = require("./excludes")
+ , child_process = require("child_process");
exports.pack = pack
exports.unpack = unpack
## -168,13 +169,17 ##
//console.error(npm.config.get("gzipbin")+" --decompress --stdout "
// +tarball+" | "+npm.config.get("tar")+" -mvxpf - -o -C "
// +tmp)
- pipe( spawn( npm.config.get("gzipbin")
- , ["--decompress", "--stdout", tarball]
- , process.env, false )
- , spawn( npm.config.get("tar")
- , ["-mvxpf", "-", "-o", "-C", tmp]
- , process.env, false )
- , function (er) {
+ // pipe( spawn( npm.config.get("gzipbin")
+ // , ["--decompress", "--stdout", tarball]
+ // , process.env, false )
+ // , spawn( npm.config.get("tar")
+ // , ["-mvxpf", "-", "-o", "-C", tmp]
+ // , process.env, false )
+ // , function (er) {
+
+ child_process.exec(npm.config.get("gzipbin")+" --decompress --stdout "
+ +tarball+" | "+npm.config.get("tar")+" -mvxpf - --no-same-owner -C " +tmp
+ , function (er, stdout, stderr) {
// if we're not doing ownership management,
// then we're done now.
if (er) return log.er(cb,
If it happen, try to delete partially extracted modules from .npm directory (might be located in home directory: ~/.npm) and try again (twice or more).

Resources