Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Installing Gentoo
  • Search

tiny USB image

Having problems with the Gentoo Handbook? If you're still working your way through it, or just need some info before you start your install, this is the place. All other questions go elsewhere.
Post Reply
Advanced search
4 posts • Page 1 of 1
Author
Message
o5gmmob8
l33t
l33t
Posts: 737
Joined: Fri Oct 17, 2003 9:17 pm

tiny USB image

  • Quote

Post by o5gmmob8 » Sat Oct 11, 2025 11:08 pm

I would like to build a tiny USB image with a small subset of tools:

Code: Select all

Java Runtime with specified jars
pre-built executables from go
wifi
nftables
micro
When building my system chroot environment, it has a lot of libraries and tools I'm not sure I need. I ultimately build a squashfs image and dd that onto the USB image, but prior to that, I am wondering what tools would I use to perhaps just ensure that those executables and necessary libraries are available and nothing more?

That will ensure the boot time is as little as possible and the system can only do what is intended.

Should I generate a filelist to include for squashfs as opposed to listing what files to exclude? Having a single-user should be fine to further simplify matters.
Top
zen_desu
Guru
Guru
Posts: 501
Joined: Fri Oct 25, 2024 3:14 pm
Location: your area

Re: tiny USB image

  • Quote

Post by zen_desu » Sun Oct 12, 2025 3:59 am

o5gmmob8 wrote:I would like to build a tiny USB image with a small subset of tools:

Code: Select all

Java Runtime with specified jars
pre-built executables from go
wifi
nftables
micro
When building my system chroot environment, it has a lot of libraries and tools I'm not sure I need. I ultimately build a squashfs image and dd that onto the USB image, but prior to that, I am wondering what tools would I use to perhaps just ensure that those executables and necessary libraries are available and nothing more?

That will ensure the boot time is as little as possible and the system can only do what is intended.

Should I generate a filelist to include for squashfs as opposed to listing what files to exclude? Having a single-user should be fine to further simplify matters.
you can use lddtree to do a lot of the work here. It won't help you find and include required resources/config files, only libraries though

coincidentally what you described is a big part of what ugrd does (but it's designed to make initramfs images). Most of the relevant code is here: https://github.com/desultory/ugrd/blob/ ... #L125-L159

ugrd has a "livecd" module which will boot a squashfs which you may find interesting: https://github.com/desultory/ugrd/blob/ ... /livecd.py

If you want to do it from scratch using portage, you can use "emerge --root </builddir> <packages>" to build a system image from scratch, but you have to be sure to start with baselayout, then the system set, but that will include a lot of "unnecessary" stuff like compilers
µgRD dev
Wiki writer
Top
C5ace
Guru
Guru
Posts: 517
Joined: Mon Dec 23, 2013 12:44 am
Location: Brisbane, Australia

Re: tiny USB image

  • Quote

Post by C5ace » Sun Oct 12, 2025 5:30 am

o5gmmob8 wrote:I would like to build a tiny USB image with a small subset of tools:

Code: Select all

Java Runtime with specified jars
pre-built executables from go
wifi
nftables
micro
When building my system chroot environment, it has a lot of libraries and tools I'm not sure I need. I ultimately build a squashfs image and dd that onto the USB image, but prior to that, I am wondering what tools would I use to perhaps just ensure that those executables and necessary libraries are available and nothing more?

That will ensure the boot time is as little as possible and the system can only do what is intended.

Should I generate a filelist to include for squashfs as opposed to listing what files to exclude? Having a single-user should be fine to further simplify matters.
In the past I used a USB stick with Gentoo, Xfce, compilers, etc. to boot, install gentoo and fix laptops. Was very slow. Now I am using 2TB USB drive for this purpose.

Size of USB stick or drive?
Gui or no gui?
Applications?
Hardware specs to build on?
Hardware specs to boot from and run on?
Observation after 30 years working with computers:
All software has known and unknown bugs and vulnerabilities. Especially software written in complex, unstable and object oriented languages such as perl, python, C++, C#, Rust and the likes.
Top
o5gmmob8
l33t
l33t
Posts: 737
Joined: Fri Oct 17, 2003 9:17 pm

  • Quote

Post by o5gmmob8 » Sun Oct 12, 2025 6:02 am

The size of the drive isn't the issue, my use case is a special one. I will be booting the system to RAM so I will copy the contents of the USB image to memory so that the USB stick can be removed. The systems I will be operating on have 8GB of ram, but even before that, the less I can put on the image, the faster it will load and all of that good stuff.

I want to essentially make it like an embedded device, like a wifi router that boots up a tiny Linux system.

Yes, I was thinking that I'd use lddtree and I think I'd probably start with a list of executables and from that, generate a list of files. I will start from the ugrd code and go from there. Right now for reference, my system is about 2.5GB and maybe 2.2GB compressed. It will surely work, but I want to optimize ...
Top
Post Reply

4 posts • Page 1 of 1

Return to “Installing Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic