Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Minimal chroot installation
View unanswered posts
View posts from last 24 hours

Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message

Joined: 13 Feb 2016
Posts: 892

PostPosted: Wed Nov 22, 2017 12:30 am    Post subject: Minimal chroot installation Reply with quote

(edited as of well, now)
Hi, I am following the guide in wiki for the chroot, at the stage of installing packages for the 32-bit chroot environment, the purpose of it is mostly to run Wine and maybe a few other windows applications from it. I was thinking unlike other gentoo installs, to severely limit the packages in world set with this.

I wanted to remove SSL but I'm not sure that I'm going to have any luck with that because it looks like it is a dependency of Portage. Is that correct?

In general, though would be nice to know how I might get around including a bunch of packages that aren't even going to be useful to me. And in the process be able to:
1) Reduce the storage on hard disk
2) Limit the functioning to just what I need on the chroot
3) Maintain it over time, don't know if Portage is going to be the right tool for the job here or not.

IF there isn't arleady a wiki on developing a chroot within gentoo environment for a non-Portage managed environment, would that have the potential of being more/less minimal than the alternative which is to follow the wiki which uses a bunch of bind mounts and then installs everything from the portage tree.

Everything is working fine right now with the portage install, but basically just checking if there is a more minimal thing I can go or if I should abandon the idea of making it a smaller footprint, and allow the additional packages to be merged. Like in this case:

The following USE changes are necessary to proceed:
 (see "package.use" in the portage(5) man page for more details)
# required by sys-apps/portage-2.3.13-r1::gentoo[-build,python_targets_python2_7]
# required by virtual/package-manager-0::gentoo
# required by @system
# required by @world (argument)
>=dev-lang/python-2.7.14-r1:2.7 ssl

Since I set the global USE flag to -ssh....I guess Portage doesn't like that, really?! Is there another way around it perhaps?

Here is the emerge --info from within the chroot...

Machine_West /etc/portage/package.use # emerge --info
Portage 2.3.6 (python 3.4.5-final-0, default/linux/x86/13.0, gcc-5.4.0, glibc-2.25-r9, 4.14.0-gentooJRcustome i686)
System uname: Linux-4.14.0-gentooJRcustome-i686-Intel-R-_Core-TM-_i3-5010U_CPU_@_2.10GHz-with-gentoo-2.4.1
KiB Mem:     8068808 total,   3748352 free
KiB Swap:     524276 total,    524276 free
Timestamp of repository gentoo: Mon, 20 Nov 2017 09:30:01 +0000
sh bash 4.3_p48-r1
ld GNU ld (Gentoo 2.28.1 p1.0) 2.28.1
app-shells/bash:          4.3_p48-r1::gentoo
dev-lang/perl:            5.24.3::gentoo
dev-lang/python:          2.7.14::gentoo, 3.4.5::gentoo, 3.5.4::gentoo
dev-util/cmake:           3.7.2::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.34.8::gentoo
sys-apps/sandbox:         2.10-r4::gentoo
sys-devel/autoconf:       2.69::gentoo
sys-devel/automake:       1.15.1-r1::gentoo
sys-devel/binutils:       2.28.1::gentoo, 2.29.1-r1::gentoo
sys-devel/gcc:            5.4.0-r3::gentoo, 6.4.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.4::gentoo (virtual/os-headers)
sys-libs/glibc:           2.25-r9::gentoo

    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://
    priority: -1000

    location: /var/lib/layman/steam-overlay
    masters: gentoo
    priority: 50

CFLAGS="-O2 -march=i686 -pipe"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=i686 -pipe"
FCFLAGS="-O2 -march=i686 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -march=i686 -pipe"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
USE="X acl berkdb bzip2 cli cracklib crypt cxx dri fortran gdbm glamor iconv ipv6 modules ncurses nls nptl openmp pam pcre readline seccomp session tcpd unicode x86 xattr zlib" ABI_X86="32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby22" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"

And, here's the emerge info from the root filesystem which it is mounted on top of....


[Moderator edit: changed [quote] tags to [code] tags to preserve output layout. -Hu]
Back to top
View user's profile Send private message

Joined: 16 Jul 2004
Posts: 407
Location: CH

PostPosted: Wed Nov 22, 2017 9:50 am    Post subject: Reply with quote

Maybe its just a typo in your post but you wrote
Since I set the global USE flag to -ssh

If you want to remove support for ssl you need

Note the "l" instead of the "h" at the end.

I am not sure you can gain much of minimization if you want to run wine, wine already depends on many packages.

But do I understand correctly, you intend to run Windoze applications from within the chroot? I don't think this will work. You cannot access the X server of your host neither can you start another X server within your chroot. If you want to run Windoze and corresponding applications you will succeed running a full system within a qemu instance or any other VM solution - which will be contradictory to your initial intent to reduce disk space requirements. On the other hand, if you don't install a separate chroot for running Windoze applications and instead run those applications from within your primary system through wine on your host, you reduce disk space requirements because no chroot is necessary.

Not the solution you're looking for but maybe it still helps.

I see it is possible to run X applications from within a chroot, so maybe it still is an option for you to go. Nevertheless, the packages and use flags needed for running wine smoothly with your applications can be quite large so I still guess minimizing is hard.
Back to top
View user's profile Send private message

Joined: 13 Feb 2016
Posts: 892

PostPosted: Wed Nov 22, 2017 12:14 pm    Post subject: Reply with quote

These are all good aspects to note, and good thoughts thanks for the suggestions. I've tried running wine in the native enviornment, which is pure 64-bit...don't ask me why I went that route with the initial install on the system. But as you mentioned, wine is more particularly what I am after, rather than VM solution, in order to do just the following: have office on there, and play a bunch of games that I accumulated over the years (and recently, ha hah). Nothing too process heavy, or anything that should require the full VT technology or whatever of the kernel at this point. So besides not wanting to waste space, I am pleased with the minimal resources taken as well of wine when it isn't directly running a process in the foreground it pretty much doesn't use up any memory or cpu. That and with a VM that would be just another system I'd be managing and would need to look after. And no dreadful windows installations and updates!!!

I think in the future, there will be much more software like what is seen with wine, which does more for the improvement of not just linux users, but all of linux programming of software applications by bringing cross-platform (OS platform) software solutions to users. Otherwise in theory, I guess I could go back to a dual boot system, but there's just no way I would ever want Windose

Up until recently I had the installation of all wine packages, along with another 32-bit enging (Steam) running on my desktop build, which was installed with both 32-bit and 64-bit libraries so there was no problems there.

But now that I'm effectively wanting to move all that windows stuff over to my work laptop and off of the desktop this is like starting over again, which it is. I've noticed that the idea of chroot environment comes into play heavily with these technologies, like Steam (which is built for Ubuntu but runs in a 32-bit chroot envirnoment), and Wine which I never had to learn how it worked, until now because it just did on my multilibrary machine, but that is no longer an option!!!
Back to top
View user's profile Send private message

Joined: 05 Jul 2003
Posts: 41725
Location: 56N 3W

PostPosted: Wed Nov 22, 2017 12:34 pm    Post subject: Reply with quote


A long time ago when the first liweCD was produced for Gentoos 10th birtday. I wote HOWTO_DVD_10.0_10.1 after I was told that its not possibre to install from the liveCD.

The interesting part in relation to this topic is where it describes creating a chroot from individual binary packages - without the use of a stage3
You can build your own binaries, or get them from a public binhost.
You may need a few more packages now but its a good minimal chroot starting point.


Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message

Joined: 16 Jul 2004
Posts: 407
Location: CH

PostPosted: Wed Nov 22, 2017 1:52 pm    Post subject: Reply with quote

In effect an interesting idea in general, would be glad to hear more about your success story.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum