Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
building-snacklinux [2022/12/18 09:19] snacsnocbuilding-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 /opt/homebrew/bin cd /opt/homebrew/bin
 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://github.com/richfelker/musl-cross-make.git) Compile your own toolchain with [musl-cross-make](https://github.com/richfelker/musl-cross-make.git)
  
-`git clone https://github.com/richfelker/musl-cross-make.git`+git clone https://github.com/richfelker/musl-cross-make.git
  
 ### 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's PATH: Add the toolchain to your shell's PATH:
-`export PATH=$PATH:/path/to/out/bin`+  export PATH=$PATH:/path/to/out/bin
  
 # Building SnackLinux # Building SnackLinux
Line 64: Line 64:
 ## Environment vars ## Environment vars
  
-`JOBSSet 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`+  make busybox arch=aarch64 JOBS=-j4
  
 Defaults to x86 Defaults to x86
Line 88: Line 88:
  
 ## Versions ## Versions
-See `defs.shfor 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 ./download_prereq.sh `+  bash ./download_prereq.sh 
  
 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 `/opt/snacklinux_rootfsdirectory+  make system 
 + 
 + 
 +Install to /opt/snacklinux_rootfs directory 
 + 
 + 
 +  make install
  
-``` 
-make install 
-``` 
  
 Next step: [booting](#Booting) Next step: [booting](#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: +  Prerequisites: 
-```+
 #Base files (/etc) #Base files (/etc)
-git clone https://github.com/snacsnoc/snacklinux-base.git +  git clone https://github.com/snacsnoc/snacklinux-base.git 
-cp -R snacklinux-base/rootfs/* /opt/snacklinux_rootfs/+  cp -R snacklinux-base/rootfs/* /opt/snacklinux_rootfs/
  
 #Create ./dev files #Create ./dev files
-./createdev.sh+  ./createdev.sh
  
 #fbpkg (package manager) #fbpkg (package manager)
-git clone https://github.com/snacsnoc/fbpkg.git +  git clone https://github.com/snacsnoc/fbpkg.git 
-cp fbpkg/src/fbpkg /opt/snacklinux_rootfs/usr/bin +  cp fbpkg/src/fbpkg /opt/snacklinux_rootfs/usr/bin 
-```+
 ## 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 /opt/snacklinux_rootfs/; find . -print | cpio -o -H newc --quiet | gzip -6 > ~/rootfs.gz  +  cd /opt/snacklinux_rootfs/; find . -print | cpio -o -H newc --quiet | gzip -6 > ~/rootfs.gz  
-```+
  
 Packages Packages
Line 205: Line 205:
 Hacking Hacking
 ------- -------
-Edit anything in `/opt/snacklinux_rootfs`, it is the root filesystem.+Edit anything in /opt/snacklinux_rootfs, it is the root filesystem.
 The kernel can also be recompiled to fit your needs.  The kernel can also be recompiled to fit your needs. 
  
-The `boot/isolinuxdirectory is where ISOLINUX resides, edit the menu to adjust to your needs.+The boot/isolinux directory is where ISOLINUX resides, edit the menu to adjust to your needs.