Release schroot


chaotix

Member
Joined
Jun 16, 2012
Messages
47
Hi.


I received my Pandora this Tuesday and was missing apt-get. I looked into PanDebian, but although it is a nice project with the menu integration and easy installation, I didn't think the PND-way was the way to go for such a system utility. I couldn't start the applications on my desktop computer via SSH as pnd_run makes some HOME/XAUTHORITY voodoo. I also didn't like that I couldn't terminate the session without a reboot. So I turned to the one-size-fits-all chroot solution on Debian: schroot.


I compiled it for the Pandora to be installed in /opt, changed some minor stuff for better "Pandora-integration" and configured it so that newly inserted SD-Cards are automatically (un)mounted in all running chroots. (As the subtree mount options seem to be broken on the Pandora, already mounted cards have to be manually unmounted in the chroot first to be ejected.)


It doesn't make the installed applications accessible in a menu as PanDebian does, but you can start every program from a Pandora shell prompt and even associate them with filetypes in Xfce (Just use a custom command like "schroot mplayer "%s"" in the Xfce filemanager). A menu should be possible, but as I'm more a CLI kind of guy that's not really on my radar.


If someone is interested, I uploaded the package (and the current debootstrap from wheezy) with some installation instructions: http://lxtek.de./pandora/


Maybe someone finds it useful,


Lars
 
Just added it to the Software projects page. Thanks for the advice.


It seems to work really well. I just installed Iceweasel (Debian branded Firefox) with aptitude and it worked out of the box. As did mplayer with video and audio without any manual configuration.
 
Be careful with installing things on the nand though, it's space is quite limited.


This may be more suited for an sd-install.


[edit: I just saw you added instructions on how to install it externally. great work, I may try it sometime this weekend :) ]
 
Last edited by a moderator:
Sounds like it might be just the ticket for running Arduino. I tried firing it up and got:


/opt# sudo /opt/schroot/bin/schroot -c squeeze apt-get update


E: 09pandorapremount: mount: can't find /media in /etc/fstab or /etc/mtab


E: 10mount: warning: Mount location /opt/schroot/var/lib/schroot/mount/squeeze-23525c75-6c1c-4b88-a4ff-3c5545277bb4 no longer exists; skipping unmount


E: squeeze-23525c75-6c1c-4b88-a4ff-3c5545277bb4: Chroot setup failed: stage=setup-start


This is after a successful base-system install. Does it expect something atypical of /media? Which, for me, is not a mount point, but a folder of mount points...


Update: I hacked /etc/init.d/pandora-mediabind.sh and stuck an "exit 0" after the failing "mount --bind /media /media" line to get me up and running.


Update: Eek. False positive. That fixed nothing.
 
Last edited by a moderator:
This is after a successful base-system install. Does it expect something atypical of /media? Which, for me, is not a mount point, but a folder of mount points...

Yes, /media needs to be a mount point. That's what the /etc/init.d/pandora-mediabind.sh is for. It makes a bind-mount from /media to /media. This is necessary for subtree mounts to work. Without this SD-cards will not be automatically mounted and unmounted within the chroots.


Could you check if there is a /media directory within the chroot? If not, just create it. I also had that problem with a chroot. But I don't think it happened on my first install, that's why I forget to mention it in the docs.

Update: I hacked /etc/init.d/pandora-mediabind.sh and stuck an "exit 0" after the failing "mount --bind /media /media" line to get me up and running.


Update: Eek. False positive. That fixed nothing.

Did you copy pandora-mediabind.sh to your Pandora root-filesystem or to the chroot? It needs to be started directly on the Pandora before anything get's mounted under /media.


How does the output of "df" look like? Do you get a line like



Code:
ubi0:rootfs			 466452	345852	120600  74% /media


(This requires a reboot after you "sudo update-rc.d pandora-mediabind.sh start 2 S .")


Please let me know if it works and if so, what fixed the problem. I thought it should work even without the pandora-mediabind.sh script installed (without automatic SD-card mounts of course).
 
Aha, looks like I might need to reboot and put all the scripts I fiddled with back in their rightful place then :D Will give it a punt and get back to you.


Update: Yeeahhhs, seems to be healthier now. I still get the following though, which may or may not be due to the fact I still have not rebooted:


E: 20nssdatabases: stat: cannot stat '/etc/networks': No such file or directory


Update: Currently installing Arduino, it's going to take some time (~430mb of stuff to install) but once it's done I'm hoping this setup will let it get at the serial ports. Shame the Ubuntu repo version is a little ancient.
 
Last edited by a moderator:
Aha, looks like I might need to reboot and put all the scripts I fiddled with back in their rightful place then :D Will give it a punt and get back to you.

I guess, I should add that to the instructions :)

E: 20nssdatabases: stat: cannot stat '/etc/networks': No such file or directory

Forgot about that... schroot tries to copy important files and system databases from the host to the chroot on system start. This includes the "/etc/networks" which is not existent by default on the Pandora. Either create it or tell schroot not to copy it (if you don't have a use for it). Just delete the line "networks" in /opt/schroot/etc/schroot/pandora/nssdatabases.


When I update the package I will remove the line from the configuration.

Update: Currently installing Arduino, it's going to take some time (~430mb of stuff to install) but once it's done I'm hoping this setup will let it get at the serial ports. Shame the Ubuntu repo version is a little ancient.

Hope it works.
 
OK. I updated the package.

  • It should now work even without the pandora-mediabind.sh script installed (or before rebooting). Although this will disable automatic SD-card mounting and unmounting.
  • If the /media directory in the chroot is missing, it will be created.
  • NSS database files that are not present on the host system will be skipped.
 
I hope this thread isn't too old...


So I can't install anything through apt-get since it's complaining about me not having any locales.


[paul374@pandorica ~]$ sudo /opt/schroot/bin/schroot -c jessie apt-get install sudo


Reading package lists... Done


Building dependency tree


Reading state information... Done


The following NEW packages will be installed:


sudo


0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.


Need to get 0 B/828 kB of archives.


After this operation, 2678 kB of additional disk space will be used.


perl: warning: Setting locale failed.


perl: warning: Please check that your locale settings:


LANGUAGE = (unset),


LC_ALL = "ja_JP.UTF-8",


LANG = "ja_JP.UTF-8"


are supported and installed on your system.


perl: warning: Falling back to the standard locale ("C").


locale: Cannot set LC_CTYPE to default locale: No such file or directory


locale: Cannot set LC_MESSAGES to default locale: No such file or directory


locale: Cannot set LC_ALL to default locale: No such file or directory


dpkg: unrecoverable fatal error, aborting:


unknown group 'crontab' in statoverride file


E: Sub-process /usr/bin/dpkg returned an error code (2)


locale-gen does not exist, and I can't apt-get install locales. localedef doesn't seem to have any effect, so I can't dpkg-reconfigure to fix this either.


What do I do?
 
It's not working.


[paul374@pandorica ~]$ sudo /opt/schroot/bin/schroot -c jessie echo $LANGUAGE


ja_JP.UTF-8


[paul374@pandorica ~]$ sudo /opt/schroot/bin/schroot -c jessie apt-get install sudo


Reading package lists... Done


Building dependency tree


Reading state information... Done


The following NEW packages will be installed:


sudo


0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.


Need to get 0 B/828 kB of archives.


After this operation, 2678 kB of additional disk space will be used.


perl: warning: Setting locale failed.


perl: warning: Please check that your locale settings:


LANGUAGE = (unset),


LC_ALL = "ja_JP.UTF-8",


LANG = "ja_JP.UTF-8"


are supported and installed on your system.


perl: warning: Falling back to the standard locale ("C").


locale: Cannot set LC_CTYPE to default locale: No such file or directory


locale: Cannot set LC_MESSAGES to default locale: No such file or directory


locale: Cannot set LC_ALL to default locale: No such file or directory


dpkg: unrecoverable fatal error, aborting:


unknown group 'crontab' in statoverride file


E: Sub-process /usr/bin/dpkg returned an error code (2)
 
I got it!

locales isn't in the schroot so it's pointless trying to set it to anything other than C.

So I just set LANGUAGE, LC_ALL, and LANG to C (outside of schroot), and the locale problem was fixed (install locales first right after)

Then there was a problem with unknown group 'crontab' in statoverride file so from inside the chroot I moved statoverride to statoverride-old and that fixed the problem.
 
Last edited by a moderator:
Back
Top