pikhq / bootstrap-linux Goto Github PK
View Code? Open in Web Editor NEWA Linux system which is just barely capable of building itself.
A Linux system which is just barely capable of building itself.
This is a complete, self-bootstrapping musl-based Linux system. It contains nothing more than Linux, Busybox, Binutils, GCC, GMP, MPFR, MPC, and GNU Make. I haven't attempted to minimize the configuration of these (yet), merely the package set. The programs get static-linked, but musl does install a dynamic linker, and GCC should be able to link programs against it. To build this from a non-musl Linux system, you will need to execute ./bootstrap.sh. This will build musl and a cross compiler, and then build the system against it, placing the result in ./out. ./make_fs.sh can be used to generate a bootable ext2 filesystem from the out directory. To use it, you will need the "genext2fs" program installed. If you don't feel like using it, you can just copy the files onto a filesystem of your choice and boot it. Some todos: * Fix the busybox patches so they work with latest busybox * Update to Linux 3.4 (after fixing those patches) * Backport the GCC patches, so I can use 4.2.x, and then remove MPFR, MPC, and GMP
this needs to be fixed to prevent software using tls from crashing
Trying to build from git head (on Ubuntu 12.04 x86_64) I get...
make[4]: Entering directory `/home/justin/musl/bootstrap-linux/work/binutils-2.22/ld'
/bin/bash ./libtool --tag=CC --mode=compile x86_64-unknown-linux-musl-gcc -DHAVE_CONFIG_H -I. -I. -I. -I../bfd -I./../bfd -I./../include -Os -DENABLE_PLUGINS -DLOCALEDIR="\"//share/locale\"" -g -O2 -Os -MT libldtestplug_la-testplug.lo -MD -MP -MF .deps/libldtestplug_la-testplug.Tpo -c -o libldtestplug_la-testplug.lo `test -f 'testplug.c' || echo './'`testplug.c
libtool: compile: x86_64-unknown-linux-musl-gcc -DHAVE_CONFIG_H -I. -I. -I. -I../bfd -I./../bfd -I./../include -Os -DENABLE_PLUGINS -DLOCALEDIR=\"//share/locale\" -g -O2 -Os -MT libldtestplug_la-testplug.lo -MD -MP -MF .deps/libldtestplug_la-testplug.Tpo -c testplug.c -fPIC -DPIC -o .libs/libldtestplug_la-testplug.o
libtool: compile: x86_64-unknown-linux-musl-gcc -DHAVE_CONFIG_H -I. -I. -I. -I../bfd -I./../bfd -I./../include -Os -DENABLE_PLUGINS -DLOCALEDIR=\"//share/locale\" -g -O2 -Os -MT libldtestplug_la-testplug.lo -MD -MP -MF .deps/libldtestplug_la-testplug.Tpo -c testplug.c -o libldtestplug_la-testplug.o >/dev/null 2>&1
mv -f .deps/libldtestplug_la-testplug.Tpo .deps/libldtestplug_la-testplug.Plo
/bin/bash ./libtool --tag=CC --mode=link x86_64-unknown-linux-musl-gcc -g -O2 -Os -no-undefined -rpath /nowhere -s -o libldtestplug.la libldtestplug_la-testplug.lo
libtool: link: x86_64-unknown-linux-musl-gcc -shared .libs/libldtestplug_la-testplug.o -Wl,-soname -Wl,libldtestplug.so.0 -o .libs/libldtestplug.so.0.0.0
/home/justin/musl/bootstrap-linux/cross/lib/gcc/x86_64-unknown-linux-musl/4.6.3/../../../../x86_64-unknown-linux-musl/bin/ld: /home/justin/musl/bootstrap-linux/cross/lib/gcc/x86_64-unknown-linux-musl/4.6.3/../../../../x86_64-unknown-linux-musl/lib/libc.a(lite_malloc.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
/home/justin/musl/bootstrap-linux/cross/lib/gcc/x86_64-unknown-linux-musl/4.6.3/../../../../x86_64-unknown-linux-musl/lib/libc.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[4]: *** [libldtestplug.la] Error 1
Doing export CFLAGS=-fPIC and adding -fPIC in the CFLAGS in bootstrap.sh seems to fix it so far, if anyone else having this issue.
I'd like to use bootstrap-linux as a starting point for a little Linux distribution project. What license is it available under?
Can you update bootstrap-linux to musl 0.9.1 ?
Thanks, Olivier.
I tend to move small files between my various VirtualBox VMs via my various email accounts. So after building bootstrap-linux in ArchBang Linux, I bzip2'd it so that it can be dl'd by my host machine. However, when I attach it to the email, Yahoo! reports the 13.7MB filesystem.img.bz2 file to contain file that has a virus. It recommends that I remove the one infected file and then re-attach. Any idea what Yahoo! is talking about?
Hello!
I'm sorry for being a total newbie.
I've built bootstrap-linux, made filesystem.img, but when I try to boot it with qemu (qemu-system-x86_64 filesystem.img
) I get error:
Booting form Hard disk... Boot failed: not a bootable disk
Hi, i want to use newer gcc, so i had tried cross compiler from musl-cross.
all build succeed, but after bootstrap-linux booted, native gcc compile failed.
[btw, older native musl-gcc version(4.2.1) works fine.]
the error message:
gcc hello.c
libgcc_s.so.1 not found needed by as
musl-cross configuration:
https://github.com/GregorR/musl-cross
CC_BASE_PREFIX=/opt/cross
MAKEFLAGS=-j8
BINUTILS_VERSION=2.23.2
GCC_VERSION=4.8.0
MUSL_VERSION=0.9.10
GCC_BUILTIN_PREREQS=yes
host compiler version:
gcc-4.8.0.tar.bz2
gmp-5.1.1.tar.xz
mpc-1.0.1.tar.gz
mpfr-3.1.2.tar.xz
musl version :
musl-0.9.10.tar.gz (git version compressed as 0.9.10)
linux version:
linux-3.8.8.tar.bz2
make_fs.sh only creates a filesystem image, but does not produce a bootable image (via lilo, grub, or direct kernel placement).
I'm happy to contribute this - any preference for method?
Hi, after boot, i am trying to compile gcc with native gcc(x86_64-linux-musl) compiler.
libstdc++ doesn't exist, previous bootstrap installation, it didn't compile libstdc++..
Awesome project! Could we publish this as a Docker image, to make it easier for others to tinker with?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.