New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup environment on Android 6 (CyanogenMod 13) #57

Closed
armando-basile opened this Issue Feb 3, 2016 · 7 comments

Comments

Projects
None yet
2 participants
@armando-basile

armando-basile commented Feb 3, 2016

Hi,
i trying to setup optware-ng on my android 6. first of all i installed busybox:

# mount -o remount,rw /
# mount -o remount,rw /system
# mount -o remount,rw /data
# mkdir /data/opt
# chmod 777 /data/opt
# ln -s /data/opt /opt
# mkdir -p /data/opt/tmp
# chmod 777 /data/opt/tmp
# ln -s /data/opt/tmp /tmp
# cd /opt
# curl -o busybox https://busybox.net/downloads/binaries/1.21.1/busybox-armv7l
# cp busybox /data/local/busybox
# chmod 755 /data/local/busybox

--- if not exists /system/xbin ---
# /data/local/busybox mkdir /system/xbin
# cd /data/local
# ./busybox cp /data/local/busybox /system/xbin
# cd /system/xbin
# chmod 755 busybox
# ./busybox --install -s /system/xbin
# rm /data/local/busybox

after i install static ipkg following buildroot-armeabihf-bootstrap.sh steps:

# cd /opt
# wget -O ipkg-static_0.99.163-3_arm.ipk http://optware-ng.zyxmon.org/buildroot-armeabihf/ipkg-static_0.99.163-3_arm.ipk
# tar -xvzf ipkg-static_0.99.163-3_arm.ipk ./data.tar.gz
# tar -C / -xzvf data.tar.gz
# echo "src/gz alllexx http://optware-ng.zyxmon.org/buildroot-armeabihf" > /opt/etc/ipkg.conf 
# echo "dest /opt/ /" >> /opt/etc/ipkg.conf
# PATH=$PATH:/opt/bin:/opt/sbin
# TMPDIR=/data/opt/tmp
# /opt/bin/ipkg update

but i receive an error from ipkg:

Downloading http://optware-ng.zyxmon.org/buildroot-armeabihf/Packages.gz
An error ocurred, return value: 1.
Collected errors:
ipkg_download: ERROR: Command failed with return value 127: `wget    -q -P /data/opt/tmp/ipkg-VO20AJ http://optware-ng.zyxmon.org/buildroot-armeabihf/Packages.gz'

this is strace ipkg update response

i saw that if i try:

# wget -P /data/opt/tmp/ipkg-qUiDHM http://optware-ng.zyxmon.org/buildroot-armeabihf/Packages.gz

wget don't save file, but if i use -O option, it do that:

# wget -O Packages.gz -P /data/opt/tmp/ipkg-qUiDHM http://optware-ng.zyxmon.org/buildroot-armeabihf/Packages.gz

seems that temporary random folder was created but with another name.

could you help me

@armando-basile armando-basile changed the title from setup environment on Android 5 to setup environment on Android 6 (CyanogenMod 13) Feb 3, 2016

@alllexx88

This comment has been minimized.

Show comment
Hide comment
@alllexx88

alllexx88 Feb 6, 2016

Collaborator

Looks like a weird android wget behaviour. Could you try to create wget ling to /data/local/busybox and change PATH to use this wget?:

mkdir -p /data/local/xbin
ln -s ../busybox /data/local/xbin/wget
export PATH=/data/local/xbin:$PATH

?

Collaborator

alllexx88 commented Feb 6, 2016

Looks like a weird android wget behaviour. Could you try to create wget ling to /data/local/busybox and change PATH to use this wget?:

mkdir -p /data/local/xbin
ln -s ../busybox /data/local/xbin/wget
export PATH=/data/local/xbin:$PATH

?

@armando-basile

This comment has been minimized.

Show comment
Hide comment
@armando-basile

armando-basile Feb 9, 2016

https://gist.github.com/armando-basile/a6a16bb897f17aadb1ac#file-stacktrace
i saw that now if i try to download using wget in a folder already exists, work fine, es using /data/opt/tmp that i already have:

wget -P /data/opt/tmp http://optware-ng.zyxmon.org/buildroot-armeabihf/Packages.gz

if wget need to create a subfolder into, there is the problem

wget -P /data/opt/tmp/ipkg-qUiDHM http://optware-ng.zyxmon.org/buildroot-armeabihf/Packages.gz

armando-basile commented Feb 9, 2016

https://gist.github.com/armando-basile/a6a16bb897f17aadb1ac#file-stacktrace
i saw that now if i try to download using wget in a folder already exists, work fine, es using /data/opt/tmp that i already have:

wget -P /data/opt/tmp http://optware-ng.zyxmon.org/buildroot-armeabihf/Packages.gz

if wget need to create a subfolder into, there is the problem

wget -P /data/opt/tmp/ipkg-qUiDHM http://optware-ng.zyxmon.org/buildroot-armeabihf/Packages.gz
@armando-basile

This comment has been minimized.

Show comment
Hide comment
@armando-basile

armando-basile Feb 11, 2016

i tryed also on another android device always with Android 6 and have the same problem.
Could be an idea to split in ipkg mkdir command and after wget using already created folder ?

armando-basile commented Feb 11, 2016

i tryed also on another android device always with Android 6 and have the same problem.
Could be an idea to split in ipkg mkdir command and after wget using already created folder ?

@alllexx88

This comment has been minimized.

Show comment
Hide comment
@alllexx88

alllexx88 Feb 11, 2016

Collaborator

That's normal wget behaviour. That temp dir should've been created by ipkg beforehand, and judging from your ipkg strace, it is (attempted to be) created:

mkdir("/data/local/tmp/ipkg-5L9LTZ", 0700) = 0

But later on wget complains that the dir doesn't exist:

unlink("/data/local/tmp/ipkg-5L9LTZ/Packages.gz") = -1 ENOENT (No such file or directory)

So either mkdir syscal doesn't work properly, or something happens between these calls that removes the dir (given that wget works as you've described).

Collaborator

alllexx88 commented Feb 11, 2016

That's normal wget behaviour. That temp dir should've been created by ipkg beforehand, and judging from your ipkg strace, it is (attempted to be) created:

mkdir("/data/local/tmp/ipkg-5L9LTZ", 0700) = 0

But later on wget complains that the dir doesn't exist:

unlink("/data/local/tmp/ipkg-5L9LTZ/Packages.gz") = -1 ENOENT (No such file or directory)

So either mkdir syscal doesn't work properly, or something happens between these calls that removes the dir (given that wget works as you've described).

@armando-basile

This comment has been minimized.

Show comment
Hide comment
@armando-basile

armando-basile Feb 12, 2016

Oh i tryed also on Android 5.1 and also here there is problem :(
the only Android where it's work is 4.x

could we try a workaround ?

armando-basile commented Feb 12, 2016

Oh i tryed also on Android 5.1 and also here there is problem :(
the only Android where it's work is 4.x

could we try a workaround ?

@armando-basile

This comment has been minimized.

Show comment
Hide comment
@armando-basile

armando-basile Feb 12, 2016

BINGOOO

optware-ng on Android require also:

# mkdir /bin
# ln -s /system/bin/sh /bin/sh

to work

armando-basile commented Feb 12, 2016

BINGOOO

optware-ng on Android require also:

# mkdir /bin
# ln -s /system/bin/sh /bin/sh

to work

@armando-basile

This comment has been minimized.

Show comment
Hide comment
@armando-basile

armando-basile Feb 13, 2016

:) ok, tested with success on android 5 and also 6. This is my start.sh boot script :

#!/system/bin/sh
mount -o remount,rw rootfs /
ln -s /data/opt /opt
ln -s /data/opt/tmp /tmp
chmod 777 /data/opt/tmp
rm -rf /data/opt/tmp/*
mkdir /bin
ln -s /system/bin/sh /bin/sh
mount -o remount,ro /

# update PATH
export PATH=/data/opt/sbin:/data/opt/bin:/data/opt:$PATH
export TMPDIR=/data/opt/tmp

# openssh server
rm -rf /data/opt/var/run/dropbear.pid
/data/opt/sbin/dropbear -A -N root -U 0 -G 0 -C <password> -p 22

# transmission daemon
rm -rf /opt/var/run/transmission-daemon.pid
/data/opt/bin/transmission-daemon -g /data/opt/etc/transmission-daemon -e /data/opt/var/log/transmission-daemon.log --log-error

# minidlna server
rm -rf /data/opt/var/minidlna/minidlna.pid
(/data/opt/sbin/minidlnad -f /data/opt/etc/minidlna.conf -P /data/opt/var/minidlna/minidlna.pid -d /opt/etc/minidlna/minidlna.log) &

# update dtdns
(/data/opt/bin/udtdns >/dev/null) &

# update date
(ntpd -q -p 1.it.pool.ntp.org) &

# pyLoad
/opt/etc/init.d/S98Pyload start &

# start samba server
/opt/etc/init.d/S08samba start &

armando-basile commented Feb 13, 2016

:) ok, tested with success on android 5 and also 6. This is my start.sh boot script :

#!/system/bin/sh
mount -o remount,rw rootfs /
ln -s /data/opt /opt
ln -s /data/opt/tmp /tmp
chmod 777 /data/opt/tmp
rm -rf /data/opt/tmp/*
mkdir /bin
ln -s /system/bin/sh /bin/sh
mount -o remount,ro /

# update PATH
export PATH=/data/opt/sbin:/data/opt/bin:/data/opt:$PATH
export TMPDIR=/data/opt/tmp

# openssh server
rm -rf /data/opt/var/run/dropbear.pid
/data/opt/sbin/dropbear -A -N root -U 0 -G 0 -C <password> -p 22

# transmission daemon
rm -rf /opt/var/run/transmission-daemon.pid
/data/opt/bin/transmission-daemon -g /data/opt/etc/transmission-daemon -e /data/opt/var/log/transmission-daemon.log --log-error

# minidlna server
rm -rf /data/opt/var/minidlna/minidlna.pid
(/data/opt/sbin/minidlnad -f /data/opt/etc/minidlna.conf -P /data/opt/var/minidlna/minidlna.pid -d /opt/etc/minidlna/minidlna.log) &

# update dtdns
(/data/opt/bin/udtdns >/dev/null) &

# update date
(ntpd -q -p 1.it.pool.ntp.org) &

# pyLoad
/opt/etc/init.d/S98Pyload start &

# start samba server
/opt/etc/init.d/S08samba start &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment