![]() |
Running Debain in a chroot made simple!!
I've decided to make this guide for people who are booting Debain and want a simple method for acsessing and running Debain applications in maemo. for more information please refer to this wiki
If you have eny suggeststions for improving this method, pleas post them here. Requirements: root acsess x-terminal or emelfm2 you must have Debain in it's own partition in order for this to work. How to: here's a slightly modified script for chroot: echo "Setting up the chroot..." export CHROOT=/opt ### # Make the tablet's devices available to Debian. mount --bind /dev $CHROOT/dev mount --bind /proc $CHROOT/proc ### # Gentoo wiki says this will make X work. mount -t devpts none $CHROOT/dev/pts mount --bind /tmp $CHROOT/tmp ### # Mount various external devices (SD cards, USB devices) mount --bind /media $CHROOT/media mount --bind /media/mmc1 $CHROOT/media/mmc1 mount --bind /media/mmc2 $CHROOT/media/mmc2 mount --bind /media/usb $CHROOT/media/usb ### # Mount the user's home directory mount --bind /home/user $CHROOT/home/user ### # Make the Internet work. cp /etc/resolv.conf $CHROOT/etc/resolv.conf cp /etc/hosts $CHROOT/etc/hosts ### # Make permissions work. cp /etc/group $CHROOT/etc/group cp /etc/passwd $CHROOT/etc/passwd ### # Custom prompt. Reduces confusion. export PS1="[\u@Debian: \w]" ### # Actually chroot. echo "Everything set up, running chroot..." chroot $CHROOT $* Name it Debain, place that file in /usr/bin, and give it execute permissions as root. Here's how to move this file into /usr/bin and how to give that new file execute permissions as root: sudo gainroot mv /home/user/MyDocs/Debain /usr/bin cd /usr/bin chmod +x Debain Now to actually run chroot: (just run theas commands in x-terminal as root- this assumes that your debain partition is in the second partition on mmc2) sudo gainroot mount /dev/mmcblk0p2 /opt chroot /opt exit Debain Congratulations!!! you are now in the root of Debain!!!:D Again, if you have eny questions or suggeststions pleas report them here. |
Re: Running Debain in a chroot made simple!!
Good job, b-man. Thanks for the thread, that would be great for a late comer like myself. I would greatly appreciate if you can shed light about your system, like partition, MMC boot, etc, in particular, did you have to modify the bootmenu or you use it right out of the box? Oh, a couple line about your system would be useful.
Thanks for the thread, bun |
Re: Running Debain in a chroot made simple!!
Thanks!:D I am currently using a N800 with Debain running on mmc2 (mmcblk0p2) and my cloned OS on mmc1 (mmcblk1p2) with a bootmenu right out of the box. My Debain's rootfs size is 2.4 gb and my cloned os's rootfs at 1.65 gb.
|
Re: Running Debain in a chroot made simple!!
Hi, you don't actually have to write "chroot /opt" and "exit" after mounting the Debian partition. This is done by the script, after all.
I saw the wiki article a couple of days ago, but couldn't get the script to work on my 770. Now I realised why. Option "--bind" is not working with the BusyBox version of 770. But "-o bind" does the same thing. Btw, the Linux distro is spelled "Debian" ;) |
Re: Running Debain in a chroot made simple!!
Quote:
In fact Debian is from Debra and Ian, many years ago. It must have been Deb-kids-ian by now, they got married. bun |
Re: Running Debain in a chroot made simple!!
Hi, b-man,
No big deal or anything, I'm glad more people are "getting into" Debian chroot, but... How is this different (or easier) than my method? The user of your script has to manually mount the partition, instead of having the script mount it. Another thing (that I've recently discovered) for Debian booters who want to chroot as well: BACK UP YOUR FILES. The "cp" lines in the script above overwrite fairly important system files that may break your bootable Debian. I would recommend doing the following before chrooting to your bootable Debian with the above script: (after mounting your partition to /opt, but before running the full chroot script) Code:
chroot /opt For instance, the mpd music player daemon installed in the beta3 Debian has an mpd user that is lost when you copy your /etc/passwd file from OS2008, and apt-get install complains bitterly about this missing user. I found the best thing to do was put back my .deboot backup files and do an "apt-get remove --purge mpd" to maintain my sanity. We haven't really discussed this over in the chroot thread, because it's mainly a development thread at the moment. The whole chroot process is, I know, needlessly complex and ugly. But I am not a developer, packager, whatever. I'm just a self-taught hacker guy. I would love to get the chroot process to the point where you can download an .img file and install it on any generic SD card that has enough room, and then install a .deb that drops all the right scripts in all the right places so you can start running Debian apps without a hassle. |
Re: Running Debain in a chroot made simple!!
Quote:
|
Re: Running Debain in a chroot made simple!!
Thanks qole and Tragos! I appreciate your advice very much! :D
|
Re: Running Debain in a chroot made simple!!
I understand this guide is little old but might still apply. Am wondering if someone have tested it on the n900.. Or if there is a better way of doing it now?
I want to run Ubuntu with Gnome in a chrooted environment. |
Re: Running Debain in a chroot made simple!!
qole already has the Easy-Debian package out that does this for you. It's drop dead simple for anybody.
|
All times are GMT. The time now is 15:01. |
vBulletin® Version 3.8.8