haha yes, I've forgotten that. Now its up to date.quoting myself (lol)
nevermind, it works the same using
"busybox tar -xvf /sdcard/debian.tar.bz2 -C /data/local"
haha yes, I've forgotten that. Now its up to date.quoting myself (lol)
nevermind, it works the same using
"busybox tar -xvf /sdcard/debian.tar.bz2 -C /data/local"
Nope, the problem here is not a lack of support for loop devices, the problem is the ext2 filesystem itself, which is not supported in our defy.Hi. Well, I've researched a lot to get to this. For now, I haven't used the mount commands (because there isn't support for loop devices, or at least, that I think; in my stock rom). Because of that, the files are in a folder in the Filesystem of android.
Hey, yes, I know that the defy has the ext3 filesystem extension in the kernel, but always it gives me an error trying to mount ext3 images.Nope, the problem here is not a lack of support for loop devices, the problem is the ext2 filesystem itself, which is not supported in our defy.
Check by yourself, type from terminal:
"cat /proc/filesystems"
So, what is the solution?
It's much easier than you can expect, when you build your debian.img file just make it a ext3 filesystem rather than an ext2 !
Then, in your bootdeb file remember you're going to mount ext3 instead of ext2, so the code looks something like:
"busybox mount -t ext3 -o noatime,nodiratime [your_loop_device] [your_dir]"
Another way would be: find an ext2.ko (linux kernel module) specifically compiled for defy's kernel and place "insmod ext2.ko" inside bootdeb.. but i was not be able to find such a module over the net (all those i tried failed).
Right now i have debian running, i made a debian.img (ext3) and got it mounted on /data/local/debian
Hope this can help
BTW i made a one-click apk installer for all those who want to skip the hard stuffi'll post it soon in a new thread
Below you can take a look to the whole code i used to get debian workingHey, yes, I know that the defy has the ext3 filesystem extension in the kernel, but always it gives me an error trying to mount ext3 images.
It would be great if you make the apk. I can help you with the spanish translation, PM me if you want.
#----------------------------------------------------------------
# From linux: build debian image
#----------------------------------------------------------------
dd if=/dev/zero of=debian.img seek=838860800 bs=1 count=1
mkfs.ext3 -F debian.img
mkdir debian
mount -o loop debian.img debian/
cp -r debian-bak/* debian
umount debian/
rm -r debian/
tar -cjf debian.img.bz2 bootdeb debian.img
#----------------------------------------------------------------
# From device: setup debian image (that is what installer does)
#----------------------------------------------------------------
busybox tar -xvf /sdcard/debian/debian.img.bz2 -C /sdcard/debian
mkdir data/local/debian
mount -o remount,rw -t yaffs2 /dev/block/mmcblk1p21 /system
cp /sdcard/debian/bootdeb /system/bin/bootdeb
chmod 755 /system/bin/bootdeb
ln /dev/block/loop5 /dev/loop5
mount -o remount,ro -t yaffs2 /dev/block/mmcblk1p21 /system
#----------------------------------------------------------------
# From device: launch debian (bootdeb file content)
#----------------------------------------------------------------
mount -o remount,rw -t yaffs2 /dev/block/mmcblk1p21 /system
echo "Setting up paths.."
export bin=/system/bin
export img=/mnt/sdcard/debian/debian.img
export mnt=/data/local/debian
export OLDPATH=$PATH
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
echo "Mounting Linux image.."
busybox mknod /dev/block/loop5 b 7 0
busybox losetup /dev/block/loop5 $img
busybox mount -t ext3 -o noatime,nodiratime /dev/block/loop5 $mnt
busybox mount -t devpts devpts $mnt/dev/pts
busybox mount -t proc proc $mnt/proc
busybox mount -t sysfs sysfs $mnt/sys
echo "Setting up network.."
busybox sysctl -w net.ipv4.ip_forward=1
echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf
echo "nameserver 8.8.4.4" >> $mnt/etc/resolv.conf
echo "127.0.0.1 localhost" > $mnt/etc/hosts
echo "Mounting sdcard.."
busybox mount --bind /mnt/sdcard/ $mnt/mnt/sdcard
echo "Launching debian.."
echo " "
echo "------------------------------"
echo " Make sure to exit properly"
echo " Type EXIT to close session"
echo "------------------------------"
echo " "
busybox chroot $mnt /bin/bash
echo " "
echo "Shutting down.."
busybox umount $mnt/mnt/sdcard
busybox sysctl -w net.ipv4.ip_forward=0
busybox umount $mnt/dev/pts
busybox umount $mnt/proc
busybox umount $mnt/sys
busybox umount $mnt
busybox losetup -d /dev/block/loop5
export PATH=$OLDPATH
mount -o remount,ro -t yaffs2 /dev/block/mmcblk1p21 /system
First of all, I've followed all of your script step-by-step without any errors, except when I try to run it:Below you can take a look to the whole code i used to get debian working
Note:Code:#---------------------------------------------------------------- # From linux: build debian image #---------------------------------------------------------------- dd if=/dev/zero of=debian.img seek=838860800 bs=1 count=1 mkfs.ext3 -F debian.img mkdir debian mount -o loop debian.img debian/ cp -r debian-bak/* debian umount debian/ rm -r debian/ tar -cjf debian.img.bz2 bootdeb debian.img #---------------------------------------------------------------- # From device: setup debian image (that is what installer does) #---------------------------------------------------------------- busybox tar -xvf /sdcard/debian/debian.img.bz2 -C /sdcard/debian mkdir data/local/debian mount -o remount,rw -t yaffs2 /dev/block/mmcblk1p21 /system cp /sdcard/debian/bootdeb /system/bin/bootdeb chmod 755 /system/bin/bootdeb ln /dev/block/loop5 /dev/loop5 mount -o remount,ro -t yaffs2 /dev/block/mmcblk1p21 /system #---------------------------------------------------------------- # From device: launch debian (bootdeb file content) #---------------------------------------------------------------- mount -o remount,rw -t yaffs2 /dev/block/mmcblk1p21 /system echo "Setting up paths.." export bin=/system/bin export img=/mnt/sdcard/debian/debian.img export mnt=/data/local/debian export OLDPATH=$PATH export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH export TERM=linux export HOME=/root echo "Mounting Linux image.." busybox mknod /dev/block/loop5 b 7 0 busybox losetup /dev/block/loop5 $img busybox mount -t ext3 -o noatime,nodiratime /dev/block/loop5 $mnt busybox mount -t devpts devpts $mnt/dev/pts busybox mount -t proc proc $mnt/proc busybox mount -t sysfs sysfs $mnt/sys echo "Setting up network.." busybox sysctl -w net.ipv4.ip_forward=1 echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf echo "nameserver 8.8.4.4" >> $mnt/etc/resolv.conf echo "127.0.0.1 localhost" > $mnt/etc/hosts echo "Mounting sdcard.." busybox mount --bind /mnt/sdcard/ $mnt/mnt/sdcard echo "Launching debian.." echo " " echo "------------------------------" echo " Make sure to exit properly" echo " Type EXIT to close session" echo "------------------------------" echo " " busybox chroot $mnt /bin/bash echo " " echo "Shutting down.." busybox umount $mnt/mnt/sdcard busybox sysctl -w net.ipv4.ip_forward=0 busybox umount $mnt/dev/pts busybox umount $mnt/proc busybox umount $mnt/sys busybox umount $mnt busybox losetup -d /dev/block/loop5 export PATH=$OLDPATH mount -o remount,ro -t yaffs2 /dev/block/mmcblk1p21 /system
* debian-bak folder contains all the debian files
* the installer i made places debian.img in the folder /sdcard/debian
- mknod: /dev/block/loop5: File existsFirst of all, I've followed all of your script step-by-step without any errors, except when I try to run it:
mknod: /dev/block/loop5: File exists
losetup: /dev/block/loop5: No such file or directory
mount: mounting /dev/block/loop5 on /data/local/debian failed: Invalid argument
mount: mounting devpts on /data/local/debian/dev/pts failed: No such file or directory
mount: mounting proc on /data/local/debian/proc failed: No such file or directory
mount: mounting sysfs on /data/local/debian/sys failed: No such file or directory
Setting up network..
net.ipv4.ip_forward = 1
/system/bin/bootdeb: line 19: /data/local/debian/etc/resolv.conf: No such file or directory
/system/bin/bootdeb: line 20: /data/local/debian/etc/resolv.conf: No such file or directory
/system/bin/bootdeb: line 21: /data/local/debian/etc/hosts: No such file or directory
Mounting sdcard..
mount: mounting /mnt/sdcard/ on /data/local/debian/mnt/sdcard failed: No such file or directory
Launching debian..
------------------------------
Make sure to exit properly
Type EXIT to close session
------------------------------
chroot: can't execute '/bin/bash': No such file or directory
Shutting down..
umount: can't umount /data/local/debian/mnt/sdcard: No such file or directory
net.ipv4.ip_forward = 0
umount: can't umount /data/local/debian/dev/pts: No such file or directory
umount: can't umount /data/local/debian/proc: No such file or directory
umount: can't umount /data/local/debian/sys: No such file or directory
umount: can't umount /data/local/debian: Invalid argument
losetup: /dev/block/loop5: No such device or address
- mknod: /dev/block/loop5: File exists
this is nothing wrong, mknod is there just in case there's no loop5 in /dev/block/
losetup: /dev/block/loop5: No such file or directory
this is the error, but just to be sure,
did you checked if the file debian.img was exactly in the folder
/sdcard/debian/ ?
losetup was looking for
/sdcard/debian/debian.img
and note, the output
"/dev/block/loop5: No such file or directory"
is the same even if the device (loop5) or the img file was not found.
[18:43 localhost] <21 /sdcard/debian/> ls
bootdeb
debian.img
Otherwise, this is a pretty weird error, try to insert
"ln /dev/block/loop5 /dev/loop5"
at the top of bootdeb
let me know
ln /dev/block/loop5 /dev/loop5
link failed File exists
Now it worked. But, just in case, I have to keep the linewell, just another attempt, let's try in another way
from bootdeb cut these lines:
busybox mknod /dev/block/loop5 b 7 0
busybox losetup /dev/block/loop5 $img
busybox mount -t ext3 -o noatime,nodiratime /dev/block/loop5 $mnt
and replace with:
busybox mount -t ext3 -o loop /sdcard/debian/debian.img /data/local/debian
(just in case you didn't try it yet)
busybox mknod /dev/block/loop5 b 7 0
Actually doing in this way you don't choose which loop device will be selected (or at least, i think so) but let the system do it for you. So, i think you can skip that line.Now it worked. But, just in case, I have to keep the line
to create the loop if it didnt exists?Code:busybox mknod /dev/block/loop5 b 7 0