tag:help.appveyor.com,2012-11-13:/discussions/problems/14486-how-do-i-chroot-fakeroot-or-sbuild-with-the-ubuntu-imageAppVeyor: Discussion 2018-08-31T18:52:45Ztag:help.appveyor.com,2012-11-13:Comment/453912452018-05-31T16:12:03Z2018-05-31T16:12:04ZHow do I chroot / fakeroot or sbuild with the ubuntu image?<div><p>Hi there,</p>
<p>I would like to use the ubuntu image to build 32-bit versions of mesa (the graphic driver).</p>
<p>However no matter what I try, the actual chroot doesn't seem to work, as I always end up in the exact same setup as it was before.<br>
I.e. when I try to install packages it uses the 64-bit versions, the same goes for the actual build process which also tries (and this case also fails) to use an 64-bit environment.</p>
<p>If I try this on my local machine there is absolutely no problem at all to get it working.<br>
So is chroot disabled for some reason or are there additional steps I need to take in order to enable it?<br>
(Using chroot or fakechroot directly fails with bash complaining that there is no interactive shell or invalid ioctl)</p>
<p>excerpt from the current version of the appveyor.yml I'm using:</p>
<p>sudo adduser $USER sbuild<br>
Adding user <code>appveyor' to group</code>sbuild' ...<br>
Adding user appveyor to group sbuild<br>
Done.<br>
sudo adduser root sbuild<br>
Adding user <code>root' to group</code>sbuild' ...<br>
Adding user root to group sbuild<br>
Done.<br>
sudo mkdir -p $HOME/ubuntu/scratch<br>
sudo chmod ugo+w /etc/schroot/sbuild/fstab<br>
sudo echo "/home/$USER/ubuntu/scratch /scratch none rw,bind 0 0" >> /etc/schroot/sbuild/fstab<br>
sudo echo "\$maintainer_name='me';\n\$distribution = 'xenial';\n\$build_arch_all = 1;\n\$purge_build_directory = 'successful';\n\$purge_session = 'successful';\n\$purge_build_deps = 'successful';\n\$log_dir=\$ENV{HOME}.'/ubuntu/logs';\n1;" > ~/.sbuildrc<br>
sudo mkdir -p $HOME/ubuntu/{build,logs}<br>
sudo echo 'SCHROOT_CONF_SUFFIX="source-root-users=root,sbuild,admin\nsource-root-groups=root,sbuild,admin\npreserve-environment=true"' > ~/.mk-sbuild.rc<br>
sudo sg sbuild<br>
sudo mk-sbuild xenial --arch=i386<br>
... Done building xenial-i386.<br>
To CHANGE the golden image: sudo schroot -c source:xenial-i386 -u root To ENTER an image snapshot: schroot -c xenial-i386 To BUILD within a snapshot: sbuild -A -d xenial-i386 PACKAGE*.dsc To BUILD for : sbuild -A -d xenial-i386 --host PACKAGE*.dsc</p>
<p>sudo schroot -c xenial-i386 -u root<br>
W: Failed to change to directory ‘/home/appveyor/projects/mymesa’: No such file or directory<br>
I: The directory does not exist inside the chroot. Use the --directory option to run the command in a different directory.<br>
W: Falling back to directory ‘/root’</p>
<p>From here on it still uses the 64-bit versions.</p></div>Benedikt Schemmertag:help.appveyor.com,2012-11-13:Comment/453912452018-05-31T19:37:37Z2018-05-31T19:37:37ZHow do I chroot / fakeroot or sbuild with the ubuntu image?<div><p>Benedikt,</p>
<p>As I can see you try to write several lines to .sbuildrc and .mk-sbuild.rc with one echo command. To make echo read \n as line feed you have to provide it -e option like this:<br>
echo -e "line1\nline2" >myfile<br>
If this does not fix your problem please show us your appveyor.yml. You can email it <a href="mailto:team@appveyor.com">team@appveyor.com</a> if you don't what to show it publicly.</p>
<p>Am I understanding right that you trying to build the driver from mesa3d.org?</p></div>Wasa Pleshakov