HD2 SD/MALDR System.ext2 Auto Builder V1.0 - HD2 Android SD Development

1. purpose just speeding up the system.ext2 file making.I'm lazy....
2. use it in Ubuntu O.S. with root account
3. decompress this auto builder and put it in folder /root or else place
4. put the CWM ROM's zip file in the folder "cwm_rom" and put the kernel modules *.ko files in the folder " kernel"
5.open terminal, cd the folder of this scripts, and execute it.
bash systemext2builder.sh then it will auto build the system.ext2 for SD ROM.
here is a demo how to use http://www.mediafire.com/?3lj5iuiv6ddcppi or http://dl.dbank.com/c0xn7ck608
Code:
#!/bin/bash
####################################################
# HD2 Android SD/MAGLDR ROM system.ext2 Auto builder.
# version 1.0
# By 3dak on 2011-04-29
##################################################
# to get current script's path
script_dir=`dirname $(readlink -f $0)`
extract_dir=$script_dir/extract
mount_dir=/mnt/system
#check the $mount_dir folder and ensure it is unmount and it's a fresh empty folder
if [ -d "$mount_dir" ] ; then
umount $mount_dir
rm -rf $mount_dir
mkdir $mount_dir
else
mkdir $mount_dir
fi
#to ensure there is no old extract folder or system.ext2
if [ -d "$extract_dir" ] ; then
rm -rf $extract_dir
fi
if [ -f $script_dir/system.ext2 ]; then
rm -f $script_dir/system.ext2
fi
#to get the main file name of the latest MIUI CWM ROM (*.zip) and decompress it!
# Please put the latest MIUI CWM ROM in the folder $script_dir/cwm_rom
build=`ls $script_dir/cwm_rom/*.zip | tail -1`
unzip $build -d $extract_dir/
#now change the cwm_rom kernel to SD version's kernel
#Please put all kernel modules *.ko files in the folder $script_dir/kernel
rm $extract_dir/system/lib/modules/*.ko
cp $script_dir/kernel/*.ko $extract_dir/system/lib/modules/
# Now create a fresh empty 250MB system.ext2 image file and format it.
dd if=/dev/zero of=$script_dir/system.ext2 bs=1048576 count=250
mke2fs -F $script_dir/system.ext2
#Now mount this fresh system.ext2
mount -o loop $script_dir/system.ext2 $mount_dir
#Now copy the CWM ROM's system folder to the $mount_dir (/mnt/system )
cp -ar $extract_dir/system/* $mount_dir/
############################################################
# Read CWM ROM's updater-script
# Createa Symlinks and set permissions of folders and files
#############################################################
updater_script=$extract_dir/META-INF/com/google/android/updater-script
# create symbolic links
SYMLINKS=`grep "symlink" $updater_script | cut -d'"' -f2`
for SYMLINK in $SYMLINKS; do
echo "Creating symolic links for $SYMLINK..."
if [ "$SYMLINK" = "busybox" -o "$SYMLINK" = "iwmulticall" ]; then
LINK_DIR='/system/xbin/'
elif [ "$SYMLINK" = "toolbox" ]; then
LINK_DIR='/system/bin/'
fi
MATCHES=`awk '/symlink\(\"'"$SYMLINK"'/,/\);/ {print}' $updater_script | \
sed "s/symlink(\"$SYMLINK\",//g" | \
sed 's/);//g' | \
sed 's/"//g' | \
sed 'N;s/\n//g' | \
sed 's/ //g' | \
sed 's/,/ /g' | \
sed "[email protected][email protected]@g"`
cd /mnt/$LINK_DIR
for LINK in $MATCHES; do
echo -n "Linking $SYMLINK to $LINK... "
ln -sf $SYMLINK $LINK && echo "done"
done
done
# set permissions
grep "set_perm_recursive" $updater_script | grep -v "tmp" | grep -v "recovery" | \
while read LINE; do
PERM=`echo $LINE | sed 's/set_perm_recursive(//g' | sed 's/);//g' | sed 's/"//g' | sed 's/ //g'`
USER=`echo $PERM | cut -d',' -f1`;
GROUP=`echo $PERM | cut -d',' -f2`;
DIR_PERM=`echo $PERM | cut -d',' -f3`;
FILE_PERM=`echo $PERM | cut -d',' -f4`;
TARGET=`echo $PERM | cut -d',' -f5`;
echo -n "Setting permissions for $TARGET... "
chown -R $USER:$GROUP /mnt$TARGET
chmod -R $DIR_PERM /mnt$TARGET
find /mnt$TARGET -type f -exec chmod $FILE_PERM {} \; && echo "done"
done
grep "set_perm" $updater_script | grep -v "recursive" | grep -v "tmp" | grep -v "recovery" | \
while read LINE; do
PERM=`echo $LINE | sed 's/set_perm(//g' | sed 's/);//g' | sed 's/"//g' | sed 's/ //g'`
USER=`echo $PERM | cut -d',' -f1`;
GROUP=`echo $PERM | cut -d',' -f2`;
FILE_PERM=`echo $PERM | cut -d',' -f3`;
TARGET=`echo $PERM | cut -d',' -f4`;
echo -n "Setting permissions for $TARGET... "
chown $USER:$GROUP /mnt$TARGET
chmod $FILE_PERM /mnt$TARGET && echo "done"
done
#now unmount system.ext2
umount $mount_dir
#cleanup
rm -rf $extract_dir
echo " All Done!"
# EOF by 3dak :) 2011-04-29
if you wanna a system.img file too for DAF ROM, add the follwoing line before this line #now unmount system.ext2
Code:
mkyaffs2image $mount_dir $script_dir/system.img
tools.zip is some tools for rom making. put them in the foloer
/usr/local/bin

Wonderful !
Would love to see such an application for Windows OS ....

that's very cool! now we can make new sd builds by ourselves
thanks 3dak!

3dak said:
1. purpose just speeding up the system.ext2 file making.I'm lazy....
Click to expand...
Click to collapse
Man this way you take away all the fun!!
Joking... I'm lazy, too!

great tool, work great to build miui 1.4.29
Thanks 3dak

It's so bad that I don't use Ubuntu OS!
I am looking for some tool like this for a long time but running in Windows OS!

kimquypticc said:
It's so bad that I don't use Ubuntu OS!
I am looking for some tool like this for a long time but running in Windows OS!
Click to expand...
Click to collapse
Use ubuntu.
Just make a live cd or live flash drive. It's worth it
Sent from my HD2 using XDA app

kimquypticc said:
It's so bad that I don't use Ubuntu OS!
I am looking for some tool like this for a long time but running in Windows OS!
Click to expand...
Click to collapse
Or use it in a VirtualBox.
It's rather easy
peter

this is just Awesome!

Awesome, I will test this soon!

Problem for build mimu 1.5.20
It's a good application.
I put the miui_HD2_1.5.20_3nhrpwvbo7_2.3.zip into the cwm_rom folder, and copy all *.ko files that extracted from the system.ext2's \lib\modules folder in the miui_HD2_1.5.20_3dak_SD_2.3.4_ACA_r518.7z into the kernel folder, then a system.ext2 file was built with no errors.
I replaced the origin system.ext2 from the miui_HD2_1.5.20_3dak_SD_2.3.4_ACA_r518 by this file, run it from my HD2 SD card, all was fine expect the GPRS. The origin system.ext2 hasn't this bug.
What's the different?

Ty 3dak for this. Are there no way to do this in Windows?

giveup said:
It's a good application.
I put the miui_HD2_1.5.20_3nhrpwvbo7_2.3.zip into the cwm_rom folder, and copy all *.ko files that extracted from the system.ext2's \lib\modules folder in the miui_HD2_1.5.20_3dak_SD_2.3.4_ACA_r518.7z into the kernel folder, then a system.ext2 file was built with no errors.
I replaced the origin system.ext2 from the miui_HD2_1.5.20_3dak_SD_2.3.4_ACA_r518 by this file, run it from my HD2 SD card, all was fine expect the GPRS. The origin system.ext2 hasn't this bug.
What's the different?
Click to expand...
Click to collapse
the different is my system.ext2 opened PPP mode while official MIUI ROM didn't.

giveup said:
It's a good application.
copy all *.ko files that extracted from the system.ext2's \lib\modules folder in the ?
Click to expand...
Click to collapse
in Ubuntu, how do you extract files from system.ext2?
Any comprehensive step by step?

ketzazu said:
in Ubuntu, how do you extract files from system.ext2?
Any comprehensive step by step?
Click to expand...
Click to collapse
Just mount it :
mkdir /mnt/mysystemext2
mount -t ext2 -o loop system.ext2 /mnt/mysystemext2
then go to /mnt/mysystemext2 folder to copy or modify
Sent from my HTC HD2 using xda premium

3dak said:
Just mount it :
mkdir /mnt/mysystemext2
mount -t ext2 -o loop system.ext2 /mnt/mysystemext2
then go to /mnt/mysystemext2 folder to copy or modify
Sent from my HTC HD2 using xda premium
Click to expand...
Click to collapse
Thanks! I'll try those commands instead.

3dak said:
Just mount it :
mkdir /mnt/mysystemext2
then go to /mnt/mysystemext2 folder to copy or modify
Sent from my HTC HD2 using xda premium
Click to expand...
Click to collapse
No matter what I do the system.ext2 is always missing in action, nowhere to be found even after I "sudo chmod 777" the folders. I always get the error "system.ext2: No such file or directory"
I have ubuntu installed in a different drive than windows 7
This is what I did: BTW, I always have to sudo since I don't login as root
I put this zipped NAND "Runnymede_0.82.401.1_v1.3_Tmous" to the folder as you instructed,
I extract all the ".ko" files from this ziped ROM and put them in the "kernel" folder as instructed.
I go to terminal and i sudo the bash command. It spits out the system.ext2 file with a lot of other files.
I copy the system.ext2 file to the Desktop.
then mkdir /mnt/mystemext2
then mount -t ext2 -o loop system.ext2 /mnt/mysystemext2
I sudo chmod 777 the folders to be able access them. I even drag the system.ext2 from the Desktop to the /nmt and mnt/systemext2.
Still, all is empty.
What am i doing wrong?
When I try to copy directly system.ext2 to /mnt or /mnt/system.ext2 I get "not enough space error" but I don't see anything in the "lost+found" folder or anywhere else.
And also what program to use in Ubuntu to be able to open and see and edit the contents of system.ext2 in the folder?
PS. What are the instructions to use tools.zip for ROM making?
Thanks!

ketzazu said:
No matter what I do the system.ext2 is always missing in action, nowhere to be found even after I "sudo chmod 777" the folders. I always get the error "system.ext2: No such file or directory"
I have ubuntu installed in a different drive than windows 7
This is what I did: BTW, I always have to sudo since I don't login as root
I put this zipped NAND "Runnymede_0.82.401.1_v1.3_Tmous" to the folder as you instructed,
I extract all the ".ko" files from this ziped ROM and put them in the "kernel" folder as instructed.
I go to terminal and i sudo the bash command. It spits out the system.ext2 file with a lot of other files.
I copy the system.ext2 file to the Desktop.
then mkdir /mnt/mystemext2
then mount -t ext2 -o loop system.ext2 /mnt/mysystemext2
I sudo chmod 777 the folders to be able access them. I even drag the system.ext2 from the Desktop to the /nmt and mnt/systemext2.
Still, all is empty.
What am i doing wrong?
When I try to copy directly system.ext2 to /mnt or /mnt/system.ext2 I get "not enough space error" but I don't see anything in the "lost+found" folder or anywhere else.
And also what program to use in Ubuntu to be able to open and see and edit the contents of system.ext2 in the folder?
PS. What are the instructions to use tools.zip for ROM making?
Thanks!
Click to expand...
Click to collapse
put system.ext2 in your home folder,
then open terminal,
cd ~ (this will goto your home folder)
ls (check if you can see system.ext2, if no, you put it at wrong place)
mkdir /mnt/mysystemext2
mount -t ext2 -o loop system.ext2 /mnt/mysystemext2
-----------------
or if you want to keep the created system.ext2 is mounted, just open the 3daksystemext2builder.sh,
#now unmount system.ext2
umount $mount_dir
change to
#now unmount system.ext2
#umount $mount_dir
this will keep the system.ext2 is at MOUNT status after the system.ext2 created. check folder /mnt/system and modify or copy
remember to umount it after you finish your work,
umount /mnt/system

3dak said:
put system.ext2 in your home folder,
then open terminal,
cd ~ (this will goto your home folder)
ls (check if you can see system.ext2, if no, you put it at wrong place)
mkdir /mnt/mysystemext2
mount -t ext2 -o loop system.ext2 /mnt/mysystemext2
-----------------
or if you want to keep the created system.ext2 is mounted, just open the 3daksystemext2builder.sh,
#now unmount system.ext2
umount $mount_dir
change to
#now unmount system.ext2
#umount $mount_dir
this will keep the system.ext2 is at MOUNT status after the system.ext2 created. check folder /mnt/system and modify or copy
remember to umount it after you finish your work,
umount /mnt/system
Click to expand...
Click to collapse
thanks again! I'll give it a try. But first, I have to figure out how to get damsel Ubuntu out of that sudden "Read only" blues madness.

Thank you finally found learning to learn!!!

Related

[WIP] [DEV] [HOWTO] Ubuntu on Nook Color! UPDATE 1/5/11

DISCLAIMER: You know the risks, bricking, breaking etc. I'm not, nor is anyone else responsible if something goes wrong with your device, especially should it turn into a cave troll and bludgeon someone to death.
You will have to be rooted for this to work.
Update 1/5/11
Changed the install and loader scripts re-compressed and uploaded, new download link. Stream lined the installation process (removed 5 steps)
Update 1/4/11
reflect changes to ubuntu.sh and bootubuntu scripts and streamlining the process. Added screenshots
_________________________
I was over at nexusonehacks.net and looking at the ubuntu on nexus one hack and was thinking that this could be ported to the nook color. The idea is to run ubuntu from an img on the sd card.
The following is a modified version of the "how to" orginally posted here
http://nexusonehacks.net/nexus-one-hacks/how-to-install-ubuntu-on-your-nexus-oneandroid/
Credits
The guys at NexusOneHacks
xda user munday who has modified the scripts to work for the nook color
Devs at XDA Developer for the Ubuntu ARM image for HTC HD2
Saurik (Jay Freeman) for the Debian G1 script, which was hacked for Ubuntu on Nexus One! and then re-hacked for the Nook Color by munday
Here we go:
1) Go download the ubuntu file here: http://www.megaupload.com/?d=67BU4Y3T
2) Extract the contents using 7zip http://www.7-zip.org/download.html
3) Copy the extracted folder "ubuntu" to the root of your SD card
4) Unmount the nook from your pc, go into the app NookColor Tools (if you don't have it download it here courtesy of Ben 74 and click All Settings->Development then uncheck Auto Mount. This will prevent the SD card from being mounted automatically when plugged into the PC
5) Plug the Nook back into your pc and open a command line then navigate to your android sdk folder ie C:\android-sdk or wherever you have it and type
Code:
adb devices
Hit enter and make sure that the nook color comes up (should be the SN of your Nook)
Note: This can also be done from terminal emulator instead of adb...but it is kind of a pain
6) Now we want to go into the command line on the nook so type
Code:
adb shell
Hit enter and this should bring up a "#" sign.
7) Type
Code:
su
hit enter (I do this just as a force of habit)
8) Now we navigate to the ubuntu folder we just copied to our sd card by entering
Code:
cd /sdcard/ubuntu
hit enter. To confirm you are where you want to be you can type
Code:
ls
and it should list the contents of the ubuntu folder.
9) Run the setup script ubuntu.sh by entering the following:
Code:
sh ./ubuntu.sh
hit enter
10) Now type
Code:
bootubuntu
and hit enter
11) So now we have ubuntu command line up and running which should look like:
Code:
[email protected]:/#
We will need to get some packages to run a gui and then connect to it via VNC client. So we need to update a few things first. Type:
Code:
apt-get update
then
Code:
apt-get install tightvncserver
now we need the gui elements so enter this:
Code:
apt-get install lxde
12) Type the following:
Code:
export USER=root
vncserver -geometry 1024×600
this sets the resolution...you can change it to play around, but the native resolution for the nook is 1024x600. This is also where you will set the password for your vnc server...make sure to remember it
13) Next, we are going to add the following to /root/.vnc/xstartup file using cat command: (hit enter after each line and ignore the fact that it looks like it does it twice)
Code:
cat > /root/.vnc/xstartup
#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey
icewm &
lxsession
After hitting enter after the last line press "Ctrl+D" twice then press enter
14) We need the vnc server to start every time we start ubuntu, type this:
Code:
cat > front
export USER=root
cd /
rm -r -f tmp
mkdir tmp
cd /
vncserver -geometry 1024×600
Same as before, hit enter after each line then after hitting enter for the last line press "Ctrl+D" twice then press enter.
15) Enter this
Code:
cat front /root/.bashrc > temp
Then
Code:
cp temp /root/.bashrc
16) Now on the nook open up your vnc viewer app (android vnc viewer or PocketCloud...or whatever you use)
Use the following settings:
Host Address: 127.0.0.1 (some don't require this)
Password: the password you set up in step 16
Port: 5901
Save and then click connect and you should be up and running on ubuntu! To leave ubuntu type exit from adb. This should kill ubuntu. Exit adb and then you can disconnect the nook from your pc.
To start ubuntu from the nook open up a terminal emulater and type:
Code:
bootubuntu
Hit enter, this should bring up the [email protected], hhen press "Home" key and open up your vnc app. Now you are ready to rock your Linux tablet!
You could also use gscript lite to automate the process of starting ubuntu so you don't have to type it in the terminal everytime. You can get gscript lite from the market or download the file I have attached.
It does seem a little laggy..just a little...for now anyway
To exit ubuntu: Disconnect the vnc client then hold the "Home" key (I use button savior which brings up a nice little task manager) and click the Terminal emulator when it pops up under running tasks. Once you are back in the terminal you can type:
Code:
exit
to shut down ubuntu.
Enjoy and make sure you thank munday and the guys at nexusonehacks and all the devs who helped make it possible.
-devastator
EDIT:
I noticed that after rebooting the nook would hang at the "Future of reading" screen....if this happens turn the device off remove the sd card the turn the nook back on. It should boot fine. After it's finished you can return the sd card and mount it. This is strange and I'm looking into it. I'm not sure if this is limited to me or if it is universal to all nooks. It also still fails at shutting ubuntu down for some reason. I'm still looking into this.g into this.
I got it going, just needed a few "busybox"-es here and there . It needs some work, right now to get X you have to use VNC.
It's sluggish but a bit more work might just yield something a bit more usable. I'll play more tomorrow night.
Here's my scripts:
ubuntu.sh
Code:
mount -o remount,rw /dev/block/mmcblk0p5 /system
busybox modprobe ext2
rm -f /data/local/bin/fsrw
rm -f /data/local/bin/bootubuntu
rm -f /data/local/bin/unionfs
rm -f /data/local/bin/installer.sh
rm -f /data/local/bin/mountonly
mkdir /data/local/mnt
#busybox clear
rm /system/bin/fsrw
rm /system/bin/bootubuntu
rm /system/bin/unionfs
rm -/system/bin/mountonly
busybox cp -f fsrw /system/bin
busybox cp -f bootubuntu /system/bin
busybox cp -f unionfs /system/bin
busybox cp -f mountonly /system/bin
cd /sdcard/ubuntu
busybox chmod 4777 *
cd /system/bin/
busybox chmod 4777 *
cd /
#busybox clear
echo " "
echo "Ubuntu Chroot Bootloader v0.1"
echo "Ubuntu Bootloader is now installed!"
echo "This process does NOT damage Android OS!"
echo " "
echo "Original Installer by Charan Singh"
echo "Modified for Ubuntu Chroot by Max Lee at NexusOneHacks.net"
echo " "
echo "To enter the Debian Linux console just type 'bootubuntu'"
bootubuntu
Code:
mount -o remount,rw /dev/block/mmcblk0p5 /system
export kit=/sdcard/ubuntu
export bin=/system/bin
export mnt=/data/local/mnt
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
busybox mknod /dev/loop2 b 7 0
mount -o loop,noatime -t ext2 $kit/ubuntu.img $mnt
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
busybox sysctl -w net.ipv4.ip_forward=1
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 "READY TO ROCK AND ROLL BABY! "
echo "Brought to you by NexusOneHacks.net and the open source community! "
echo " "
busybox chroot $mnt /bin/bash
#After exit command is executed clear it all up
echo " "
echo "Shutting down Ubuntu"
umount $mnt/dev/pts
umount $mnt/proc
umount $mnt/sys
umount $mnt
Then just followed the instructions at nexusonehacks.
note: to run bootubuntu i had to use sh and the use the full path:
Code:
# sh /system/bin/bootubuntu
other note: I was using adb not a term app on the nook.
Obligatory video
I can't post links yet so check: youtube.com/watch?v=TnXfZ6aagn8 for a really boring video
EDIT: switched the names, DOH!
I also had to use sh and the full path also. Thanks for the update on the script...gonna try it in the morning (it's 2am here) will also see if I can help to get it running smoother. What class SD card are you using? I imagine a class 4 or higher would yeild better results as far as responsiveness goes.
The sd is a class 2 that came in one of my dev phones. I'll pick up a faster one tomorrow after work and test it out.
It's just about 3am here now, we must be in the same time zone.
I'm going to bed now, but first here's a modded version of the script you had originally posted that also works now.
bootubuntu
Code:
#!/bin/sh
mount -o remount,rw /dev/block/mmcblk0p5 /system
export kit=/sdcard/ubuntu
export bin=/system/bin
busybox [ ! -d /data/local/ubuntu ] && mkdir /data/local/ubuntu
export mnt=/data/local/ubuntu
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
busybox mknod /dev/loop1 b 7 0
busybox losetup /dev/block/loop1 /sdcard/ubuntu/ubuntu.img
mount -t ext2 /dev/block/loop1 /data/local/ubuntu
#mount -o loop,noatime -t ext2 $kit/ubuntu.img $mnt
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
busybox sysctl -w net.ipv4.ip_forward=1
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 "READY TO ROCK AND ROLL BABY! "
echo "Brought to you by NexusOneHacks.net and the open source community! "
echo " "
busybox chroot $mnt /bin/bash
#After exit command is executed clear it all up
echo " "
echo "Shutting down Ubuntu"
umount $mnt/dev/pts
umount $mnt/proc
umount $mnt/sys
umount $mnt
busybox losetup -d /dev/loop1
#unregistering the loopback device just seems to die. need to fix or remove.
I'll look at the N1 formus tomorrow too and see if they have made progress in getting X to run fast or without need for VNC.
Nice work, I am addicted in seeing the crazy crap people are doing everyday.
Couldn't sleep so I'm messing around with it now...I'm using a class 4 and have it up and running. It does seem to be a little laggy, but I don't have a class 2 to compare it to. Let me know what you find out, I'll keep playing with it also to see if I can get it to be more responsive...but we are definately on our way to having a great little linux tablet in addition to android. You should also be able to use this for other builds of linux also by just changing out the .img file to a flavor of your choosing. I'm excited
I have also updated the OP with the how to and credits. Really appreciate your help munday.
I noticed that after rebooting the nook would hang at the "Future of reading" screen....if this happens turn the device off remove the sd card the turn the nook back on. It should boot fine. After it's finished you can return the sd card and mount it. This is strange and I'm looking into it. I'm not sure if this is limited to me or if it is universal to all nooks.
Edit:
Running into some strange occurrences...it appears that when you type exit from the terminal to kill ubuntu, I believe ubuntu stays running...anyway, I'm going to bed and will work on it more tomorrow.
devastatorx said:
You should also be able to use this for other builds of linux also by just changing out the .img file to a flavor of your choosing. I'm excited
Click to expand...
Click to collapse
Are there any increased risks with changing the version you use?
Well, you will want to make sure that the build supports ARM based devices.
munday said:
Then just followed the instructions at nexusonehacks.
note: to run bootubuntu i had to use sh and the use the full path:
Code:
# sh /system/bin/bootubuntu
Click to expand...
Click to collapse
I fixed this, the scripts were backwards, I have updated the OP to reflect the changes and bootubuntu now works
devastatorx said:
I fixed this, the scripts were backwards, I have updated the OP to reflect the changes and bootubuntu now works
Click to expand...
Click to collapse
sweet, i can't wait to get home to play more!!!
I've tried running ubuntu.sh from the terminal emulator (With su) and from ADB, and have not had success with either.
The readout is:
Code:
': File existste '/system/bin
': File existste '/system/bin
': File existste '/system/bin
: not found
: not found
cd: can't cd to /sdcard/ubuntu
: not found
: No such file or directory
: not found
cd: can't cd to /system/bin
: not found
: No such file or directory
: not found
cd: can't cd to /
: not found
: not found
Ubuntu Chroot Bootloader v0.1
Ubuntu Bootloader is now installed!
etc., etc.
Is there a problem with how I copied the script? I assume the first part about the file existing is due to this being the third or fourth time I've tried running the script (Unsuccessfully), but I've no idea how to interpret the rest.
Thanks
munday said:
sweet, i can't wait to get home to play more!!!
Click to expand...
Click to collapse
I sent you a message
Link3737 said:
I've tried running ubuntu.sh from the terminal emulator (With su) and from ADB, and have not had success with either.
The readout is:
Code:
': File existste '/system/bin
': File existste '/system/bin
': File existste '/system/bin
: not found
: not found
cd: can't cd to /sdcard/ubuntu
: not found
: No such file or directory
: not found
cd: can't cd to /system/bin
: not found
: No such file or directory
: not found
cd: can't cd to /
: not found
: not found
Ubuntu Chroot Bootloader v0.1
Ubuntu Bootloader is now installed!
etc., etc.
Is there a problem with how I copied the script? I assume the first part about the file existing is due to this being the third or fourth time I've tried running the script (Unsuccessfully), but I've no idea how to interpret the rest.
Thanks
Click to expand...
Click to collapse
Try using these, just unrar and then copy them in your ubuntu folder, if it asks to overwrite just click yes...also you have autmounting of the sd card turnned off in nook color tools settings right?
Yeah, it must have been an error on my end. Using the updated scripts you posted worked like a charm.
Thanks!
Link3737 said:
Yeah, it must have been an error on my end. Using the updated scripts you posted worked like a charm.
Thanks!
Click to expand...
Click to collapse
Good to hear!
I'm currently working on making this a port to the SD card so that with the sd card in it boots into ubuntu from power off, and with the sd card out it boots to android then you replace the sd and use it for storage like normal. It will also run a lot snappier....well that's the idea anyway.
devastatorx said:
Good to hear!
I'm currently working on making this a port to the SD card so that with the sd card in it boots into android from power off, and with the sd card out it boots to android then you replace the sd and use it for storage like normal. It will also run a lot snappier....well that's the idea anyway.
Click to expand...
Click to collapse
Booting from SD in the same fashion as Nookie Froyo? That sounds like it would give a huge performance boost over the current method, I can't wait to see what you come up with.
This should be acheivable using the method mentioned in this topic:
http://forum.xda-developers.com/showthread.php?t=873243 thanks to clockworx.
Currently looking into this
devastatorx said:
This should be acheivable using the method mentioned in this topic:
http://forum.xda-developers.com/showthread.php?t=873243 thanks to clockworx.
Currently looking into this
Click to expand...
Click to collapse
I was thinking the exact same thing, the nook seems to like booting from sd, so we should be able to set up the partitions like the foryo sd and edit the init.rc and env.txt to boot ubuntu instead of android. Just a theory though. It's my plan for tonight anyway.
munday said:
I was thinking the exact same thing, the nook seems to like booting from sd, so we should be able to set up the partitions like the foryo sd and edit the init.rc and env.txt to boot ubuntu instead of android. Just a theory though. It's my plan for tonight anyway.
Click to expand...
Click to collapse
I also stumbled across this: http://androix.org/ Which talks about a native android xserver which does a way with the vnc aspect altogether. I downloaded and attempted to install but I get the error "There is a problem parsing the package" and I haven't had any luck plus there isn't much documentation.
Let me know how it goes munday, I'll be working on the same thing later (have to take the fiance out for dinner)
question
I was just curious, after installing ubuntu can we install flash as we would had we booted linux from netbook?

[Q] busybox and touch command

Who can help me with the syntax of the command touch?
Using the touch command as follows:
touch -d "01/01/2012 00:00:00" \ data \ data \ com.android.providers.telephony \ databases \ mmssms.db
the system outputs the following message:
unknow option - d etc ...
But Usage Command is:
touch [-c] [-d DATE] FILE [FILE]
BR
die-hard
Yeah, that's weird. It works as you typed it in a regular linux shell, but the busybox on my android gives me the same error. Might be a bug in busybox, or perhaps the date parser in the busybox version is less tolerant on the date format. It may be a config option as well. I know that date/time parsing is very "expensive" in libc and perhaps busybox just doesn't implement it by default.
10x bro,
I solved installing busybox 1.18.0 git
My busybox touch accepts dates in ISO format:
/ # touch -d '2011-1-1 23:1' x
/ # ls -l x
-rw-rw-rw- root shell 0 2011-01-02 00:01 x
Click to expand...
Click to collapse
Hi
I have CM 10.1 with busybox 1.20.2-jb installed. Touch binary doenst have -d option:
Code:
1|[email protected]:/sdcard $ touch --h
touch --h
touch: usage: touch [-alm] [-t time_t] <file>
-t option only accept date in unix timestamp format, but default format ( [[[[cc]yy]MM]dd]hhmm[.ss] ) needed for me.
Can anybody provide touch binary with -d option support or with -t option, that accept date in this format: [[[[cc]yy]MM]dd]hhmm[.ss]?
Second question:
Code:
[email protected]:/ $ awk 'BEGIN {print mktime("1970-01-01 00 00 00")}' <
-5454000
Why awk return -5454000 instead 0?
I tried update busybox to 1.21.0 version, it doesnt help.
memtew said:
Hi
I have CM 10.1 with busybox 1.20.2-jb installed. Touch binary doenst have -d option:
Code:
1|[email protected]:/sdcard $ touch --h
touch --h
touch: usage: touch [-alm] [-t time_t] <file>
-t option only accept date in unix timestamp format, but default format ( [[[[cc]yy]MM]dd]hhmm[.ss] ) needed for me.
Can anybody provide touch binary with -d option support or with -t option, that accept date in this format: [[[[cc]yy]MM]dd]hhmm[.ss]?
Second question:
Code:
[email protected]:/ $ awk 'BEGIN {print mktime("1970-01-01 00 00 00")}' <
-5454000
Why awk return -5454000 instead 0?
I tried update busybox to 1.21.0 version, it doesnt help.
Click to expand...
Click to collapse
Use the touch inside busybox, not the one that comes with the stock rom. Install Busybox from Stericson on your android device. It has also the -d option. You must run it as root, so check that you are superuser if using a script.
Code:
su
busybox touch -c -t YYYYMMDDHHMM[.ss] yourfile
hi,
i have the command working, but is it possible to keep the date and time of each file like "vid_yyyymmdd_hhmmss.mp4" to push it in the command for each file of the folder ?
Thanks.
nobody to help ???
diabolyk said:
hi,
i have the command working, but is it possible to keep the date and time of each file like "vid_yyyymmdd_hhmmss.mp4" to push it in the command for each file of the folder ?
Thanks.
Click to expand...
Click to collapse
You want to rename the files?
scandiun said:
You want to rename the files?
Click to expand...
Click to collapse
no, just change the time of creation of the file
diabolyk34 said:
no, just change the time of creation of the file
Click to expand...
Click to collapse
Don't understand exactly what you want to do.
scandiun said:
Don't understand exactly what you want to do.
Click to expand...
Click to collapse
I have found a command that working well but I should change the files one by one and I would like to find a command which is changing all videos files of a folder.
video name for example : vid_20170717_103251.mp4
need to extract date and time (in the name of the file) to put it in the command.
here the command which is working :
busybox touch -c -t 201707171032 *
and it changes all the files of the folder with the *...
I would like to extract the elements of the name from each file to give it its own date and time.
diabolyk34 said:
I have found a command that working well but I should change the files one by one and I would like to find a command which is changing all videos files of a folder.
video name for example : vid_20170717_103251.mp4
need to extract date and time (in the name of the file) to put it in the command.
here the command which is working :
busybox touch -c -t 201707171032 *
and it changes all the files of the folder with the *...
I would like to extract the elements of the name from each file to give it its own date and time.
Click to expand...
Click to collapse
Ok to do that you need a shell (bash) script. For example this code will get the date in the format you want, now you just need to read it from files and change the timestamp accordingly.
Code:
echo vid_20110717_103251.mp4 | sed 's/vid_*//' | sed 's;.mp4*;;' | sed 's/_//'
Test it online here: http://www.learnshell.org/
scandiun said:
Ok to do that you need a shell (bash) script. For example this code will get the date in the format you want, now you just need to read it from files and change the timestamp accordingly.
Code:
echo vid_20110717_103251.mp4 | sed 's/vid_*//' | sed 's;.mp4*;;' | sed 's/_//'
Test it online here: http://www.learnshell.org/
Click to expand...
Click to collapse
ok thanks for your help, your code is well working
Is it possible to keep all without the seconds (last 2 digits before .mp4) ?
And after that it should put the result in the command 'busybox touch -c -t result name_of_the_file'
and how to repeat that for each file named 'vid_xxxx' ?
thanks a lot
diabolyk34 said:
ok thanks for your help, your code is well working
Is it possible to keep all without the seconds (last 2 digits before .mp4) ?
And after that it should put the result in the command 'busybox touch -c -t result name_of_the_file'
and how to repeat that for each file named 'vid_xxxx' ?
thanks a lot
Click to expand...
Click to collapse
Go to the folder of the vids with "cd /sdcard/DCIM/Videos" or the appropriate and then execute this:
Code:
for i in * ; do touch -c -t "$(echo $i | sed 's/vid_*//' | sed 's;.mp4*;;' | sed 's/_//' | sed 's/..$//')" "$i" ; done
Make sure that in that folder there are only files that have the same exact filename pattern.
scandiun said:
Go to the folder of the vids with "cd /sdcard/DCIM/Videos" or the appropriate and then execute this:
Code:
for i in * ; do touch -c -t "$(echo $i | sed 's/vid_*//' | sed 's;.mp4*;;' | sed 's/_//' | sed 's/..$//')" "$i" ; done
Make sure that in that folder there are only files that have the same exact filename pattern.
Click to expand...
Click to collapse
in the folder there is img and videos but if i should put videos on a separate folder i can...
this code will do all i need ? (i think missing just "busybox" in the code)
extract the name of each file without seconds, put for each one the extraction in the command : busybox touch -c -t 201707181200 vid_20170718_120000.mp4 (for example of a file of today at 12 o'clock)
diabolyk34 said:
in the folder there is img and videos but if i should put videos on a separate folder i can...
this code will do all i need ? (i think missing just "busybox" in the code)
extract the name of each file without seconds, put for each one the extraction in the command : busybox touch -c -t 201707181200 vid_20170718_120000.mp4 (for example of a file of today at 12 o'clock)
Click to expand...
Click to collapse
This code will alter only files starting with vid:
Code:
for i in vid* ; do touch -c -t "$(echo $i | sed 's/vid_*//' | sed 's;.mp4*;;' | sed 's/_//' | sed 's/..$//')" "$i" ; done
You can try with or without busybox first and see which one works for you.
scandiun said:
This code will alter only files starting with vid:
Code:
for i in vid* ; do touch -c -t "$(echo $i | sed 's/vid_*//' | sed 's;.mp4*;;' | sed 's/_//' | sed 's/..$//')" "$i" ; done
You can try with or without busybox first and see which one works for you.
Click to expand...
Click to collapse
thank you very much i will try this in an hour to send you the answer if it's working or not
are you a developper ? cause it seems very hard to know all that...
i have another question, is it possible to put 1 or 2 less than the hour because of GMT ?
201707172000 should be 201707171900...
the answer of the command (not working) is :
touch: invalid date 'VID20170717_2000'
repeat for all lines....
i think it keep too many characters.
characters keeped should be 201707172000 (without "VID" and without "_")
how to delete that from the echo ?

[W-I-P][DEVELOPMENT] Dual / Multi Boot Project: Devs Only

{ LONG POST WARNING }
{ NOT FULLY WORKING YET}
{ NEEDS A LOT OF FURTHER DEVELOPMENT }
Hey everyone I had thought of making this Dual Booting system work along side recovery… because initially (with FreeX10-alpha) it was not possible to have both recovery & dual boot...
Thank you zdzihu & jerpelea for your great work on FreeX10-alpha, which booted off SDCARD… I got inspiration to try and make this work for FreeX10-beta4 based on the amazing work that u guys did! Thank you jerpelea for all your feedback on my repeated messages when I was testing this a few months back (hope I didn’t bother u too much with questions )...
zdzihu & jerpelea u are truly LEGENDS!!!
[This is just my personal opinion] Really hoping that some devs can take interest in this to provide compatible files (ramdisks, system files) for this to work… may be as an add-on to their main roms… please don’t keep bothering devs to create ramdisks for booting off SDCARD… they are already very busy trying to make our X10 better with faster and stable ROMS/MODS/etc… this is just an additional feature…
The basic idea was to use the chargemon booting scripts provided in FreeX10-alpha and to try and make FreeX10-beta4 to boot off SDCARD…
Initially I used the img files which came with FreeX10-alpha and wiped the image to then put FreeX10-beta4 on it… while doing so I realized that all of the symbolic links were not getting copied correctly (obviously)… so I started from scratch with blank ext2fs images…
Later I thought of using clean/base nandroid/recovery backups as they are already working/preconfigured system of FreeX10-beta4…
Following is a small How-To on converting NANDROID/RECOVERY images (with yaffs fs) to ext2 fs images keeping the symlinks intact!!
I have used Ubuntu for these steps.
I have attached blank_files.7z which contains precompiled ext2fs images:
system.img [size: 256 MB]
data.img [size: 512 MB]
cache.img [size: 128 MB]
To resize or create newer ext2fs images:
[APP] Windows: Create Your Own Data.img Maker Application, +/- From Existing data.img
U can use the commands provided there even in linux to create/resize these images...
We will keep the NANDROID images at:
Code:
/home/user/nandroid_imgs/test1/
and EXT2 FS images at:
Code:
/home/user/ext2fs_imgs/test1/
while temporary mounts points will be made at:
Code:
/home/user/mntpts/
We will be using unyaffs from here:
[How-To] Extracting/Accessing Recovery/Nandroid backup (.img) files
Extracting files from the nandroid/recovery backups:
Code:
cd /home/user/nandroid_imgs/test1
mv system.img /home/user/nandroid_imgs/test1/system/
cd /home/user/nandroid_imgs/test1/system/
sudo unyaffs system.img
mv system.img ../.
mv data.img /home/user/nandroid_imgs/test1/data/.
cd /home/user/nandroid_imgs/test1/data/
sudo unyaffs data.img
mv data.img ../.
mv cache.img /home/user/nandroid_imgs/test1/cache/
cd /home/user/nandroid_imgs/test1/cache/
sudo unyaffs cache.img
mv cache.img ../.
Loop mounting ext2 fs files:
Code:
sudo mount -t ext2 -o loop,rw,noatime,nodiratime /home/user/ext2fs_imgs/test1/system.img /home/user/mntpts/system/
sudo mount -t ext2 -o loop,rw,noatime,nodiratime,nosuid,nodev /home/user/ext2fs_imgs/test1/data.img /home/user/mntpts/data/
sudo mount -t ext2 -o loop,rw,noatime,nodiratime,nosuid,nodev /home/user/ext2fs_imgs/test1/cache.img /home/user/mntpts/cache/
Recursively copy all files (preserving symlinks) from extracted yaffs images to mount points
Code:
sudo cp -r -p /home/user/nandroid_imgs/test1/system/* /home/user/mntpts/system/.
sudo cp -r -p /home/user/nandroid_imgs/test1/data/* /home/user/mntpts/data/.
sudo cp -r -p /home/user/nandroid_imgs/test1/cache/* /home/user/mntpts/cache/.
Unmount the mounts:
Code:
sudo umount /home/user/mntpts/system/
sudo umount /home/user/mntpts/data/
sudo umount /home/user/mntpts/cache/
Ok now that the ext2fs iamges are populated with working files copy them onto SDCARD…
I have placed it at:
Code:
/sdcard/FreeX10
lets move on to the chargemon script...
This is, as of now, based off xRecovery chargemon (modified from FreeX10-alpha)
Code:
#!/system/bin/busybox sh
# modified chargemon for recovery + dual boot from NAND/SDCARD
/system/bin/charger
cat /dev/input/event2 > /dev/keycheck&
sleep 3
kill -9 $!
# intact recovery
if [ -s /dev/keycheck ]
then
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount MTDs
umount -l /data
umount -l /cache
# Extract recovery
cd /
rm -r /sbin
rm -f etc
tar -xf /system/bin/xrecovery.tar
# Umount system
umount -l /system
chroot / /init
fi
echo "check if reboot into SDCARD OS was called"
if [ -e /data/local/tmp/rebootsdcardos ]
then
echo "Booting from SDCARD!"
# FreeX10-alpha code follows with slight modifications!!!
# remount rootfs rw
mount -o remount,rw rootfs /
busybox chmod 0777 /dev -R
busybox chown 0.2000 /dev/oncrpc -R
rm -r /sdcard
cd /
mkdir sd
chmod 777 sd
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/sdcardos_ramdisk.tar
# Umount system,data,cache
umount -l /system
umount -l /data
umount -l /cache
# Check and mount SD Card
dosfsck -y /dev/block/mmcblk0p1
sleep 5
mount -t vfat -o rw,noatime,nodiratime /dev/block/mmcblk0p1 /sd
sleep 5
# Mount system and data ext2 images
losetup /dev/block/loop1 /sd/FreeX10/system.img
sleep 5
losetup /dev/block/loop2 /sd/FreeX10/data.img
sleep 5
losetup /dev/block/loop3 /sd/FreeX10/cache.img
sleep 5
e2fsck -y /dev/block/loop1
e2fsck -y /dev/block/loop2
e2fsck -y /dev/block/loop3
mount -t ext2 -o rw,noatime,nodiratime /dev/block/loop1 /system
sleep 5
mount -t ext2 -o rw,noatime,nodiratime,nosuid,nodev /dev/block/loop2 /data
sleep 5
mount -t ext2 -o rw,noatime,nodiratime,nosuid,nodev /dev/block/loop3 /cache
sleep 5
# zdzihu: hack-fix
if [ -e /data/data/com.android.providers.telephony/databases/telephony.db ]; then
/system/bin/chroot / /init
exit
fi
# Chroot :)
chroot / /init
# jump out of chargemon to skip NAND booting
exit
fi
echo "Booting from NAND!"
# remount rw
mount -o remount,rw rootfs /
cd /
rm -r /sdcard
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/ramdisk.tar
# zdzihu: hack-fix
if [ -e /data/data/com.android.providers.telephony/databases/telephony.db ]; then
/system/bin/chroot / /init
exit
fi
chroot / /init
Recovery is intact so u can get into recovery the normal way… (press/tap back key after seeing SE text logo)
OS on NAND (normal system on MTD) will boot by default…
To reboot into OS on SDCARD issue the following commands in terminal emulator/adb shell:
Code:
touch /data/local/tmp/rebootsdcardos
reboot
NOW the OS should start booting off the SDCARD…
It completes commands in chargemon and then BootAnimation can be seen…
BUT HERE IS THE PROBLEM!
Check LOGCAT here: http://www.mediafire.com/?phxm3uqzp0dzzhb
here is wht J had to say:
jerpelea said:
as you can see in logcat
1.your prelink is not ok
2.you don't have something ok in initrd
3.you dont have all permisions ok on data
Click to expand...
Click to collapse
From my limited understanding we yet have to make a proper ramdisk (sdcardos_ramdisk.tar)… I feel the init.rc file has to be changed especially the following line (based off FreeX10-beta4 ramdisk):
Code:
mount yaffs2 [email protected] /system rw remount
mount yaffs2 [email protected] /data nosuid nodev
mount yaffs2 [email protected] /cache nosuid nodev
As for Multi-Booting:
We can keep adding different sections to chargmeon:
Code:
/data/local/tmp/rebootsdcardos1
/data/local/tmp/rebootsdcardos2
etc…
OR
possible solution for having both recovery and dual boot
and similarly keep adding ramdisks in NAND /system:
Code:
sdcardos1_ramdisk.tar
sdcardos2_ramdisk.tar
etc
So we can have as many OS/ROMs on SDCARD as u have free space… though we need to make specific ramdisks for each…
Hope this was slightly useful… and waiting for feedback from advance users on how we can get this working....
Lol, you're working very hard Doom! Keep going!
Doom! You are making enormous progress and helping a lot with Other Devs.
A Combination of a good rom and one of these additional Dual Boot would make x10 better than any Android mobile SE could deliver.
Thank you and I really pray to give SE a run for their money!
for someone thats always saying hes not a developer you sure as hell seem to know what your doing!
Keep up the great work, i hope to see this working flawlessly that would be awesome to be able to dual boot.
Whats the next steps in the project?
BULL3TPR00F said:
for someone thats always saying hes not a developer you sure as hell seem to know what your doing!
Keep up the great work, i hope to see this working flawlessly that would be awesome to be able to dual boot.
Whats the next steps in the project?
Click to expand...
Click to collapse
well i am not exactly a ROM developer and dont know much about how to compile libs/sources/etc...
next step is that we need to make compatible system files & ramdisk (init.rc) for dual booting
DooMLoRD said:
well i am not exactly a ROM developer and dont know much about how to compile libs/sources/etc...
next step is that we need to make compatible system files & ramdisk (init.rc) for dual booting
Click to expand...
Click to collapse
You may not be a rom developer but your an amazing commited x10 modder
Sent from my X10i TripNMiUI using XDA App
DooMLoRD said:
well i am not exactly a ROM developer and dont know much about how to compile libs/sources/etc...
next step is that we need to make compatible system files & ramdisk (init.rc) for dual booting
Click to expand...
Click to collapse
I am also excited buddy..... Once i get through my experiments i will surely like to focus on this as this will allow us to have more then one version of ROM on one machine.
Based on your first post
all i can get is we are getting the boot animation but not going after that.
i would suggest following things based on my experiments with ubuntu work.
use loops above 10 coz i suspect some loops are already in use during my ubuntu boot i am watching that loop7 is already created so i would suggest avoiding it.
also as we have been adding debug "we have reached here" style code can we do the same here that might help us.
also can we find any debug-able place i mean place where we can track the progress to get the position inside the rom so that we can understand except logcat where we are.
any progress or hurdles buddy.....
i am eager to test this .....
anantshri said:
any progress or hurdles buddy.....
i am eager to test this .....
Click to expand...
Click to collapse
sorry man havent had time to do any further testing for this... have been very busy with some personal work and kernel manager scripts...
DooMLoRD said:
sorry man havent had time to do any further testing for this... have been very busy with some personal work and kernel manager scripts...
Click to expand...
Click to collapse
Keep up the good Work Doom. ! and thx for your work
Sorry if its no help but there's a thread in the x10 mini pro section
http://forum.xda-developers.com/showthread.php?t=1084555
Sent from my SEX10 using XDA App
These are great news, keep on developing!
sent from my x10i with wolfbreaks CM 6.1.3 v006 undervolted, bb67
rtblittlebrown said:
Sorry if its no help but there's a thread in the x10 mini pro section
http://forum.xda-developers.com/showthread.php?t=1084555
Sent from my SEX10 using XDA App
Click to expand...
Click to collapse
they have posted exactly the same thing!
read my 1st post in this thread and then read the first few posts there
Ohk so since we now have one more option in Xrecovery i am back to my old suggestion.
however this time i will post my thought out in open so that if someone has required skills and time then they can work on .
I have an idea of using xrecovery as a boot menu.
process would be
1) Xrecovery to start everytime. (this needs some consideration.)
2) To have a timeout value if any key pressed before that then remain in menu otherwise boot to the os.
3) inside menu we should have options of all O.S. / ROM (os coz my intention are to run linux off dualboot) available with selection options.
4) ON selection it will just be the same procedure as already using in xrecovery 1.0 to handover the command to a script. and let it load.
5) boot menu if possible could be controlled by an outside file which we can edit just like grub.conf in linux.
Note : This will requires good understanding of booting process of X10i and c skills as xrecovery is written in complete c.
anantshri said:
Ohk so since we now have one more option in Xrecovery i am back to my old suggestion.
however this time i will post my thought out in open so that if someone has required skills and time then they can work on .
I have an idea of using xrecovery as a boot menu.
process would be
1) Xrecovery to start everytime. (this needs some consideration.)
2) To have a timeout value if any key pressed before that then remain in menu otherwise boot to the os.
3) inside menu we should have options of all O.S. / ROM (os coz my intention are to run linux off dualboot) available with selection options.
4) ON selection it will just be the same procedure as already using in xrecovery 1.0 to handover the command to a script. and let it load.
5) boot menu if possible could be controlled by an outside file which we can edit just like grub.conf in linux.
Note : This will requires good understanding of booting process of X10i and c skills as xrecovery is written in complete c.
Click to expand...
Click to collapse
point no.1 is easy... not an issue..
abt point 2 i think that too would be possible... a while loop with sleep function & wait for input/keppress
pt3 the newer xrecovery v1.0.0 already has something similar may be we can look into it to add "Boot NAND system" as first option
point no. 5 if possible WILL BE BRILLIANT!!!
@anantshri
dude may be these guys can help us:
http://forum.xda-developers.com/showpost.php?p=14354231&postcount=49
DooMLoRD said:
they have posted exactly the same thing!
read my 1st post in this thread and then read the first few posts there
Click to expand...
Click to collapse
Oops sorry..
Sent from my SEX10 using XDA App
rtblittlebrown said:
Oops sorry..
Sent from my SEX10 using XDA App
Click to expand...
Click to collapse
no dude thanks for the info... i have already contacted those guys for help... lets see may be they can help us out to get this working!!!
dual boot hint by Z
http://forum.xda-developers.com/showthread.php?t=1107111
something related

[Q] System.img Editing Dev Help

Hi all,
im working on making a ROM for the Asus Transformer and im struggling a bit. im totall new to Linux, using mint and just getting used to it.
Basically im just trying to take a stock ROM and add root but adding superuser.apk and SU binary but im running into problems.
Asus Roms are a bit unusual, packed into blob files, ive unpacked that no problem, the system image is called blob.APP but its just the same as system.img just the name as i understand it.
ok so what ive done:
Code:
mkdir system
sudo mount -t ext4 -o loop blob.APP system/
so this mounts the ext4 fs as a loop device and allows me to copy the contents out
Code:
sudo cp -ar system new_system
then ive copied superuser.apk to /app and SU binary to /dev with drop and drag.
then make the filesystem image
Code:
sudo ./make_ext4fs -l 512m -a system blob.APP new_system/system
then just pack it up and flash it, flashing works fine, no errors but when i go to reboot it warns that theres no OS so somethings not worked. ive tried everything i can find googeling!
i just started learning linux on weds so go easy on me
any advice or help would be really great. thanks!
mkdir system here you will mount the old system
mkdir system_new here you will mount the new system
we now create the actual image
dd if=/dev/zero of=system_new.img bs=4k count=60000
bs=4k is the block size
count=60000 the number of blocks of 4kb size
so is something like 60000*4= 240000 which is actually 240 Mb
so it depends to you how big you want the image.
now we format the system.img in ext4
mkfs.ext4 system_new.img
Proceed anyway? (y,n) y
now we override the filesystem check
tune2fs -c0 -i0 system_new.img
Now we mount the the 2 directories that we created in the first step
mount -o loop system_new.img system_new/
mount -o loop system_new.img system/
Now we copy the contet of the old image to the new one with all the perimissions
cp -v -r -p system/* system_new/
We sinc the files
sync
We unmount the partitions
umount system_new/
umount system/
And voila, the system.img in ext4 is created.
Tips: you will need superuser acces.
if you will copy new files besides the ones from the old system you will have to set by hand all the permissions.
If you are using ubuntu just type
sudo su
and you will be root and no more sudo at each command.
Thank u so much for your guide this is exactly what I'm looking for so massive thanks!
So to add root I.can drop and drag superuser.apk and the binary into the new image?
Also do I need to worry about the android mountpoint?
Sent from my HTC Sensation Z710e using xda premium
yes you can do that, as long as you set the permissions right. (you can google for them)
and from what i remeber you will have to set also the ownership of the su, and superusers files
you need to do tests first, and then try
the mountpoint should be ok as it is now.
globula_neagra said:
mkdir system here you will mount the old system
mkdir system_new here you will mount the new system
we now create the actual image
dd if=/dev/zero of=system_new.img bs=4k count=60000
bs=4k is the block size
count=60000 the number of blocks of 4kb size
so is something like 60000*4= 240000 which is actually 240 Mb
so it depends to you how big you want the image.
now we format the system.img in ext4
mkfs.ext4 system_new.img
Proceed anyway? (y,n) y
now we override the filesystem check
tune2fs -c0 -i0 system_new.img
Now we mount the the 2 directories that we created in the first step
mount -o loop system_new.img system_new/
mount -o loop system_new.img system/
Now we copy the contet of the old image to the new one with all the perimissions
cp -v -r -p system/* system_new/
We sinc the files
sync
We unmount the partitions
umount system_new/
umount system/
And voila, the system.img in ext4 is created.
Tips: you will need superuser acces.
if you will copy new files besides the ones from the old system you will have to set by hand all the permissions.
If you are using ubuntu just type
sudo su
and you will be root and no more sudo at each command.
Click to expand...
Click to collapse
U said, we have to set permissions by ourselves. So what are the permissions that needs to be set when I add a new folder with an APK in it?
Sudo chmod 777 filepath/filename.apk
Sudo chmod a-rwx filepatch/filename.apk.
This is what I remember from top of my head. Google it a bit if it does not work from the first try as I have not used this like in 5 years.
If you allready have root you can you a file manager and just copy the file/folder where you want and set the permissions via thw file manager or using terminal commanda or via adb.
From what remember you can t make a folder in the apk folder as you won t be able to run the apk.

[Q] Simple File Copy Script

Hello everyone, I'm trying to figure out how to write a script to copy three .mp3 files from three different locations all to /system/media/audio/ringtones. So far, I'm in a bit over my head and I was wondering if anyone here could help me please?
Thanks in advance!
Mac of York said:
Hello everyone, I'm trying to figure out how to write a script to copy three .mp3 files from three different locations all to /system/media/audio/ringtones. So far, I'm in a bit over my head and I was wondering if anyone here could help me please?
Thanks in advance!
Click to expand...
Click to collapse
Well bud, honestly, it's not even worth all the writing it would take to compile a script for such an easy task via and file explorer that supports root functions. Simply copy n paste all into one folder, mount your /system -r/w and then the good ol multi-select button, copy to clipboard, browse up to /system/media/ringtones or /system/audio (whichever your phone model stores your system sounds/ui crap in), then after pasted to destination folder simply remount -r/o, reboot phone, voila!
jtmarich1985 said:
Well bud, honestly, it's not even worth all the writing it would take to compile a script for such an easy task via and file explorer that supports root functions. Simply copy n paste all into one folder, mount your /system -r/w and then the good ol multi-select button, copy to clipboard, browse up to /system/media/ringtones or /system/audio (whichever your phone model stores your system sounds/ui crap in), then after pasted to destination folder simply remount -r/o, reboot phone, voila!
Click to expand...
Click to collapse
Haha, thanks -- that's what I usually do but if it's too complicated it's not worth it.
Open a new text file, and write this:
Code:
#!/system/bin/sh
mount -o rw,remount /system
cp location1/file.mp3 /system/media/audio/ringtones/file.mp3
cp location2/file2.mp3 /system/media/audio/ringtones/file2.mp3
cp location3/file3.mp3 /system/media/audio/ringtones/file3.mp3
mount -o ro,remount /system
Save it (the extension doesn't matter) and that's it. You can run it using script manager, or the terminal emulator (in this case you need to get root permissions first, using the su command).
Also you can add some messages (to get a nicer script, you know ), this way:
Code:
#!/system/bin/sh
echo "Mounting /system as RW..."
mount -o rw,remount /system
echo "Copying files..."
cp location1/file.mp3 /system/media/audio/ringtones/file.mp3
cp location2/file2.mp3 /system/media/audio/ringtones/file2.mp3
cp location3/file3.mp3 /system/media/audio/ringtones/file3.mp3
echo "Done. Mounting /system as RO again..."
mount -o ro,remount /system
echo "All done. Have a nice day =)"
Please be careful while using scripts, otherwise you'll brick some devices :silly:
RoberGalarga said:
Open a new text file, and write this:
Code:
#!/system/bin/sh
mount -o rw,remount /system
cp location1/file.mp3 /system/media/audio/ringtones/file.mp3
cp location2/file2.mp3 /system/media/audio/ringtones/file2.mp3
cp location3/file3.mp3 /system/media/audio/ringtones/file3.mp3
mount -o ro,remount /system
Save it (the extension doesn't matter) and that's it. You can run it using script manager, or the terminal emulator (in this case you need to get root permissions first, using the su command).
Also you can add some messages (to get a nicer script, you know ), this way:
Code:
#!/system/bin/sh
echo "Mounting /system as RW..."
mount -o rw,remount /system
echo "Copying files..."
cp location1/file.mp3 /system/media/audio/ringtones/file.mp3
cp location2/file2.mp3 /system/media/audio/ringtones/file2.mp3
cp location3/file3.mp3 /system/media/audio/ringtones/file3.mp3
echo "Done. Mounting /system as RO again..."
mount -o ro,remount /system
echo "All done. Have a nice day =)"
Please be careful while using scripts, otherwise you'll brick some devices :silly:
Click to expand...
Click to collapse
Awesome, thanks. I'd give you a thanks but I'm all thanked out today.
RoberGalarga said:
Open a new text file, and write this:
Code:
#!/system/bin/sh
mount -o rw,remount /system
cp location1/file.mp3 /system/media/audio/ringtones/file.mp3
cp location2/file2.mp3 /system/media/audio/ringtones/file2.mp3
cp location3/file3.mp3 /system/media/audio/ringtones/file3.mp3
mount -o ro,remount /system
Save it (the extension doesn't matter) and that's it. You can run it using script manager, or the terminal emulator (in this case you need to get root permissions first, using the su command).
Also you can add some messages (to get a nicer script, you know ), this way:
Code:
#!/system/bin/sh
echo "Mounting /system as RW..."
mount -o rw,remount /system
echo "Copying files..."
cp location1/file.mp3 /system/media/audio/ringtones/file.mp3
cp location2/file2.mp3 /system/media/audio/ringtones/file2.mp3
cp location3/file3.mp3 /system/media/audio/ringtones/file3.mp3
echo "Done. Mounting /system as RO again..."
mount -o ro,remount /system
echo "All done. Have a nice day =)"
Please be careful while using scripts, otherwise you'll brick some devices :silly:
Click to expand...
Click to collapse
This is exactly what I wanted and it works beautifully! Thank you so much!
If I put script like thisone (classic copy-paste) in /system/etc/init.d, is it possible to configure that runing on ewery boot? And how?
Thanks.
Haven't tried this yet for fear of bricking, can someone help to see it this will work? I'm just trying to have a script to be placed on the homescreen so I can easily disable/enable the mediascanner/screenshot function. By the way, cp copies files, and cp -r actually moves (cut-paste) files, right?
#!/system/bin/sh
echo "Mounting /system as RW..."
mount -o rw,remount /system
echo "Movingfiles..."
cp -r /system/prv-app/MediaProvider.apk /system/prv-app/newfolder/MediaProvider.apk
echo "Done. Mounting /system as RO again..."
mount -o ro,remount /system
#!/system/bin/sh
echo "Mounting /system as RW..."
mount -o rw,remount /system
echo "Moving files..."
cp -r /system/prv-app/newfolder/MediaProvider.apk /system/prv-app/MediaProvider.apk
echo "Done. Mounting /system as RO again..."
mount -o ro,remount /system
Is it possible to do the same but with a folder+ content and not just a file?
Best thought to testing scripts, would be to add an android emulator to your computer. The one I use is nox. Its great for testing scripts and a variety of other things as well. Nox is an android based application, made jjust like a phone. All the features and extensions that your normal everyday android has, this emulator has as well.

Categories

Resources