Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    [Debian] Running Debian in a chroot

    Reply
    Page 33 of 34 | Prev | 23   31     32   33   34   | Next
    qole | # 321 | 2008-10-04, 18:57 | Report

    I spent some time hacking around with the Xomap / chvt method of running a secondary WM.

    I think I'm not going to persue it farther. The advantages (slightly faster execution, pressure sensitivity) are just not enough to outweigh the disadvantages (difficult to switch between displays, no icon on Maemo desktop, no Maemo notifications when in secondary WM, etc).

    Edit | Forward | Quote | Quick Reply | Thanks

     
    johnnyesp | # 322 | 2008-10-10, 22:43 | Report

    I can downloaded and descompreser file debian.img.ext2 and it is not even recognized on the Nokia N810.
    How can I install the file debian.img.ext2?
    Please me. Thank you.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    rjsiva | # 323 | 2008-10-15, 07:17 | Report

    As we working on porting Debian in our embedded platform, we are struggling to write booting script or chroot script from our own linux platform. We booted our linux kernel with minimal filesystem(jffs2) and we doesn't hav e any packages for Xserver or GUI components packages.But everything working fine in chroot debian platform, We need to have a script which has to mount the chroot partition from the usb drive and has to start the xserver or xdm.Can you please suggest me how to run a command after chroot has started in a script.

    regards,
    rjsiva

    Edit | Forward | Quote | Quick Reply | Thanks

     
    qole | # 324 | 2008-10-15, 16:06 | Report

    I'm sorry, I'm not entirely sure about your question... My scripts (posted earlier) run a command after starting the chroot; please see them for an example.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    qole | # 325 | 2009-02-07, 06:56 | Report

    Here are my latest chroot scripts. These form the basis for all my work in this area moving forward.

    There are two scripts, /sbin/ezchroot and /sbin/debian2

    You need to install easy-deb-chroot first, then untar these scripts as root from /

    /sbin/ezchroot is a much improved standalone chroot script. It has new features like auto-detection of filesystem type for partitions, and much cleaner command line output (no more harmless insmod "errors"). You run it like so:

    sudo ezchroot <image filename, /dev/mmcblkNpN, or "none"> <chroot dir> <command> <parameters...>

    /sbin/debian2 is the replacement script for /sbin/debian that sets up the debian-specific stuff (GTK stylus hack, OpenOffice environment variables, resizing TMP folder, etc) and then calls ezchroot to actually do the heavy lifting. It is basically a wrapper for ezchroot, and should be a drop-in replacement for the "debian" script.

    Please try out these scripts and report problems to me.

    I'll be packaging these up for the next version of Easy Debian over the next few days; Easy Chroot will be a new package that can be used as part of other projects like isomount or whatever, and Easy Debian will depend on it.

    Soon, I hope to have Easy Ubuntu released, which will just be Easy Debian but slightly modified for Ubuntu. By breaking out Easy Chroot, I won't be duplicating lots of stuff with Easy Ubuntu, just a new image installer and a modified wrapper script. Maybe some new menu items and icons too, I dunno if I'll do that this time, or let the users install their own stuff from scratch...

    Anyway. Again, please test this out, especially people like Benson and pipeline.

    Edit | Forward | Quote | Quick Reply | Thanks
    Attached Files
    File Type: gz new-chroot-scripts.tar.gz (2.5 KB, 148 views)
    The Following User Says Thank You to qole For This Useful Post:
    pipeline

     
    pipeline | # 326 | 2009-02-08, 00:26 | Report

    Thanks qole. If i understand correctly, there's no way to chroot without mounting? And no way to automatically unmount when done?

    I could in theory replace my mount/chroot/unmount with ezchroot/umount. But if i need to execute code before the chroot i can't. This is rare case where i might want to ask user if they want to install icon package... to main fs from ext2.

    Also, oddly it seems the image is 'sticking'. I'm calling 'my' ext2drop command which unmounts your chroot mount to my /mnt/ext2 mountpoint, but if i try to mount a different image (using your ezchroot) it remembers the old one even though its a different filename. Any ideas? I'm actually monitoring the mountpoint and see it unmounting but the next run remembers old mount. I am doing a lazy unmount but it 'looks' like it unmounts.

    Update-- ok after messing around with this it looks like the dmlosetup was not being released. So not only do i umount my mountpoint but i also have to dmlosetup -d loop0

    So i guess i need to think about those two things... I was planning on autodetecting if your chroot script exists and use it if it does, otherwise fallback to my simpler script... but to take advantage of turboloop i need to mount similarly before your script to run preinit.sh script but i would need your script to accept option to not mount filesystem (since already mounted).

    Also I need to either manually close of the loop0 or ask if your script can close out.

    Thanks otherwise this looks like it will work well... thanks for working out all these issues... i'm sure chroot will play a big part in extending the tablet's usefulness.

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by pipeline; 2009-02-08 at 05:00.

     
    qole | # 327 | 2009-02-08, 21:51 | Report

    pipeline:

    Originally Posted by pipeline View Post
    there's no way to chroot without mounting?
    The following will chroot into the /debian directory, where the /debian directory has a rootfs in it.

    Code:
    sudo ezchroot none /debian
    Also, if you tell it to mount an image and the image is already mounted, it will just use the mounted image.

    Originally Posted by pipeline View Post
    And no way to automatically unmount when done?
    You would use my "closechroot" script to kill chroot apps and unmount the image or partition (including releasing the dm loop). But you usually don't want to unmount automatically. If you keep the image mounted, the next run of the chroot app is much faster.

    I have new scripts that let you mount/chroot several image files & partitions simultaneously. I'll attach them shortly.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    qole | # 328 | 2009-02-08, 22:51 | Report

    OK, new scripts with more features.

    Now, ezchroot will not only check the chroot directory to see if there's already a chroot running there (it was already doing this to skip remounting a mounted chroot), it will now compare the mounted chroot with the image or partition you're trying to mount, and if they're different, it will close the mounted chroot before proceeding to mount the requested image/partition. (I moved the "chroot-complete" to /var/lock/chroot-complete in the chroot folder; this file contains the name of the image file or partition that is mounted)

    I have also set up ezchroot, closechroot and synchroot to be able to handle multiple chroots. This means you can set up /media/mmc1/debian.img.ext2 on /debian and /media/mmc2/ubuntu.img.ext3 on /ubuntu and the scripts will be able to figure out what file system and loop device to use, etc. You now have to use a parameter for closechroot and synchroot, however; you have to tell them what chroot directory to use (eg. /debian or /ubuntu or /opt or whatever). If you don't provide a parameter, they'll try to use the chroot info from ~/.chroot (which was the former behaviour).

    The one thing I wish I knew how to do is mount a jffs2 image. Anybody want to help here?

    Note: The attached tar includes /sbin/debian rather than /sbin/debian2. This will overwrite the "debian" script from Easy Debian. You've been warned.

    Tar contents:

    /sbin/ezchroot
    /sbin/closechroot
    /sbin/synchroot
    /sbin/debian
    /usr/bin/debbie

    EDIT: These scripts really are my entire original contribution to the tablet development community. Everything else has just been installing, testing, configuring and packaging.

    Edit | Forward | Quote | Quick Reply | Thanks
    Attached Files
    File Type: gz new-chroot-scripts-2.tar.gz (3.9 KB, 154 views)

    Last edited by qole; 2009-02-08 at 23:25.
    The Following User Says Thank You to qole For This Useful Post:
    pipeline

     
    pipeline | # 329 | 2009-02-10, 00:16 | Report

    Thanks qole, i'll try those scripts... yep alot of the value you've done its working out the architecture and testing which takes a long time with image this big.

    Even better you cleaned up your scripts to make it almost seem easy Thats what i'm thankful for.

    I agree about the jffs2, would be nice option. I remember trying jffs2 at first instead of ext2 and i was unable to mount as loopback device. With the minimal information provided in the error message ('mount failed') i just kept moved on to ext2.

    This webpage written back in the 770 days appears to indicate a workaround but i haven't tried it yet. Have you seen this?
    http://test.maemo.org/maemowiki/ModifyingRootImage

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to pipeline For This Useful Post:
    qole

     
    Micah | # 330 | 2010-02-16, 19:16 | Report

    Sorry to resurrect an old thread but I have a question. I would like to have a debian chroot environment with only the base install. No X or any of that. There are a few console programs I would like to run. Is there an image file floating around like that? Could I just download the 1 Gig file and uninstall the apps from it?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Page 33 of 34 | Prev | 23   31     32   33   34   | Next
vBulletin® Version 3.8.8
Normal Logout