Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Last revisionBoth sides next revision | ||
building-snacklinux [2022/12/18 09:19] – snacsnoc | building-snacklinux [2022/12/19 02:00] – snacsnoc | ||
---|---|---|---|
Line 6: | Line 6: | ||
**Debian** | **Debian** | ||
- | ``` | + | |
- | apt-get install build-essential git libgmp-dev libmpc-dev flex bison bc | + | apt-get install build-essential git libgmp-dev libmpc-dev flex bison bc |
- | ``` | + | |
Optional: | Optional: | ||
- | ``` | + | |
- | apt-get install genisoimage #used for generating x86 ISO images | + | apt-get install genisoimage #used for generating x86 ISO images |
- | ``` | + | |
**Mac OS*** | **Mac OS*** | ||
Line 19: | Line 19: | ||
#### gcc | #### gcc | ||
- | ``` | + | |
- | arch -arm64 brew install gcc@12 | + | arch -arm64 brew install gcc@12 |
- | ``` | + | |
If you have an alternate version of gcc installed, create symlinks: | If you have an alternate version of gcc installed, create symlinks: | ||
- | ``` | + | |
cd / | cd / | ||
ln -s gcc-12 gcc | ln -s gcc-12 gcc | ||
ln -s g++-12 g++ | ln -s g++-12 g++ | ||
- | ``` | + | |
# Toolchain | # Toolchain | ||
Line 36: | Line 36: | ||
Compile your own toolchain with [musl-cross-make](https:// | Compile your own toolchain with [musl-cross-make](https:// | ||
- | `git clone https:// | + | git clone https:// |
### arm64 | ### arm64 | ||
- | ``` | + | |
- | TARGET=aarch64-linux-musl make | + | TARGET=aarch64-linux-musl make |
- | TARGET=aarch64-linux-musl make install | + | TARGET=aarch64-linux-musl make install |
- | ``` | + | |
### x86 | ### x86 | ||
- | ``` | + | |
- | TARGET=i486-linux-musl make | + | TARGET=i486-linux-musl make |
- | TARGET=i486-linux-musl make install | + | TARGET=i486-linux-musl make install |
- | ``` | + | |
Line 56: | Line 56: | ||
- | Installs to `output/` | + | Installs to output/ |
Add the toolchain to your shell' | Add the toolchain to your shell' | ||
- | `export PATH=$PATH:/ | + | |
# Building SnackLinux | # Building SnackLinux | ||
Line 64: | Line 64: | ||
## Environment vars | ## Environment vars | ||
- | `JOBS` Set number of parallel jobs to create, defaults to -j8 | + | JOBS Set number of parallel jobs to create, defaults to -j8 |
Example | Example | ||
- | `make busybox JOBS=-j12` | + | make busybox JOBS=-j12 |
### Architechtures | ### Architechtures | ||
Change target arch by using switches with make: | Change target arch by using switches with make: | ||
- | ``` | + | |
arch=aarch64 | arch=aarch64 | ||
arch=x86 | arch=x86 | ||
arch=x86_64 | arch=x86_64 | ||
- | ``` | + | |
Building for arm64: | Building for arm64: | ||
Example | Example | ||
- | `make busybox arch=aarch64 JOBS=-j4` | + | |
Defaults to x86 | Defaults to x86 | ||
Line 88: | Line 88: | ||
## Versions | ## Versions | ||
- | See `defs.sh` for kernel and package versions | + | See defs.sh for kernel and package versions |
Line 96: | Line 96: | ||
Download source tars and link | Download source tars and link | ||
- | `bash ./ | + | |
Set the amount of parallel jobs to run when using make | Set the amount of parallel jobs to run when using make | ||
- | ``` | + | |
- | export JOBS=j16 | + | export JOBS=j16 |
- | ``` | + | |
Compile the kernel | Compile the kernel | ||
- | ``` | + | |
- | make kernel | + | make kernel |
- | ``` | + | |
Build musl, Bash and BusyBox | Build musl, Bash and BusyBox | ||
- | ``` | ||
- | make system | ||
- | ``` | ||
- | Install to `/ | + | make system |
+ | |||
+ | |||
+ | Install to / | ||
+ | |||
+ | |||
+ | make install | ||
- | ``` | ||
- | make install | ||
- | ``` | ||
Next step: [booting](# | Next step: [booting](# | ||
Line 128: | Line 128: | ||
#### Linux - | #### Linux - | ||
- | ``` | + | |
- | make kernel | + | make kernel |
- | ``` | + | |
#### musl - | #### musl - | ||
- | ``` | + | |
- | make musl | + | make musl |
- | ``` | + | |
#### BusyBox - | #### BusyBox - | ||
- | ``` | + | |
- | make busybox | + | make busybox |
- | ``` | + | |
#### Bash - | #### Bash - | ||
- | ``` | + | |
- | make bash | + | make bash |
- | ``` | + | |
#### Binutils (optional) | #### Binutils (optional) | ||
- | ``` | + | |
- | make binutils | + | make binutils |
- | ``` | + | |
#### Syslinux | #### Syslinux | ||
- | ``` | + | |
- | make syslinux | + | make syslinux |
- | ``` | + | |
If you would also like to install binutils, use: | If you would also like to install binutils, use: | ||
- | ``` | + | |
- | make binutils-install | + | make binutils-install |
- | ``` | + | |
#### stripping symbols | #### stripping symbols | ||
This target strips all debug symbols files matching LSB executable, shared object or ar archive | This target strips all debug symbols files matching LSB executable, shared object or ar archive | ||
- | ``` | + | |
- | make arch=arm64 strip-fs | + | make arch=arm64 strip-fs |
- | ``` | + | |
# Booting | # Booting | ||
- | Prerequisites: | + | |
- | ``` | + | |
#Base files (/etc) | #Base files (/etc) | ||
- | git clone https:// | + | |
- | cp -R snacklinux-base/ | + | cp -R snacklinux-base/ |
#Create ./dev files | #Create ./dev files | ||
- | ./ | + | |
#fbpkg (package manager) | #fbpkg (package manager) | ||
- | git clone https:// | + | |
- | cp fbpkg/ | + | cp fbpkg/ |
- | ``` | + | |
## ISO | ## ISO | ||
- | Run `make iso`. The output ISO will be in `iso/` | + | Run make iso. The output ISO will be in iso/ |
Note: you do not have to have the toolchain to create the ISO | Note: you do not have to have the toolchain to create the ISO | ||
Line 194: | Line 194: | ||
## qemu | ## qemu | ||
Create a gzipped rootfs by running: | Create a gzipped rootfs by running: | ||
- | ``` | + | |
- | cd / | + | cd / |
- | ``` | + | |
Packages | Packages | ||
Line 205: | Line 205: | ||
Hacking | Hacking | ||
------- | ------- | ||
- | Edit anything in `/ | + | Edit anything in / |
The kernel can also be recompiled to fit your needs. | The kernel can also be recompiled to fit your needs. | ||
- | The `boot/ | + | The boot/ |