Re: [MOD] Full Linux (Debian) inside WebTop! v0.2.7
I managed to unlock, root and install WebTopMOD on my new2me searet Atrix 4g. Great feeling for an android n00b! I can run iceweasel, gimp and whatever I like just like any linux distro on the webtop as long as I start a new shell to launch linux apps. I had wanted to continue on to using the instructions in post #865 by jissee44 to get the xfce4 window manager running. No luck! I can launch (I think) xfce4 manually and the entire view changes - new wallpaper, new toolbar, but no access to the linux filesystem - everything connects to the android filesystem.
Here is what I think is needed to see what went wrong. There are only two files to edit when following post #865. I am including the entire file as the posting I was following does not include diffs.
/osh/usr/sbin/linux
Code:
#!/bin/bash
CHROOTDIR="/osh/opt/WebTopMOD/root"
LOOPDEVICE="/dev/block/loop50"
function enablex {
xhost +
}
function mountlinuxdisk {
loopdevice
sudo mount -t ext3 -o loop=$LOOPDEVICE $FILENAME $CHROOTDIR
touch /tmp/linuxdiskactive
}
function umountlinuxdisk {
sudo umount $CHROOTDIR
sudo umount $LOOPDEVICE
rm /tmp/linuxdiskactive
}
function startfulllinuxchroot {
mountlinuxdisk
sudo mount -o bind /proc $CHROOTDIR/proc
sudo mount -o bind /dev $CHROOTDIR/dev
sudo mount -o bind /dev/pts $CHROOTDIR/dev/pts
sudo mount -o bind /dev/shm $CHROOTDIR/dev/shm
#sudo mount -o bind /proc/bus/usb $CHROOTDIR/proc/bus/usb
sudo mount -o bind /sys $CHROOTDIR/sys
sudo mount -o bind /tmp $CHROOTDIR/tmp
sudo mount -o bind /var/tmp $CHROOTDIR/var/tmp
sudo mount -o bind /var/run/dbus/ $CHROOTDIR/var/run/dbus
sudo mount -t vfat /dev/block/vold/179:18 $CHROOTDIR/sdcard
sudo mount -t vfat /dev/block/vold/179:33 $CHROOTDIR/sdcard-ext
sudo mount -o bind /etc $CHROOTDIR/mnt/DEVICE/etc
sudo mount -o bind /usr $CHROOTDIR/mnt/DEVICE/usr
touch /tmp/fulllinuxchrootactive
}
function startxterm {
# sudo chroot $CHROOTDIR /usr/bin/xterm pdmenu
sudo chroot $CHROOTDIR /usr/bin/xterm
}
function startxfce {
kill $(ps -ef | grep 5000 | grep webtop-wallpaper | cut -c10-15)
kill $(ps -ef | grep 5000 | grep xscreensaver | cut -c10-15
sudo chroot $CHROOTDIR /usr/bin/xfce4-session
}
function stopfullchroot {
CHECKS=0
until [ "$CHECKS" -eq "15" ]
do
TOUMOUNT=`sudo mount | grep "$CHROOTDIR" | awk '{ print $3 }'`
if [ "$TOUMOUNT" = "" ]; then break; fi
for i in $TOUMOUNT
do
sudo umount $i
done
CHECKS=$(( $CHECKS + 1 ))
done
rm /tmp/fulllinuxchrootactive
mountlinuxdisk
}
function checkwhereislinux {
if [ -e /sdcard/WebTopMOD/linuxdisk ]; then
FILENAME="/sdcard/WebTopMOD/linuxdisk"
if [ "$1" -eq 1 ]; then
/usr/bin/xmessage "Found image in /sdcard/WebTopMOD/linu
xdisk!"
checklinuxdisk
fi
else
if [ -e /sdcard-ext/WebTopMOD/linuxdisk ]; then
FILENAME="/sdcard-ext/WebTopMOD/linuxdisk"
if [ "$1" -eq 1 ]; then
/usr/bin/xmessage "Found image in /sdcard-ext/We
bTopMOD/linuxdisk!"
checklinuxdisk
fi
else
if [ "$1" -eq 1 ]; then
/usr/bin/xmessage "Sorry, no image available...
put linuxdisk in /sdcard/WebTopMOD/ OR /sdcard-ext/WebTopMOD/linuxdisk"
exit 1
fi
fi
fi
}
function checklinuxdisk {
if [ ! -s $FILENAME ]; then
/usr/bin/xmessage "But... Wait... Your disk looks damaged, maybe
you tried to copy an image larger then 4gB? This is a FAT32 limit."
exit 1
fi
if [ -d $FILENAME ]; then
/usr/bin/xmessage "Damn! linuxdisk is a file and it MUST be plac
ed in /sdcard/WebTopMOD/ OR /sdcard-ext/WebTopMOD/ folder. Otherwise this mod CA
N'T work' "
exit 1
fi
}
function loopdevice {
if [ -e $LOOPDEVICE ]; then
echo "Device exist"
else
sudo mknod -m600 $LOOPDEVICE b 7 50
fi
}
enablex
if [ -e /tmp/linuxdiskactive ]; then
if [ -e /tmp/fulllinuxchrootactive ]; then
startxterm
else
checkwhereislinux 0
startfulllinuxchroot
startxterm
fi
else
checkwhereislinux 1
mountlinuxdisk
startfulllinuxchroot
startxfce
# startxterm
fi
#RUNNINGXTERM=`ps -C xterm h | wc -l`
#if [ "$RUNNINGXTERM" -eq 0 ]
#then
# stopfullchroot
# umountlinuxdisk
#fi
exit 0
/osh/usr/local/bin/start-oshwt-2.sh
Code:
#! /bin/sh
### BEGIN INIT INFO
# Provides: start_lxde2.sh
# Required-Start:
# Required-Stop:
# Default-Start:
# Default-Stop:
# Short-Description: started by adas user at login
### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export LD_LIBRARY_PATH=/usr/lib:/usr/local/lib
. /lib/lsb/init-functions
log_action_msg "Will now start OSHWT 2 scripts"
# start OSHWT 2 scripts
sfalv -i "lxpanel"
#sfalv -i "awn-autostart"
sfalv -i "webtop-panel"
sfalv -i "webtop-wallpaper"
sfalv -i "evbridge"
sfalv -i "window_switcher"
sr-test avahi_start &
Can someone give me some clues as to what has gone wrong? I'm not sure if something is missing or if I broke something in my edits, and there are no follow up questions on the post. There are 13 thanks.
ruarri
making progress?
Okay, I'm just hearing the crickets.
> startxfce4
provides some of the results I want, but leaves AWN in control. Now that the new ICS ROMs are coming out I'll have to see if I can just make webtopMOD usable until something better comes along. It would be good to see better documentation for n00bs. The forums are a little rambling. There is a lot of good info, its just scattered.
ruarri
ruarri said:
no access to the linux filesystem - everything connects to the android filesystem.
Click to expand...
Click to collapse
Hi,
What do you mean ?
The Debian is a Chroot
Good'nough
jisse44 said:
The Debian is a Chroot
Click to expand...
Click to collapse
Thanks for the terse explanation, jisse44. It took me a while to get around to reading the docs on chroot. It makes sense that webtop isrunning in a sandbox. That is inherently limiting.
I still love webtop and my lapdock. It will be interesting to see what happens with webtop and the ICS ROMs on the Atrix 4G.
ruarri said:
It will be interesting to see what happens with webtop and the ICS ROMs on the Atrix 4G.
Click to expand...
Click to collapse
Or not....
By now you can only run last new "webtop" on ICS Roms, and this is not THE webtop, it's a tablet mode: no Ubuntu or debian, only Android....
Related
Welcome to the EternityProject's WebTop Modifications Thread for Motorola RAZR
...:: Unleash your Gentoo Power! ::...
What do we need?
A brain...... And willing to unleash the power of your device.... :°)
Download:
GenTop for Motorola RAZR - v0.2: HERE
domain_policy.conf: HERE
sudoers: HERE
Changelog:
Code:
v0.2:
- World has been updated (01/2012)
- Recompiled most things with NEON support
- Portage bug solved (can now emerge without tricks)
v0.1:
- First release
History:
GenTop for Motorola RAZR - v0.1: HERE
Instructions:
1. UnBz2/UnTar the archive
2. Copy the IMG file on the root of your external sdcard
3. Execute the scripts
4. Enjoy!
Script:
Only for the first time setup:
Code:
adb push domain_policy.conf /tmp/
adh push sudoers /tmp/
adb shell
su
cp domain_policy.conf /etc/tomoyo/
cp sudoers /etc/
chown root:root /etc/tomoyo/domain_policy.conf
chown root:root /etc/sudoers
chmod 440 /etc/sudoers
reboot
Then start WebTop and execute this:
Code:
su
/usr/bin/sudo -H -u adas bash
export DISPLAY=:0
xhost +
sudo -i
mknod -m640 /dev/loop94 b 7 94
mkdir /tmp/wtm
mount -o loop /sdcard-ext/eternitygentop.img /tmp/wtm
mount -o bind /proc /tmp/wtm/proc
mount -o bind /dev /tmp/wtm/dev
mount -o bind /dev/pts /tmp/wtm/dev/pts
mount -o bind /dev/shm /tmp/wtm/dev/shm
mount -o bind /proc/bus/usb /tmp/wtm/proc/bus/usb
mount -o bind /sys /tmp/wtm/sys
mount -o bind /tmp /tmp/wtm/tmp
mount -o bind /var/tmp /tmp/wtm/var/tmp
mount -o bind /var/run/dbus/ /tmp/wtm/var/run/dbus
mount -o bind /var/lib/dbus/ /tmp/wtm/var/lib/dbus
mount -o bind /sdcard /tmp/wtm/sdcard
mount -o bind /sdcard-ext /tmp/wtm/sdcard-ext
chroot /tmp/wtm /bin/bash
export DISPLAY=:0
xterm
The xterm window is acting on the new Gentoo system.
Replacing WebTop UI with Lightweight GNOME (only panels and metacity):
Code:
eprj_lightgnome
Replacing WebTop with Full GNOME:
Code:
eprj_fullgnome
Replacing WebTop UI with Lightweight GNOME (only panels and metacity -- manual):
Code:
kill $(ps -ef | grep 5000 | grep webtop-panel | cut -c10-15)
kill $(ps -ef | grep 5000 | grep apptray | cut -c10-15)
kill $(ps -ef | grep 5000 | grep metacity | cut -c10-15)
kill $(ps -ef | grep 5000 | grep xscreensaver | cut -c10-15)
sleep 3
gnome-panel &
metacity -c &
Replacing WebTop with Full GNOME (Manual):
Code:
kill $(ps -ef | grep 5000 | grep webtop-panel | cut -c10-15)
kill $(ps -ef | grep 5000 | grep apptray | cut -c10-15)
kill $(ps -ef | grep 5000 | grep metacity | cut -c10-15)
kill $(ps -ef | grep 5000 | grep webtop-wallpaper | cut -c10-15)
kill $(ps -ef | grep 5000 | grep xscreensaver | cut -c10-15)
sleep 3
gnome-session &
How to emerge packages:
Code:
cd /root
emerge --pretend --fetchonly MYEBUILD | sed -r '/^(ht|f)tp:\/\//{s/ +/\n/g;p};d' >urllist
xargs wget -nc -nd -P /usr/portage/distfiles/ <urllist
emerge MYEBUILD
rm -rf /usr/portage/distfiles/*
Replace "MYEBUILD" with your package's name.
Status:
Note that it is an alpha version so, not everything will work flawlessly and easily. If your network doesn't work, check /etc/resolv.conf.
The EternityProject Team Manager & Main Developer,
-kholk
EternityProject Team FTW! ^_^
Heh! When I promise something, I'll do. Unless you're a bad child.
Oh, forgetting to say and I didn't want to write that on first post, the GenTop image is intended to be used on a real MicroSD (first) ext4 partition if you want to install other things on it.
You know, Gentoo requires a lot of space when compiling
Great work. Looking forward to unleashing the Gentop!
I'll try and keep my extreme noobie questions to a minimum, but:
1. Do I need to root my phone?
2. So I paste these 3 (uncompressed) files onto the root directory of my SD card and open the 3 files using a file explorer. Does this open a terminal window where I type in the scripts you listed (similar to if I have a DOS window open on my PC?)
3. When I plug the phone into the lapdock, will I get a choice of whether it opens into webtop vs gentop?
Thanks.
1. Yup.
2. What a confusion... You should do the first time setup using a computer with ADB
3. No. It will simply boot WebTop, you'll replace it with GenTop later.
Thanks. I'll do some self directed learning before my next question
I'll start here: http://developer.android.com/guide/developing/tools/adb.html
Anyhow, I don't want to waste peoples time with too many overly basic questions. Your time is better spent developing this I still have to swap out my slightly defective phone, so probably won't get to installing this for about a week. In the mean time I'll read up on some of the basics...
Looking forward to try it out.
broken links got my hopes up here i miss gentoo
Oh, my bad, links fixed.
ArchTop would be the best option here IMHO. No need to compile-recompile especially on SD card which I believe will be affecting sd card life (lots of reads/writes cycles is bad for cards)
Link is not working for me...makes me a sad panda
Yup, I know. I'm really sorry for this, my head is giving me some bad jokes today.
Link re-fixed and tested. Now it works
Can you please explain how to create an ext4 partition to mount the gentop?
Unless you mean you want to get the IMG on an sdcard partition (in this case you should use fdisk and dd, and you can find more infos HERE) ....
....it's all written on first post.
Code:
export PATH=/data/local/bin:$PATH
[email protected]_spyder:/$ export PATH=/data/local/bin:$PATH
[email protected]_spyder:/$ su
[email protected]_spyder:/# /usr/bin/sudo -H -u adas bash
[email protected]:/$ export DISPLAY=:0
[email protected]:/$ xhost +
access control disabled, clients can connect from any host
[email protected]:/$ sudo -i
-bash: getprop: command not found
[email protected]:~# mknod -m640 /dev/loop94 b 7 94
mknod: /dev/loop94: File exists
[email protected]:~# mount -o loop /sdcard-ext/gentop.img /tmp/wtm
mount: you must specify the filesystem type
[email protected]:~# mount -o loop /sdcard-ext/gentop.img /tmp/wtm -t ext4
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
[email protected]:~# mount -o loop -t auto /sdcard-ext/gentop.img /tmp/wtm
mount: you must specify the filesystem type
[email protected]:~# mount -o loop -t ext3 /sdcard-ext/gentop.img /tmp/wtm
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
[email protected]:~# mount -o loop -t ext4 /sdcard-ext/gentop.img /tmp/wtm
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
[email protected]:~# dmesg | tail
[ 1635.078918] HDCP: hdcp_ioctl() - QUERY 1335468
[ 1635.627441] 1 1429 679 0
[ 1636.224029] 1 850 234 1
[ 1636.291473] 1 850 234 0
[ 1636.829101] HDCP: hdcp_ioctl() - QUERY 1337226
[ 1637.243896] CPU1: shutdown
[ 1638.579315] HDCP: hdcp_ioctl() - QUERY 1338976
[ 1640.329528] HDCP: hdcp_ioctl() - QUERY 1340726
[ 1642.080322] HDCP: hdcp_ioctl() - QUERY 1342476
[ 1643.830505] HDCP: hdcp_ioctl() - QUERY 1344226
[email protected]:~#
No luck mounting the image.. any advice?
mount -o loop -t ext4 /sdcard-ext/gentop.img /tmp/wtm
That works on my device.
OR...
....fsck.ext4 -f /sdcard-ext/gentop.img
and retry to mount.
This looks awesome as well, but I'm having the same issue that was occurring with the ubuntop mod where my screen goes blank after a random interval of time.
It's obvious. The problem comes from Moto's XServer and I cannot do anything right now for this as I'm looking to solve some other things and make something else to be easier.
Anyway this is solvable with some working (and it WILL be solved!) and you can avoid this to happen clicking sometimes on the mobile view window!
Take your time! Although I think the recent RAZR update broke it for the original WTM for ubuntu on my phone too...
GenTop looks much better then ubuntu but like really noob I don't know lot of things there. Like how to install apps(libreoffice, jdownloader,...), how to mount external drive, etc. I have also issue with MX video player when I switch it on full screen and back. On gentop mobile view stop working. And on ubuntu WebTop falls at all. But maybe it is caused by nebtop.
I think it looks very promising but there is lot of work to be done. I'll be glad to help you, if there is something that I could do.
Thanks.
EDITn standard webtop with nebtop it works fine.
Sent from my XT910 using XDA App
I have two of these devices sitting around and I was wondering how people were repurposing them. I just picked up a Raspberry Pi with the intention of setting up a home automation system. Isn't the Eris also an ARMv6 processor? Could they be used as smart WiIP video security cameras? Is there a Linux distro somewhere? Anyone have any experience?
Greetings! There's a thread here you might be interested in. http://forum.xda-developers.com/showthread.php?t=823564&highlight=linux
roirraW "edor" ehT said:
Greetings! There's a thread here you might be interested in. http://forum.xda-developers.com/showthread.php?t=823564&highlight=linux
Click to expand...
Click to collapse
http://www.4shared.com/zip/uiPl7NhN/ubuntu.html Link to Ubuntu.img
to mount you can use this:
linuxboot.sh
#option if you wish to load a different file than the rc_enter just replace the rc_enter.sh with the script file you want to run
# i.e init.sh below this script I will post the initl.ls if you wan to replace the rc_enter.sh
Code:
#!/system/bin/sh
(
# If $BINDS does not exist, then done of the others are set iether.
if [ -z "$BINDS" ]; then
export DIST="debian squeeze"
export FILESYSTEM=/sdcard/ubuntu.img
export MOUNTPOINT=/sdcard/linux
export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
export USER=root
export LOGNAME=root
export UID=0
export SHELL=bash
export FS=ext3
export busybox="/data/data/com.galoula.LinuxInstall/bin/busybox"
export BINDS="1"
unset TMPDIR
fi
createLinuxBoot() {
if $busybox [ -d "$FILESYSTEM" ]
then
echo "I: Directory chroot !"
if $busybox [ ! -z "$($busybox mount | $busybox grep "$MOUNTPOINT/proc")" ]; then
# If the loop device is already mounted, we do nothing.
echo "W: $DIST is already mounted. Entering chroot..."
else
echo "I: Mounting device for $DIST..."
# Bind some Android dirs to the linux filesystem
if $busybox [ $BINDS -eq 1 ]
then
# Create mtab
echo > "${MOUNTPOINT}/etc/mtab"
$busybox cat /proc/mounts > "${MOUNTPOINT}/etc/mtab"
# for i in `$busybox cat /proc/mounts | $busybox cut -d " " -f 2`
for i in $( $busybox cat /proc/mounts | $busybox awk '{print $2}' )
do
$busybox mkdir -p "${MOUNTPOINT}/$i" 2> /dev/null
$busybox mount -o bind "${i}" "${MOUNTPOINT}/${i}" 2> /dev/null
#echo "${i}" >> "${MOUNTPOINT}/etc/mtab"
done
fi
fi
else
if $busybox [ ! -z "$($busybox mount | $busybox grep "$MOUNTPOINT ")" ]; then
# If the loop device is already mounted, we do nothing.
echo "W: $DIST is already mounted. Entering chroot..."
else
echo "I: Mounting device for $DIST..."
if $busybox [ ! -d $MOUNTPOINT ]; then
# Create the mount point if it does not already exist
$busybox mkdir -p $MOUNTPOINT 2> /dev/null
if $busybox [ ! -d $MOUNTPOINT ]; then
echo "F: It was not possible to create the missing mount location ($MOUNTPOINT)"
return 0
fi
fi
if $busybox [ -f "$FILESYSTEM" ]
then
# Android places loop devices in /dev/block/ instead of root /dev/
# If there are none in /dev/ we create links between /dev/loopX and /dev/block/loopX so that losetup will work as it should.
if $busybox [ ! -e /dev/block/loop0 ]; then
i=0
while [ $i -le 8 ]
do
$busybox mknod /dev/block/loop$i b 7 $i
let i=1+$i
done
fi
# Locate the current loop device file
if $busybox [ ! -z "$($busybox losetup | $busybox grep "$FILESYSTEM")" ]; then
# If the filesystem file is already attached to an loop device, we get the path to the device file.
loblk=$($busybox losetup | $busybox grep "$FILESYSTEM" | $busybox cut -d ":" -f 1)
else
# If the filesystem file is not yet attached, we attach it.
loblk=$($busybox losetup -f)
$busybox losetup $loblk $FILESYSTEM 2> /dev/null
# Make sure that the device was successfully attached to a loop device file
if $busybox [ -z "$($busybox losetup | $busybox grep "$FILESYSTEM")" ]; then
echo "F: It was not possible to attach the device to a loop device file"
return 0
fi
fi
fi
if $busybox [ -b "$FILESYSTEM" ]
then
loblk=$FILESYSTEM
fi
# Mount the filesystem
$busybox mount -t $FS $loblk $MOUNTPOINT 2> /dev/null
if $busybox [ ! -z "$($busybox mount | $busybox grep "$MOUNTPOINT ")" ]; then
# Bind some Android dirs to the linux filesystem
if $busybox [ $BINDS -eq 1 ]
then
# Create mtab
echo > "${MOUNTPOINT}/etc/mtab"
$busybox cat /proc/mounts > "${MOUNTPOINT}/etc/mtab"
# for i in `$busybox cat /proc/mounts | $busybox cut -d " " -f 2`
for i in $( $busybox cat /proc/mounts | $busybox awk '{print $2}' )
do
# /sdcard/Mon mount/Linux
$busybox mkdir -p "${MOUNTPOINT}/$i" 2> /dev/null
$busybox mount -o bind "${i}" "${MOUNTPOINT}/${i}" 2> /dev/null
#echo "${i}" >> "${MOUNTPOINT}/etc/mtab"
done
fi
#for i in $BINDS
#do
# # Bind the dirs if they are not already binded
# if $busybox [ -z "$($busybox mount | $busybox grep "$MOUNTPOINT/$i ")" ]; then
# # Create any missing dirs in the mountpoint
# if $busybox [ ! -d $MOUNTPOINT/$i ]; then
# $busybox mkdir -p $MOUNTPOINT/$i
# fi
# $busybox mount -o bind $i $MOUNTPOINT$i
# fi
#done
else
echo "F: It was not possible to mount $DIST at the specified location ($MOUNTPOINT)"
return 0
fi
fi
fi
# FIX the "stdin: is not a tty" error in direct hadware case.
if $busybox [ -z "$($busybox mount | $busybox grep "$MOUNTPOINT/dev/pts ")" ]; then
$busybox mount -t devpts devpts $MOUNTPOINT/dev/pts
fi
# For the network.
#sysctl -w net.ipv4.ip_forward=1
echo 1 > /proc/sys/net/ipv4/ip_forward
# Cleanup tmp folder.
$busybox rm -rf $MOUNTPOINT/tmp/*
if $busybox [ -f $MOUNTPOINT/etc/init.android/rc_mount.sh ]; then
# Execute the mount init file, if it exists
echo "I: Executing /etc/init.android/rc_mount.sh"
$busybox chroot $MOUNTPOINT /etc/init.android/rc_mount.sh
fi
echo "I: Entering chroot..."
return 1
}
removeLinuxBoot() {
if $busybox [ -d "$FILESYSTEM" ]
then
echo "I: Directory chroot !"
# Unmount pts
if $busybox [ ! -z "$($busybox mount | $busybox grep "$MOUNTPOINT/dev/pts ")" ]; then
$busybox umount $MOUNTPOINT/dev/pts 2> /dev/null
fi
for i in $BINDS
do
# Unmount all binding dirs
if $busybox [ ! -z "$($busybox mount | $busybox grep "$MOUNTPOINT/$i ")" ]; then
$busybox umount $MOUNTPOINT/$i
fi
done
for i in `$busybox cat /proc/mounts | $busybox tac | $busybox grep -v "$MOUNTPOINT " | $busybox grep "$MOUNTPOINT" | $busybox cut -d " " -f 2`;do umount $i 2> /dev/null;done
else
if $busybox [ -z "$($busybox mount | $busybox grep "$MOUNTPOINT ")" ]; then
# If linux is not mounted, then do nothing.
echo "W: $DIST is already unmounted"
else
echo "I: Unmounting $DIST..."
if $busybox [ -f $MOUNTPOINT/etc/init.android/rc_unmount.sh ]; then
echo "I: Executing /etc/init.android/rc_unmount.sh"
# Execute the unmount init script, if it exist.
$busybox chroot $MOUNTPOINT /etc/init.android/rc_unmount.sh
fi
sync
# Make sure that we have an loop device file to use
if $busybox [ -f "$FILESYSTEM" ]
then
if $busybox [ ! -z "$($busybox losetup | $busybox grep "$FILESYSTEM")" ]; then
# Get the loop device file
loblk=$($busybox losetup | $busybox grep "$FILESYSTEM" | $busybox cut -d ":" -f 1)
else
echo "E: Could not locate the loop device file. $DIST was not unmounted successfully"
fi
fi
if $busybox [ -b "$FILESYSTEM" ]
then
loblk=$FILESYSTEM
fi
# Unmount pts
if $busybox [ ! -z "$($busybox mount | $busybox grep "$MOUNTPOINT/dev/pts ")" ]; then
$busybox umount $MOUNTPOINT/dev/pts
fi
for i in `$busybox cat /proc/mounts | $busybox tac | $busybox grep -v "$MOUNTPOINT " | $busybox grep "$MOUNTPOINT" | $busybox cut -d " " -f 2`;do umount $i 2> /dev/null;done
for i in $BINDS
do
# Unmount all binding dirs
if $busybox [ ! -z "$($busybox mount | $busybox grep "$MOUNTPOINT/$i ")" ]; then
$busybox umount $MOUNTPOINT/$i
fi
done
sync && sleep 1
# Unmount the device
$busybox umount $MOUNTPOINT 2> /dev/null && sleep 1
# If the device could not be unmounted
if $busybox [ ! -z "$($busybox mount | $busybox grep "$MOUNTPOINT ")" ]; then
echo "E: $DIST could not be unmounted. Trying to kill attached processes..."
# Try to kill all processes holding the device
for i in `$busybox grep "$MOUNTPOINT" /proc/*/maps 2> /dev/null | $busybox cut -d":" -f 1 | $busybox sort | $busybox uniq | $busybox cut -d "/" -f 3`; do kill $i 2> /dev/null; echo; done
fuser -k -9 $MOUNTPOINT
for i in `$busybox grep "$MOUNTPOINT" /proc/*/maps 2> /dev/null | $busybox cut -d":" -f 1 | $busybox sort | $busybox uniq | $busybox cut -d "/" -f 3`; do kill -9 $i 2> /dev/null; echo; done
# Use umount with the -l option to take care of the rest
$busybox umount -l $MOUNTPOINT 2> /dev/null && sleep 1
fi
# Make sure the device has been successfully unmounted
if $busybox [ -z "$($busybox mount | $busybox grep "$MOUNTPOINT ")" ]; then
if $busybox [ -f "$FILESYSTEM" ]
then
# Try to detach the device from the loop device file
$busybox losetup -d $loblk 2> /dev/null
# Make sure that the device was successfully detached
if $busybox [ -z "$($busybox losetup | $busybox grep "$FILESYSTEM")" ]; then
echo "I: $DIST has been successfully unmounted"
else
echo "E: $DIST has been unmounted, but could not detach the loop device"
fi
fi
if $busybox [ -b "$FILESYSTEM" ]
then
if $busybox [ -z "$($busybox mount | $busybox grep "$MOUNTPOINT ")" ]; then
echo "I: $DIST has been successfully unmounted"
else
echo "E: $DIST has been unmounted, but could not detach the loop device"
fi
fi
else
echo "E: $DIST could not be unmounted successfully"
fi
fi
fi
}
if $busybox [ "$1" = "unmount" ]; then
removeLinuxBoot
else
createLinuxBoot
if $busybox [ $? -eq 1 ]; then
if $busybox [ -f $MOUNTPOINT/etc/init.android/rc_enter.sh ]; then
echo "I: Executing /etc/init.android/rc_enter.sh"
$busybox chroot $MOUNTPOINT /etc/init.android/rc_enter.sh
else
echo "I: To run command when enterring Linux create executable file at /etc/init.android/rc_enter.sh"
fi
$busybox chroot $MOUNTPOINT /bin/bash -i
if $busybox [ -f $MOUNTPOINT/etc/init.android/rc_leave.sh ]; then
echo "I: Executing /etc/init.android/rc_leave.sh ..."
$busybox chroot $MOUNTPOINT /etc/init.android/rc_leave.sh
else
echo "I: To run command when leaving Linux create executable file at /etc/init.android/rc_leave.sh"
fi
echo "Q: Do you want to unmount the $DIST environment, or leave it as is ? Y will kill all process as required; any other key will leave services running."
read REPLY
if $busybox [ "y$REPLY" = "yy" ] || $busybox [ "y$REPLY" = "yY" ]; then
removeLinuxBoot
fi
fi
fi
)
or you can mount it with this linuxboot.sh:
Code:
# Check Permissions
if [ $(whoami) != root ]; then
echo "This script must be run as root."
exit
fi
# Script Variables
NAME=ubuntu
PATH=$(dirname $0)
# Enviroment Variables
export BIN=/system/bin
export HOME=/root
export MOUNT=/data/local/mnt/$NAME
export PATH=$BIN:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
export TERM=linux
export USER=root
# Change Directory
cd $PATH
# Create Mount Point
mkdir -p $MOUNT
# Remount System Read/Write
mount -o remount,rw /system
# Check Loop Block Device
if [ ! -b /dev/block/loop_$NAME ]; then
# Create Loop Block Device
mknod /dev/block/loop_$NAME b 7 255
fi
# Setup Loop Block Device
losetup /dev/block/loop_$NAME $NAME.img
# Mount Loop Block Device To Mount Point
mount -t ext3 /dev/block/loop_$NAME $MOUNT
# Add Mount Points
mount -o bind /dev $MOUNT/dev
mount -o bind /dev/pts $MOUNT/dev/pts
mount -o bind /dev/shm $MOUNT/dev/shm
mount -o bind /sdcard $MOUNT/media
mount -t proc none $MOUNT/proc
mount -t sysfs none $MOUNT/sys
# Set Options
echo "127.0.0.1 localhost" > $MOUNT/etc/hosts
echo "nameserver 8.8.4.4" > $MOUNT/etc/resolv.conf
echo "nameserver 8.8.8.8" >> $MOUNT/etc/resolv.conf
rm -rf $MOUNT/lost+found
sysctl -w net.ipv4.ip_forward=1 > /dev/null
sysctl -w net.ipv6.conf.all.forwarding=1 > /dev/null
# Enter Linux
chroot $MOUNT /bin/bash -c "source /etc/profile; bash"
# Remove Mount Points
umount $MOUNT/sys
umount $MOUNT/proc
umount $MOUNT/media
umount $MOUNT/dev/shm
umount $MOUNT/dev/pts
umount $MOUNT/dev
# Clean Up
umount $MOUNT
losetup -d /dev/block/loop_$NAME
rm /dev/block/loop_$NAME
rmdir $MOUNT
this is not the init.sh.
the init.sh is iniside the ubuntu.img so to boot using the init.sh you can edit the rc_enter.sh to start init.sh like so:
./init.sh
you can also start a service like so:
service hostname start
I want to make app symlinks to sd-ext on booting.
I made a short init.d script, And It correctly worked on JB based rom.
But after I downgraded to GB, It doesn't work anymore.
I founded that pure bone shell doesn't support arrays.
The script uses string array to declare apk list I want to symlink.
So is there a way to use string array or make similar effect?
Here is my script.
Code:
#!/system/bin/sh
if [ -z "$SD_EXT_DIRECTORY" ]; then SD_EXT_DIRECTORY=/sd-ext; fi
SYSBLOCK=`mount | grep system | cut -f 1 -d ' '`
sysapp2sd=("BackupRestoreConfirmation.apk" "BasicDreams.apk" "Bluetooth.apk" "CertInstaller.apk" "Calculator.apk" "CMFileManager.apk" "CMScreenshot.apk" "DSPManager.apk" "DrmProvider.apk" "Email.apk" "Email2.apk" "Exchange.apk" "Exchange2.apk" "Gmail.apk" "GoogleBackupTransport.apk" "InputDevices.apk" "Music.apk" "OneTimeInitializer.apk" "PhotoTable.apk" "PicoTts.apk" "SamsungTTS.apk" "SharedStorageBackup.apk" "SoundRecorder.apk" "Talk.apk" "ThemeChooser.apk" "ThemeManager.apk" "Torch.apk" "VpnDialogs.apk" "WAPPushManager.apk")
app2sd_exception=("com.UCMobile" "com.adobe.flashplayer" "com.android.lmt" "com.fiberthemax.OpQ2keyboard" "com.fiberthemax.OpQ2keyboard.dict.ko" "com.google.android.gms" "com.google.android.googlequicksearchbox" "com.jungsup.thecall" "com.mobint.hololauncher" "com.mobint.hololauncherplus" "com.mobitobi.android.gentlealarm" "com.myhome.mytheme" "com.rs.autorun" "com.teslacoilsw.launcher" "com.vladlee.callconfirm.free" "eu.chainfire.supersu" "kz.mek.DialerOne" "me.dennis.weather.naver" "net.dinglisch.android.taskerm" "net.everythingandroid.smspopup" )
# make sure $SD_EXT_DIRECTORY is actually mounted
if ! awk -vDIR="$SD_EXT_DIRECTORY" '$2 == DIR { exit 1; }' /proc/mounts ; then
mount -rw -o remount SYSBLOCK /system
mkdir -p /sd-ext/symlink/system/app
# /system/app/ -> /sd-ext/symlink/system/app/
FILES=`find /system/app -maxdepth 1 -type f`
for file in $FILES; do
filename=`basename $file`
for pattern in ${sysapp2sd[@]}; do
if [[ $filename == $pattern ]]; then
cp /system/app/$filename /sd-ext/symlink/system/app/
rm -f /system/app/$filename
ln -s /sd-ext/symlink/system/app/$filename /system/app/$filename
fi
done
done
# /data/app/ -> /sd-ext/symlink/data/app/
FILES=`find /data/app -maxdepth 1 -type f`
for file in $FILES; do
filename=`basename $file`
match=false
for pattern in ${app2sd_exception[@]}; do
if [[ $filename == $pattern* ]]; then
match=true
fi
done
if ! $match; then
cp /data/app/$filename /sd-ext/symlink/data/app/
rm -f /data/app/$filename
ln -s /sd-ext/symlink/data/app/$filename /data/app/$filename
fi
done
mount -r -o remount SYSBLOCK /system
fi
You can use echo or cat command to wrap list and grab it with awk.
and add another for loop over for loop for getting the counted numbers to be used on awk...
Build your own Ubuntu Filesystem and Run (chroot) with Android
NOTE: This is an ongoing project for me so I am not done with this post,
Everything works but obviously room for Improvement. Starting with the Mounts in script, not sure proper mounts i should use.
e.g.
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
or:
mount -t devpts none $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sys $mnt/sys
or:
mount -t dev $mnt/dev/pts
mount -t proc $mnt/proc
mount -t sysfs $mnt/sys
???
Lets get on with it.
I was having trouble with corrupted image file or ubuntu.img that i made so i tried a different method.
I kept getting input/output errors.
Using a partition on my external sdcard and Mounting it back to the external card,
to hold the file system, instead of an image file, Mounted in a Loop device.
I dont have the time to to get into detail of the steps involved, I gotta get back to work.
If you want to do this bad enough,im sure you will figure it out.
My Tools:
Ubuntu 13.10 setup on VirtualBox in Windows8 Envirement
Sdcard is class 10 64G, however i have tried class 4 16G and 16G class 10 and it worked too.
SdcardFormatter: https://www.sdcard.org/downloads/formatter_4/
Galaxy Note3 SM-N900P
First
any sdcard will do.
Now im not going to get into how to figure out the "start sector" (mine is 2048 for the particular card im using) all i can say is,
if its a "stock card", and you haven't partitioned it before, you should be ok. If your not sure use SdcardFormatter to get card back to stock.
In ubuntu find your card:
open Gparted and top right corner select: yor sdcard
Mine is sdb..
(Make sure all partitions are unmounted)
Click on first partition then select: information...It will tell you the start sector, make note.
select: last partition,
Do same for last step: if applicable for end sector.
Make sure all partitions are Unmounted
MAKE SURE WHEN YOU DO THE NEXT STEP, YOUR NOT DELETING YOUR SYSTEM
delete all partitions,
select: unnallocated space,
select: the unnallocated space,
select: new,
select: space before 0, space after, (leave space for whatever your system or image size is mine was 3.94G) so i left 4G.
select: fat32 for file system
select: ok
select: next unallocated space,
select: space before is 0 space after is 0
select: file system ext4
select: ok
MAKE SURE WHEN YOU DO THE NEXT STEP YOUR NOT DELETING YOUR SYSTEM
DONT FORMAT ANYTHING
select: apply
Check information again, check for start and end sector to see if they match the origanal settings you took note of at the begining.
If they are different, use SD Formater ^LINK^ to set sdcart back to stock setting.
Try again after you do some homework on Partitioning and formating sdcards.
Make your Image:
Install Qemu:
sudo apt-get install qemu-user-static qemu-system
sudo apt-get install debootstrap
Make dirctory:
mkdir ~/arm
Or whatever
Then make another directory:
mkdir ~/arm/ubuntu
Or whatever
Go to that directory:
cd ~/arm
Then:
Make an image...........................Pick one or make your own size:
dd if=/dev/zero of=ubuntu.img bs=8k count=524000 >...3.99
dd if=/dev/zero of=ubuntu.img bs=8k count=350000 >...2.9G
dd if=/dev/zero of=ubuntu.img bs=8k count=510000 >...3.6G...........etc.
Example: for a 4G do:
dd if=/dev/zero of=ubuntu.img bs=8k count=524000
Make Filesystem:
sudo mkfs.ext3 -F ubuntu.img
YES THATS EXT3:
Set the Filesystem checking interval:
tune2fs -c 0 ubuntu.img
Mount Filesystem:
sudo mount -o loop ubuntu.img ubuntu
Bring in Base System:
sudo debootstrap --arch armhf --foreign raring ubuntu
You can change raring for other distros, such as stable, or hoary. look in /usr/share/debootstrap/scripts
Make folders for sdcard links:
sudo mkdir ubuntu/media && sudo mkdir ubuntu/media/sdcard && sudo mkdir ubuntu/media/extSdCard
Or you can use your own sdcard settings
Copy Qemu file over to Ubuntu folder:
sudo cp /usr/bin/qemu-arm-static ubuntu/usr/bin
Run first Chroot:
LANG=C sudo chroot ubuntu /usr/bin/qemu-arm-static -cpu cortex-a9 /bin/bash
Finish Installation:
/debootstrap/debootstrap --second-stage
Exit Chroot
exit
Mount some stuff
sudo mount -t proc none ubuntu/proc/ && sudo mount -t devpts devpts ubuntu/dev/pts
Start second Croot:
sudo chroot ubuntu /usr/bin/qemu-arm-static -cpu cortex-a9 /bin/bash
Set some Variables:
export HOME=/root && export USER=root && export LC_ALL=C
Create User:
adduser [PICK A USER NAME]
Set Root Password:
passwd
Add some Groups for permissions:
groupadd -g 3001 aid_net_bt_admin && usermod -G aid_net_bt_admin -a dad && groupadd -g 3002 aid_net_bt && usermod -G aid_net_bt -a dad && groupadd -g 3003 aid_inet && usermod -G aid_inet -a dad && groupadd -g 3004 aid_net_raw && usermod -G aid_net_raw -a dad && groupadd -g 3005 aid_net_admin && usermod -G aid_net_admin -a dad && groupadd -g 3006 aid_net_bw_stats && usermod -G aid_net_bw_stats -a dad && groupadd -g 3007 aid_net_bw_acct && usermod -G aid_net_bw_acct -a dad && groupadd -g 3008 aid_net_bt_stack && usermod -G aid_net_bt_stack -a dad
For Raring...........................
echo "deb http://ports.ubuntu.com saucy main restricted universe multiverse" >> /etc/apt/sources.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 428D7C01
For Quantal.........................
echo "deb http://ports.ubuntu.com quantal main restricted universe multiverse" >> /etc/apt/sources.list
For Wheezy.........................
echo "deb http://ftp.us.debian.org/debian stable main contrib non-free" >> /etc/apt/sources.list
Dont hold me to the last one you may want to double check.
Update Package Manager
apt-get update
Now you can add packages, these are some of the programs i use:
(i dont like to add all packages at once, i break them up because somtimes i notice dpkg error's when i try all at once).
apt-get install git gnupg flex bison gperf build-essential zip curl
apt-get install xfce4 xfce4-goodies
apt-get --reinstall install xfonts-base
apt-get install samba samba-common system-config-samba
Debian: apt-get install openoffice.org
Ubuntu: sudo apt-get install libreoffice
apt-get install tightvncserver streamtuner2
apt-get install xchat-gnome xchat
MAKE SURE YOU INSTALL TIGHTVNCSERVER..................Thats how you will connect to Ubuntu.........,if you want GUI.
Add permissions for sudo:
visudo
Example root ALL=(ALL:ALL) ALL
dad ALL=(ALL:ALL) ALL
(My username is dad)
Dont know if you need this or not i do it:
chmod a+rw /dev/null
chmod 1777 /tmp
To Fix SDCARD
groupadd -g 1015 sdcard-rw && usermod -a -G sdcard-rw dad && groupadd -g 1016 extSdCard-rw && usermod -a -G extSdCard-rw dad
Exit Chroot
exit
Unmount some stuff
sudo umount ubuntu/proc/ && sudo umount ubuntu/dev/pts && sudo umount ubuntu
Transfer your Image to Sdcard
Now Dump the image to Sdcard:
MAKE SURE THE EXT4 PARTITION ON SDCARD IS UNMOUNTED
My sdcard was sdb, so sdb1 would be partition 1 sdb2 would be partition 2
sudo dd if=ubuntu.img of=/dev/sdb2
...........If you notice below, it took 2.8 hrs to dump the image.
[email protected]:/media/dad/Development/arm$ sudo dd if=ubuntu.img of=/dev/sdb2
[sudo] password for dad:
8160000+0 records in
8160000+0 records out
4177920000 bytes (4.2 GB) copied, 10371.3 s, 403 kB/s
[UPDATE]
So far I have not found any problems using the copy command to transfer filesystem over to sdcard.
example:
sudo cp -rp ubuntu/* /media/dad/4920cacb-49aa-4366-8fb7-016b8e502406 (only takes 15-20min)
(Make sure your ubuntu.img is mounted in the ubuntu folder) using:
sudo mount -o loop ubuntu.img ubuntu
To Chroot it.............
With sdcard in Phone,
Connect to windows usb:
IN WINDOWS:
Open File Explorer:
Create directory "ubuntu" on root of sdcard
Copy ext4ubuntu.sh to root of sdcard (not in the ubuntu folder)
ON PHONE:
Open Terminal:
su
cd /storage/extSdCard
chmod 777 ext4ubuntu.sh
sh ./ext4ubuntu.sh
Ready to go.
Connect to Ubuntu:
Get bVNC Free from Market
In Terminal type:
login dad
vncserver :0 -geometry 960x540
Open VNC Viewer and enter:
localhost:0 for ip address
and password if you want.
Connect
Notes:
I was able to sudo cp -rp ubuntu/* /media/dad/912c45f4-b0bd-4e14-a55d-d8d9bcd4bd6a (which is the path to my sdcard), worked the second time i tried it.
( I mounted the ubuntu.img then copied all files to sdcard)
The first time i tried it i got dpkg errors.
That took only 20min to copy vrs. almost 3 hrs using dd if=
Here are some after thought I made note of, I havent tried them yet but u can, just let us know your experiances with them.
Some things you can put in a script to run after ubuntu started.
df doesn't work, there is no mtab file containing the currently mounted filesystems:
grep -Ev "rootfs|tmpfs|cgroup|mmcblk|usbfs|asec|storage" /proc/mounts | sort -r | uniq > /etc/mtab
if you can only run vncserver/Xvnc as root Try
chmod 01777 /tmp/.X11-unix
or
Fix Upstart
dpkg-divert --local --rename --add /sbin/initctl > /dev/null 2>&1
ln -s /bin/true /sbin/initctl > /dev/null 2>&1
Sources:
http://the.taoofmac.com/space/blog/2013/04/28/2330
http://whiteboard.ping.se/Android/Debian
http://linux-expert.net/?Trucs_et_astuces___Android___Tutoriel_:_Chroot_Debian
http://forum.xda-developers.com/showthread.php?t=2598481
http://gautampk.tumblr.com/post/23032189096/ubuntuonandroid-linuxshell#
BELOW IS:.....ext4ubuntu.sh
Just copy and paste into txt editor and name it ext4ubuntu.sh
Dont make too much fun of it. Im still learnen.
###################################################################Cut
echo "This will Install Ununtu ...................."
sleep .8
c=5 # seconds to wait
REWRITE="\e[25D\e[1A\e[K"
echo "Starting..."
while [ $c -gt 0 ]; do
c=$((c-1))
sleep 1
echo -e "${REWRITE}$c"
done
echo -e "${REWRITE}Done."
mount -o remount,rw /dev/block/mmcblk0p23 /system
export bin=/system/bin
export mnt=/storage/extSdCard/ubuntu
export TMPDIR=/tmp
export PATH=$bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:$PATH
export HOME=/root
export PWD=/root
export SHELL=/bin/bash
export TERM=linux
export EDITOR=/usr/bin/nano
export VISUAL=/usr/bin/vi
echo "Mounting File System..........................."
sleep .5
mount -t ext4 -o rw,noatime /dev/block/mmcblk1p2 $mnt
sleep .5
echo "Mounting and Binding Neccesary Devices..............."
sleep .5
echo ".................................DONE!.................."
sleep .5
mount -o bind /dev $mnt/dev
echo "dev"
sleep .5
mount -t devpts devpts $mnt/dev/pts
echo "devpts......................................................"
sleep .5
mount -o bind /proc $mnt/proc
echo "proc..................................................."
sleep .5
mount -o bind /sys $mnt/sys
echo "sys..............................................."
sleep .5
sysctl -w net.ipv4.ip_forward=1
echo "inet................................."
sleep .5
echo "MOUNTING SD CARDS................"
sleep .5
mount -o bind /data/media/0 $mnt/media/sdcard
echo "Card: sdcard............"
sleep .5
mount -o bind /storage/extSdCard $mnt/media/extSdCard
echo "Card: extSdCard....."
sleep .5
echo "Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4"
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 "Ubuntu Has Started "
echo "Enjoy "
echo "..."
chroot $mnt /bin/bash
echo " "
echo "Shutting down Ubuntu"
busybox umount $mnt/dev/pts
busybox umount $mnt/proc
busybox umount $mnt/sys
busybox umount $mnt
echo "...It might have Worked... "
#####################################################################END
holy crap. ok. Thanks dude
femmyade2001 said:
holy crap. ok. Thanks dude
Click to expand...
Click to collapse
Thanks
Might be a good idea to post commands between
Code:
tags
Man o man. This looks very interesting.
Any screenshots?
Sent from my SM-N900P using XDA Premium 4 mobile app
yotaking said:
Man o man. This looks very interesting.
Any screenshots?
Sent from my SM-N900P using XDA Premium 4 mobile app
Click to expand...
Click to collapse
{
"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"
}
Homefix said:
View attachment 2637812
Click to expand...
Click to collapse
Best post of the day.
Sent from my SM-N900P using Xparent BlueTapatalk 2
I need the Remix OS to mount other partitions in my computer,such as Disk D(sda5)、Disk E(sda6)and Disk G(sda7),https://www.reddit.com/r/RemixOS/comments/430hpx/question_does_remix_support_ntfs_partitions/
from this thread i know how to edit grub.cfg to mount the Disk D as SDCARD,the grub.cfg like this:
---------------------------------------------------------------------------------------------------------------------------------------------
Code:
menuentry 'Remix OS ' --class android-x86 {
search --file --no-floppy --set=root /kernel
linux /kernel root=/dev/ram0 androidboot.hardware=remix_cn_x86_64 androidboot.selinux=permissive quiet DATA=/data SDCARD=sda5 CREATE_DATA_IMG=1
initrd /initrd.img
}
---------------------------------------------------------------------------------------------------------------------------------------------
now,i want to mount both Disk D E and Disk F on the Remix OS,how to edit the grub.cfg?
please tell me ,thanks in advance!
To mount any partition or file img you must do it in "initrd.img/init" script
I'm not sure if its like this "mount -o loop /dev/sda5 sdcard1"
just google it
imadlatch said:
To mount any partition or file img you must do it in "initrd.img/init" script
I'm not sure if its like this "mount -o loop /dev/sda5 sdcard1"
just google it
Click to expand...
Click to collapse
That's only the case for partitions that need to be mounted before the system is loaded.
Stickmount by chainfire should be what you need.
Alternatively you could run a script like:
Code:
for a in `ls /dev/block/ | grep sda`; do sdcardp=/dev/block/"$a";num=`expr "${num:-0}" + 1`; sdcardf=/mnt/media_rw/sda"$num" ; [ -e $sdcardp ] && mount -o rw,remount / && mkdir -p $sdcardf && fst=`blkid $sdcardp | awk '{print ($NF)}' | cut -d\" -f2` && mount -t $fst $sdcardp $sdcardf && mount -o ro,remount /; done
Would do something similar; with some caveats.
HypoTurtle said:
That's only the case for partitions that need to be mounted before the system is loaded.
Alternatively you could run a script like:
Code:
for a in `ls /dev/block/ | grep sda`; do sdcardp=/dev/block/"$a";num=`expr "${num:-0}" + 1`; sdcardf=/mnt/media_rw/sda"$num" ; [ -e $sdcardp ] && mount -o rw,remount / && mkdir -p $sdcardf && fst=`blkid $sdcardp | awk '{print ($NF)}' | cut -d\" -f2` && mount -t $fst $sdcardp $sdcardf && mount -o ro,remount /; done
Would do something similar; with some caveats.
Click to expand...
Click to collapse
put the code in terminal and run or put them in grun.cfg? i don't how to use the script.
welcometoken said:
put the code in terminal and run or put them in grun.cfg? i don't how to use the script.
Click to expand...
Click to collapse
Put it in terminal; or use a script manager app so it's easy to run every boot.