{"id":15007318,"url":"https://github.com/snacsnoc/snacklinux","last_synced_at":"2025-10-20T11:59:48.841Z","repository":{"id":7354729,"uuid":"8679096","full_name":"snacsnoc/snacklinux","owner":"snacsnoc","description":"Linux distribution for lazy people","archived":false,"fork":false,"pushed_at":"2025-04-01T06:58:42.000Z","size":71269,"stargazers_count":16,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-09T15:10:31.076Z","etag":null,"topics":["binutils","busybox","linux","linux-distribution","linux-distros","musl","musl-libc","operating-system","syslinux"],"latest_commit_sha":null,"homepage":"https://snacklinux.org","language":"Makefile","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/snacsnoc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-03-10T01:43:31.000Z","updated_at":"2025-03-25T23:37:51.000Z","dependencies_parsed_at":"2023-11-18T06:27:08.624Z","dependency_job_id":"3b5472b2-14a1-48c7-a0d4-0c4687e1f64e","html_url":"https://github.com/snacsnoc/snacklinux","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/snacsnoc/snacklinux","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snacsnoc%2Fsnacklinux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snacsnoc%2Fsnacklinux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snacsnoc%2Fsnacklinux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snacsnoc%2Fsnacklinux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snacsnoc","download_url":"https://codeload.github.com/snacsnoc/snacklinux/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snacsnoc%2Fsnacklinux/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268689815,"owners_count":24291079,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binutils","busybox","linux","linux-distribution","linux-distros","musl","musl-libc","operating-system","syslinux"],"created_at":"2024-09-24T19:08:18.509Z","updated_at":"2025-10-20T11:59:43.771Z","avatar_url":"https://github.com/snacsnoc.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"![logo](http://snacklinux.geekness.eu/_media/logo-smaller.png)SnackLinux\n===========\n![alt text](http://snacklinux.geekness.eu/_media/ezgif.com-gif-maker_1_.gif)\n\n:computer: SnackLinux is an ultra minimal Linux distribution for 486 CPUs\n\n:wrench: Linux 4.4 kernel with BusyBox, musl, and Bash\n\n:small_orange_diamond: Built from scratch with that can run with 8MB RAM\n\n:file_folder:\tBash-based package manager [fbpkg](https://github.com/snacsnoc/fbpkg)\n\n:package: x86 has 31 packages, including a working gcc toolchain and other GNU utilities \n\n\n\nVisit [snacklinux.geekness.eu](http://snacklinux.geekness.eu) for downloads, wiki and more information about SnackLinux.\n______\n# Intro\n-------------------------------\nSnackLinux runs a barebone kernel with downloadable extra kernel modules.\n\nThe philosophy is to create a completely hackable Linux system using standard GNU utilities, controlled by makefiles. The system installs to a local directory, anything in there is included in the final build. Imagine [Linux From Scratch](https://www.linuxfromscratch.org/) but with a lot less features. If you've ever wanted to build your own Linux distribution in 30 minutes, this is the project you're after.\n\nOriginally designed to bring the latest software to vintage i486 systems, SnackLinux is built for minimal size and low RAM usage. You can use virtualization or real hardware. The x86 bootable ISO is under 5MB.\n\n\n\n\n__Archtechtures supported:__\n* x86/i486 (current, works)\n* arm64 (not maintained, works) See [Fluxflop](https://github.com/snacsnoc/fluxflop)\n* amd64/x86_64 (not maintained, but works with effort)\n\n\n# Getting started\n-------------------------------\nYou can use prebuilt ISOs, a flashable disk image for use with Compact Flash or compile from source.\nSee [Getting started](http://snacklinux.geekness.eu/getting-started) to download ISOs and a quick start guide.\n\n# Compiling SnackLinux from source\n-------------------------------\n\n\n# Build system\n\n* Linux is preferable to build with\n \n## Debian\n```\napt-get install build-essential git libgmp-dev libmpc-dev flex bison bc \n``` \n_Optional:_\n```\napt-get install genisoimage #used for generating x86 ISO images\n```\n\n## Mac OS*\n* Mac OS is **incredibly** difficult to get working alone to build the kernel, otherwise cross-compiling packages works\n* An alternative to a tradtional VM is to use something like [krunvm](https://github.com/containers/krunvm)\n\n### gcc\n```\narch -arm64 brew install gcc@12\n```\n\nIf you have an alternate version of gcc installed, create symlinks:\n```\ncd /opt/homebrew/bin\nln -s gcc-12 gcc \nln -s g++-12 g++\n```\n\n# Toolchain\n\n\n## Build your own\nCompile your own toolchain with [musl-cross-make](https://github.com/richfelker/musl-cross-make.git)\n\n`git clone https://github.com/richfelker/musl-cross-make.git`\n\n\n### x86\n\n```\nTARGET=i486-linux-musl make\nTARGET=i486-linux-musl make install\n```\n\n#### arm64\n\n```\nTARGET=aarch64-linux-musl make\nTARGET=aarch64-linux-musl make install\n```\n\n\n\n\nToolchain installs to `output/` \n\nAdd the toolchain to your shell's PATH:\n```\nexport PATH=$PATH:/path/musl-cross-make/output/bin\n```\n\n# Building SnackLinux\nAfter our toolchain is built, we can build SnackLinux which includes the kernel and user utilities.\n\n## Environment vars\n\n `JOBS` \nSet number of parallel jobs to create, defaults to 8\nExample:\n`export JOBS=12`\n\n`ROOTFS_PATH`\nPath to SnackLinux root filesystem, defaults to `/opt/snacklinux_rootfs`\n\n### Architechtures\n```\nTARGET=aarch64\nTARGET=i486\nTARGET=x86_64\n```\nDefaults to `i486`\n\n__Example, building for arm64:__\n\n`export TARGET=aarch64 JOBS=4`\n\n\n## Versions\nSee `defs.sh` for defined kernel and package versions\n\n\n## Getting started\n\n\n* Download source tars and link\n\n`bash ./download_prereq.sh `\n\n* Create target install directory\n`mkdir /opt/snacklinux_rootfs`\n\n* Compile the kernel\n_See `configs/linux` for available configs_\n```\nmake kernel\n```\n\n* Build musl, Bash and BusyBox\n```\nmake system\n```\n\n* Install to `/opt/snacklinux_rootfs` directory\n\n```\nmake install\n```\n\nNext step: [booting](#Booting)\n\n\n#### Compile individual packages\nYou can alternatively build the individual software and install at your will.\n\n#### Linux\n\n```\nmake kernel\n```\n\n#### musl\n```\nmake musl\n```\n#### BusyBox\n\n```\nmake busybox\n```\n \n#### Bash\n\n```\nmake bash\n```\n#### Binutils (optional)\n\n```\nmake binutils\n```\n\n#### Syslinux\n\n```\nmake syslinux\n```\n\n#### Python (experimental)\n\n```\nmake python\n```\n\nIf you would also like to install binutils, use:\n\n```\nmake binutils-install\n```\n\n#### stripping symbols\n\nThis target strips all debug symbols files matching LSB executable, shared object or ar archive \n```\nmake strip-fs\n```\n\n#### additional packages\nSee [building packages](http://snacklinux.geekness.eu/packages)\n# Booting\nPrerequisites:\n\n#### Base files (/etc)\n```\ngit clone https://github.com/snacsnoc/snacklinux-base.git\ncp -R snacklinux-base/rootfs/* /opt/snacklinux_rootfs/\n```\n### Create /dev files and required directories\nRun as root:\n```\nbash ./tools/create_dev.sh\n```\n### fbpkg (package manager)\n```\ngit clone https://github.com/snacsnoc/fbpkg.git\ncp fbpkg/src/fbpkg /opt/snacklinux_rootfs/usr/bin\nchmod +x /opt/snacklinux_rootfs/usr/bin\n```\n# Booting \n## ISO (x86)\n\nRun `make iso` to generate a bootable ISO. The output ISO will be in `iso/`\n\nRun `make iso-with-kernel` to generate a bootable ISO with the kernel in `/boot`. The output ISO will be in `iso/`\n\n\nNote: you do not have to have the toolchain to create the ISO\n\n## Flashable boot disk\nYou can generate a disk image suitable for flashing onto a Compact Flash card (using an IDE adapter) for deployment on real hardware.\n\nCreate an image of your preferred size:\n```\ndd if=/dev/zero of=snacklinux.img bs=1M count=450\n```\n\nMount it and create a partition:\n```\nsudo losetup -Pf snacklinux.img\n\nmkdir -p /mnt/snacklinux\n\necho -e \"o\\nn\\np\\n1\\n\\n\\nw\" | sudo fdisk /dev/loop0 \nsudo mkfs.ext2 /dev/loop0p1\n\nsudo mount /dev/loop0p1 /mnt/snacklinux\n```\nCopy the root filesystem and install Syslinux bootloader:\n```\ncp -a /opt/snacklinux_rootfs/* /mnt/snacklinux/\nsudo mkdir -p /mnt/boot/extlinux\n# Copy the compressed kernel image if your rootfs does not include it\ncp linux/arch/x86/boot/bzImage /mnt/boot/extlinux\n\ncat \u003c\u003c EOF \u003e /boot/extlinux/extlinux.conf\nDEFAULT linux\nLABEL linux\n  KERNEL bzImage\n  APPEND root=/dev/hda1 rw noapic noacpi\nEOF\n\n# syslinux 6.03/6.04 is not reliable on old hardware, please use 4.07 and compile source\nsudo extlinux --install /mnt/boot/extlinux \n```\nInstall Syslinux MBR to the disk image:\n```\nsudo dd if=/usr/lib/EXTLINUX/mbr.bin of=/dev/loop0 bs=440 count=1\n```\nFinally make it bootable, unmount and detach:\n```\necho -e \"a\\nw\" | fdisk snacklinux.img\n\nsync\n\nsudo umount /mnt\n\nsudo losetup -d /dev/loop0\n```\n\n\n\n## qemu\nCreate a gzipped rootfs by running:\n```\ncd /opt/snacklinux_rootfs/; find . -print | cpio -o -H newc --quiet | gzip -6 \u003e ~/rootfs.gz \n```\nThen boot in qemu:\n\n### arm64:\nLinux:\n```\nqemu-system-aarch64 -M virt,highmem=off -kernel linux/arch/arm64/boot/Image -initrd rootfs.gz -append \"root=/dev/ram\" -m 256 -serial stdio -boot menu=off -cpu max -nodefaults -boot d -device virtio-gpu-pci -device virtio-keyboard-pci,id=kbd0,serial=virtio-keyboard\n```\n\nMac OS (Apple Silicon):\n```\nqemu-system-aarch64 -M virt,highmem=off -kernel Image -initrd rootfs.gz -append \"root=/dev/ram\" -m 128  -boot menu=off -cpu max -nodefaults -boot d -bios \"/opt/homebrew/Cellar/qemu/7.1.0/share/qemu/edk2-aarch64-code.fd\" -device virtio-gpu-pci  -device virtio-keyboard-pci,id=kbd0,serial=virtio-keyboard -accel hvf \n```\n\nRun a VNC server with qemu:\n`-vnc 12.34.56.78:0`\n\n### x86:\n```\nqemu-system-i386 -cpu 486-v1 -m 256 -kernel bzImage -initrd rootfs.gz -append \"root=/dev/ram rdinit=/sbin/init\"\n```\n\n\n### x86_64:\n```\nqemu-system-x86_64 -m 256 -kernel bzImage -initrd rootfs.gz -append \"root=/dev/ram rdinit=/sbin/init\"\n```\n\n# Packages\nRead the [Packages page](http://snacklinux.geekness.eu/packages) for building packages.\nFor SnackLinux's package manager fbpkg, see [here](https://github.com/snacsnoc/fbpkg).\n\n# Hacking\nEdit anything in `/opt/snacklinux_rootfs`, it is the root filesystem.\nThe kernel can also be recompiled to fit your needs. \n\nThe `boot/isolinux` directory is where ISOLINUX resides, edit the menu to adjust to your needs.\n\n# Contributing\nSnackLinux is a personal project, but I welcome contributions from the community. If you have ideas, feedback, or code changes that can improve SnackLinux, your input is valued.\n\nThanks\n------\nMike Chirico for http://souptonuts.sourceforge.net/cdrom.htm\n\nTiny Core Linux distribution for inspiration and documentation http://tinycorelinux.net\n\nGregor Richards for the many Musl compiler scripts https://github.com/GregorR\n\nLinux From Scratch for excellent documentation http://www.linuxfromscratch.org/\n\nThe Arch Linux wiki https://wiki.archlinux.org/\n\nRich Felker for creating musl-cross-make and make building so easy https://github.com/richfelker/musl-cross-make\n\nHere are links to the software used in SnackLinux:\n\n[syslinux](https://www.kernel.org/pub/linux/utils/boot/syslinux/)\n\n[linux](https://www.kernel.org)\n\n[busybox](http://www.busybox.net/downloads/)\n\n[bash](http://ftp.gnu.org/gnu/bash/)\n\n[fbpkg](https://github.com/snacsnoc/fbpkg)\n\n[binutils](http://ftp.gnu.org/gnu/binutils/)\n\n[musl](http://www.musl-libc.org/)\n\n# Resources\nhttp://port70.net/~nsz/32_dynlink.html\nhttps://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnacsnoc%2Fsnacklinux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnacsnoc%2Fsnacklinux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnacsnoc%2Fsnacklinux/lists"}