Linking from /mnt/sdcard to /mnt/sdcard-ext - automatization - Motorola Droid 4

Found the solution, it's in the fifth post
Hey, first of all I'm Linux and Android newbie, so sorry if my question reveals it a bit
As my Internal Storage a.k.a. /mnt/sdcard is getting full and I hate to be reminded of it by notification I can't get rid of, I decided to put some effort into moving the largest files to the SD card. I have a 64GB SD an there still are several free gigs So after some googling I found out a way to link it. It works like this:
Code:
mount -o bind /origdir /newdir
where both /origdir and /newdir must exist, in my case as an example:
Code:
mount -o bind /mnt/sdcard-ext/sd/DictionariesNGHS /mnt/sdcard/DictionariesNGHS
where /mnt/sdcard-ext/sd/DictionariesNGHS is the data containing folder and /mnt/sdcard/sd/DictionariesNGHS is an empty folder for linking. It works like a charm, tried with several applications including some off-line navigations. The downside is that such links are forgotten after a reboot.
I didn't find out how to automatize that. I tried putting the line from second code to the end of /system/etc/init.goldfish.sh (I run Eclipse ICS 1.2) and it didn't get linked after a reboot (but works OK after mounting manually in terminal) - I suspect it runs before sdcard-ext is mounted. Any thoughts on how to make it run after reboot? Or maybe of an app that does this for me?
EDIT:
Put my links into /data/data/init.sh
Tried several not working apps:
ScriptMe by gilsken says Script run mount: No such file or directory
Script Manager - SManager by devworm says
Code:
exec sh '/data/data/init.sh'
[email protected]_maserati:/ # exec sh '/data/data/init.sh'
mount: No such file or directory
while interestingly when I write it by myself in its built-in console it works...
App that works: Tasker by Crafty Apps
I can have scripts run on boot and it works, but I can add only one line at time (or at least it's the only option I found) which is still kinda inconvenient plus it runs all the time consuming system resources. I'd like some less robust solution, preferably executed after boot and exiting after mounts proceed. Any ideas?
EDIT 2:
My "workaround" in Tasker: Profiles -> New -> Event -> System -> Device Boot -> OK -> New Task -> OK -> + -> Script -> Run Shell -> Command: /data/data/init.sh -> OK
Surprisingly enough it doesn't even need root permission...
In init.sh I have several lines with different mounts, it all works well. I'm still looking for less robust solution than Tasker is, or maybe a way to kill it after the init.sh is processed?

hey
can you please post the content of youre
Code:
/data/data/init.sh
---------- Post added at 04:35 PM ---------- Previous post was at 03:50 PM ----------
youre problem is, at the runtime form the mount command, the mount is not in youre path.
can you add to you script the command
Code:
env
and post the output?

I tried it with a file containing only this line:
Code:
mount -o bind /mnt/sdcard-ext/sd/DictionariesNGHS /mnt/sdcard/DictionariesNGHS
OK, after running it by SManager it looks like giving errors, but the folder gets mounted.
Also it seems apps get access to /mnt/sdcard faster after reboot then to /data/data (I wonder why...?) so I moved the script there.
Here you have the output with env at the end of init.sh, run by SManager as root (mounted OK):
Code:
exec sh '/mnt/sdcard/init.sh'
[email protected]_maserati:/ # exec sh '/mnt/sdcard/init.sh'
mount: No such file or directory
_=/system/xbin/env
ANDROID_BOOTLOGO=1
ANDROID_PROPERTY_WORKSPACE=8,69632
LOOP_MOUNTPOINT=/mnt/obb
SM_API=15
RANDOM=26725
ANDROID_ASSETS=/system/app
USER=root
EXTERNAL_STORAGE=/mnt/sdcard
ANDROID_DATA=/data
PATH=/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
SM_LAUNCHER=MANUAL
TERM=vt100
PS1=$(precmd)[email protected]$HOSTNAME:${PWD:-?} #
SM_VERSION=2.5.3.1
SM_GUIFD=3
LD_LIBRARY_PATH=/vendor/lib:/system/lib
SECONDARY_STORAGE=/mnt/sdcard-ext
SM_ALIAS=init.sh
ASEC_MOUNTPOINT=/mnt/asec
SM_HOME=/mnt/sdcard
HOSTNAME=cdma_maserati
HOME=/
SM_VERSIONCODE=77
BOOTCLASSPATH=/system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework-ext.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/filterfw.jar:/system/framework/com.motorola.android.frameworks.jar:/system/framework/com.motorola.android.widget.jar:/system/framework/com.motorola.frameworks.core.addon.jar:/system/framework/kafdex.jar:/system/framework/com.motorola.orange.simauth.jar
ANDROID_ROOT=/system
SHELL=/system/bin/sh
MKSH=/system/bin/sh
ANDROID_SOCKET_zygote=9
So it works after all with the SManager as I intended, I just don't understand why it gives that error when everything actually is OK...
Any ideas on how to make it run automatically after every mount of sdcard-ext instead of on reboot? Because when I connect it to the computer as Mass Storage, the directory mounts disappear and I have to run the script manually...

LuH said:
I tried it with a file containing only this line:
Code:
mount -o bind /mnt/sdcard-ext/sd/DictionariesNGHS /mnt/sdcard/DictionariesNGHS
...
Any ideas on how to make it run automatically after every mount of sdcard-ext instead of on reboot? Because when I connect it to the computer as Mass Storage, the directory mounts disappear and I have to run the script manually...
Click to expand...
Click to collapse
for the first, replace the mount with this:
Code:
/system/bin/mount -o bind /mnt/sdcard-ext/sd/DictionariesNGHS /mnt/sdcard/DictionariesNGHS

Found out that the "mount: No such file or directory" error was due to typo in folder path
So to wrap it up:
You need to be rooted first.
Create your init.sh script file, works fine when put to /mnt/sdcard/
Example file (also attached so you have a sample in UNIX formatting - don't open with Notepad under Windows, better edit it in your phone):
Code:
# mount -o bind /sourcedir /fakedir - both sourcedir and fakedir MUST exist!
mount -o bind /mnt/sdcard-ext/sd/DictionariesNGHS /mnt/sdcard/DictionariesNGHS
mount -o bind /mnt/sdcard-ext/sd/Android/obb /mnt/sdcard/Android/obb
Note: you should use a UNIX formatting of the file, not Windows (I'm not sure if it's necessary though).
As hinted in the beginning note, sourcedir and fakedir must exist and after successful mount the fakedir folder will appear to have the contents of the sourcedir folder. Any fakedir's contents are ignored ("disappear") after mount and reappear only after it gets unmounted.
It gets automatically unmounted after unmounting of either fakedir's or sourcedir's media (typically when connecting phone to a computer as mass storage) and I haven't found any workaround for running the script after remounting of media... Any suggestions?
Install SManager (free version here).
In SManager navigate to your script file, tap it and select Script/Executable and tap Su and Boot icons (see attached screenshot).
Done, your folders get mounted on reboot

Related

How to install ubuntu on the Droid 4

How to install ubuntu on the Droid 4
Note to mods: this thread is a branch off of this thread
Huge thanks to zacthespack for creating the ubuntu installer app and original boot script and to zeroktal for modifying the script to work on the D4 and helping me get it working on my device.
I decided to take my experience in setting this up and put it into a how-to so that others could enjoy the experience of having ubuntu on the Droid 4. If zackthespac or zeroktal have any problems with me making and putting this guide up, please let me know and I will remove it.
Knowledge Required:
working knowledge of command line
working knowledge of vi
OR the ability to learn how to use both
Tools Required:
A rooted Motorola Droid 4
BusyBox (Android Market)
Terminal Emulator (Android Market)
Android VNC Viewer (Android Market)
Ubuntu Installer App (Android Market)
zeroktal's ubuntud4.zip file (attached to this post and mediafire)
Vi Cheat Sheet (lagmonster.org)
Step by Step:
Install BusyBox, Terminal, and Android VNC Viewer
Install and run Ubunutu Installer App
Follow the on-screen instructions and click next
Download either the Small or Large image to your phone, (use zeroktal's ubuntud4.zip file instead of the boot script provided in the guide) after the image downloads (will take a while because the file is HUGE) click next
For this screen, the instructions differ from the app.
1. With your D4 plugged into your PC in USB Mass Storage, create a directory (folder) called ubuntu in the EXTERNAL sdcard's root*
2. Extract the image you downloaded to that directory
3. Download and extract the attached .sh (ununtud4.zip) to that directory
4. Disconnect your phone from your PC
5. Open terminal and run the following commands:
su [ENTER]
mount -o remount,rw,exec,suid /dev/block/vold/179:1 /mnt/sdcard-ext [ENTER]
cd /mnt/sdcard-ext/ubuntu [ENTER]
sh ubuntud4.sh [ENTER]
960x540 [ENTER]**​If you get an error message: ubuntud4.sh: 45: syntax error: end of file unexpected (expecting "then") see troubleshooting section below.​killall -TERM Xtightvnc [ENTER]
vncserver :1 -geometry 960x540 [ENTER]**​6. Open androidVNC app and enter the following settings:
Nickname: Anything you want
Password: ubuntu
Address: localhost
Port: 5901
Color Format: 24-bit color (4 bpp)
7. Hit connect
8. Hit your menu soft button and then set input mode to touchpad
9. You have ubuntu on your Droid 4!
To "shut down" ubuntu:
press the menu button, select disconnect in VNC
In terminal type this command 3 times (terminal will close itself when you are done):
exit [ENTER]
To "start up" ubuntu again:
Follow steps 5-8 above
Troubleshooting:
If you get the error message: ubuntud4.sh: 45: syntax error: end of file unexpected (expecting "then") you are about to have fun with vi at the command line.
Do the following from inside terminal:
su [ENTER]
cd /mnt/sdcard-ext/ubuntu [ENTER]
vi ubuntud4.sh [ENTER]​If you see ^M or ^ at the end of any line (remember to scroll all the way to the right to see the end of long lines) remove it. once you do that, everything should work just fine. (See the Vi Cheat Sheet above for help with Vi)
Note: Vol Up + E is [ESC] by default in this terminal emulator
Notes:
* It does not have to be on the external SD, but if you put it on the internal SD you will have to modify things as needed-- if you dont know what needs to be changed, just put it on the external SD.
** Screen size can be whatever you want it to be, but 960x540 is the size of the D4 screen.
*** This is a fairly involved process... especially when it comes to editing the .sh file in vi things can get very frustrating and hard, but just take your time and you will get it. As always, doing anything with root access on your phone, especially on the command line has risks. I am not responsible if anything goes wrong with your phone... proceed at your own risk!
greekchampion04 said:
Notes:
* It does not have to be on the external SD, but if you put it on the internal SD you will have to modify things as needed-- if you dont know what needs to be changed, just put it on the external SD.
** Screen size can be whatever you want it to be, but 960x540 is the size of the D4 screen.
*** This is a fairly involved process... especially when it comes to editing the .sh file in vi things can get very frustrating and hard, but just take your time and you will get it. As always, doing anything with root access on your phone, especially on the command line has risks. I am not responsible if anything goes wrong with your phone... proceed at your own risk!
Click to expand...
Click to collapse
I actually got it up and running on my internal sdcard partition. Pretty much just have to modify the Mount remount command, and a few lines in the script.
Here's the original command
Code:
mount -o remount,rw,exec,suid /dev/block/vold/179:1 /mnt/sdcard-ext
And the modified one
Code:
mount -o remount,rw,exec,suid /dev/block/vold/179:57 /mnt/sdcard
Only things you have to change are the device location(179:57) and mount location(drop the -ext after sdcard)
Now, after that you also have to modify the script a bit. Just go through it, and anywhere that you see sdcard-ext, drop the -ext off the end.
thanks for putting that up for everybody! like i said, if you know what you are doing its not a hard swap to make.
Is anyone else getting just a gray screen when they remote in? What could be causing this?
i had that same problem at first... did you use zeroktal's ubuntud4.zip file? or did you use the ubuntu.sh file included in the app?
I used the sh file included. I did however fix the problem, when mounting at the start i confused vold with void. I did not get the file system mounted properly. This method does work!! however I am currently trying to get bash on my droid to replace sh as the shell. I've checked the forums but have not found anything yet about someone installing bash on the droid 4. With no way for nandroids I feel i should wait before I kill sh.
Sent from my DROID4 using XDA App
If you mod your init.sh in your root directory to the following, your vnc will work on startup without issue. It will also shutdown vnc on exit.
#!/bin/bash
#############################################
# Asks User to screen size and saves as REZ #
#############################################
#echo "Now enter the screen size you want in pixels (e.g. 800x480), followed by [ENTER]:"
#read REZ
##############################################
# Pick which desktop environment to use, this#
# is done by having a xstartup file for each #
# desktop, then renaming the one you want to #
# use to 'xstartup' before boot #
##############################################
echo "Please select which Desktop environment you want to use, type the number to select it then press [ENTER]"
echo "1 - LXDE"
echo "2 - Gnome"
echo "Make your Selection:"
read DESKTOP
if [ $DESKTOP == 1 ]
then
mv /root/.vnc/lxstartup /root/.vnc/xstartup
fi
if [ $DESKTOP == 2 ]
then
mv /root/.vnc/gxstartup /root/.vnc/xstartup
fi
###########################################
# Tidy up previous LXDE and DBUS sessions #
###########################################
rm /tmp/.X* > /dev/null 2>&1
rm /tmp/.X11-unix/X* > /dev/null 2>&1
rm /root/.vnc/localhost* > /dev/null 2>&1
rm /var/run/dbus/pid > /dev/null 2>&1
############################################################
# enable workaround for upstart dependent installs #
# in chroot'd environment. this allows certain packages #
# that use upstart start/stop to not fail on install. #
# this means they will have to be launched manually though #
############################################################
dpkg-divert --local --rename --add /sbin/initctl > /dev/null 2>&1
ln -s /bin/true /sbin/initctl > /dev/null 2>&1
###############################################
# start vnc server with given resolution and #
# DBUS server, (and optionally an SSH server) #
###############################################
dbus-daemon --system --fork > /dev/null 2>&1
/etc/init.d/ssh start
vncserver :1 -geometry 960x540
echo
echo "If you see the message 'New 'X' Desktop is localhost:1' then you are ready to VNC into your ubuntu OS.."
echo
echo "If VNC'ing from a different machine on the same network as the android device use the 1st address below:"
##########################################
# Output IP address of android device #
##########################################
ifconfig | grep "inet addr"
echo
echo "If using androidVNC, change the 'Color Format' setting to 24-bit colour, and once you've VNC'd in, change the 'input mode' to touchpad (in settings)"
echo
echo "To shut down the VNC server and exit the ubuntu environment, just enter 'exit' at this terminal - and WAIT for all shutdown routines to finish!"
echo
###############################################################
# Spawn and interactive shell - this effectively halts script #
# execution until the spawning shell is exited (i.e. you want #
# to shut down vncserver and exit the ubuntu environment) #
###############################################################
/bin/bash -i
#########################################
# Disable upstart workaround and #
# kill VNC server (and optionally SSH) #
# Rename used xstartup to its first file#
#########################################
killall -TERM Xtightvnc
/etc/init.d/ssh stop
Also save the follow lines between ### as remount.sh on your system partition. Then chmod 755 /system/remount.sh. Now you can just run run from a terminal /system/remount.sh and voila it remounts correctly and starts ubuntu(with the above fixes). Im still working on the unmounts.
####### for the internal sd card
mount -o remount,rw,exec,suid /dev/block/vold/179:57 /mnt/sdcard
/mnt/sdcard/ubuntu/ubuntu.sh
######
OR
####### for the external sd card
mount -o remount,rw,exec,suid /dev/block/vold/179:1 /mnt/sdcard-ext
/mnt/sdcard-ext/ubuntu/ubuntu.sh
#######
great stuff!
feel free
Feel free and take, modify, repost or edit anything I touch.
QUESTION:
After I delete all the ^M and ^ what do i do next? I try to hit the command ":x" to exit and save changes but it just creates another line. Also when I press VOL UP + E to escape nothing happens.
PhanTuhC said:
QUESTION:
After I delete all the ^M and ^ what do i do next? I try to hit the command ":x" to exit and save changes but it just creates another line. Also when I press VOL UP + E to escape nothing happens.
Click to expand...
Click to collapse
In vi, the command to save and exit is :wq (probably short for write and quit).
remember, read up on the vi quick-reference guide: http://www.lagmonster.org/docs/vi.html
OK I fixed it but now its not letting me connect with androidVNC. All the settings entered is correct but when I try to connect it says:
"VNC connection failed!" localhost/127.0.0.1:5901 - Connection refused"
ok, i've gone thru this a few times (slowly and deliberately) and must be missing something...the directions seem pretty straightforward! here's what i know...
busy/terminal/vnc are all installed
small 2.5gb image is unzipped in /sdcard-ext/ubuntu directory
the attached .sh file from page 1 is in the same directory
i removed all ^M using vi
but when I try sh ubuntud4.sh i get an error...
"mkdir failed for /data/local/mnt/ubun, No such file or directory"
(plus a few other errors)
should the directory be "ubun" or "ubuntu"? am I typing something incorrectly?
copy and paste new script
Copy and paste the new scripts I posted. They will fix your problem. Remember to use the remount script from /system/ the rest will work perfectly if you are root. I'll check back later on your progress.
Ok, well I started from scratch (deleted both .img and .sh files) and it's still not working.
I have all the apps installed (and yes rooted, SU works just fine)
I used Ubuntu Installer app to download the image zip (tried both the large and small img)
I downloaded the .sh file from the first post
The /sdcard-ext/ubuntu/ folder now has two files: "ubuntu.img" and "ubuntud4.sh"
All ^M characters have been removed from .sh file
Still no joy...
Ideas? What am I missing?
In terminal, I can set SU permissions and the mount/cd commands work just fine...it's the last sh command that spits out a bunch of errors about not being able to create/find the directories.
I'm going to format the sdcard and try again...any help is appreciated.
Update: Even after re-formatting the SD and following the steps exactly, no luck!
Did you remember to remount the sdcard with exec and suid permissions?
Andbuntu will work much better than this method. It works on every single phone with modification to the "environmental variables".
http://code.google.com/p/andbuntu/
Follow the directions in the script to make the process much easier than the first post.
instructions:
generate an image with rootstock on an ubuntu computer.
put it on /sdcard/ubuntu/ubuntu.img
run the script on your phone with "sh /path/to/script"
Here is the script. http://andbuntu.googlecode.com/svn/trunk/uboot
Also, run "firstRun" to make things like terminals work properly.
Adamoutler: That didnt work for me. The permissions were incorrect on the mounted partitions.
Sent from my DROID4 using XDA App

Linux installer

Trying to get Ubuntu chroot up and running with Linux installer from the market.
Followed the quick start guide to a "t", only changes I made from the default settings were distribution and version. This resulted in a /data/local/mnt/Linux directory with the Ubuntu file structure inside and a Linux.loop file in the root of my internal storage.
The part that is confusing of how to mount. The last step in the guide is to press the button that creates the linuxchroot script; when I press the button out says it's creating the file but the file isn't created.
I'm attempting to use the following commands to mount manually:
Code: ---------# mount loop.img directory ---------If for some reason that doesn't work use losetup.
Code: ---------# losetup /dev/block/loop7 loop.img # mount -t auto /dev/block/loop7 directory
But not sure how to use them because there isn't a .img file, just the previously mentioned /data/local/mnt/Linux directory and the Linux.loop file.
Anyone? Thanks in advance
Sent from my DROID3 using Tapatalk 2
Q9Nap said:
Trying to get Ubuntu chroot up and running with Linux installer from the market.
Followed the quick start guide to a "t", only changes I made from the default settings were distribution and version. This resulted in a /data/local/mnt/Linux directory with the Ubuntu file structure inside and a Linux.loop file in the root of my internal storage.
The part that is confusing of how to mount. The last step in the guide is to press the button that creates the linuxchroot script; when I press the button out says it's creating the file but the file isn't created.
I'm attempting to use the following commands to mount manually:
Code: ---------# mount loop.img directory ---------If for some reason that doesn't work use losetup.
Code: ---------# losetup /dev/block/loop7 loop.img # mount -t auto /dev/block/loop7 directory
But not sure how to use them because there isn't a .img file, just the previously mentioned /data/local/mnt/Linux directory and the Linux.loop file.
Anyone? Thanks in advance
Sent from my DROID3 using Tapatalk 2
Click to expand...
Click to collapse
If you see the directory structure in /data/local/mnt/Linux then it's already mounted.
Code:
chroot /data/local/mnt/Linux /bin/bash
Should work, but I have no idea why the script isn't being created.
To manually mount.
Code:
mount /sdcard/Linux.loop /data/local/mnt/Linux
and un-mount after exiting the chroot environment by a ctrl-d or typing "exit".
Code:
umount /data/local/mnt/Linux
if un-mounting causes a device is busy error, un-mount the lazy way
Code:
umount -l /data/local/mnt/Linux
Doing any of this manually might cause some errors because the script isn't doing whatever it is that it does.
Ok so I finally got Ubuntu up and running with vnc server and all, & realized there's no way to input text.
Anyone know if there's any possible way to be able to use the d3 keyboard while in chroot (other than in terminal of course) ?
*edit*
Seems to be working now...

[Q] Updating Boot For SD based ICS

I am using "generic-sdcard-v1.3-ICS-large-Rev3" from leapinlar/verygreen and a knightly from @CM_Encore (TeamWin)
http://forum.xda-developers.com/showthread.php?t=1000957
Pulling the micro SD out of the nook, into the SD Adapter and into the PC isn't complicated, but I would rather handle this via a PC batch and adb.
By default partition 1 of the SDCard is not mounted on boot. (so far as I can tell)
My Linux days are a bit behind me, but I found /etc/vold.fstab pointing to dev_mount sdcard /mnt/sdcard 4 /devices/platform/mmci-omap-hs.0/mmc_host/mmc1.
So I assume I want to mount somthing like:
dev_mount boot /mnt/boot 1 /devices/platform/mmci-omap-hs.0/mmc_host/mmc1
Then I can ADB PUSH updated and ADB reboot recovery.
I don't see a path to dev_mount to reproduce this approach.
I am also not sure if I need to create a /mnt/boot path first.
jmiller76 said:
I am using "generic-sdcard-v1.3-ICS-large-Rev3" from leapinlar/verygreen and a knightly from @CM_Encore (TeamWin)
http://forum.xda-developers.com/showthread.php?t=1000957
Pulling the micro SD out of the nook, into the SD Adapter and into the PC isn't complicated, but I would rather handle this via a PC batch and adb.
By default partition 1 of the SDCard is not mounted on boot. (so far as I can tell)
My Linux days are a bit behind me, but I found /etc/vold.fstab pointing to dev_mount sdcard /mnt/sdcard 4 /devices/platform/mmci-omap-hs.0/mmc_host/mmc1.
So I assume I want to mount somthing like:
dev_mount boot /mnt/boot 1 /devices/platform/mmci-omap-hs.0/mmc_host/mmc1
Then I can ADB PUSH updated and ADB reboot recovery.
I don't see a path to dev_mount to reproduce this approach.
I am also not sure if I need to create a /mnt/boot path first.
Click to expand...
Click to collapse
Just create a directory on /sdcard called boot...
adb shell mkdir /sdcard/boot
adb shell mount /dev/block/mmcblk1p1 /sdcard/boot
adb push XXXXX /sdcard/boot
There are two easy ways to accomplish what you need if you don't want to mess with adb. But Dizzy's instructions work if you are comfortable with adb.
One is to us a third party program named NookColorUMS and it will mount the boot partition on the PC using your USB cable.
The second way is to install a script file that I created to make the boot partition mount directly on the Nook.
You can learn about both by reading my tips thread linked in my signature.
Is this right to set the mount folder on the sdcard (fat32)?
I can make the folder, but attempting:
255|[email protected]:/ # mount /dev/block/mmcblk1p1 /sdcard/boot
mount /dev/block/mmcblk1p1 /sdcard/boot
Usage: mount [-r] [-w] [-o options] [-t type] device directory​The direct "Usage" text isn't explaining the syntax problem.
Believe it or not the whole /dev/block/ wasn't there when I used Linux in school. everything was just under /dev/ an ls -al took a while. Impossible to find things.
NookColorUMS-CM9.apk seems to do the trick if I switch out of MTP to Mass Storage.
Is there a way to make this work for MTP?
Id also still like to understand why the mount commands aren't working.
Thanks,
Josh
jmiller76 said:
Is this right to set the mount folder on the sdcard (fat32)?
I can make the folder, but attempting:
255|[email protected]:/ # mount /dev/block/mmcblk1p1 /sdcard/boot
mount /dev/block/mmcblk1p1 /sdcard/boot
Usage: mount [-r] [-w] [-o options] [-t type] device directory​The direct "Usage" text isn't explaining the syntax problem.
Believe it or not the whole /dev/block/ wasn't there when I used Linux in school. everything was just under /dev/ an ls -al took a while. Impossible to find things.
NookColorUMS-CM9.apk seems to do the trick if I switch out of MTP to Mass Storage.
Is there a way to make this work for MTP?
Id also still like to understand why the mount commands aren't working.
Thanks,
Josh
Click to expand...
Click to collapse
No the app only works for UMS (mass storage).
The mount command was not working for you because in CM9, you must use the -t option. For boot it is vfat. So the command would be:
mount -t vfat /dev/block/mmcblk1p1 /sdcard/boot
Specifying the type makes sense, wish mount had told me that, or that a type was needed.
Do you know what the behavior would be to mount the SD via mass storage with that mount point?
I scanned your(Leapinlar) user tips again and saw that at some point this behavior was working out of the box with /data/sdboot linked to /sdboot. It said it would be discussed again, but I am not sure the current draft does that.[it is mentioned below, but not explained]
In MTP mode the /sdcard/boot is not visible. Is there a way to register this partition as visible via MTP?
Are there any gotchas I should keep an eye out for?
Or any issues adding this to /data/local/userinit.d?
Thanks.
jmiller76 said:
Specifying the type makes sense, wish mount had told me that, or that a type was needed.
Do you know what the behavior would be to mount the SD via mass storage with that mount point?
I scanned your(Leapinlar) user tips again and saw that at some point this behavior was working out of the box with /data/sdboot linked to /sdboot. It said it would be discussed again, but I am not sure the current draft does that.[it is mentioned below, but not explained]
In MTP mode the /sdcard/boot is not visible. Is there a way to register this partition as visible via MTP?
Are there any gotchas I should keep an eye out for?
Or any issues adding this to /data/local/userinit.d?
Thanks.
Click to expand...
Click to collapse
The sdboot folder only shows inside CM. The reason I set up that folder was so GooManager could use it, not to make it available to the PC. And it works well with no issues adding that script.
Mtp only shows sdcard and emmc folders and I don't know of a way to change that. It probably does not show the sdcard/boot because it is mounted there rather than an actual part of the sdcard.
Yes, I do know how to mount the boot partition with a userint script so that it mounts using UMS, but I now use the NookColorUMS app since it is easier.

[GUIDE] Running ArchLinuxARM on Huawei Ascend P7

Prerequisites:
Rooted device
Busybox installed ( get it from Google Play )
Terminal emulator ( get it from Google Play )
An armv7h linux image ( see the download link below )
ArchLinuxARM images:
You can download any ArchLinuxARM image you want from this link sourceforge.net/projects/linuxonandroid/files/ArchLinux/
After downloading your image rename it to "arch.img".
Step 1:
Create the following directories on your EXTERNAL-SDcard ( works on internal too but you'll have to modify the paths in the arch.sh script ): archlinux/ and archlinux/mount/
Step 2:
Copy the arch.img file you downloaded from your computer to your EXTERNAL-SDcard and store it under archlinux/
Step 3:
Open a text editor on your computer and create a new file called arch.sh and paste the following text in it:
# path to the linux img
# change this in case it is different from your image's path
LINUX_IMG=/storage/sdcard1/archlinux/arch.img
# location where the linux image will be mounted (/storage/sdcard1/archlinux/mount/)
# change this if you want to mount it somewhere else
LINUX_DIR=/storage/sdcard1/archlinux/mount/
# create the directory where the linux image will be mounted in case it doesn't exist
mkdir -p $LINUX_DIR
# mount the image
busybox mount -o loop $LINUX_IMG $LINUX_DIR
# mount dev and proc directories
cd $LINUX_DIR
busybox mount -t proc proc proc/
busybox mount -o bind /dev/ dev/
# optionally mount sdcard and external sdcard (if you do not want to mount them simply comment the following 2 lines)
busybox mount -o bind /sdcard/ sdcard/
busybox mount -o bind /storage/sdcard1/ external_sd/
# copy resolv.conf from android environment to arch linux environment
cp /etc/resolv.conf etc/resolv.conf
# chroot into the arch linux environment
chroot $LINUX_DIR /bin/bash
Step 4:
Copy the arch.sh script from your computer to the root of your INTERNAL SDcard ( since we don't have execute permissions on the external SDcard we will store the script on the internal SDcard).
Step 5:
Unplug your AscendP7 from the computer and open the terminal emulator.
Once the terminal emulator opened type the following:
su
cd /storage/sdcard0/
./arch.sh
If you followed the above steps, after executing the above commands you should find yourself inside the ArchLinux environment.
problem with download file
MihaiChirculete said:
Prerequisites:
Rooted device
Busybox installed ( get it from Google Play )
Terminal emulator ( get it from Google Play )
An armv7h linux image ( see the download link below )
ArchLinuxARM images:
You can download any ArchLinuxARM image you want from this link nl.mirror.archlinuxarm.org/armv7h/alarm/
After downloading your image rename it to "arch.img".
Step 1:
Create the following directories on your EXTERNAL-SDcard ( works on internal too but you'll have to modify the paths in the arch.sh script ): archlinux/ and archlinux/mount/
Step 2:
Copy the arch.img file you downloaded from your computer to your EXTERNAL-SDcard and store it under archlinux/
Step 3:
Open a text editor on your computer and create a new file called arch.sh and paste the following text in it:
# path to the linux img
# change this in case it is different from your image's path
LINUX_IMG=/storage/sdcard1/archlinux/arch.img
# location where the linux image will be mounted (/storage/sdcard1/archlinux/mount/)
# change this if you want to mount it somewhere else
LINUX_DIR=/storage/sdcard1/archlinux/mount/
# create the directory where the linux image will be mounted in case it doesn't exist
mkdir -p $LINUX_DIR
# mount the image
busybox mount -o loop $LINUX_IMG $LINUX_DIR
# mount dev and proc directories
cd $LINUX_DIR
busybox mount -t proc proc proc/
busybox mount -o bind /dev/ dev/
# optionally mount sdcard and external sdcard (if you do not want to mount them simply comment the following 2 lines)
busybox mount -o bind /sdcard/ sdcard/
busybox mount -o bind /storage/sdcard1/ external_sd/
# copy resolv.conf from android environment to arch linux environment
cp /etc/resolv.conf etc/resolv.conf
# chroot into the arch linux environment
chroot $LINUX_DIR /bin/bash
Step 4:
Copy the arch.sh script from your computer to the root of your INTERNAL SDcard ( since we don't have execute permissions on the external SDcard we will store the script on the internal SDcard).
Step 5:
Unplug your AscendP7 from the computer and open the terminal emulator.
Once the terminal emulator opened type the following:
su
cd /storage/sdcard0/
./arch.sh
If you followed the above steps, after executing the above commands you should find yourself inside the ArchLinux environment.
Click to expand...
Click to collapse
which one must to download?
rahim1234 said:
which one must to download?
Click to expand...
Click to collapse
I changed the download link. Try this: sourceforge.net/projects/linuxonandroid/files/ArchLinux/
so, what is the advantage of this kernel?

Question Renaming a system file?

I have a rooted Pixel 7 and It was suggested that I rename a system file to prevent the system from updating itself (despite my having turned off all such options). My first attempt was to merely try renaming the file, but that didn’t work because the file systems in mounted RO.
I did some looking around, and the common approach to dealing with this issue is to remount the file system. Following is a ‘screen grab’ of my abd session:
Code:
cheetah:/ $ su
cheetah:/ $ ls /product
app etc fonts framework lib lib64 lost+found media overlay priv-app tts usr wallpaper
(this has the directory I want, so this file system)
cheetah:/ $ mount | grep product
/dev/block/dm-15 on /product type ext4 (ro,seclabel,relatime)
(this is a mounted file system)
cheetah:/ # mount -o rw,remount /product
'/dev/block/dm-15' is read-only
cheetah:/ # mount -o rw,remount -t ext4 /product
'/dev/block/dm-15' is read-only
cheetah:/ # mount -o rw,remount /dev/block/dm-15 /product
'/dev/block/dm-15' is read-only
(three attempts to remount – all failed)
So, now what should I try?
groston said:
I have a rooted Pixel 7 and It was suggested that I rename a system file to prevent the system from updating itself (despite my having turned off all such options). My first attempt was to merely try renaming the file, but that didn’t work because the file systems in mounted RO.
I did some looking around, and the common approach to dealing with this issue is to remount the file system. Following is a ‘screen grab’ of my abd session:
Code:
cheetah:/ $ su
cheetah:/ $ ls /product
app etc fonts framework lib lib64 lost+found media overlay priv-app tts usr wallpaper
(this has the directory I want, so this file system)
cheetah:/ $ mount | grep product
/dev/block/dm-15 on /product type ext4 (ro,seclabel,relatime)
(this is a mounted file system)
cheetah:/ # mount -o rw,remount /product
'/dev/block/dm-15' is read-only
cheetah:/ # mount -o rw,remount -t ext4 /product
'/dev/block/dm-15' is read-only
cheetah:/ # mount -o rw,remount /dev/block/dm-15 /product
'/dev/block/dm-15' is read-only
(three attempts to remount – all failed)
So, now what should I try?
Click to expand...
Click to collapse
I haven't used this, but maybe it can help you.
Lughnasadh said:
I haven't used this, but maybe it can help you.
Click to expand...
Click to collapse
Thank you. Seems like this might work, but after reading several pages, I am not sure how to install/use overlayfs. I have a Windows system - any chance you could point me to something that provides some guidance?
groston said:
Thank you. Seems like this might work, but after reading several pages, I am not sure how to install/use overlayfs. I have a Windows system - any chance you could point me to something that provides some guidance?
Click to expand...
Click to collapse
I've never used this before but I believe once you flash the module it makes the /system RW so you can start making modifications. There's a README that provides some information. I don't know of any other guides besides the information on that Github page.
Checking out the thread below might reveal a solution and/or give a clue or hint...
Pixel 7 Pro Stuck in read only mode (rooted with magisk 26.1) Am I missing something? HELP
Everything ive tried in FX Explorer fails. No matter what I try, for example editing build.prop or anything else, it constantly says read only. i cannot use any method to allow write access. Did i miss something when i rooted with Magisk? I dont...
forum.xda-developers.com
simplepinoi177 said:
Checking out the thread below might reveal a solution and/or give a clue or hint...
Pixel 7 Pro Stuck in read only mode (rooted with magisk 26.1) Am I missing something? HELP
Everything ive tried in FX Explorer fails. No matter what I try, for example editing build.prop or anything else, it constantly says read only. i cannot use any method to allow write access. Did i miss something when i rooted with Magisk? I dont...
forum.xda-developers.com
Click to expand...
Click to collapse
Good suggestion. I installed FX File Explorer, gave it the appropriate permissions, but was unable to change the /product filesystem to read/write.
groston said:
Good suggestion. I installed FX File Explorer, gave it the appropriate permissions, but was unable to change the /product filesystem to read/write.
Click to expand...
Click to collapse
When you say "gave it the appropriate permissions", just to confirm -- that doesn't mean that you changed the security permissions on the folder & files, correct? I hope it means you did not do what the OP in that thread had done and actually did enable root access particularly (hoping that's what you meant on "gave it appropriate permissions").
Because, in certain cases, I've changed permissions on files/folders vs. simply enabling root access mode....
Apologies in advanced if my inquiry seems fairly obvious (to the point of insulting maybe; it is not meant to be), but you never know and many foolish things has been done/assumed on this site that missed many (obvious) things because it wasn't confirmed....

Categories

Resources