Skip to content

Aarav90-cpu/BlackBox-Linux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blackbox Linux

A minimal, ultra-lightweight Linux distribution. ( This Project is in Alpha. Only use for testing purposes. Many fatures listed are not available yet. )

ISO SIZE: ~35 MB

Project Size ~3 GB


About

Blackbox Linux is a challenge for Linux professionals and enthusiasts. If you can master this minimal OS with only essential Unix utilities, you've truly proven your Linux expertise.

Features

  • Minimal footprint - Only the essentials included
  • Lightweight - Perfect for resource-constrained environments
  • Pure Linux - No bloat, no package managers, no hand-holding

What's NOT Included

  • Package managers
  • Pre-built binaries
  • Desktop environments
  • Additional utilities
  • No Documentation

Issues

  • No Internet. To be Patched. You can edit source code to add it your self.

Getting Started

Currently, pre-built ISO files are available for few beta versions which are unstable.

Needed:

Arch Linux

User named bbox.

Installation

Download the latest from the Releases page.

WARNING: At least the user must know the basic commands of linux. E.g. (ls, cp, ,v, tar, wget, etc.)

Making The Enviornment

  • Create the user bbox:

    sudo useradd -s /bin/bash -m bbox

  • Set password for the user. ( Make sure the user has sudo privliges )

  • Run this to create a file called .bash_profile:

     cat > ~/.bash_profile << "EOF"
     export BB_ROOT="$HOME/blackbox-linux"
     export BB_SYSROOT="$BB_ROOT/sysroot"
     export BB_TOOLS="$BB_ROOT/cross-tools"
     export TARGET="x86_64-linux-musl"
     export PATH="$BB_TOOLS/bin:$PATH"
     EOF
     

Note: Every time you open a new terminal or reboot/shutdown ( suspend as well if you really want to be safe ) run:

source~/.bash_profile

DO NOT RUN THIS COMMAND NOW!

  • Create a new folder called blackbox-linux and cd into it.

  • Then download the latest package unzip it into your directory using tar.

  • Then run cd .. && source ~/.bash_profile && cd blackbox-linux

Making Directories

  • Create the following directories as git does not allow empty directories!

     
     mkdir $BB_ROOT/rootfs/proc
     mkdir $BB_ROOT/rootfs/sys
     mkdir $BB_ROOT/rootfs/dev
     mkdir $BB_ROOT/rootfs/run
     mkdir $BB_ROOT/rootfs/tmp
       

Cleaning Up

  • Clear out some prebuilt files ( This will remove the premade ISO )

      
      rm -f blackbox.iso initramfs.cpio.gz
      

Kernel and git lfs

Install git lfs on your system using

sudo pacman -Syu git-lfs

  • Run the following commands to fetch the git lfs files.
git lfs install
git lfs checkout
git lfs fetch
  • Compile the kernel.
cd $BB_ROOT/linux-6.18.21

# 1. Deep clean the source tree
make mrproper

# 2. Extract the Arch config from memory
zcat /proc/config.gz > .config

# 3. Update the config to match your kernel version with defaults
make ARCH=x86_64 CROSS_COMPILE=$BB_TOOLS/bin/$TARGET- olddefconfig

# 4. Forge the Kernel
make ARCH=x86_64 CROSS_COMPILE=$BB_TOOLS/bin/$TARGET- -j$(nproc) bzImage

Adding Stuff

Now if you want to make changes you are free to do so. But according to the Apache 2.0 License.

Also instead of editing the init file at $BB_ROOT/rootfs/ edit the file init_config at $BB_ROOT/rootfs/etc/. When the OS starts the init file runs source /etc/init_config

Packing Initramfs

  • Go to rootfs

  • Run the following command

    find . | cpio -o -H newc | gzip -9 > ../initramfs.cpio.gz
  • Go back to /home/bbox/blackbox-linux/

Staging the ISO

Now if you are done run these. ( If you set anything else up that needs aditional commands to be run during this step then do those as well )

  • Copy the initramfs.cpio.gz to iso_root/boot/

  • Copy the bzImage file at linux-6.18.21/arch/x86/boot/bzImage to iso_root/boot/

Inastalling Packages and Forgeing the ISO

  • Install the following packages:

     sudo pacman -Syu qemu-full xorriso
  • Forge the ISO using this:

     
     xorriso -as mkisofs \
       -o blackbox.iso \
       -b boot/isolinux/isolinux.bin \
       -c boot/isolinux/boot.cat \
       -no-emul-boot -boot-load-size 4 -boot-info-table \
       -R -J iso_root
     

Testing (QEMU)

WARNING: DO NOT GO BARE METAL. THIS OS IS NOT TESTED FOR IT YET. BOOT AT OWN RISK.

Use qemu to boot, install or play around.

 
 qemu-system-x86_64 \
   -cdrom blackbox.iso \
   -m 5G -smp 5 \
   -netdev user,id=net0 -device e1000,netdev=net0 \
   -nographic
   

Have FUN!

Contribute

Found an issue? This is your opportunity to prove your Linux powers!

Please report bugs and issues in the Issues tab so they can be patched.

Join Discussions


Challenge accepted? Install Blackbox Linux and show the world you're a true Linux pro.