<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Coredumb</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Coredumb"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Coredumb"/>
	<updated>2026-05-03T01:59:05Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Software_management&amp;diff=10593</id>
		<title>Software management</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Software_management&amp;diff=10593"/>
		<updated>2015-03-27T08:10:01Z</updated>

		<summary type="html">&lt;p&gt;Coredumb: /* Skype on Debian chroot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Draft}}&lt;br /&gt;
&lt;br /&gt;
If you want to run glibc programs under alpine there are a few ways to do so.You could install glibc additional to uclibc (you would have to do this manualy) or you could do the easy way and use a chroot.&amp;lt;br&amp;gt;&lt;br /&gt;
Because there are different usecases I want to give a slight overview about what&#039;s possible and what is intelligent.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Your options==&lt;br /&gt;
===Using Busybox===&lt;br /&gt;
First the most simple approach for setting up a chroot is using a glibc build of busybox.&amp;lt;br&amp;gt;&lt;br /&gt;
This approach has just a few downsides:&amp;lt;br&amp;gt;&lt;br /&gt;
- You have to link most /bin/ and /usr/bin program against /bin/busybox and some busybox builds break if you don&#039;t configure it right.&amp;lt;br&amp;gt;&lt;br /&gt;
- You have to manually download every library you need for your program manually.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
But if you want a small enviroment for one simple use case this is the solution you want.&lt;br /&gt;
&lt;br /&gt;
===Using a livecd===&lt;br /&gt;
If you prefer any special distri you can always download and extract a livecd and use it as a chroot enviroment.&lt;br /&gt;
&lt;br /&gt;
===Using a stage3 gentoo archive===&lt;br /&gt;
This is the fastest approach and you have the advantage of controlling which package version of which library you will install.&amp;lt;br&amp;gt;&lt;br /&gt;
Drawbacks are as follow:&amp;lt;br&amp;gt;&lt;br /&gt;
- Big build.You have to install a portage tree which uses up a lot of space.(It&#039;s not 100% necessary if you don&#039;t have to install any additional content you don&#039;t need it)&amp;lt;br&amp;gt;&lt;br /&gt;
- On slow mashines not recommended because you have to compile your packages.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Using Archlinux or Debian===&lt;br /&gt;
If you want a nice running system you can install Arch or Debian in a chroot.This approach isn&#039;t as easily executed as the other alternatives, but are in my opinion the cleanest and most recommended for the every day user.&lt;br /&gt;
&lt;br /&gt;
==How to do it==&lt;br /&gt;
Like I said this is just a quick draft so here it comes.&lt;br /&gt;
===Using Busybox===&lt;br /&gt;
First we need to download busybox.You can choose any of your favourit distros to download a prebuild version.I for instance would use Archlinux packages from http://www.archlinux.org/packages/community/i686/busybox/.&amp;lt;br&amp;gt;&lt;br /&gt;
 wget http://www.archlinux.org/packages/community/i686/busybox/download/ -O busybox.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/glibc/download/ -O glibc.pkg.tar.xz&lt;br /&gt;
 mkdir -p ~/chroot/usr/bin/ ~/chroot/{dev,proc,root,etc}&lt;br /&gt;
 for i in *.pkg.tar.xz;do&lt;br /&gt;
 bsdtar xfJ $i -C ~/chroot&lt;br /&gt;
 done&lt;br /&gt;
 cp /etc/resolv.conf ~/chroot/etc/&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/sh&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/ln&lt;br /&gt;
 sudo chroot ~/chroot/ /bin/sh&lt;br /&gt;
&lt;br /&gt;
This creates a simple chroot enviroment which we will expand through all commands included in busybox.&lt;br /&gt;
 for i in $(busybox --list);do ln -s /bin/busybox /usr/bin/$i;done&lt;br /&gt;
&lt;br /&gt;
===Using a livecd===&lt;br /&gt;
WIP&lt;br /&gt;
&lt;br /&gt;
===Using a stage3 tar archive===&lt;br /&gt;
Select a mirror from http://www.gentoo.org/main/en/mirrors2.xml , switch to /releases/x86/current-stage3/ and download the latest tar ball (for me stage3-i686-20120124.tar.bz2 ).&lt;br /&gt;
 wget http://de-mirror.org/gentoo/releases/x86/current-stage3/stage3-i686-20120124.tar.bz2&lt;br /&gt;
 mkdir ~/chroot&lt;br /&gt;
 tar xfj stage3-i686-*.tar.bz2 -C ~/chroot&lt;br /&gt;
 sudo chroot ~/chroot&lt;br /&gt;
And voila you got your working gentoo chroot.&amp;lt;br&amp;gt;&lt;br /&gt;
You can now take a look at http://www.gentoo.org/doc/en/?catid=desktop to find out how you can configure and install your system or simply extract/copy the program you need to run in your chroot enviroment and execute it.&lt;br /&gt;
&lt;br /&gt;
===Using Archlinux or Debian===&lt;br /&gt;
====Archlinux====&lt;br /&gt;
WIP&lt;br /&gt;
====Debian====&lt;br /&gt;
Use the provided debootstrap package to create the Debian chroot. --arch is optional depending of your needs.&amp;lt;br&amp;gt;&lt;br /&gt;
On linux-grsec kernel you&#039;ll need to relax chroot limitations.&lt;br /&gt;
&lt;br /&gt;
  sudo apk add debootstrap&lt;br /&gt;
  for i in /proc/sys/kernel/grsecurity/chroot_*; do echo 0 | sudo tee $i; done&lt;br /&gt;
  mkdir ~/chroot&lt;br /&gt;
  sudo debootstrap --arch=i386 wheezy ~/chroot http://http.debian.net/debian/&lt;br /&gt;
  for i in /proc/sys/kernel/grsecurity/chroot_*; do echo 1 | sudo tee $i; done&lt;br /&gt;
  sudo chroot ~/chroot /bin/bash&lt;br /&gt;
&lt;br /&gt;
You can now use apt-get to install needed packages.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
===Source Dedicated Server===&lt;br /&gt;
Here is an easy example of how you can run http://www.srcds.com in a simple busybox chroot.&amp;lt;br&amp;gt;&lt;br /&gt;
For this server you will only need the basic chroot and a advanced tar version (the busybox version is not sufficient because of the missing -U command).&amp;lt;br&amp;gt;&lt;br /&gt;
 wget http://www.archlinux.org/packages/community/i686/busybox/download/ -O busybox.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/glibc/download/ -O glibc.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/tar/download/ -O tar.pkg.tar.xz&lt;br /&gt;
 mkdir -p ~/chroot/usr/bin/ ~/chroot/{dev,proc,root,etc}&lt;br /&gt;
 for i in *.pkg.tar.xz;do&lt;br /&gt;
 bsdtar xfJ $i -C ~/chroot&lt;br /&gt;
 done&lt;br /&gt;
 cp /etc/resolv.conf ~/chroot/etc/&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/sh&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/ln&lt;br /&gt;
 sudo chroot ~/chroot/ /bin/sh&lt;br /&gt;
Now that you are in a working chroot you can download the server and install it.You just have to execute the following self explaining commands.&lt;br /&gt;
 mkdir ~/work&lt;br /&gt;
 cd ~/work&lt;br /&gt;
 busybox wget http://www.steampowered.com/download/hldsupdatetool.bin&lt;br /&gt;
 chmod +x hldsupdatetool.bin&lt;br /&gt;
 ln -s /bin/busybox ./uncompress&lt;br /&gt;
 cp /bin/tar . #right now executing programs from $PATH is buggy soon to be fixed (no bug in busybox but in my script)&lt;br /&gt;
 ./hdsupdatetool.bin #you can accept it or not ;)&lt;br /&gt;
 ./steam&lt;br /&gt;
 ./steam&lt;br /&gt;
And you should have a working chroot with srcds installed in it.&amp;lt;br&amp;gt;&lt;br /&gt;
If you think you are clever or elegant you can use the server with a bash script.&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 chroot ~/chroot /root/work/steam $@&lt;br /&gt;
Just save it (in your alpine installation) under /usr/bin/steam do a chmod +x /usr/bin/steam and have phun.&amp;lt;br&amp;gt;&lt;br /&gt;
WARNING:&amp;lt;br&amp;gt;&lt;br /&gt;
This script would let steam run with root priviliges.This is not recommended.&lt;br /&gt;
&lt;br /&gt;
===MegaCli===&lt;br /&gt;
So let&#039;s run MegaCli in a chroot to shall we? ;)&amp;lt;br&amp;gt;&lt;br /&gt;
First we set up a uclibc chroot :)&amp;lt;br&amp;gt;&lt;br /&gt;
MegaCli needs more than just glibc it needs ncurses and the gcc-libs.&lt;br /&gt;
 wget http://www.archlinux.org/packages/community/i686/busybox/download/ -O busybox.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/glibc/download/ -O glibc.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/ncurses/download/ -O ncurses.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/gcc-libs/download/ -O gcc-libs.pkg.tar.xz&lt;br /&gt;
 mkdir -p ~/chroot/usr/bin/ ~/chroot/{dev,proc,root,etc,sys}&lt;br /&gt;
 cp /etc/resolv.conf ~/chroot/etc/&lt;br /&gt;
 for i in *.pkg.tar.xz;do&lt;br /&gt;
 bsdtar xfJ $i -C ~/chroot&lt;br /&gt;
 done&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/sh&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/ln&lt;br /&gt;
&lt;br /&gt;
After this we visit this site http://www.lsi.com/downloads/Public/MegaRAID%20Common%20Files/8.02.16_MegaCLI.zip and download 8.02.16_MegaCLI.zip.&amp;lt;br&amp;gt;&lt;br /&gt;
 mkdir tmp&lt;br /&gt;
 cd tmp&lt;br /&gt;
 unzip ../8.02.16_MegaCLI.zip&lt;br /&gt;
 cd LINUX&lt;br /&gt;
 unzip MegaCliLin.zip&lt;br /&gt;
 #Now comes code stolen from rpm2cpio&lt;br /&gt;
 o=`expr 96 + 8`&lt;br /&gt;
 set `od -j $o -N 8 -t u1 MegaCli-8.02.16-1.i386.rpm`&lt;br /&gt;
 il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`&lt;br /&gt;
 dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`&lt;br /&gt;
 sigsize=`expr 8 + 16 \* $il + $dl`&lt;br /&gt;
 o=`expr $o + $sigsize + \( 8 - \( $sigsize \% 8 \) \) \% 8 + 8`&lt;br /&gt;
 set `od -j $o -N 8 -t u1 MegaCli-8.02.16-1.i386.rpm`&lt;br /&gt;
 il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`&lt;br /&gt;
 dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`&lt;br /&gt;
 hdrsize=`expr 8 + 16 \* $il + $dl`&lt;br /&gt;
 o=`expr $o + $hdrsize`&lt;br /&gt;
 dd if=MegaCli-8.02.16-1.i386.rpm ibs=$o skip=1 2&amp;gt;/dev/null |bsdtar -xf -&lt;br /&gt;
 #wow ...&lt;br /&gt;
 rm opt/MegaRAID/MegaCli/MegaCli64 # who needs 64bit?&lt;br /&gt;
 cp -r opt/ ~/chroot/&lt;br /&gt;
Now we got a working MegaCli client in our chroot.&amp;lt;br&amp;gt;&lt;br /&gt;
Like with srcds we don&#039;t want to operate from inside the chroot so here is a little script that should ease you up. (use at your own risk)&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 user=$(whoami)&lt;br /&gt;
 if [ &amp;quot;$user&amp;quot; != &amp;quot;root&amp;quot; ];then&lt;br /&gt;
 echo &amp;quot;This script needs root access&amp;quot;&lt;br /&gt;
 exit&lt;br /&gt;
 fi&lt;br /&gt;
 mount -t proc proc ~/chroot/proc/&lt;br /&gt;
 mount --bind /dev/ ~/chroot/dev/&lt;br /&gt;
 mount --bind /sys/ ~/chroot/sys/&lt;br /&gt;
 #we may need dev and maybe proc too to use this program&lt;br /&gt;
 chroot ~/chroot /opt/MegaRAID/MegaCli/MegaCli $@&lt;br /&gt;
 umount ~/chroot/proc&lt;br /&gt;
 umount ~/chroot/dev&lt;br /&gt;
 umount ~/chroot/sys&lt;br /&gt;
Save it under /usr/bin/MegaCli .Do a chmod +x /usr/bin/MegaCli and good luck.&lt;br /&gt;
Hf&lt;br /&gt;
PS&lt;br /&gt;
This method takes around 50mb.If you need something smaller you can strip a few files from glibc (not recommended) or work on a squashfs.&amp;lt;br&amp;gt;&lt;br /&gt;
With&lt;br /&gt;
 mksquashfs ~/chroot/ /chroot.sfs -b 65536&lt;br /&gt;
you can create a squashfs that is around 15mb small.When you add an unionfs layer you can even use it with write access or you can bind some dirs to the writeable dirs before you chroot into it.&amp;lt;br&amp;gt;&lt;br /&gt;
I will look into it later on.&amp;lt;br&amp;gt;&lt;br /&gt;
You can save the chroot in another dir than your home dir and you an even install a chroot through a APKBUILD (after someone wrote it).&amp;lt;br&amp;gt;&lt;br /&gt;
Through this you could use many glibc dependend programs through one chroot, but be aware that running programs like this should not be standard but only be used in extreme situations like for _closed source_ tools linked against glibc.&lt;br /&gt;
&lt;br /&gt;
===Skype on Debian chroot===&lt;br /&gt;
WIP - Not yet validated&amp;lt;br&amp;gt;&lt;br /&gt;
This is an example on how to run Skype from a Debian 32b chroot.&lt;br /&gt;
  sudo chroot ~/chroot&lt;br /&gt;
  wget http://www.skype.com/go/getskype-linux-deb&lt;br /&gt;
  dpkg -i getskype-linux-deb&lt;br /&gt;
To fix missings deps you&#039;ll want to use:&lt;br /&gt;
  apt-get -f install&lt;br /&gt;
Then exit the chroot&lt;br /&gt;
  exit&lt;br /&gt;
Fix PAX flags on Skype binary - linux-grsec only.&amp;lt;br&amp;gt;&lt;br /&gt;
ELF marking with paxctl cannot be used cause Skype binary refuses to run if modified&amp;lt;br&amp;gt;&lt;br /&gt;
CONFIG_PAX_XATTR_PAX_FLAGS is NOT yet available in linux-grsec&lt;br /&gt;
  sudo apk add attr&lt;br /&gt;
  sudo setfattr -n user.pax.flags -v &amp;quot;em&amp;quot; ~/chroot/usr/bin/skype&lt;br /&gt;
Mount needed directories in the chroot read-only to limit access to the system devices.&amp;lt;br&amp;gt;&lt;br /&gt;
Give write access to /dev/v4l and /dev/snd to let Skype use webcam device - Skype is not compatible with Alsa anymore and requires Pulseaudio running.&lt;br /&gt;
  sudo mount -o bind /proc ~/chroot/proc&lt;br /&gt;
  sudo mount -o bind,ro,remount /proc ~/chroot/proc&lt;br /&gt;
  sudo mount -o bind /sys ~/chroot/sys&lt;br /&gt;
  sudo mount -o bind,ro,remount /sys ~/chroot/sys&lt;br /&gt;
  sudo mount -o bind /dev ~/chroot/dev&lt;br /&gt;
  sudo mount -o bind,ro,remount /dev ~/chroot/dev&lt;br /&gt;
  sudo mount -o bind /dev/v4l ~/chroot/dev/v4l&lt;br /&gt;
  sudo mount -t tmpfs -o nodev,nosuid,noexec shm $CHROOT_PATH/dev/shm&lt;br /&gt;
Enter the chroot and create a user&lt;br /&gt;
  sudo chroot ~/chroot&lt;br /&gt;
  useradd -G audio,video &amp;lt;username&amp;gt;&lt;br /&gt;
  exit&lt;br /&gt;
Then run skype as your newly created user&lt;br /&gt;
  sudo chroot ~/chroot /bin/su - &amp;lt;username&amp;gt; -c /usr/bin/skype&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Coredumb</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Software_management&amp;diff=10575</id>
		<title>Software management</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Software_management&amp;diff=10575"/>
		<updated>2015-03-23T13:41:50Z</updated>

		<summary type="html">&lt;p&gt;Coredumb: /* Skype on Debian chroot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Draft}}&lt;br /&gt;
&lt;br /&gt;
If you want to run glibc programs under alpine there are a few ways to do so.You could install glibc additional to uclibc (you would have to do this manualy) or you could do the easy way and use a chroot.&amp;lt;br&amp;gt;&lt;br /&gt;
Because there are different usecases I want to give a slight overview about what&#039;s possible and what is intelligent.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Your options==&lt;br /&gt;
===Using Busybox===&lt;br /&gt;
First the most simple approach for setting up a chroot is using a glibc build of busybox.&amp;lt;br&amp;gt;&lt;br /&gt;
This approach has just a few downsides:&amp;lt;br&amp;gt;&lt;br /&gt;
- You have to link most /bin/ and /usr/bin program against /bin/busybox and some busybox builds break if you don&#039;t configure it right.&amp;lt;br&amp;gt;&lt;br /&gt;
- You have to manually download every library you need for your program manually.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
But if you want a small enviroment for one simple use case this is the solution you want.&lt;br /&gt;
&lt;br /&gt;
===Using a livecd===&lt;br /&gt;
If you prefer any special distri you can always download and extract a livecd and use it as a chroot enviroment.&lt;br /&gt;
&lt;br /&gt;
===Using a stage3 gentoo archive===&lt;br /&gt;
This is the fastest approach and you have the advantage of controlling which package version of which library you will install.&amp;lt;br&amp;gt;&lt;br /&gt;
Drawbacks are as follow:&amp;lt;br&amp;gt;&lt;br /&gt;
- Big build.You have to install a portage tree which uses up a lot of space.(It&#039;s not 100% necessary if you don&#039;t have to install any additional content you don&#039;t need it)&amp;lt;br&amp;gt;&lt;br /&gt;
- On slow mashines not recommended because you have to compile your packages.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Using Archlinux or Debian===&lt;br /&gt;
If you want a nice running system you can install Arch or Debian in a chroot.This approach isn&#039;t as easily executed as the other alternatives, but are in my opinion the cleanest and most recommended for the every day user.&lt;br /&gt;
&lt;br /&gt;
==How to do it==&lt;br /&gt;
Like I said this is just a quick draft so here it comes.&lt;br /&gt;
===Using Busybox===&lt;br /&gt;
First we need to download busybox.You can choose any of your favourit distros to download a prebuild version.I for instance would use Archlinux packages from http://www.archlinux.org/packages/community/i686/busybox/.&amp;lt;br&amp;gt;&lt;br /&gt;
 wget http://www.archlinux.org/packages/community/i686/busybox/download/ -O busybox.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/glibc/download/ -O glibc.pkg.tar.xz&lt;br /&gt;
 mkdir -p ~/chroot/usr/bin/ ~/chroot/{dev,proc,root,etc}&lt;br /&gt;
 for i in *.pkg.tar.xz;do&lt;br /&gt;
 bsdtar xfJ $i -C ~/chroot&lt;br /&gt;
 done&lt;br /&gt;
 cp /etc/resolv.conf ~/chroot/etc/&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/sh&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/ln&lt;br /&gt;
 sudo chroot ~/chroot/ /bin/sh&lt;br /&gt;
&lt;br /&gt;
This creates a simple chroot enviroment which we will expand through all commands included in busybox.&lt;br /&gt;
 for i in $(busybox --list);do ln -s /bin/busybox /usr/bin/$i;done&lt;br /&gt;
&lt;br /&gt;
===Using a livecd===&lt;br /&gt;
WIP&lt;br /&gt;
&lt;br /&gt;
===Using a stage3 tar archive===&lt;br /&gt;
Select a mirror from http://www.gentoo.org/main/en/mirrors2.xml , switch to /releases/x86/current-stage3/ and download the latest tar ball (for me stage3-i686-20120124.tar.bz2 ).&lt;br /&gt;
 wget http://de-mirror.org/gentoo/releases/x86/current-stage3/stage3-i686-20120124.tar.bz2&lt;br /&gt;
 mkdir ~/chroot&lt;br /&gt;
 tar xfj stage3-i686-*.tar.bz2 -C ~/chroot&lt;br /&gt;
 sudo chroot ~/chroot&lt;br /&gt;
And voila you got your working gentoo chroot.&amp;lt;br&amp;gt;&lt;br /&gt;
You can now take a look at http://www.gentoo.org/doc/en/?catid=desktop to find out how you can configure and install your system or simply extract/copy the program you need to run in your chroot enviroment and execute it.&lt;br /&gt;
&lt;br /&gt;
===Using Archlinux or Debian===&lt;br /&gt;
====Archlinux====&lt;br /&gt;
WIP&lt;br /&gt;
====Debian====&lt;br /&gt;
Use the provided debootstrap package to create the Debian chroot. --arch is optional depending of your needs.&amp;lt;br&amp;gt;&lt;br /&gt;
On linux-grsec kernel you&#039;ll need to relax chroot limitations.&lt;br /&gt;
&lt;br /&gt;
  sudo apk add debootstrap&lt;br /&gt;
  for i in /proc/sys/kernel/grsecurity/chroot_*; do echo 0 | sudo tee $i; done&lt;br /&gt;
  mkdir ~/chroot&lt;br /&gt;
  sudo debootstrap --arch=i386 wheezy ./chroot http://http.debian.net/debian/&lt;br /&gt;
  for i in /proc/sys/kernel/grsecurity/chroot_*; do echo 1 | sudo tee $i; done&lt;br /&gt;
  sudo chroot ~/chroot /bin/bash&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You can now use apt-get to install needed packages.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
===Source Dedicated Server===&lt;br /&gt;
Here is an easy example of how you can run http://www.srcds.com in a simple busybox chroot.&amp;lt;br&amp;gt;&lt;br /&gt;
For this server you will only need the basic chroot and a advanced tar version (the busybox version is not sufficient because of the missing -U command).&amp;lt;br&amp;gt;&lt;br /&gt;
 wget http://www.archlinux.org/packages/community/i686/busybox/download/ -O busybox.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/glibc/download/ -O glibc.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/tar/download/ -O tar.pkg.tar.xz&lt;br /&gt;
 mkdir -p ~/chroot/usr/bin/ ~/chroot/{dev,proc,root,etc}&lt;br /&gt;
 for i in *.pkg.tar.xz;do&lt;br /&gt;
 bsdtar xfJ $i -C ~/chroot&lt;br /&gt;
 done&lt;br /&gt;
 cp /etc/resolv.conf ~/chroot/etc/&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/sh&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/ln&lt;br /&gt;
 sudo chroot ~/chroot/ /bin/sh&lt;br /&gt;
Now that you are in a working chroot you can download the server and install it.You just have to execute the following self explaining commands.&lt;br /&gt;
 mkdir ~/work&lt;br /&gt;
 cd ~/work&lt;br /&gt;
 busybox wget http://www.steampowered.com/download/hldsupdatetool.bin&lt;br /&gt;
 chmod +x hldsupdatetool.bin&lt;br /&gt;
 ln -s /bin/busybox ./uncompress&lt;br /&gt;
 cp /bin/tar . #right now executing programs from $PATH is buggy soon to be fixed (no bug in busybox but in my script)&lt;br /&gt;
 ./hdsupdatetool.bin #you can accept it or not ;)&lt;br /&gt;
 ./steam&lt;br /&gt;
 ./steam&lt;br /&gt;
And you should have a working chroot with srcds installed in it.&amp;lt;br&amp;gt;&lt;br /&gt;
If you think you are clever or elegant you can use the server with a bash script.&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 chroot ~/chroot /root/work/steam $@&lt;br /&gt;
Just save it (in your alpine installation) under /usr/bin/steam do a chmod +x /usr/bin/steam and have phun.&amp;lt;br&amp;gt;&lt;br /&gt;
WARNING:&amp;lt;br&amp;gt;&lt;br /&gt;
This script would let steam run with root priviliges.This is not recommended.&lt;br /&gt;
&lt;br /&gt;
===MegaCli===&lt;br /&gt;
So let&#039;s run MegaCli in a chroot to shall we? ;)&amp;lt;br&amp;gt;&lt;br /&gt;
First we set up a uclibc chroot :)&amp;lt;br&amp;gt;&lt;br /&gt;
MegaCli needs more than just glibc it needs ncurses and the gcc-libs.&lt;br /&gt;
 wget http://www.archlinux.org/packages/community/i686/busybox/download/ -O busybox.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/glibc/download/ -O glibc.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/ncurses/download/ -O ncurses.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/gcc-libs/download/ -O gcc-libs.pkg.tar.xz&lt;br /&gt;
 mkdir -p ~/chroot/usr/bin/ ~/chroot/{dev,proc,root,etc,sys}&lt;br /&gt;
 cp /etc/resolv.conf ~/chroot/etc/&lt;br /&gt;
 for i in *.pkg.tar.xz;do&lt;br /&gt;
 bsdtar xfJ $i -C ~/chroot&lt;br /&gt;
 done&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/sh&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/ln&lt;br /&gt;
&lt;br /&gt;
After this we visit this site http://www.lsi.com/downloads/Public/MegaRAID%20Common%20Files/8.02.16_MegaCLI.zip and download 8.02.16_MegaCLI.zip.&amp;lt;br&amp;gt;&lt;br /&gt;
 mkdir tmp&lt;br /&gt;
 cd tmp&lt;br /&gt;
 unzip ../8.02.16_MegaCLI.zip&lt;br /&gt;
 cd LINUX&lt;br /&gt;
 unzip MegaCliLin.zip&lt;br /&gt;
 #Now comes code stolen from rpm2cpio&lt;br /&gt;
 o=`expr 96 + 8`&lt;br /&gt;
 set `od -j $o -N 8 -t u1 MegaCli-8.02.16-1.i386.rpm`&lt;br /&gt;
 il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`&lt;br /&gt;
 dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`&lt;br /&gt;
 sigsize=`expr 8 + 16 \* $il + $dl`&lt;br /&gt;
 o=`expr $o + $sigsize + \( 8 - \( $sigsize \% 8 \) \) \% 8 + 8`&lt;br /&gt;
 set `od -j $o -N 8 -t u1 MegaCli-8.02.16-1.i386.rpm`&lt;br /&gt;
 il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`&lt;br /&gt;
 dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`&lt;br /&gt;
 hdrsize=`expr 8 + 16 \* $il + $dl`&lt;br /&gt;
 o=`expr $o + $hdrsize`&lt;br /&gt;
 dd if=MegaCli-8.02.16-1.i386.rpm ibs=$o skip=1 2&amp;gt;/dev/null |bsdtar -xf -&lt;br /&gt;
 #wow ...&lt;br /&gt;
 rm opt/MegaRAID/MegaCli/MegaCli64 # who needs 64bit?&lt;br /&gt;
 cp -r opt/ ~/chroot/&lt;br /&gt;
Now we got a working MegaCli client in our chroot.&amp;lt;br&amp;gt;&lt;br /&gt;
Like with srcds we don&#039;t want to operate from inside the chroot so here is a little script that should ease you up. (use at your own risk)&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 user=$(whoami)&lt;br /&gt;
 if [ &amp;quot;$user&amp;quot; != &amp;quot;root&amp;quot; ];then&lt;br /&gt;
 echo &amp;quot;This script needs root access&amp;quot;&lt;br /&gt;
 exit&lt;br /&gt;
 fi&lt;br /&gt;
 mount -t proc proc ~/chroot/proc/&lt;br /&gt;
 mount --bind /dev/ ~/chroot/dev/&lt;br /&gt;
 mount --bind /sys/ ~/chroot/sys/&lt;br /&gt;
 #we may need dev and maybe proc too to use this program&lt;br /&gt;
 chroot ~/chroot /opt/MegaRAID/MegaCli/MegaCli $@&lt;br /&gt;
 umount ~/chroot/proc&lt;br /&gt;
 umount ~/chroot/dev&lt;br /&gt;
 umount ~/chroot/sys&lt;br /&gt;
Save it under /usr/bin/MegaCli .Do a chmod +x /usr/bin/MegaCli and good luck.&lt;br /&gt;
Hf&lt;br /&gt;
PS&lt;br /&gt;
This method takes around 50mb.If you need something smaller you can strip a few files from glibc (not recommended) or work on a squashfs.&amp;lt;br&amp;gt;&lt;br /&gt;
With&lt;br /&gt;
 mksquashfs ~/chroot/ /chroot.sfs -b 65536&lt;br /&gt;
you can create a squashfs that is around 15mb small.When you add an unionfs layer you can even use it with write access or you can bind some dirs to the writeable dirs before you chroot into it.&amp;lt;br&amp;gt;&lt;br /&gt;
I will look into it later on.&amp;lt;br&amp;gt;&lt;br /&gt;
You can save the chroot in another dir than your home dir and you an even install a chroot through a APKBUILD (after someone wrote it).&amp;lt;br&amp;gt;&lt;br /&gt;
Through this you could use many glibc dependend programs through one chroot, but be aware that running programs like this should not be standard but only be used in extreme situations like for _closed source_ tools linked against glibc.&lt;br /&gt;
&lt;br /&gt;
===Skype on Debian chroot===&lt;br /&gt;
WIP - Not yet validated&amp;lt;br&amp;gt;&lt;br /&gt;
This is an example on how to run Skype from a Debian 32b chroot.&lt;br /&gt;
  sudo chroot ~/chroot&lt;br /&gt;
  wget http://www.skype.com/go/getskype-linux-deb&lt;br /&gt;
  dpkg -i getskype-linux-deb&lt;br /&gt;
To fix missings deps you&#039;ll want to use:&lt;br /&gt;
  apt-get -f install&lt;br /&gt;
Then exit the chroot&lt;br /&gt;
  exit&lt;br /&gt;
Fix PAX flags on Skype binary - linux-grsec only.&amp;lt;br&amp;gt;&lt;br /&gt;
ELF marking with paxctl cannot be used cause Skype binary refuses to run if modified&amp;lt;br&amp;gt;&lt;br /&gt;
CONFIG_PAX_XATTR_PAX_FLAGS is NOT yet available in linux-grsec&lt;br /&gt;
  sudo apk add attr&lt;br /&gt;
  sudo setfattr -n user.pax.flags -v &amp;quot;em&amp;quot; ~/chroot/usr/bin/skype&lt;br /&gt;
Mount needed directories in the chroot read-only to limit access to the system devices.&amp;lt;br&amp;gt;&lt;br /&gt;
Give write access to /dev/v4l and /dev/snd to let Skype use sound and webcam devices&lt;br /&gt;
  sudo mount -o bind /proc ~/chroot/proc&lt;br /&gt;
  sudo mount -o bind,ro,remount /proc ~/chroot/proc&lt;br /&gt;
  sudo mount -o bind /sys ~/chroot/sys&lt;br /&gt;
  sudo mount -o bind,ro,remount /sys ~/chroot/sys&lt;br /&gt;
  sudo mount -o bind /dev ~/chroot/dev&lt;br /&gt;
  sudo mount -o bind,ro,remount /dev ~/chroot/dev&lt;br /&gt;
  sudo mount -o bind /dev/v4l ~/chroot/dev/v4l&lt;br /&gt;
  sudo mount -o bind /dev/snd ~/chroot/dev/snd&lt;br /&gt;
Enter the chroot and create a user&lt;br /&gt;
  sudo chroot ~/chroot&lt;br /&gt;
  useradd -G audio,video &amp;lt;username&amp;gt;&lt;br /&gt;
  exit&lt;br /&gt;
Then run skype as your newly created user&lt;br /&gt;
  sudo chroot ~/chroot /bin/su - &amp;lt;username&amp;gt; -c /usr/bin/skype&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Coredumb</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Software_management&amp;diff=10574</id>
		<title>Software management</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Software_management&amp;diff=10574"/>
		<updated>2015-03-23T12:50:08Z</updated>

		<summary type="html">&lt;p&gt;Coredumb: /* Skype on Debian chroot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Draft}}&lt;br /&gt;
&lt;br /&gt;
If you want to run glibc programs under alpine there are a few ways to do so.You could install glibc additional to uclibc (you would have to do this manualy) or you could do the easy way and use a chroot.&amp;lt;br&amp;gt;&lt;br /&gt;
Because there are different usecases I want to give a slight overview about what&#039;s possible and what is intelligent.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Your options==&lt;br /&gt;
===Using Busybox===&lt;br /&gt;
First the most simple approach for setting up a chroot is using a glibc build of busybox.&amp;lt;br&amp;gt;&lt;br /&gt;
This approach has just a few downsides:&amp;lt;br&amp;gt;&lt;br /&gt;
- You have to link most /bin/ and /usr/bin program against /bin/busybox and some busybox builds break if you don&#039;t configure it right.&amp;lt;br&amp;gt;&lt;br /&gt;
- You have to manually download every library you need for your program manually.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
But if you want a small enviroment for one simple use case this is the solution you want.&lt;br /&gt;
&lt;br /&gt;
===Using a livecd===&lt;br /&gt;
If you prefer any special distri you can always download and extract a livecd and use it as a chroot enviroment.&lt;br /&gt;
&lt;br /&gt;
===Using a stage3 gentoo archive===&lt;br /&gt;
This is the fastest approach and you have the advantage of controlling which package version of which library you will install.&amp;lt;br&amp;gt;&lt;br /&gt;
Drawbacks are as follow:&amp;lt;br&amp;gt;&lt;br /&gt;
- Big build.You have to install a portage tree which uses up a lot of space.(It&#039;s not 100% necessary if you don&#039;t have to install any additional content you don&#039;t need it)&amp;lt;br&amp;gt;&lt;br /&gt;
- On slow mashines not recommended because you have to compile your packages.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Using Archlinux or Debian===&lt;br /&gt;
If you want a nice running system you can install Arch or Debian in a chroot.This approach isn&#039;t as easily executed as the other alternatives, but are in my opinion the cleanest and most recommended for the every day user.&lt;br /&gt;
&lt;br /&gt;
==How to do it==&lt;br /&gt;
Like I said this is just a quick draft so here it comes.&lt;br /&gt;
===Using Busybox===&lt;br /&gt;
First we need to download busybox.You can choose any of your favourit distros to download a prebuild version.I for instance would use Archlinux packages from http://www.archlinux.org/packages/community/i686/busybox/.&amp;lt;br&amp;gt;&lt;br /&gt;
 wget http://www.archlinux.org/packages/community/i686/busybox/download/ -O busybox.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/glibc/download/ -O glibc.pkg.tar.xz&lt;br /&gt;
 mkdir -p ~/chroot/usr/bin/ ~/chroot/{dev,proc,root,etc}&lt;br /&gt;
 for i in *.pkg.tar.xz;do&lt;br /&gt;
 bsdtar xfJ $i -C ~/chroot&lt;br /&gt;
 done&lt;br /&gt;
 cp /etc/resolv.conf ~/chroot/etc/&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/sh&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/ln&lt;br /&gt;
 sudo chroot ~/chroot/ /bin/sh&lt;br /&gt;
&lt;br /&gt;
This creates a simple chroot enviroment which we will expand through all commands included in busybox.&lt;br /&gt;
 for i in $(busybox --list);do ln -s /bin/busybox /usr/bin/$i;done&lt;br /&gt;
&lt;br /&gt;
===Using a livecd===&lt;br /&gt;
WIP&lt;br /&gt;
&lt;br /&gt;
===Using a stage3 tar archive===&lt;br /&gt;
Select a mirror from http://www.gentoo.org/main/en/mirrors2.xml , switch to /releases/x86/current-stage3/ and download the latest tar ball (for me stage3-i686-20120124.tar.bz2 ).&lt;br /&gt;
 wget http://de-mirror.org/gentoo/releases/x86/current-stage3/stage3-i686-20120124.tar.bz2&lt;br /&gt;
 mkdir ~/chroot&lt;br /&gt;
 tar xfj stage3-i686-*.tar.bz2 -C ~/chroot&lt;br /&gt;
 sudo chroot ~/chroot&lt;br /&gt;
And voila you got your working gentoo chroot.&amp;lt;br&amp;gt;&lt;br /&gt;
You can now take a look at http://www.gentoo.org/doc/en/?catid=desktop to find out how you can configure and install your system or simply extract/copy the program you need to run in your chroot enviroment and execute it.&lt;br /&gt;
&lt;br /&gt;
===Using Archlinux or Debian===&lt;br /&gt;
====Archlinux====&lt;br /&gt;
WIP&lt;br /&gt;
====Debian====&lt;br /&gt;
Use the provided debootstrap package to create the Debian chroot. --arch is optional depending of your needs.&amp;lt;br&amp;gt;&lt;br /&gt;
On linux-grsec kernel you&#039;ll need to relax chroot limitations.&lt;br /&gt;
&lt;br /&gt;
  sudo apk add debootstrap&lt;br /&gt;
  for i in /proc/sys/kernel/grsecurity/chroot_*; do echo 0 | sudo tee $i; done&lt;br /&gt;
  mkdir ~/chroot&lt;br /&gt;
  sudo debootstrap --arch=i386 wheezy ./chroot http://http.debian.net/debian/&lt;br /&gt;
  for i in /proc/sys/kernel/grsecurity/chroot_*; do echo 1 | sudo tee $i; done&lt;br /&gt;
  sudo chroot ~/chroot /bin/bash&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You can now use apt-get to install needed packages.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
===Source Dedicated Server===&lt;br /&gt;
Here is an easy example of how you can run http://www.srcds.com in a simple busybox chroot.&amp;lt;br&amp;gt;&lt;br /&gt;
For this server you will only need the basic chroot and a advanced tar version (the busybox version is not sufficient because of the missing -U command).&amp;lt;br&amp;gt;&lt;br /&gt;
 wget http://www.archlinux.org/packages/community/i686/busybox/download/ -O busybox.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/glibc/download/ -O glibc.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/tar/download/ -O tar.pkg.tar.xz&lt;br /&gt;
 mkdir -p ~/chroot/usr/bin/ ~/chroot/{dev,proc,root,etc}&lt;br /&gt;
 for i in *.pkg.tar.xz;do&lt;br /&gt;
 bsdtar xfJ $i -C ~/chroot&lt;br /&gt;
 done&lt;br /&gt;
 cp /etc/resolv.conf ~/chroot/etc/&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/sh&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/ln&lt;br /&gt;
 sudo chroot ~/chroot/ /bin/sh&lt;br /&gt;
Now that you are in a working chroot you can download the server and install it.You just have to execute the following self explaining commands.&lt;br /&gt;
 mkdir ~/work&lt;br /&gt;
 cd ~/work&lt;br /&gt;
 busybox wget http://www.steampowered.com/download/hldsupdatetool.bin&lt;br /&gt;
 chmod +x hldsupdatetool.bin&lt;br /&gt;
 ln -s /bin/busybox ./uncompress&lt;br /&gt;
 cp /bin/tar . #right now executing programs from $PATH is buggy soon to be fixed (no bug in busybox but in my script)&lt;br /&gt;
 ./hdsupdatetool.bin #you can accept it or not ;)&lt;br /&gt;
 ./steam&lt;br /&gt;
 ./steam&lt;br /&gt;
And you should have a working chroot with srcds installed in it.&amp;lt;br&amp;gt;&lt;br /&gt;
If you think you are clever or elegant you can use the server with a bash script.&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 chroot ~/chroot /root/work/steam $@&lt;br /&gt;
Just save it (in your alpine installation) under /usr/bin/steam do a chmod +x /usr/bin/steam and have phun.&amp;lt;br&amp;gt;&lt;br /&gt;
WARNING:&amp;lt;br&amp;gt;&lt;br /&gt;
This script would let steam run with root priviliges.This is not recommended.&lt;br /&gt;
&lt;br /&gt;
===MegaCli===&lt;br /&gt;
So let&#039;s run MegaCli in a chroot to shall we? ;)&amp;lt;br&amp;gt;&lt;br /&gt;
First we set up a uclibc chroot :)&amp;lt;br&amp;gt;&lt;br /&gt;
MegaCli needs more than just glibc it needs ncurses and the gcc-libs.&lt;br /&gt;
 wget http://www.archlinux.org/packages/community/i686/busybox/download/ -O busybox.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/glibc/download/ -O glibc.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/ncurses/download/ -O ncurses.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/gcc-libs/download/ -O gcc-libs.pkg.tar.xz&lt;br /&gt;
 mkdir -p ~/chroot/usr/bin/ ~/chroot/{dev,proc,root,etc,sys}&lt;br /&gt;
 cp /etc/resolv.conf ~/chroot/etc/&lt;br /&gt;
 for i in *.pkg.tar.xz;do&lt;br /&gt;
 bsdtar xfJ $i -C ~/chroot&lt;br /&gt;
 done&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/sh&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/ln&lt;br /&gt;
&lt;br /&gt;
After this we visit this site http://www.lsi.com/downloads/Public/MegaRAID%20Common%20Files/8.02.16_MegaCLI.zip and download 8.02.16_MegaCLI.zip.&amp;lt;br&amp;gt;&lt;br /&gt;
 mkdir tmp&lt;br /&gt;
 cd tmp&lt;br /&gt;
 unzip ../8.02.16_MegaCLI.zip&lt;br /&gt;
 cd LINUX&lt;br /&gt;
 unzip MegaCliLin.zip&lt;br /&gt;
 #Now comes code stolen from rpm2cpio&lt;br /&gt;
 o=`expr 96 + 8`&lt;br /&gt;
 set `od -j $o -N 8 -t u1 MegaCli-8.02.16-1.i386.rpm`&lt;br /&gt;
 il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`&lt;br /&gt;
 dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`&lt;br /&gt;
 sigsize=`expr 8 + 16 \* $il + $dl`&lt;br /&gt;
 o=`expr $o + $sigsize + \( 8 - \( $sigsize \% 8 \) \) \% 8 + 8`&lt;br /&gt;
 set `od -j $o -N 8 -t u1 MegaCli-8.02.16-1.i386.rpm`&lt;br /&gt;
 il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`&lt;br /&gt;
 dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`&lt;br /&gt;
 hdrsize=`expr 8 + 16 \* $il + $dl`&lt;br /&gt;
 o=`expr $o + $hdrsize`&lt;br /&gt;
 dd if=MegaCli-8.02.16-1.i386.rpm ibs=$o skip=1 2&amp;gt;/dev/null |bsdtar -xf -&lt;br /&gt;
 #wow ...&lt;br /&gt;
 rm opt/MegaRAID/MegaCli/MegaCli64 # who needs 64bit?&lt;br /&gt;
 cp -r opt/ ~/chroot/&lt;br /&gt;
Now we got a working MegaCli client in our chroot.&amp;lt;br&amp;gt;&lt;br /&gt;
Like with srcds we don&#039;t want to operate from inside the chroot so here is a little script that should ease you up. (use at your own risk)&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 user=$(whoami)&lt;br /&gt;
 if [ &amp;quot;$user&amp;quot; != &amp;quot;root&amp;quot; ];then&lt;br /&gt;
 echo &amp;quot;This script needs root access&amp;quot;&lt;br /&gt;
 exit&lt;br /&gt;
 fi&lt;br /&gt;
 mount -t proc proc ~/chroot/proc/&lt;br /&gt;
 mount --bind /dev/ ~/chroot/dev/&lt;br /&gt;
 mount --bind /sys/ ~/chroot/sys/&lt;br /&gt;
 #we may need dev and maybe proc too to use this program&lt;br /&gt;
 chroot ~/chroot /opt/MegaRAID/MegaCli/MegaCli $@&lt;br /&gt;
 umount ~/chroot/proc&lt;br /&gt;
 umount ~/chroot/dev&lt;br /&gt;
 umount ~/chroot/sys&lt;br /&gt;
Save it under /usr/bin/MegaCli .Do a chmod +x /usr/bin/MegaCli and good luck.&lt;br /&gt;
Hf&lt;br /&gt;
PS&lt;br /&gt;
This method takes around 50mb.If you need something smaller you can strip a few files from glibc (not recommended) or work on a squashfs.&amp;lt;br&amp;gt;&lt;br /&gt;
With&lt;br /&gt;
 mksquashfs ~/chroot/ /chroot.sfs -b 65536&lt;br /&gt;
you can create a squashfs that is around 15mb small.When you add an unionfs layer you can even use it with write access or you can bind some dirs to the writeable dirs before you chroot into it.&amp;lt;br&amp;gt;&lt;br /&gt;
I will look into it later on.&amp;lt;br&amp;gt;&lt;br /&gt;
You can save the chroot in another dir than your home dir and you an even install a chroot through a APKBUILD (after someone wrote it).&amp;lt;br&amp;gt;&lt;br /&gt;
Through this you could use many glibc dependend programs through one chroot, but be aware that running programs like this should not be standard but only be used in extreme situations like for _closed source_ tools linked against glibc.&lt;br /&gt;
&lt;br /&gt;
===Skype on Debian chroot===&lt;br /&gt;
WIP - Not yet validated&amp;lt;br&amp;gt;&lt;br /&gt;
This is an example on how to run Skype from a Debian 32b chroot.&lt;br /&gt;
  sudo chroot ~/chroot&lt;br /&gt;
  wget http://www.skype.com/go/getskype-linux-deb&lt;br /&gt;
  dpkg -i getskype-linux-deb&lt;br /&gt;
To fix missings deps you&#039;ll want to use:&lt;br /&gt;
  apt-get -f install&lt;br /&gt;
Then exit the chroot&lt;br /&gt;
  exit&lt;br /&gt;
Fix PAX flags on Skype binary - linux-grsec only&lt;br /&gt;
  sudo apk add paxctl&lt;br /&gt;
  sudo paxct -pemrxsc ~/chroot/usr/bin/skype&lt;br /&gt;
Mount needed directories in the chroot read-only to limit access to the system devices.&amp;lt;br&amp;gt;&lt;br /&gt;
Give write access to /dev/v4l and /dev/snd to let Skype use sound and webcam devices&lt;br /&gt;
  sudo mount -o bind /proc ~/chroot/proc&lt;br /&gt;
  sudo mount -o bind,ro,remount /proc ~/chroot/proc&lt;br /&gt;
  sudo mount -o bind /sys ~/chroot/sys&lt;br /&gt;
  sudo mount -o bind,ro,remount /sys ~/chroot/sys&lt;br /&gt;
  sudo mount -o bind /dev ~/chroot/dev&lt;br /&gt;
  sudo mount -o bind,ro,remount /dev ~/chroot/dev&lt;br /&gt;
  sudo mount -o bind /dev/v4l ~/chroot/dev/v4l&lt;br /&gt;
  sudo mount -o bind /dev/snd ~/chroot/dev/snd&lt;br /&gt;
Enter the chroot and create a user&lt;br /&gt;
  sudo chroot ~/chroot&lt;br /&gt;
  useradd -G audio,video &amp;lt;username&amp;gt;&lt;br /&gt;
  exit&lt;br /&gt;
Then run skype as your newly created user&lt;br /&gt;
  sudo chroot ~/chroot /bin/su - &amp;lt;username&amp;gt; -c /usr/bin/skype&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Coredumb</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Software_management&amp;diff=10573</id>
		<title>Software management</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Software_management&amp;diff=10573"/>
		<updated>2015-03-23T12:40:16Z</updated>

		<summary type="html">&lt;p&gt;Coredumb: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Draft}}&lt;br /&gt;
&lt;br /&gt;
If you want to run glibc programs under alpine there are a few ways to do so.You could install glibc additional to uclibc (you would have to do this manualy) or you could do the easy way and use a chroot.&amp;lt;br&amp;gt;&lt;br /&gt;
Because there are different usecases I want to give a slight overview about what&#039;s possible and what is intelligent.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Your options==&lt;br /&gt;
===Using Busybox===&lt;br /&gt;
First the most simple approach for setting up a chroot is using a glibc build of busybox.&amp;lt;br&amp;gt;&lt;br /&gt;
This approach has just a few downsides:&amp;lt;br&amp;gt;&lt;br /&gt;
- You have to link most /bin/ and /usr/bin program against /bin/busybox and some busybox builds break if you don&#039;t configure it right.&amp;lt;br&amp;gt;&lt;br /&gt;
- You have to manually download every library you need for your program manually.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
But if you want a small enviroment for one simple use case this is the solution you want.&lt;br /&gt;
&lt;br /&gt;
===Using a livecd===&lt;br /&gt;
If you prefer any special distri you can always download and extract a livecd and use it as a chroot enviroment.&lt;br /&gt;
&lt;br /&gt;
===Using a stage3 gentoo archive===&lt;br /&gt;
This is the fastest approach and you have the advantage of controlling which package version of which library you will install.&amp;lt;br&amp;gt;&lt;br /&gt;
Drawbacks are as follow:&amp;lt;br&amp;gt;&lt;br /&gt;
- Big build.You have to install a portage tree which uses up a lot of space.(It&#039;s not 100% necessary if you don&#039;t have to install any additional content you don&#039;t need it)&amp;lt;br&amp;gt;&lt;br /&gt;
- On slow mashines not recommended because you have to compile your packages.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Using Archlinux or Debian===&lt;br /&gt;
If you want a nice running system you can install Arch or Debian in a chroot.This approach isn&#039;t as easily executed as the other alternatives, but are in my opinion the cleanest and most recommended for the every day user.&lt;br /&gt;
&lt;br /&gt;
==How to do it==&lt;br /&gt;
Like I said this is just a quick draft so here it comes.&lt;br /&gt;
===Using Busybox===&lt;br /&gt;
First we need to download busybox.You can choose any of your favourit distros to download a prebuild version.I for instance would use Archlinux packages from http://www.archlinux.org/packages/community/i686/busybox/.&amp;lt;br&amp;gt;&lt;br /&gt;
 wget http://www.archlinux.org/packages/community/i686/busybox/download/ -O busybox.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/glibc/download/ -O glibc.pkg.tar.xz&lt;br /&gt;
 mkdir -p ~/chroot/usr/bin/ ~/chroot/{dev,proc,root,etc}&lt;br /&gt;
 for i in *.pkg.tar.xz;do&lt;br /&gt;
 bsdtar xfJ $i -C ~/chroot&lt;br /&gt;
 done&lt;br /&gt;
 cp /etc/resolv.conf ~/chroot/etc/&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/sh&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/ln&lt;br /&gt;
 sudo chroot ~/chroot/ /bin/sh&lt;br /&gt;
&lt;br /&gt;
This creates a simple chroot enviroment which we will expand through all commands included in busybox.&lt;br /&gt;
 for i in $(busybox --list);do ln -s /bin/busybox /usr/bin/$i;done&lt;br /&gt;
&lt;br /&gt;
===Using a livecd===&lt;br /&gt;
WIP&lt;br /&gt;
&lt;br /&gt;
===Using a stage3 tar archive===&lt;br /&gt;
Select a mirror from http://www.gentoo.org/main/en/mirrors2.xml , switch to /releases/x86/current-stage3/ and download the latest tar ball (for me stage3-i686-20120124.tar.bz2 ).&lt;br /&gt;
 wget http://de-mirror.org/gentoo/releases/x86/current-stage3/stage3-i686-20120124.tar.bz2&lt;br /&gt;
 mkdir ~/chroot&lt;br /&gt;
 tar xfj stage3-i686-*.tar.bz2 -C ~/chroot&lt;br /&gt;
 sudo chroot ~/chroot&lt;br /&gt;
And voila you got your working gentoo chroot.&amp;lt;br&amp;gt;&lt;br /&gt;
You can now take a look at http://www.gentoo.org/doc/en/?catid=desktop to find out how you can configure and install your system or simply extract/copy the program you need to run in your chroot enviroment and execute it.&lt;br /&gt;
&lt;br /&gt;
===Using Archlinux or Debian===&lt;br /&gt;
====Archlinux====&lt;br /&gt;
WIP&lt;br /&gt;
====Debian====&lt;br /&gt;
Use the provided debootstrap package to create the Debian chroot. --arch is optional depending of your needs.&amp;lt;br&amp;gt;&lt;br /&gt;
On linux-grsec kernel you&#039;ll need to relax chroot limitations.&lt;br /&gt;
&lt;br /&gt;
  sudo apk add debootstrap&lt;br /&gt;
  for i in /proc/sys/kernel/grsecurity/chroot_*; do echo 0 | sudo tee $i; done&lt;br /&gt;
  mkdir ~/chroot&lt;br /&gt;
  sudo debootstrap --arch=i386 wheezy ./chroot http://http.debian.net/debian/&lt;br /&gt;
  for i in /proc/sys/kernel/grsecurity/chroot_*; do echo 1 | sudo tee $i; done&lt;br /&gt;
  sudo chroot ~/chroot /bin/bash&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You can now use apt-get to install needed packages.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
===Source Dedicated Server===&lt;br /&gt;
Here is an easy example of how you can run http://www.srcds.com in a simple busybox chroot.&amp;lt;br&amp;gt;&lt;br /&gt;
For this server you will only need the basic chroot and a advanced tar version (the busybox version is not sufficient because of the missing -U command).&amp;lt;br&amp;gt;&lt;br /&gt;
 wget http://www.archlinux.org/packages/community/i686/busybox/download/ -O busybox.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/glibc/download/ -O glibc.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/tar/download/ -O tar.pkg.tar.xz&lt;br /&gt;
 mkdir -p ~/chroot/usr/bin/ ~/chroot/{dev,proc,root,etc}&lt;br /&gt;
 for i in *.pkg.tar.xz;do&lt;br /&gt;
 bsdtar xfJ $i -C ~/chroot&lt;br /&gt;
 done&lt;br /&gt;
 cp /etc/resolv.conf ~/chroot/etc/&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/sh&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/ln&lt;br /&gt;
 sudo chroot ~/chroot/ /bin/sh&lt;br /&gt;
Now that you are in a working chroot you can download the server and install it.You just have to execute the following self explaining commands.&lt;br /&gt;
 mkdir ~/work&lt;br /&gt;
 cd ~/work&lt;br /&gt;
 busybox wget http://www.steampowered.com/download/hldsupdatetool.bin&lt;br /&gt;
 chmod +x hldsupdatetool.bin&lt;br /&gt;
 ln -s /bin/busybox ./uncompress&lt;br /&gt;
 cp /bin/tar . #right now executing programs from $PATH is buggy soon to be fixed (no bug in busybox but in my script)&lt;br /&gt;
 ./hdsupdatetool.bin #you can accept it or not ;)&lt;br /&gt;
 ./steam&lt;br /&gt;
 ./steam&lt;br /&gt;
And you should have a working chroot with srcds installed in it.&amp;lt;br&amp;gt;&lt;br /&gt;
If you think you are clever or elegant you can use the server with a bash script.&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 chroot ~/chroot /root/work/steam $@&lt;br /&gt;
Just save it (in your alpine installation) under /usr/bin/steam do a chmod +x /usr/bin/steam and have phun.&amp;lt;br&amp;gt;&lt;br /&gt;
WARNING:&amp;lt;br&amp;gt;&lt;br /&gt;
This script would let steam run with root priviliges.This is not recommended.&lt;br /&gt;
&lt;br /&gt;
===MegaCli===&lt;br /&gt;
So let&#039;s run MegaCli in a chroot to shall we? ;)&amp;lt;br&amp;gt;&lt;br /&gt;
First we set up a uclibc chroot :)&amp;lt;br&amp;gt;&lt;br /&gt;
MegaCli needs more than just glibc it needs ncurses and the gcc-libs.&lt;br /&gt;
 wget http://www.archlinux.org/packages/community/i686/busybox/download/ -O busybox.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/glibc/download/ -O glibc.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/ncurses/download/ -O ncurses.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/gcc-libs/download/ -O gcc-libs.pkg.tar.xz&lt;br /&gt;
 mkdir -p ~/chroot/usr/bin/ ~/chroot/{dev,proc,root,etc,sys}&lt;br /&gt;
 cp /etc/resolv.conf ~/chroot/etc/&lt;br /&gt;
 for i in *.pkg.tar.xz;do&lt;br /&gt;
 bsdtar xfJ $i -C ~/chroot&lt;br /&gt;
 done&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/sh&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/ln&lt;br /&gt;
&lt;br /&gt;
After this we visit this site http://www.lsi.com/downloads/Public/MegaRAID%20Common%20Files/8.02.16_MegaCLI.zip and download 8.02.16_MegaCLI.zip.&amp;lt;br&amp;gt;&lt;br /&gt;
 mkdir tmp&lt;br /&gt;
 cd tmp&lt;br /&gt;
 unzip ../8.02.16_MegaCLI.zip&lt;br /&gt;
 cd LINUX&lt;br /&gt;
 unzip MegaCliLin.zip&lt;br /&gt;
 #Now comes code stolen from rpm2cpio&lt;br /&gt;
 o=`expr 96 + 8`&lt;br /&gt;
 set `od -j $o -N 8 -t u1 MegaCli-8.02.16-1.i386.rpm`&lt;br /&gt;
 il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`&lt;br /&gt;
 dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`&lt;br /&gt;
 sigsize=`expr 8 + 16 \* $il + $dl`&lt;br /&gt;
 o=`expr $o + $sigsize + \( 8 - \( $sigsize \% 8 \) \) \% 8 + 8`&lt;br /&gt;
 set `od -j $o -N 8 -t u1 MegaCli-8.02.16-1.i386.rpm`&lt;br /&gt;
 il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`&lt;br /&gt;
 dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`&lt;br /&gt;
 hdrsize=`expr 8 + 16 \* $il + $dl`&lt;br /&gt;
 o=`expr $o + $hdrsize`&lt;br /&gt;
 dd if=MegaCli-8.02.16-1.i386.rpm ibs=$o skip=1 2&amp;gt;/dev/null |bsdtar -xf -&lt;br /&gt;
 #wow ...&lt;br /&gt;
 rm opt/MegaRAID/MegaCli/MegaCli64 # who needs 64bit?&lt;br /&gt;
 cp -r opt/ ~/chroot/&lt;br /&gt;
Now we got a working MegaCli client in our chroot.&amp;lt;br&amp;gt;&lt;br /&gt;
Like with srcds we don&#039;t want to operate from inside the chroot so here is a little script that should ease you up. (use at your own risk)&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 user=$(whoami)&lt;br /&gt;
 if [ &amp;quot;$user&amp;quot; != &amp;quot;root&amp;quot; ];then&lt;br /&gt;
 echo &amp;quot;This script needs root access&amp;quot;&lt;br /&gt;
 exit&lt;br /&gt;
 fi&lt;br /&gt;
 mount -t proc proc ~/chroot/proc/&lt;br /&gt;
 mount --bind /dev/ ~/chroot/dev/&lt;br /&gt;
 mount --bind /sys/ ~/chroot/sys/&lt;br /&gt;
 #we may need dev and maybe proc too to use this program&lt;br /&gt;
 chroot ~/chroot /opt/MegaRAID/MegaCli/MegaCli $@&lt;br /&gt;
 umount ~/chroot/proc&lt;br /&gt;
 umount ~/chroot/dev&lt;br /&gt;
 umount ~/chroot/sys&lt;br /&gt;
Save it under /usr/bin/MegaCli .Do a chmod +x /usr/bin/MegaCli and good luck.&lt;br /&gt;
Hf&lt;br /&gt;
PS&lt;br /&gt;
This method takes around 50mb.If you need something smaller you can strip a few files from glibc (not recommended) or work on a squashfs.&amp;lt;br&amp;gt;&lt;br /&gt;
With&lt;br /&gt;
 mksquashfs ~/chroot/ /chroot.sfs -b 65536&lt;br /&gt;
you can create a squashfs that is around 15mb small.When you add an unionfs layer you can even use it with write access or you can bind some dirs to the writeable dirs before you chroot into it.&amp;lt;br&amp;gt;&lt;br /&gt;
I will look into it later on.&amp;lt;br&amp;gt;&lt;br /&gt;
You can save the chroot in another dir than your home dir and you an even install a chroot through a APKBUILD (after someone wrote it).&amp;lt;br&amp;gt;&lt;br /&gt;
Through this you could use many glibc dependend programs through one chroot, but be aware that running programs like this should not be standard but only be used in extreme situations like for _closed source_ tools linked against glibc.&lt;br /&gt;
&lt;br /&gt;
===Skype on Debian chroot===&lt;br /&gt;
WIP - Not yet validated&amp;lt;br&amp;gt;&lt;br /&gt;
This is an example on how run Skype from a Debian 32b chroot.&lt;br /&gt;
  chroot ~/chroot&lt;br /&gt;
  wget http://www.skype.com/go/getskype-linux-deb&lt;br /&gt;
  dpkg -i getskype-linux-deb&lt;br /&gt;
To fix missings deps you&#039;ll want to use:&lt;br /&gt;
  apt-get -f install&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Coredumb</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Software_management&amp;diff=10572</id>
		<title>Software management</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Software_management&amp;diff=10572"/>
		<updated>2015-03-23T12:22:38Z</updated>

		<summary type="html">&lt;p&gt;Coredumb: /* Debian */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Draft}}&lt;br /&gt;
&lt;br /&gt;
If you want to run glibc programs under alpine there are a few ways to do so.You could install glibc additional to uclibc (you would have to do this manualy) or you could do the easy way and use a chroot.&amp;lt;br&amp;gt;&lt;br /&gt;
Because there are different usecases I want to give a slight overview about what&#039;s possible and what is intelligent.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Your options==&lt;br /&gt;
===Using Busybox===&lt;br /&gt;
First the most simple approach for setting up a chroot is using a glibc build of busybox.&amp;lt;br&amp;gt;&lt;br /&gt;
This approach has just a few downsides:&amp;lt;br&amp;gt;&lt;br /&gt;
- You have to link most /bin/ and /usr/bin program against /bin/busybox and some busybox builds break if you don&#039;t configure it right.&amp;lt;br&amp;gt;&lt;br /&gt;
- You have to manually download every library you need for your program manually.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
But if you want a small enviroment for one simple use case this is the solution you want.&lt;br /&gt;
&lt;br /&gt;
===Using a livecd===&lt;br /&gt;
If you prefer any special distri you can always download and extract a livecd and use it as a chroot enviroment.&lt;br /&gt;
&lt;br /&gt;
===Using a stage3 gentoo archive===&lt;br /&gt;
This is the fastest approach and you have the advantage of controlling which package version of which library you will install.&amp;lt;br&amp;gt;&lt;br /&gt;
Drawbacks are as follow:&amp;lt;br&amp;gt;&lt;br /&gt;
- Big build.You have to install a portage tree which uses up a lot of space.(It&#039;s not 100% necessary if you don&#039;t have to install any additional content you don&#039;t need it)&amp;lt;br&amp;gt;&lt;br /&gt;
- On slow mashines not recommended because you have to compile your packages.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Using Archlinux or Debian===&lt;br /&gt;
If you want a nice running system you can install Arch or Debian in a chroot.This approach isn&#039;t as easily executed as the other alternatives, but are in my opinion the cleanest and most recommended for the every day user.&lt;br /&gt;
&lt;br /&gt;
==How to do it==&lt;br /&gt;
Like I said this is just a quick draft so here it comes.&lt;br /&gt;
===Using Busybox===&lt;br /&gt;
First we need to download busybox.You can choose any of your favourit distros to download a prebuild version.I for instance would use Archlinux packages from http://www.archlinux.org/packages/community/i686/busybox/.&amp;lt;br&amp;gt;&lt;br /&gt;
 wget http://www.archlinux.org/packages/community/i686/busybox/download/ -O busybox.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/glibc/download/ -O glibc.pkg.tar.xz&lt;br /&gt;
 mkdir -p ~/chroot/usr/bin/ ~/chroot/{dev,proc,root,etc}&lt;br /&gt;
 for i in *.pkg.tar.xz;do&lt;br /&gt;
 bsdtar xfJ $i -C ~/chroot&lt;br /&gt;
 done&lt;br /&gt;
 cp /etc/resolv.conf ~/chroot/etc/&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/sh&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/ln&lt;br /&gt;
 sudo chroot ~/chroot/ /bin/sh&lt;br /&gt;
&lt;br /&gt;
This creates a simple chroot enviroment which we will expand through all commands included in busybox.&lt;br /&gt;
 for i in $(busybox --list);do ln -s /bin/busybox /usr/bin/$i;done&lt;br /&gt;
&lt;br /&gt;
===Using a livecd===&lt;br /&gt;
WIP&lt;br /&gt;
&lt;br /&gt;
===Using a stage3 tar archive===&lt;br /&gt;
Select a mirror from http://www.gentoo.org/main/en/mirrors2.xml , switch to /releases/x86/current-stage3/ and download the latest tar ball (for me stage3-i686-20120124.tar.bz2 ).&lt;br /&gt;
 wget http://de-mirror.org/gentoo/releases/x86/current-stage3/stage3-i686-20120124.tar.bz2&lt;br /&gt;
 mkdir ~/chroot&lt;br /&gt;
 tar xfj stage3-i686-*.tar.bz2 -C ~/chroot&lt;br /&gt;
 sudo chroot ~/chroot&lt;br /&gt;
And voila you got your working gentoo chroot.&amp;lt;br&amp;gt;&lt;br /&gt;
You can now take a look at http://www.gentoo.org/doc/en/?catid=desktop to find out how you can configure and install your system or simply extract/copy the program you need to run in your chroot enviroment and execute it.&lt;br /&gt;
&lt;br /&gt;
===Using Archlinux or Debian===&lt;br /&gt;
====Archlinux====&lt;br /&gt;
WIP&lt;br /&gt;
====Debian====&lt;br /&gt;
Use the provided debootstrap package to create the Debian chroot. --arch is optional depending of your needs.&amp;lt;br&amp;gt;&lt;br /&gt;
On linux-grsec kernel you&#039;ll need to relax chroot limitations.&lt;br /&gt;
&lt;br /&gt;
  sudo apk add debootstrap&lt;br /&gt;
  for i in /proc/sys/kernel/grsecurity/chroot_*; do echo 0 | sudo tee $i; done&lt;br /&gt;
  mkdir ~/chroot&lt;br /&gt;
  sudo debootstrap --arch=i386 wheezy ./chroot http://http.debian.net/debian/&lt;br /&gt;
  for i in /proc/sys/kernel/grsecurity/chroot_*; do echo 1 | sudo tee $i; done&lt;br /&gt;
  sudo chroot ~/chroot /bin/bash&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You can now use apt-get to install needed packages.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
===Source Dedicated Server===&lt;br /&gt;
Here is an easy example of how you can run http://www.srcds.com in a simple busybox chroot.&amp;lt;br&amp;gt;&lt;br /&gt;
For this server you will only need the basic chroot and a advanced tar version (the busybox version is not sufficient because of the missing -U command).&amp;lt;br&amp;gt;&lt;br /&gt;
 wget http://www.archlinux.org/packages/community/i686/busybox/download/ -O busybox.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/glibc/download/ -O glibc.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/tar/download/ -O tar.pkg.tar.xz&lt;br /&gt;
 mkdir -p ~/chroot/usr/bin/ ~/chroot/{dev,proc,root,etc}&lt;br /&gt;
 for i in *.pkg.tar.xz;do&lt;br /&gt;
 bsdtar xfJ $i -C ~/chroot&lt;br /&gt;
 done&lt;br /&gt;
 cp /etc/resolv.conf ~/chroot/etc/&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/sh&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/ln&lt;br /&gt;
 sudo chroot ~/chroot/ /bin/sh&lt;br /&gt;
Now that you are in a working chroot you can download the server and install it.You just have to execute the following self explaining commands.&lt;br /&gt;
 mkdir ~/work&lt;br /&gt;
 cd ~/work&lt;br /&gt;
 busybox wget http://www.steampowered.com/download/hldsupdatetool.bin&lt;br /&gt;
 chmod +x hldsupdatetool.bin&lt;br /&gt;
 ln -s /bin/busybox ./uncompress&lt;br /&gt;
 cp /bin/tar . #right now executing programs from $PATH is buggy soon to be fixed (no bug in busybox but in my script)&lt;br /&gt;
 ./hdsupdatetool.bin #you can accept it or not ;)&lt;br /&gt;
 ./steam&lt;br /&gt;
 ./steam&lt;br /&gt;
And you should have a working chroot with srcds installed in it.&amp;lt;br&amp;gt;&lt;br /&gt;
If you think you are clever or elegant you can use the server with a bash script.&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 chroot ~/chroot /root/work/steam $@&lt;br /&gt;
Just save it (in your alpine installation) under /usr/bin/steam do a chmod +x /usr/bin/steam and have phun.&amp;lt;br&amp;gt;&lt;br /&gt;
WARNING:&amp;lt;br&amp;gt;&lt;br /&gt;
This script would let steam run with root priviliges.This is not recommended.&lt;br /&gt;
&lt;br /&gt;
===MegaCli===&lt;br /&gt;
So let&#039;s run MegaCli in a chroot to shall we? ;)&amp;lt;br&amp;gt;&lt;br /&gt;
First we set up a uclibc chroot :)&amp;lt;br&amp;gt;&lt;br /&gt;
MegaCli needs more than just glibc it needs ncurses and the gcc-libs.&lt;br /&gt;
 wget http://www.archlinux.org/packages/community/i686/busybox/download/ -O busybox.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/glibc/download/ -O glibc.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/ncurses/download/ -O ncurses.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/gcc-libs/download/ -O gcc-libs.pkg.tar.xz&lt;br /&gt;
 mkdir -p ~/chroot/usr/bin/ ~/chroot/{dev,proc,root,etc,sys}&lt;br /&gt;
 cp /etc/resolv.conf ~/chroot/etc/&lt;br /&gt;
 for i in *.pkg.tar.xz;do&lt;br /&gt;
 bsdtar xfJ $i -C ~/chroot&lt;br /&gt;
 done&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/sh&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/ln&lt;br /&gt;
&lt;br /&gt;
After this we visit this site http://www.lsi.com/downloads/Public/MegaRAID%20Common%20Files/8.02.16_MegaCLI.zip and download 8.02.16_MegaCLI.zip.&amp;lt;br&amp;gt;&lt;br /&gt;
 mkdir tmp&lt;br /&gt;
 cd tmp&lt;br /&gt;
 unzip ../8.02.16_MegaCLI.zip&lt;br /&gt;
 cd LINUX&lt;br /&gt;
 unzip MegaCliLin.zip&lt;br /&gt;
 #Now comes code stolen from rpm2cpio&lt;br /&gt;
 o=`expr 96 + 8`&lt;br /&gt;
 set `od -j $o -N 8 -t u1 MegaCli-8.02.16-1.i386.rpm`&lt;br /&gt;
 il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`&lt;br /&gt;
 dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`&lt;br /&gt;
 sigsize=`expr 8 + 16 \* $il + $dl`&lt;br /&gt;
 o=`expr $o + $sigsize + \( 8 - \( $sigsize \% 8 \) \) \% 8 + 8`&lt;br /&gt;
 set `od -j $o -N 8 -t u1 MegaCli-8.02.16-1.i386.rpm`&lt;br /&gt;
 il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`&lt;br /&gt;
 dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`&lt;br /&gt;
 hdrsize=`expr 8 + 16 \* $il + $dl`&lt;br /&gt;
 o=`expr $o + $hdrsize`&lt;br /&gt;
 dd if=MegaCli-8.02.16-1.i386.rpm ibs=$o skip=1 2&amp;gt;/dev/null |bsdtar -xf -&lt;br /&gt;
 #wow ...&lt;br /&gt;
 rm opt/MegaRAID/MegaCli/MegaCli64 # who needs 64bit?&lt;br /&gt;
 cp -r opt/ ~/chroot/&lt;br /&gt;
Now we got a working MegaCli client in our chroot.&amp;lt;br&amp;gt;&lt;br /&gt;
Like with srcds we don&#039;t want to operate from inside the chroot so here is a little script that should ease you up. (use at your own risk)&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 user=$(whoami)&lt;br /&gt;
 if [ &amp;quot;$user&amp;quot; != &amp;quot;root&amp;quot; ];then&lt;br /&gt;
 echo &amp;quot;This script needs root access&amp;quot;&lt;br /&gt;
 exit&lt;br /&gt;
 fi&lt;br /&gt;
 mount -t proc proc ~/chroot/proc/&lt;br /&gt;
 mount --bind /dev/ ~/chroot/dev/&lt;br /&gt;
 mount --bind /sys/ ~/chroot/sys/&lt;br /&gt;
 #we may need dev and maybe proc too to use this program&lt;br /&gt;
 chroot ~/chroot /opt/MegaRAID/MegaCli/MegaCli $@&lt;br /&gt;
 umount ~/chroot/proc&lt;br /&gt;
 umount ~/chroot/dev&lt;br /&gt;
 umount ~/chroot/sys&lt;br /&gt;
Save it under /usr/bin/MegaCli .Do a chmod +x /usr/bin/MegaCli and good luck.&lt;br /&gt;
Hf&lt;br /&gt;
PS&lt;br /&gt;
This method takes around 50mb.If you need something smaller you can strip a few files from glibc (not recommended) or work on a squashfs.&amp;lt;br&amp;gt;&lt;br /&gt;
With&lt;br /&gt;
 mksquashfs ~/chroot/ /chroot.sfs -b 65536&lt;br /&gt;
you can create a squashfs that is around 15mb small.When you add an unionfs layer you can even use it with write access or you can bind some dirs to the writeable dirs before you chroot into it.&amp;lt;br&amp;gt;&lt;br /&gt;
I will look into it later on.&amp;lt;br&amp;gt;&lt;br /&gt;
You can save the chroot in another dir than your home dir and you an even install a chroot through a APKBUILD (after someone wrote it).&amp;lt;br&amp;gt;&lt;br /&gt;
Through this you could use many glibc dependend programs through one chroot, but be aware that running programs like this should not be standard but only be used in extreme situations like for _closed source_ tools linked against glibc.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Coredumb</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Software_management&amp;diff=10571</id>
		<title>Software management</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Software_management&amp;diff=10571"/>
		<updated>2015-03-23T12:21:19Z</updated>

		<summary type="html">&lt;p&gt;Coredumb: /* Debian */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Draft}}&lt;br /&gt;
&lt;br /&gt;
If you want to run glibc programs under alpine there are a few ways to do so.You could install glibc additional to uclibc (you would have to do this manualy) or you could do the easy way and use a chroot.&amp;lt;br&amp;gt;&lt;br /&gt;
Because there are different usecases I want to give a slight overview about what&#039;s possible and what is intelligent.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Your options==&lt;br /&gt;
===Using Busybox===&lt;br /&gt;
First the most simple approach for setting up a chroot is using a glibc build of busybox.&amp;lt;br&amp;gt;&lt;br /&gt;
This approach has just a few downsides:&amp;lt;br&amp;gt;&lt;br /&gt;
- You have to link most /bin/ and /usr/bin program against /bin/busybox and some busybox builds break if you don&#039;t configure it right.&amp;lt;br&amp;gt;&lt;br /&gt;
- You have to manually download every library you need for your program manually.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
But if you want a small enviroment for one simple use case this is the solution you want.&lt;br /&gt;
&lt;br /&gt;
===Using a livecd===&lt;br /&gt;
If you prefer any special distri you can always download and extract a livecd and use it as a chroot enviroment.&lt;br /&gt;
&lt;br /&gt;
===Using a stage3 gentoo archive===&lt;br /&gt;
This is the fastest approach and you have the advantage of controlling which package version of which library you will install.&amp;lt;br&amp;gt;&lt;br /&gt;
Drawbacks are as follow:&amp;lt;br&amp;gt;&lt;br /&gt;
- Big build.You have to install a portage tree which uses up a lot of space.(It&#039;s not 100% necessary if you don&#039;t have to install any additional content you don&#039;t need it)&amp;lt;br&amp;gt;&lt;br /&gt;
- On slow mashines not recommended because you have to compile your packages.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Using Archlinux or Debian===&lt;br /&gt;
If you want a nice running system you can install Arch or Debian in a chroot.This approach isn&#039;t as easily executed as the other alternatives, but are in my opinion the cleanest and most recommended for the every day user.&lt;br /&gt;
&lt;br /&gt;
==How to do it==&lt;br /&gt;
Like I said this is just a quick draft so here it comes.&lt;br /&gt;
===Using Busybox===&lt;br /&gt;
First we need to download busybox.You can choose any of your favourit distros to download a prebuild version.I for instance would use Archlinux packages from http://www.archlinux.org/packages/community/i686/busybox/.&amp;lt;br&amp;gt;&lt;br /&gt;
 wget http://www.archlinux.org/packages/community/i686/busybox/download/ -O busybox.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/glibc/download/ -O glibc.pkg.tar.xz&lt;br /&gt;
 mkdir -p ~/chroot/usr/bin/ ~/chroot/{dev,proc,root,etc}&lt;br /&gt;
 for i in *.pkg.tar.xz;do&lt;br /&gt;
 bsdtar xfJ $i -C ~/chroot&lt;br /&gt;
 done&lt;br /&gt;
 cp /etc/resolv.conf ~/chroot/etc/&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/sh&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/ln&lt;br /&gt;
 sudo chroot ~/chroot/ /bin/sh&lt;br /&gt;
&lt;br /&gt;
This creates a simple chroot enviroment which we will expand through all commands included in busybox.&lt;br /&gt;
 for i in $(busybox --list);do ln -s /bin/busybox /usr/bin/$i;done&lt;br /&gt;
&lt;br /&gt;
===Using a livecd===&lt;br /&gt;
WIP&lt;br /&gt;
&lt;br /&gt;
===Using a stage3 tar archive===&lt;br /&gt;
Select a mirror from http://www.gentoo.org/main/en/mirrors2.xml , switch to /releases/x86/current-stage3/ and download the latest tar ball (for me stage3-i686-20120124.tar.bz2 ).&lt;br /&gt;
 wget http://de-mirror.org/gentoo/releases/x86/current-stage3/stage3-i686-20120124.tar.bz2&lt;br /&gt;
 mkdir ~/chroot&lt;br /&gt;
 tar xfj stage3-i686-*.tar.bz2 -C ~/chroot&lt;br /&gt;
 sudo chroot ~/chroot&lt;br /&gt;
And voila you got your working gentoo chroot.&amp;lt;br&amp;gt;&lt;br /&gt;
You can now take a look at http://www.gentoo.org/doc/en/?catid=desktop to find out how you can configure and install your system or simply extract/copy the program you need to run in your chroot enviroment and execute it.&lt;br /&gt;
&lt;br /&gt;
===Using Archlinux or Debian===&lt;br /&gt;
====Archlinux====&lt;br /&gt;
WIP&lt;br /&gt;
====Debian====&lt;br /&gt;
Use the provided debootstrap package to create the Debian chroot. --arch is optional depending of your needs.&amp;lt;br&amp;gt;&lt;br /&gt;
On linux-grsec kernel you&#039;ll need to relax chroot limitations.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sudo apk add debootstrap&lt;br /&gt;
&lt;br /&gt;
for i in /proc/sys/kernel/grsecurity/chroot_*; do echo 0 | sudo tee $i; done&lt;br /&gt;
&lt;br /&gt;
mkdir ~/chroot&lt;br /&gt;
sudo debootstrap --arch=i386 wheezy ./chroot http://http.debian.net/debian/&lt;br /&gt;
&lt;br /&gt;
for i in /proc/sys/kernel/grsecurity/chroot_*; do echo 1 | sudo tee $i; done&lt;br /&gt;
&lt;br /&gt;
sudo chroot ~/chroot /bin/bash&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You can now use apt-get to install needed packages.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
===Source Dedicated Server===&lt;br /&gt;
Here is an easy example of how you can run http://www.srcds.com in a simple busybox chroot.&amp;lt;br&amp;gt;&lt;br /&gt;
For this server you will only need the basic chroot and a advanced tar version (the busybox version is not sufficient because of the missing -U command).&amp;lt;br&amp;gt;&lt;br /&gt;
 wget http://www.archlinux.org/packages/community/i686/busybox/download/ -O busybox.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/glibc/download/ -O glibc.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/tar/download/ -O tar.pkg.tar.xz&lt;br /&gt;
 mkdir -p ~/chroot/usr/bin/ ~/chroot/{dev,proc,root,etc}&lt;br /&gt;
 for i in *.pkg.tar.xz;do&lt;br /&gt;
 bsdtar xfJ $i -C ~/chroot&lt;br /&gt;
 done&lt;br /&gt;
 cp /etc/resolv.conf ~/chroot/etc/&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/sh&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/ln&lt;br /&gt;
 sudo chroot ~/chroot/ /bin/sh&lt;br /&gt;
Now that you are in a working chroot you can download the server and install it.You just have to execute the following self explaining commands.&lt;br /&gt;
 mkdir ~/work&lt;br /&gt;
 cd ~/work&lt;br /&gt;
 busybox wget http://www.steampowered.com/download/hldsupdatetool.bin&lt;br /&gt;
 chmod +x hldsupdatetool.bin&lt;br /&gt;
 ln -s /bin/busybox ./uncompress&lt;br /&gt;
 cp /bin/tar . #right now executing programs from $PATH is buggy soon to be fixed (no bug in busybox but in my script)&lt;br /&gt;
 ./hdsupdatetool.bin #you can accept it or not ;)&lt;br /&gt;
 ./steam&lt;br /&gt;
 ./steam&lt;br /&gt;
And you should have a working chroot with srcds installed in it.&amp;lt;br&amp;gt;&lt;br /&gt;
If you think you are clever or elegant you can use the server with a bash script.&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 chroot ~/chroot /root/work/steam $@&lt;br /&gt;
Just save it (in your alpine installation) under /usr/bin/steam do a chmod +x /usr/bin/steam and have phun.&amp;lt;br&amp;gt;&lt;br /&gt;
WARNING:&amp;lt;br&amp;gt;&lt;br /&gt;
This script would let steam run with root priviliges.This is not recommended.&lt;br /&gt;
&lt;br /&gt;
===MegaCli===&lt;br /&gt;
So let&#039;s run MegaCli in a chroot to shall we? ;)&amp;lt;br&amp;gt;&lt;br /&gt;
First we set up a uclibc chroot :)&amp;lt;br&amp;gt;&lt;br /&gt;
MegaCli needs more than just glibc it needs ncurses and the gcc-libs.&lt;br /&gt;
 wget http://www.archlinux.org/packages/community/i686/busybox/download/ -O busybox.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/glibc/download/ -O glibc.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/ncurses/download/ -O ncurses.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/gcc-libs/download/ -O gcc-libs.pkg.tar.xz&lt;br /&gt;
 mkdir -p ~/chroot/usr/bin/ ~/chroot/{dev,proc,root,etc,sys}&lt;br /&gt;
 cp /etc/resolv.conf ~/chroot/etc/&lt;br /&gt;
 for i in *.pkg.tar.xz;do&lt;br /&gt;
 bsdtar xfJ $i -C ~/chroot&lt;br /&gt;
 done&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/sh&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/ln&lt;br /&gt;
&lt;br /&gt;
After this we visit this site http://www.lsi.com/downloads/Public/MegaRAID%20Common%20Files/8.02.16_MegaCLI.zip and download 8.02.16_MegaCLI.zip.&amp;lt;br&amp;gt;&lt;br /&gt;
 mkdir tmp&lt;br /&gt;
 cd tmp&lt;br /&gt;
 unzip ../8.02.16_MegaCLI.zip&lt;br /&gt;
 cd LINUX&lt;br /&gt;
 unzip MegaCliLin.zip&lt;br /&gt;
 #Now comes code stolen from rpm2cpio&lt;br /&gt;
 o=`expr 96 + 8`&lt;br /&gt;
 set `od -j $o -N 8 -t u1 MegaCli-8.02.16-1.i386.rpm`&lt;br /&gt;
 il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`&lt;br /&gt;
 dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`&lt;br /&gt;
 sigsize=`expr 8 + 16 \* $il + $dl`&lt;br /&gt;
 o=`expr $o + $sigsize + \( 8 - \( $sigsize \% 8 \) \) \% 8 + 8`&lt;br /&gt;
 set `od -j $o -N 8 -t u1 MegaCli-8.02.16-1.i386.rpm`&lt;br /&gt;
 il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`&lt;br /&gt;
 dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`&lt;br /&gt;
 hdrsize=`expr 8 + 16 \* $il + $dl`&lt;br /&gt;
 o=`expr $o + $hdrsize`&lt;br /&gt;
 dd if=MegaCli-8.02.16-1.i386.rpm ibs=$o skip=1 2&amp;gt;/dev/null |bsdtar -xf -&lt;br /&gt;
 #wow ...&lt;br /&gt;
 rm opt/MegaRAID/MegaCli/MegaCli64 # who needs 64bit?&lt;br /&gt;
 cp -r opt/ ~/chroot/&lt;br /&gt;
Now we got a working MegaCli client in our chroot.&amp;lt;br&amp;gt;&lt;br /&gt;
Like with srcds we don&#039;t want to operate from inside the chroot so here is a little script that should ease you up. (use at your own risk)&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 user=$(whoami)&lt;br /&gt;
 if [ &amp;quot;$user&amp;quot; != &amp;quot;root&amp;quot; ];then&lt;br /&gt;
 echo &amp;quot;This script needs root access&amp;quot;&lt;br /&gt;
 exit&lt;br /&gt;
 fi&lt;br /&gt;
 mount -t proc proc ~/chroot/proc/&lt;br /&gt;
 mount --bind /dev/ ~/chroot/dev/&lt;br /&gt;
 mount --bind /sys/ ~/chroot/sys/&lt;br /&gt;
 #we may need dev and maybe proc too to use this program&lt;br /&gt;
 chroot ~/chroot /opt/MegaRAID/MegaCli/MegaCli $@&lt;br /&gt;
 umount ~/chroot/proc&lt;br /&gt;
 umount ~/chroot/dev&lt;br /&gt;
 umount ~/chroot/sys&lt;br /&gt;
Save it under /usr/bin/MegaCli .Do a chmod +x /usr/bin/MegaCli and good luck.&lt;br /&gt;
Hf&lt;br /&gt;
PS&lt;br /&gt;
This method takes around 50mb.If you need something smaller you can strip a few files from glibc (not recommended) or work on a squashfs.&amp;lt;br&amp;gt;&lt;br /&gt;
With&lt;br /&gt;
 mksquashfs ~/chroot/ /chroot.sfs -b 65536&lt;br /&gt;
you can create a squashfs that is around 15mb small.When you add an unionfs layer you can even use it with write access or you can bind some dirs to the writeable dirs before you chroot into it.&amp;lt;br&amp;gt;&lt;br /&gt;
I will look into it later on.&amp;lt;br&amp;gt;&lt;br /&gt;
You can save the chroot in another dir than your home dir and you an even install a chroot through a APKBUILD (after someone wrote it).&amp;lt;br&amp;gt;&lt;br /&gt;
Through this you could use many glibc dependend programs through one chroot, but be aware that running programs like this should not be standard but only be used in extreme situations like for _closed source_ tools linked against glibc.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Coredumb</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Software_management&amp;diff=10570</id>
		<title>Software management</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Software_management&amp;diff=10570"/>
		<updated>2015-03-23T10:48:16Z</updated>

		<summary type="html">&lt;p&gt;Coredumb: /* Using Archlinux or Debian */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Draft}}&lt;br /&gt;
&lt;br /&gt;
If you want to run glibc programs under alpine there are a few ways to do so.You could install glibc additional to uclibc (you would have to do this manualy) or you could do the easy way and use a chroot.&amp;lt;br&amp;gt;&lt;br /&gt;
Because there are different usecases I want to give a slight overview about what&#039;s possible and what is intelligent.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Your options==&lt;br /&gt;
===Using Busybox===&lt;br /&gt;
First the most simple approach for setting up a chroot is using a glibc build of busybox.&amp;lt;br&amp;gt;&lt;br /&gt;
This approach has just a few downsides:&amp;lt;br&amp;gt;&lt;br /&gt;
- You have to link most /bin/ and /usr/bin program against /bin/busybox and some busybox builds break if you don&#039;t configure it right.&amp;lt;br&amp;gt;&lt;br /&gt;
- You have to manually download every library you need for your program manually.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
But if you want a small enviroment for one simple use case this is the solution you want.&lt;br /&gt;
&lt;br /&gt;
===Using a livecd===&lt;br /&gt;
If you prefer any special distri you can always download and extract a livecd and use it as a chroot enviroment.&lt;br /&gt;
&lt;br /&gt;
===Using a stage3 gentoo archive===&lt;br /&gt;
This is the fastest approach and you have the advantage of controlling which package version of which library you will install.&amp;lt;br&amp;gt;&lt;br /&gt;
Drawbacks are as follow:&amp;lt;br&amp;gt;&lt;br /&gt;
- Big build.You have to install a portage tree which uses up a lot of space.(It&#039;s not 100% necessary if you don&#039;t have to install any additional content you don&#039;t need it)&amp;lt;br&amp;gt;&lt;br /&gt;
- On slow mashines not recommended because you have to compile your packages.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Using Archlinux or Debian===&lt;br /&gt;
If you want a nice running system you can install Arch or Debian in a chroot.This approach isn&#039;t as easily executed as the other alternatives, but are in my opinion the cleanest and most recommended for the every day user.&lt;br /&gt;
&lt;br /&gt;
==How to do it==&lt;br /&gt;
Like I said this is just a quick draft so here it comes.&lt;br /&gt;
===Using Busybox===&lt;br /&gt;
First we need to download busybox.You can choose any of your favourit distros to download a prebuild version.I for instance would use Archlinux packages from http://www.archlinux.org/packages/community/i686/busybox/.&amp;lt;br&amp;gt;&lt;br /&gt;
 wget http://www.archlinux.org/packages/community/i686/busybox/download/ -O busybox.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/glibc/download/ -O glibc.pkg.tar.xz&lt;br /&gt;
 mkdir -p ~/chroot/usr/bin/ ~/chroot/{dev,proc,root,etc}&lt;br /&gt;
 for i in *.pkg.tar.xz;do&lt;br /&gt;
 bsdtar xfJ $i -C ~/chroot&lt;br /&gt;
 done&lt;br /&gt;
 cp /etc/resolv.conf ~/chroot/etc/&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/sh&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/ln&lt;br /&gt;
 sudo chroot ~/chroot/ /bin/sh&lt;br /&gt;
&lt;br /&gt;
This creates a simple chroot enviroment which we will expand through all commands included in busybox.&lt;br /&gt;
 for i in $(busybox --list);do ln -s /bin/busybox /usr/bin/$i;done&lt;br /&gt;
&lt;br /&gt;
===Using a livecd===&lt;br /&gt;
WIP&lt;br /&gt;
&lt;br /&gt;
===Using a stage3 tar archive===&lt;br /&gt;
Select a mirror from http://www.gentoo.org/main/en/mirrors2.xml , switch to /releases/x86/current-stage3/ and download the latest tar ball (for me stage3-i686-20120124.tar.bz2 ).&lt;br /&gt;
 wget http://de-mirror.org/gentoo/releases/x86/current-stage3/stage3-i686-20120124.tar.bz2&lt;br /&gt;
 mkdir ~/chroot&lt;br /&gt;
 tar xfj stage3-i686-*.tar.bz2 -C ~/chroot&lt;br /&gt;
 sudo chroot ~/chroot&lt;br /&gt;
And voila you got your working gentoo chroot.&amp;lt;br&amp;gt;&lt;br /&gt;
You can now take a look at http://www.gentoo.org/doc/en/?catid=desktop to find out how you can configure and install your system or simply extract/copy the program you need to run in your chroot enviroment and execute it.&lt;br /&gt;
&lt;br /&gt;
===Using Archlinux or Debian===&lt;br /&gt;
====Archlinux====&lt;br /&gt;
WIP&lt;br /&gt;
====Debian====&lt;br /&gt;
Use the provided debootstrap package to create the Debian chroot. --arch is optional depending of your needs.&lt;br /&gt;
  sudo apk add debootstrap&lt;br /&gt;
  mkdir ~/chroot&lt;br /&gt;
  sudo debootstrap --arch=i386 wheezy ./chroot http://http.debian.net/debian/&lt;br /&gt;
  sudo chroot ~/chroot /bin/bash&lt;br /&gt;
You can now use apt-get to install needed packages.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
===Source Dedicated Server===&lt;br /&gt;
Here is an easy example of how you can run http://www.srcds.com in a simple busybox chroot.&amp;lt;br&amp;gt;&lt;br /&gt;
For this server you will only need the basic chroot and a advanced tar version (the busybox version is not sufficient because of the missing -U command).&amp;lt;br&amp;gt;&lt;br /&gt;
 wget http://www.archlinux.org/packages/community/i686/busybox/download/ -O busybox.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/glibc/download/ -O glibc.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/tar/download/ -O tar.pkg.tar.xz&lt;br /&gt;
 mkdir -p ~/chroot/usr/bin/ ~/chroot/{dev,proc,root,etc}&lt;br /&gt;
 for i in *.pkg.tar.xz;do&lt;br /&gt;
 bsdtar xfJ $i -C ~/chroot&lt;br /&gt;
 done&lt;br /&gt;
 cp /etc/resolv.conf ~/chroot/etc/&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/sh&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/ln&lt;br /&gt;
 sudo chroot ~/chroot/ /bin/sh&lt;br /&gt;
Now that you are in a working chroot you can download the server and install it.You just have to execute the following self explaining commands.&lt;br /&gt;
 mkdir ~/work&lt;br /&gt;
 cd ~/work&lt;br /&gt;
 busybox wget http://www.steampowered.com/download/hldsupdatetool.bin&lt;br /&gt;
 chmod +x hldsupdatetool.bin&lt;br /&gt;
 ln -s /bin/busybox ./uncompress&lt;br /&gt;
 cp /bin/tar . #right now executing programs from $PATH is buggy soon to be fixed (no bug in busybox but in my script)&lt;br /&gt;
 ./hdsupdatetool.bin #you can accept it or not ;)&lt;br /&gt;
 ./steam&lt;br /&gt;
 ./steam&lt;br /&gt;
And you should have a working chroot with srcds installed in it.&amp;lt;br&amp;gt;&lt;br /&gt;
If you think you are clever or elegant you can use the server with a bash script.&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 chroot ~/chroot /root/work/steam $@&lt;br /&gt;
Just save it (in your alpine installation) under /usr/bin/steam do a chmod +x /usr/bin/steam and have phun.&amp;lt;br&amp;gt;&lt;br /&gt;
WARNING:&amp;lt;br&amp;gt;&lt;br /&gt;
This script would let steam run with root priviliges.This is not recommended.&lt;br /&gt;
&lt;br /&gt;
===MegaCli===&lt;br /&gt;
So let&#039;s run MegaCli in a chroot to shall we? ;)&amp;lt;br&amp;gt;&lt;br /&gt;
First we set up a uclibc chroot :)&amp;lt;br&amp;gt;&lt;br /&gt;
MegaCli needs more than just glibc it needs ncurses and the gcc-libs.&lt;br /&gt;
 wget http://www.archlinux.org/packages/community/i686/busybox/download/ -O busybox.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/glibc/download/ -O glibc.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/ncurses/download/ -O ncurses.pkg.tar.xz&lt;br /&gt;
 wget http://www.archlinux.org/packages/core/i686/gcc-libs/download/ -O gcc-libs.pkg.tar.xz&lt;br /&gt;
 mkdir -p ~/chroot/usr/bin/ ~/chroot/{dev,proc,root,etc,sys}&lt;br /&gt;
 cp /etc/resolv.conf ~/chroot/etc/&lt;br /&gt;
 for i in *.pkg.tar.xz;do&lt;br /&gt;
 bsdtar xfJ $i -C ~/chroot&lt;br /&gt;
 done&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/sh&lt;br /&gt;
 ln -s /bin/busybox ~/chroot/bin/ln&lt;br /&gt;
&lt;br /&gt;
After this we visit this site http://www.lsi.com/downloads/Public/MegaRAID%20Common%20Files/8.02.16_MegaCLI.zip and download 8.02.16_MegaCLI.zip.&amp;lt;br&amp;gt;&lt;br /&gt;
 mkdir tmp&lt;br /&gt;
 cd tmp&lt;br /&gt;
 unzip ../8.02.16_MegaCLI.zip&lt;br /&gt;
 cd LINUX&lt;br /&gt;
 unzip MegaCliLin.zip&lt;br /&gt;
 #Now comes code stolen from rpm2cpio&lt;br /&gt;
 o=`expr 96 + 8`&lt;br /&gt;
 set `od -j $o -N 8 -t u1 MegaCli-8.02.16-1.i386.rpm`&lt;br /&gt;
 il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`&lt;br /&gt;
 dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`&lt;br /&gt;
 sigsize=`expr 8 + 16 \* $il + $dl`&lt;br /&gt;
 o=`expr $o + $sigsize + \( 8 - \( $sigsize \% 8 \) \) \% 8 + 8`&lt;br /&gt;
 set `od -j $o -N 8 -t u1 MegaCli-8.02.16-1.i386.rpm`&lt;br /&gt;
 il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`&lt;br /&gt;
 dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`&lt;br /&gt;
 hdrsize=`expr 8 + 16 \* $il + $dl`&lt;br /&gt;
 o=`expr $o + $hdrsize`&lt;br /&gt;
 dd if=MegaCli-8.02.16-1.i386.rpm ibs=$o skip=1 2&amp;gt;/dev/null |bsdtar -xf -&lt;br /&gt;
 #wow ...&lt;br /&gt;
 rm opt/MegaRAID/MegaCli/MegaCli64 # who needs 64bit?&lt;br /&gt;
 cp -r opt/ ~/chroot/&lt;br /&gt;
Now we got a working MegaCli client in our chroot.&amp;lt;br&amp;gt;&lt;br /&gt;
Like with srcds we don&#039;t want to operate from inside the chroot so here is a little script that should ease you up. (use at your own risk)&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 user=$(whoami)&lt;br /&gt;
 if [ &amp;quot;$user&amp;quot; != &amp;quot;root&amp;quot; ];then&lt;br /&gt;
 echo &amp;quot;This script needs root access&amp;quot;&lt;br /&gt;
 exit&lt;br /&gt;
 fi&lt;br /&gt;
 mount -t proc proc ~/chroot/proc/&lt;br /&gt;
 mount --bind /dev/ ~/chroot/dev/&lt;br /&gt;
 mount --bind /sys/ ~/chroot/sys/&lt;br /&gt;
 #we may need dev and maybe proc too to use this program&lt;br /&gt;
 chroot ~/chroot /opt/MegaRAID/MegaCli/MegaCli $@&lt;br /&gt;
 umount ~/chroot/proc&lt;br /&gt;
 umount ~/chroot/dev&lt;br /&gt;
 umount ~/chroot/sys&lt;br /&gt;
Save it under /usr/bin/MegaCli .Do a chmod +x /usr/bin/MegaCli and good luck.&lt;br /&gt;
Hf&lt;br /&gt;
PS&lt;br /&gt;
This method takes around 50mb.If you need something smaller you can strip a few files from glibc (not recommended) or work on a squashfs.&amp;lt;br&amp;gt;&lt;br /&gt;
With&lt;br /&gt;
 mksquashfs ~/chroot/ /chroot.sfs -b 65536&lt;br /&gt;
you can create a squashfs that is around 15mb small.When you add an unionfs layer you can even use it with write access or you can bind some dirs to the writeable dirs before you chroot into it.&amp;lt;br&amp;gt;&lt;br /&gt;
I will look into it later on.&amp;lt;br&amp;gt;&lt;br /&gt;
You can save the chroot in another dir than your home dir and you an even install a chroot through a APKBUILD (after someone wrote it).&amp;lt;br&amp;gt;&lt;br /&gt;
Through this you could use many glibc dependend programs through one chroot, but be aware that running programs like this should not be standard but only be used in extreme situations like for _closed source_ tools linked against glibc.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Coredumb</name></author>
	</entry>
</feed>