Related
there are some problem with my webtop when i want get full ubuntu....like this
tar: ./usr: Cannot change mode to rwxr-xr-x: Read-only file system
tar: .: Cannot utime: Read-only file system
tar: .: Cannot change ownership to uid 0, gid 0: Read-only file system
tar: .: Cannot change mode to rwxr-xr-x: Read-only file system
tar: Error exit delayed from previous errors
unmounting your sdcard from the temp mount, now that we are done copying all the
files.
Now we will mount the sdcard with webtop copied over to it, to the correct place
, so we can patch it, and remove the FACLs and MACLs. These are what prevent you
accessing application and making changes in the ubuntu install.
help me
You need to mount the system as read/write.
In adb type.
su
mount -o remount, rw
Sent from my Atrixperia using xda premium
z652366 said:
there are some problem with my webtop when i want get full ubuntu....like this
tar: ./usr: Cannot change mode to rwxr-xr-x: Read-only file system
tar: .: Cannot utime: Read-only file system
tar: .: Cannot change ownership to uid 0, gid 0: Read-only file system
tar: .: Cannot change mode to rwxr-xr-x: Read-only file system
tar: Error exit delayed from previous errors
unmounting your sdcard from the temp mount, now that we are done copying all the
files.
Now we will mount the sdcard with webtop copied over to it, to the correct place
, so we can patch it, and remove the FACLs and MACLs. These are what prevent you
accessing application and making changes in the ubuntu install.
help me
Click to expand...
Click to collapse
Hi,
I assume you are using my how-to?
I have a few questions, and need you to get me a few things as well, before I can be of more help.
1) I assume you are already rooted? Are you already rooted?
2) Do you have busybox installed? And have it in /system/bin, and not /system/xbin?
3) Did you run my script as root?
I am thinking that it is either just that you are not running this as root, or that your root install did not work.
Can you run the following commands from the command line on your computer, with your phone connected and post them back in here?
Code:
adb shell
su
cd /data/local
id
busybox df -h
ls -l
mount -o remount, rw /system
touch /system/bin/test
rm /system/bin/test
exit
exit
Post the output back in here, and we will see if there is an issue with your root access.
Each line is a single command, and you must ONLY copy one line and paste it to one command line, do NOT copy all of the commands and paste them to your command line window, it will not work.
This is a Tutorial to install Ubuntu/Debian in any Android mobile.
* Installing Ubuntu or Debian Linux does not format your Android OS or change anything to your phone.
The Operating Systems run over the underlying Android OS which continues to function as normal
Choosing your Linux OS:
There are few things you must be aware of before installing Ubuntu/Debian on youe Android Phone
Ubuntu does not support earlier ARM CPUs like the ones used in the Motorola Cliq. Samsung Galaxy Fit (ARMv6), Samsung Galaxy Y, etc.
( Reason behind this is , Your Android OS Kernel must support loop devices. Most newer Android smartphones/tablets come with this support so we can mount our Ubuntu image as a loop device. If not, you will either have to build your own kernel with support for loop devices or you can try an aftermarket ROM for your phone as most aftermarket ROMs come with support for it. )
You need at least an ARMv7 CPU like the kind found in the Motorola Droid, Samsung Galaxy S,HTC EVO 3D, Sony Experia Play, etc. most newer phones (Hummingbird, Snapdragon, Tegra2, etc.).So you can Install Ubuntu if you have ARMv7 or newer Processor.
If you have ARMV6 or any other moderate Processor don't be sad, because Debian supports the CPU on practically all Android devices, so if you prefer Debian, or you can't run Ubuntu, choose the Debian download link.
* If you're not sure what CPU your device has, look up your device on http://pdadb.net/, click the link under CPU, and read the line for "Supported Instruction Set(s)".
e.g. : My Phone which is a " Samsung Galaxy Fit" uses ARMV6 Instruction Sets.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Click to expand...
Click to collapse
Pre-Requirements:
Hardware Required:
an Android Phone
SD Card with more than 2GB of free Space
Android root environment:
Most important! Your Android device should be “rooted” because you need root access to run Ubuntu/Debian off your Android. If your device is not rooted you have to root your device.
Linux Operating System:
Download suitable OS from the following Link:
Ubuntu 11.04 (Natty Narwhal)
linux.ubuntu-natty.tar.bz2 Ubuntu 11.04 (Natty)
Ubuntu 11.10 Oneiric Ocelot
linux.ubuntu-oneiric.tar.bz2 Ubuntu 11.10 (Oneiric)
Debian 6.0 Squeeze
linux.debian-squeeze.tar.bz2 Debian 6.0 (Squeeze)
Click to expand...
Click to collapse
Applications Required:
BusyBox Installer
A terminal emulator like Better Terminal Emulator ( Recommended ) or Terminal Emulator.
Optional Apllications:
androidVNC
Or
ConnectBot
Click to expand...
Click to collapse
Procedure ----------------------------------------------->
Step 1:
(Mount the SD card on your computer.)
Extract the .tar.bz2 file you downloaded to your SD card. You should now have a folder named "linux" on the root of your card.
(Unmount the SD card.)
Open Busybox Installer, and install Busybox.
Open Better Terminal Emulator, and install Better Terminal Emulator.
Click to expand...
Click to collapse
Step 2:
Open your terminal emulator. (If using ConnectBot, connect to 'local', not 'ssh'.)
Run the following commands:
Code:
[B]su[/B]
( If Prompt for Superuser Request then allow )
Code:
cd /sdcard/linux
sh install.sh
If you don't see any errors, Linux is now installed.
Click to expand...
Click to collapse
Step 3:
Open your terminal emulator.
To start a chroot session
Code:
su
linux
To start the SSH server
Code:
su
linux ssh
You can then use ConnectBot (SSH: [email protected]) on your device, or any SSH client to connect to your device. See Login Information, below.
Click to expand...
Click to collapse
To start a VNC session
( Firest you need androidVNC to be installed , then type the following in terminal )
Click to expand...
Click to collapse
Code:
su
linux vnc
The first time you run VNC, it will prompt you to create a VNC password.
You can then use androidVNC (host: localhost port: 5901), or any VNC client to connect to your device.
Configure The VNC App as follows:
Note: The default desktop environment is icewm. If you wish to replace it, for example, with LXDE:
Run the following as root in Linux:
Code:
apt-get autoremove icewm- lxde+
Secure your Log in Password:
Please remember to change these passwords if you are planning on using the SSH server. Malicious people can do Very Bad things to your device if you don't.
There are two accounts included in the images:
root
Password:cheesecake
user
Password:dessert
Click to expand...
Click to collapse
After a successful connection to host you will be able to use Ubuntu / Debian in graphical interface just like in your PC ! It will keep your Android OS as it is and just run in the upper layer over it
These are some of the screen shots taken from my Samsung Galaxy Fit!
Click to expand...
Click to collapse
Linux vs Linux Terminal Emulator :
Terminal Emulator only Emulates Linux terminal, but after Linux Installation you can get full features; more than just the limited commands which runs on Android shell rather than Linux Shell.
Please Leave your Feedback and Queries below. Thank You
Verry Good
I'll test it now. Thanks for the tutorial
Did a long time ago...
even i managed to install Backtrack 5..
anyway nice post...
there is app call BotBrew...try it...
vs4vijay said:
Did a long time ago...
even i managed to install Backtrack 5..
anyway nice post...
there is app call BotBrew...try it...
Click to expand...
Click to collapse
Nice app Bro
Its very hard to get low end devices to perform flawlessly.
but who cares as long as u can work around it
great thanks
screenshots please.
Linux won't install
I love this forum. Over the last couple months I've been reading the forums and learning how to root my phone and install custom ROMs. For the last 10 years I've been using Linux on my computers and netbooks. I like Android because it's a mobile version of Linux, but I would like to get a full version of Linux running on my phone. I followed this thread many times with and cannot get Linux to install. I'll try to give the details:
I am running a rooted Samsung Galaxy S 4G T959V running the Valhalla-Black edition ROM (Gingerbread). I installed Busybox V1.20.0 and Busybox Installer V1.20 without uninstalling either. I have Android Terminal Emulator installed with su privileges. I keep getting the same mount error with all the 3 linux images shown on this thread. Here is what I got (the first error has to do with mount):
****************************************************************************************************************************************************
# sh install.sh
Remounting /system rw ...
mount: No such file or directory
Usage: mount [-r] [-w] [-o options] [-t type] device directory
Installing scripts in /system/bin ...
cp: can't create '/system/bin/fsrw': File exists
Unable to chmod /system/bin/fsrw: Read-only file system
cp: can't create '/system/bin/linux': File exists
Unable to chmod /system/bin/linux: Read-only file system
Mounting the Linux image ...
Mounting: Prepwork ...
Usage: mount [-r] [-w] [-o options] [-t type] device directory
Mounting: Loopback mount ...
mknod: /dev/block/loop254: File exists
mount: Invalid argument
Mounting: Setting up chroot environment ...
mount: No such file or directory
mount: No such file or directory
mount: No such file or directory
mount: No such file or directory
mkdir failed for /data/local/mnt/media/sdcard, No such file or directory
mount: No such file or directory
[ Done ]
Customizing the image ...
install.sh: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
install.sh: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
Installing root-scripts ...
mkdir failed for /data/local/mnt/root/scripts, No such file or directory
Unable to chmod /data/local/mnt/root/scripts: No such file or directory
cp: can't create '/data/local/mnt/root/scripts/ssh.sh': No such file or directory
cp: can't create '/data/local/mnt/root/scripts/vnc.sh': No such file or directory
Unable to chmod /data/local/mnt/root/scripts/*: No such file or directory
Install finished
*********************************************************************************************************************************
What am I missing here?
Marty
LinuxHippy said:
I love this forum. Over the last couple months I've been reading the forums and learning how to root my phone and install custom ROMs. For the last 10 years I've been using Linux on my computers and netbooks. I like Android because it's a mobile version of Linux, but I would like to get a full version of Linux running on my phone. I followed this thread many times with and cannot get Linux to install. I'll try to give the details:
I am running a rooted Samsung Galaxy S 4G T959V running the Valhalla-Black edition ROM (Gingerbread). I installed Busybox V1.20.0 and Busybox Installer V1.20 without uninstalling either. I have Android Terminal Emulator installed with su privileges. I keep getting the same mount error with all the 3 linux images shown on this thread. Here is what I got (the first error has to do with mount):
****************************************************************************************************************************************************
# sh install.sh
Remounting /system rw ...
mount: No such file or directory
Usage: mount [-r] [-w] [-o options] [-t type] device directory
Installing scripts in /system/bin ...
cp: can't create '/system/bin/fsrw': File exists
Unable to chmod /system/bin/fsrw: Read-only file system
*********************************************************************************************************************************
What am I missing here?
Marty
Click to expand...
Click to collapse
I guess mount command in install.sh didnt work
Maybe you can edit it. to correct one, may be this or may be not
Code:
echo "Remounting /system rw ..."
#busybox mount -o remount,rw /system
sh $kit/scripts/fsrw
zcop said:
I guess mount command in install.sh didnt work
Maybe you can edit it. to correct one, may be this or may be not
Code:
echo "Remounting /system rw ..."
#busybox mount -o remount,rw /system
sh $kit/scripts/fsrw
Click to expand...
Click to collapse
I placed these lines in install.sh and deleted the 3 original lines that looked similar to it. I still got messages about mount, but these are a bit different:
# sh install.sh
Remounting /system rw ...
mount: No such file or directory
Usage: mount [-r] [-w] [-o options] [-t type] device directory
Installing scripts in /system/bin ...
Mounting the Linux image ...
Mounting: Prepwork ...
Usage: mount [-r] [-w] [-o options] [-t type] device directory
Mounting: Loopback mount ...
mknod: /dev/block/loop254: File exists
mount: Invalid argument
Mounting: Setting up chroot environment ...
mount: No such file or directory
mount: No such file or directory
mount: No such file or directory
mount: No such file or directory
mkdir failed for /data/local/mnt/media/sdcard, No such file or directory
mount: No such file or directory
[ Done ]
Customizing the image ...
install.sh: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
install.sh: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
Installing root-scripts ...
mkdir failed for /data/local/mnt/root/scripts, No such file or directory
Unable to chmod /data/local/mnt/root/scripts: No such file or directory
cp: can't create '/data/local/mnt/root/scripts/ssh.sh': No such file or directory
cp: can't create '/data/local/mnt/root/scripts/vnc.sh': No such file or directory
Unable to chmod /data/local/mnt/root/scripts/*: No such file or directory
Install finished
Full install.sh
Code:
sdcard=$(readlink -f /sdcard)
kit=$sdcard/linux
img=$kit/linux.img
mnt=/data/local/mnt
export bin=/system/bin
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=screen
export HOME=/root
echo "Remounting /system rw ..."
[COLOR="Red"]#Mount command
busybox mount -o remount,rw /system
#This script just mount system. We mount it above so we dont need it again.You can see [B]fsrw[/B] with notepad....
#sh $kit/scripts/fsrw[/COLOR]
echo "Installing scripts in $bin ..."
cd $kit/scripts
for file in *; do
cp $file $bin
chmod 755 $bin/$file
done
cd - > /dev/null
echo "Mounting the Linux image ..."
#mount the image
$bin/linux mount
echo "Customizing the image ..."
echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf
echo "nameserver 8.8.4.4" >> $mnt/etc/resolv.conf
#echo "Setting localhost on /etc/hosts "
#echo "127.0.0.1 localhost" > $mnt/etc/hosts
echo " Installing root-scripts ..."
#install custom root-scripts in $mnt/root/scripts
if [ ! -d $mnt/root/scripts ]; then
mkdir $mnt/root/scripts
fi
chmod 755 $mnt/root/scripts
cp $kit/root-scripts/* $mnt/root/scripts
chmod 755 $mnt/root/scripts/*
echo "Install finished"
Try it again and let see what happen
same thing:
Remounting /system rw ...
Installing scripts in /system/bin ...
Mounting the Linux image ...
Mounting: Prepwork ...
Usage: mount [-r] [-w] [-o options] [-t type] device directory
Mounting: Loopback mount ...
mknod: /dev/block/loop254: File exists
mount: Invalid argument
Mounting: Setting up chroot environment ...
mount: No such file or directory
mount: No such file or directory
mount: No such file or directory
mount: No such file or directory
mkdir failed for /data/local/mnt/media/sdcard, No such file or directory
mount: No such file or directory
[ Done ]
Customizing the image ...
install.sh: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
install.sh: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
Installing root-scripts ...
mkdir failed for /data/local/mnt/root/scripts, No such file or directory
Unable to chmod /data/local/mnt/root/scripts: No such file or directory
cp: can't create '/data/local/mnt/root/scripts/ssh.sh': No such file or directory
cp: can't create '/data/local/mnt/root/scripts/vnc.sh': No such file or directory
Unable to chmod /data/local/mnt/root/scripts/*: No such file or directory
Install finished
so install.sh working. Now problem is in /script/linux
edit
Code:
mount -o dev,remount $sdcard
to
Code:
busybox mount -o dev,remount [COLOR="Red"]$sdcard[/COLOR]
it not work change $sdcard to /mnt/sdcard
zcop said:
so install.sh working. Now problem is in /script/linux
edit
Code:
mount -o dev,remount $sdcard
to
Code:
busybox mount -o dev,remount [COLOR="Red"]$sdcard[/COLOR]
it not work change $sdcard to /mnt/sdcard
Click to expand...
Click to collapse
It got a little further this time by adding this to /sdcard/linux/scripts/linux:
busybox mount -o dev,remount
this is what happened:
# sh install.sh
Remounting /system rw ...
Installing scripts in /system/bin ...
Mounting the Linux image ...
Mounting: Prepwork ...
Mounting: Loopback mount ...
mount: Invalid argument
Mounting: Setting up chroot environment ...
mount: No such file or directory
mount: No such file or directory
mount: No such file or directory
mount: No such file or directory
mkdir failed for /data/local/mnt/media/sdcard, No such file or directory
mount: No such file or directory
[ Done ]
Customizing the image ...
install.sh: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
install.sh: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
Installing root-scripts ...
mkdir failed for /data/local/mnt/root/scripts, No such file or directory
Unable to chmod /data/local/mnt/root/scripts: No such file or directory
cp: can't create '/data/local/mnt/root/scripts/ssh.sh': No such file or directory
cp: can't create '/data/local/mnt/root/scripts/vnc.sh': No such file or directory
Unable to chmod /data/local/mnt/root/scripts/*: No such file or directory
Install finished
hey guys.
Thanx to the author of this forum on debian on android. I had the same problem you see in the error logs above. the problem is between regular "mount" command and busybox "mount". you need to use the busybox mount. so I added the word busybox infront of every mount word in the script. eg. busybox mount -o , rw /system remount. the alternative is to delete the mount found on /system/bin so that the terminal will use the busybox one automatically on /system/xbin.
nice tutorial
Good article but...
I have some issues about installing it.I tried it with XXKPI 2.3.4 on my Fit but it only caused my phone to give me bunch of error codes on the terminal and my phone started to not dedecting sdcard and sometimes it doesnt mount on computer.I have SdCard issues.I have edited all the mount codes in fsrw,linux and install.sh (by typing a busybox like busybox mount -o)but still have problems.I have installed XXKPI in 4 Part inst. with Odin and wiped the device before and after the installation and after the Odin inst. i rooted it with UnlockRoot v 2.2.1 so it is rooted.Done a binary update on SU and installed BusyBox 1.9.3 because newer versions are incompatible with my phone.This is my last terminal session(all included)
Code:
$ su
# cd /sdcard/linux
# sh install.sh
Remounting /system rw ...
mount: mounting /dev/stl12 on rfs failed: No such file or directory
Installing scripts in /system/bin ...
Mounting the Linux image ...
Mounting: Prepwork ...
Mounting: Loopback mount ...
mount: Invalid argument
Mounting: Setting up chroot environment ...
mount: mounting /dev on /data/local/mnt/dev failed: No such file or directory
mount: mounting devpts on /data/local/mnt/dev/pts failed: No such file or directory
mount: mounting /proc on /data/local/mnt/proc failed: No such file or directory
mount: mounting /sys on /data/local/mnt/sys failed: No such file or directory
mkdir failed for /data/local/mnt/media/sdcard, No such file or directory
mount: mounting /mnt/sdcard on /data/local/mnt/media/sdcard failed: No such file or directory
[ Done ]
Customizing the image ...
install.sh: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
install.sh: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
Installing root-scripts ...
mkdir failed for /data/local/mnt/root/scripts, No such file or directory
Unable to chmod /data/local/mnt/root/scripts: No such file or directory
cp: can't create '/data/local/mnt/root/scripts/ssh.sh': No such file or directory
cp: can't create '/data/local/mnt/root/scripts/vnc.sh': No such file or directory
Unable to chmod /data/local/mnt/root/scripts/*: No such file or directory
Install finished
#
So what can i do about it?I want to install Debian 6.0 so much and i am getting impatient about it.
Any help would be appreciated.
Sorry for my English if i have mistakes.
R: [ Tutorial ] How to Install Debian Linux on Your Samsung Galaxy Fit
Is possible install aircrack-ng airodump-ng and airmon-ng on ubuntu...
Sent from my GT-5670 using xda premium
can't install inside debian
I managed to install debian and in terminal mode, i cannot install anything, i get the error about "ldconfig" when installing xterm
dpkg: warning: 'ldconfig' not fount in PATH or not executable
the same with 'start-stop-daemon'
can you help me? i wish to install a terminal like xterm inside debian and some other app
Regards,
Works
Thanks
I was able to install this on my galaxy fit very smooth. Like your tutorials
Dwi Aulia Rahman Putra said:
screenshots please.
Click to expand...
Click to collapse
Screens have been given
I am working on a startup script to allow browser2RAM to work with other browsers that don't use the android.browser.com agent (Chrome, Firefox) and don't know where to put this 00script file I wrote in the system. This device has no etc/init.d directory. Where should this go to get executed on boot?
Sent from my ASUS Transformer Pad TF700T using xda app-developers app
Re: User startup script location in system partition?
elfaure said:
I am working on a startup script to allow browser2RAM to work with other browsers that don't use the android.browser.com agent (Chrome, Firefox) and don't know where to put this 00script file I wrote in the system. This device has no etc/init.d directory. Where should this go to get executed on boot?
Click to expand...
Click to collapse
If you have a custom ROM like CleanROM Inheritance, you should have a (/system)/etc/init.d - which ROM are you running?
Re: User startup script location in system partition?
_that said:
If you have a custom ROM like CleanROM Inheritance, you should have a (/system)/etc/init.d - which ROM are you running?
Click to expand...
Click to collapse
Hi-
Thanks for your reply. I am locked and rooted on stock ROM.
Sent from my ASUS Transformer Pad TF700T using xda app-developers app
elfaure said:
I am locked and rooted on stock ROM.
Click to expand...
Click to collapse
OK, that means no support for init.d by the kernel's init.rc. You can try the following:
Create a shell script named "/system/etc/install-recovery.sh" with the following content:
Code:
#!/system/bin/sh
/system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d
Remember to make it executable and to create the /system/etc/init.d directory. Put your init script there and make it executable.
If you have busybox installed in /system/xbin and a little luck, this could enable support for running init.d scripts with the stock ROM. Tell us if it worked.
_that said:
OK, that means no support for init.d by the kernel's init.rc. You can try the following:
Create a shell script named "/system/etc/install-recovery.sh" with the following content:
Code:
#!/system/bin/sh
/system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d
Remember to make it executable and to create the /system/etc/init.d directory. Put your init script there and make it executable.
If you have busybox installed in /system/xbin and a little luck, this could enable support for running init.d scripts with the stock ROM. Tell us if it worked.
Click to expand...
Click to collapse
I thank you for the method but I'm a newb (nOOb) and this looks a little scary. I found two market apps that can do it (execute a script as root on boot): Autostart-Root and ROM Toolbox (Lite or Pro). I'm using the latter's Scripter tool to execute this script on boot as root. Seems to be working. (Appended the .txt extension to the filename in order to upload the file)
Here's another thead i found here on the subject
http://forum.xda-developers.com/showthread.php?t=690564
_That
Using your method above, how would you run the script as root (su)? This script needs to run as root to properly mount the /data partition.
elfaure said:
Using your method above, how would you run the script as root (su)? This script needs to run as root to properly mount the /data partition.
Click to expand...
Click to collapse
It should run as root because it's started by init - /data is already mounted at that time. If I understand your intention correctly, you don't need to (re)mount /data anyway, just /data/data/<whatever_directory_your_browser_uses>.
_that said:
It should run as root because it's started by init - /data is already mounted at that time. If I understand your intention correctly, you don't need to (re)mount /data anyway, just /data/data/<whatever_directory_your_browser_uses>.
Click to expand...
Click to collapse
If I run my script as normal user (not as root ie su) then I get script /data mount errors.
exec /system/bin/sh '/Removable/MicroSD/Scripts/autostart.sh'
[email protected]:/ $ exec /system/bin/sh '/Removable/MicroSD/Scripts/autostart.sh'
failed: Invalid argument
rm failed for -rf, No such file or directory
mount: Operation not permitted
failed: Invalid argument
rm failed for -rf, No such file or directory
mount: Operation not permitted
failed: Invalid argument
rm failed for -rf, No such file or directory
mount: Operation not permitted
failed: Invalid argument
rm failed for -rf, No such file or directory
mount: Operation not permitted
But when I run it as root user
exec /system/bin/sh '/Removable/MicroSD/Scripts/autostart.sh'
failed: Invalid argument
rm failed for -rf, No such file or directory
failed: Invalid argument
rm failed for -rf, No such file or directory
failed: Invalid argument
rm failed for -rf, No such file or directory
failed: Invalid argument
rm failed for -rf, No such file or directory
The rm failed for -rt really isn't an error, just an indication there was no cache file to delete, correct?
elfaure said:
If I run my script as normal user (not as root ie su) then I get script /data mount errors.
Click to expand...
Click to collapse
I don't see where "/data" is mentioned in your error messages. You get "invalid argument" from umount because there is nothing mounted on that directory, and "operation not permitted" from mount because only root is allowed to mount filesystems.
elfaure said:
The rm failed for -rt really isn't an error, just an indication there was no cache file to delete, correct?
Click to expand...
Click to collapse
Correct.
_that said:
I don't see where "/data" is mentioned in your error messages. You get "invalid argument" from umount because there is nothing mounted on that directory, and "operation not permitted" from mount because only root is allowed to mount filesystems.
Correct.
Click to expand...
Click to collapse
Thanks very much for that explaination. Sorry, I'm just getting started with scripts. In fact, this is my first one. Another question:
I added: (got the idea from this post, pg 2 http://forum.xda-developers.com/showthread.php?t=690564)
>/data/opt/autostart.out 2>/data/opt/autostart.errto the end of the script.
The original call is shown here:
"I simulate it by the following contents in /system/etc/init.d/20autostart :
/system/bin/sh /data/opt/autostart.sh >/data/opt/autostart.out 2>/data/opt/autostart.err
which not only calls /data/opt/autostart.sh at boot time, but
also dumps its stdout to /data/opt/autostart.out
and dumps its stderr to /data/opt/autostart.err
which is very helpful for debugging the commands in /data/opt/autostart.sh
Note that you need to enter recovery mode before you can write to /system/etc/init.d/" Now when it runs it dumps the two files, which are sucessfully created. But both files are blank, no data, and autostart.err does not have any error messages like I show above. What's wrong with this call statement? Can't it be executed from within this same script, or do I have to use another script to call this one to make that work?
_that said:
OK, that means no support for init.d by the kernel's init.rc. You can try the following:
Create a shell script named "/system/etc/install-recovery.sh" with the following content:
Code:
#!/system/bin/sh
/system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d
Remember to make it executable and to create the /system/etc/init.d directory. Put your init script there and make it executable.
If you have busybox installed in /system/xbin and a little luck, this could enable support for running init.d scripts with the stock ROM. Tell us if it worked.
Click to expand...
Click to collapse
From that another post, he calls:
service sysinit /system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d
disabled
oneshot
which looks quite similar. Can you describe the differences between them? Is this one only for CWM?
Is this even possible on stock ROM?
_that said:
OK, that means no support for init.d by the kernel's init.rc. You can try the following:
Create a shell script named "/system/etc/install-recovery.sh" with the following content:
Code:
#!/system/bin/sh
/system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d
Remember to make it executable and to create the /system/etc/init.d directory. Put your init script there and make it executable.
If you have busybox installed in /system/xbin and a little luck, this could enable support for running init.d scripts with the stock ROM. Tell us if it worked.
Click to expand...
Click to collapse
I got a bit educated then got brave and tried it and it doesn't seem to work. I added the file tracer output line, files> /data/opt, to my startup script, made yours executable via "chmod 776 install-recovery.sh", put it where you said, put mine where you said, made mine executable same way except had to mount system R/W to do it (should have done this before I put it there but I am learning), ran your script without error, then rebooted. I see no files in data/oct so my script did not run at boot? I even renamed my script 00autostart1.sh and still didn't work.
Also, both other methods failed to run my script at boot. Any other ideas on stock ROM or is this just not possible?
elfaure said:
>/data/opt/autostart.out 2>/data/opt/autostart.errto the end of the script.
Click to expand...
Click to collapse
You need to add these redirections to each command whose output you want to redirect, not to the end of the script. So to capture the output of your script, write another script that calls your original one with these redirections, as suggested by that other person.
elfaure said:
From that another post, he calls:
service sysinit /system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d
disabled
oneshot
which looks quite similar. Can you describe the differences between them? Is this one only for CWM?
Click to expand...
Click to collapse
The above is the block that needs to be added to /init.rc, but this is part of the kernel's ramdisk which you can only modify on an unlocked device.
elfaure said:
I got a bit educated then got brave and tried it and it doesn't seem to work.
Click to expand...
Click to collapse
Post the output of:
su
ls -l /etc/install-recovery.sh
cat /etc/install-recovery.sh
ls -ld /etc/init.d
ls -l /etc/init.d
ls -l /system/xbin/busybox
_that said:
You need to add these redirections to each command whose output you want to redirect, not to the end of the script. So to capture the output of your script, write another script that calls your original one with these redirections, as suggested by that other person.
The above is the block that needs to be added to /init.rc, but this is part of the kernel's ramdisk which you can only modify on an unlocked device.
Post the output of:
su
ls -l /etc/install-recovery.sh
cat /etc/install-recovery.sh
ls -ld /etc/init.d
ls -l /etc/init.d
ls -l /system/xbin/busybox
Click to expand...
Click to collapse
I created a script called that_script.sh that contains your command set above. I make it executable and run it (as root) and:
****************************************
There is no output because the script never completes execution? Just runs forever (Script Manager) or times out (ROM Toolbox Lite Scripter). Some kind of script-loop is created?? Upon break (exit) I get the following output:
exec sh -c '/Removable/MicroSD/Scripts/that_script.sh '
exit
-rw-rw-r-- root sdcard_rw 90 2013-03-19 18:28 install-recovery.sh
#!/system/bin/sh
/system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.ddrwx------ root root 2013-03-19 18:45 init.d
-rwxrwxrw- root root 938 2013-03-19 18:35 00autostart1.sh
-rwsr-xr-x root root 497964 2013-03-03 17:59 busybox
elfaure said:
I created a script called that_script.sh that contains your command set above. I make it executable and run it (as root) and:
****************************************
There is no output because the script never completes execution? Just runs forever (Script Manager) or times out (ROM Toolbox Lite Scripter). Some kind of script-loop is created??
Click to expand...
Click to collapse
I don't know what strange tools you are using, the commands were meant to simply type into an interactive shell (adb or a local terminal app).
However, the original problem why your script doesn't run at boot is obvious from your output:
Code:
-rw-rw-r-- root sdcard_rw 90 2013-03-19 18:28 install-recovery.sh
You forgot to make install-recovery.sh executable (or you forgot to become root first).
I use these script tools so I can copy all the text into a file and run the file (script) rather than typing each line individually into the terminal. My tools show the script is executable (I ran "chmod 776 filename.ext" = "chmod +x filename.ext" on the script file) and ran it as root? I'll try it again and post back. I'll also try it from the terminal app.
Thks
_that said:
It should run as root because it's started by init - /data is already mounted at that time. If I understand your intention correctly, you don't need to (re)mount /data anyway, just /data/data/<whatever_directory_your_browser_uses>.
Click to expand...
Click to collapse
I'm not (re)mounting /data.
So the mount is still needed, that's the key to the whole process. *The mount isn't (re)mounting the data partition, it's creating a mount point inside the data partition for the RAM cache.
What the script is doing is creating a tmpfs filesystem where the browsers expect to put their cache files. This filesystem is actually fully in memory (RAM), and never backed by any permanent storage. The -t tmpfs option tells mount to create a tmpfs filesystem, and -o size=50m tells it to reserve 50 MB of memory. The unmount is for when I use a different browser (one that doesn't use the com.android.browser agent like chrome, firefox, naked, etc.) and need to create a new mount point but want to reuse the 50MB already allocated for the existing mount point. Hope this clarifies my intent with creating this script and how it is supposed to work.
elfaure said:
I'm not (re)mounting /data.
So the mount is still needed, that's the key to the whole process. *The mount isn't (re)mounting the data partition, it's creating a mount point inside the data partition for the RAM cache.
What the script is doing is creating a tmpfs filesystem where the browsers expect to put their cache files. This filesystem is actually fully in memory (RAM), and never backed by any permanent storage. The -t tmpfs option tells mount to create a tmpfs filesystem, and -o size=50m tells it to reserve 50 MB of memory. The unmount is for when I use a different browser (one that doesn't use the com.android.browser agent like chrome, firefox, naked, etc.) and need to create a new mount point but want to reuse the 50MB already allocated for the existing mount point. Hope this clarifies my intent with creating this script and how it is supposed to work.
Click to expand...
Click to collapse
Assumed that you script is working, you could use "script manager - SManager" from the market. This app will allow yours to run as root and during start up. All you need is root. The script can be at any location (even on sdcard if you like). I used to use this with my cell phone.
elfaure said:
I'm not (re)mounting /data.
Click to expand...
Click to collapse
Well, you originally wrote:
This script needs to run as root to properly mount the /data partition.
Click to expand...
Click to collapse
Does it work now as it should?
Be sure to read also this thread about mounting in Android 4.2:
http://forum.xda-developers.com/showthread.php?t=2227123
I have an apex solo 7i (TM772) and I was able to gain root access from adb only. I modified the build.prop file and it is now stuck in a boot loop.
I have the original build.prop file on my PC (I also have the entire /system directory) but from recovery mode the only adb access I can get is to side load a zip.
I can access fastboot through droidboot.
During the boot loop it is found as a device (in production builds so I can not use the "adb root" command).
With the adb device shell I can use the su command, but while trying to mount the system rw it fails and says:
Code:
# mount -o rw,remount -t yaffs2 /dev/block/mccblk0p8 /system
mount: Operation not permitted
Is there any way to make it mount the system partition rw or could I make a flashable zip file to restore the build.prop?
I m unable to mount my filesystem in rw mode, I have used so many scripts in order to remount it rw, terminal emulator displays that's its in rw mode but when I chmod a file in xbin or try to to create a folder it displays read-only filesystem. I have used few scripts & terminal commands but to no avail also on Supersu beta. I m using s3 Verizon with the latest safestrap(twrp) recovery. Please help !!!