GithubHelp home page GithubHelp logo

k3s-root's Introduction

k3s-root

==========

NOTE: this repository has been recently (2020-11-18) moved out of the github.com/rancher org to github.com/k3s-io supporting the acceptance of K3s as a CNCF sandbox project.


k3s-root is based on https://github.com/buildroot/buildroot and provides the userspace binaries for rancher/k3s

Building

k3s-root is dapper powered, which means you should be able to simply make on your machine to compile. By default, make will compile for amd64. If you want to compile for other architectures, you can run commands like:

make ARCH=arm64

or alternatively, if you want to compile all architectures at once, you can run:

make all-build

If it is not the first time you build, delete the directories artifacts/ and dist/ to avoid problems when creating the symbolic link in the package step

sudo rm -r artifacts/ dist/

The default way of building this project is through container using dapper. If you want to tinker and have more control over the build process, it is more practical to use Vagrant with the existing Vagrantfile

Upgrading to new buildroot version

To upgrade to a new buildroot version, you must follow 4 steps:

1 - Modify the BUILDROOT_VERSION in scripts/download

2 - Check what is the busybox version in the new buildroot package. Then, upgrade the package/busybox.config by cloning the busybox project and then:

git checkout $busybox_version
cp $K3S_ROOT_PATH/package/busybox.config .config
make oldconfig
# Choose the new options
cp .config $K3S_ROOT_PATH/package/busybox.config

3 - Follow the same steps with the buildroot/ configurations. The command make oldconfig also works in the buildroot project

4 - Verify if the upgrade worked correctly by comparing the old tarball and the new one. If the same files are there, then you are set

k3s-root's People

Contributors

akihirosuda avatar brandond avatar chazapis avatar dweomer avatar erikwilson avatar ibuildthecloud avatar jandubois avatar manuelbuil avatar oats87 avatar oxr463 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

k3s-root's Issues

s390x support

We are working on building k3s-root on s390x, since we need the binaries generated in k3s-root in order to build rke2 on s390x. Unfortunately, buildroot doesn't support static builds on s390x https://bugs.busybox.net/show_bug.cgi?id=14256
Would it be possible to use shared libraries instead of static?

scripts should verify checksum

To detect potential compromise, the scripts should verify checksum here

curl -fL https://buildroot.org/downloads/buildroot-${BUILDROOT_VERSION}.tar.bz2 | tar xvjf - -C /usr/src/buildroot --strip-components=1

k3s-root/scripts/package

Lines 25 to 40 in 38468f8

# download pre-built binaries
SLIRP4NETNS_VERSION="v1.1.8"
FUSE_OVERLAYFS_VERSION="v1.3.0"
uname_m="${BUILDARCH}"
case "${BUILDARCH}" in
"amd64")
uname_m="x86_64" ;;
"arm64")
uname_m="aarch64" ;;
"arm")
uname_m="armv7l" ;;
esac
curl -o /source/artifacts/${BUILDARCH}/bin/slirp4netns -sSL https://github.com/rootless-containers/slirp4netns/releases/download/${SLIRP4NETNS_VERSION}/slirp4netns-${uname_m}
chmod +x /source/artifacts/${BUILDARCH}/bin/slirp4netns
curl -o /source/artifacts/${BUILDARCH}/bin/fuse-overlayfs -sSL https://github.com/containers/fuse-overlayfs/releases/download/${FUSE_OVERLAYFS_VERSION}/fuse-overlayfs-${uname_m}
chmod +x /source/artifacts/${BUILDARCH}/bin/fuse-overlayfs

Including k3s-root in vanilla buildroot build?

What is the preferred way of including k3s-root in Buildroot built Linux image? I imagine building the k3s-root separately and adding the produced binaries using BR2_ROOTFS_OVERLAY is one option. Is there a better way?

ebtables-legacy segfauls on s390x with SLE15-SP2

I just took binaries from https://github.com/k3s-io/k3s-root/releases/download/v0.10.0-rc.0/k3s-root-xtables-s390x.tar https://github.com/k3s-io/k3s-root/releases/download/v0.10.0-rc.0/k3s-root-s390x.tar and executed on s390x VM with SLE15-SP2:

./bin/aux/ebtables-legacy
Segmentation fault (core dumped)

kernel info:

sles@rancher-sles15sp2-jeos-ext4-devnet:~/k3s-root-release/k3s-root> uname -a
Linux rancher-sles15sp2-jeos-ext4-devnet 5.3.18-24.43-default #1 SMP Thu Dec 3 21:53:21 UTC 2020 (b48bf35) s390x s390x s390x GNU/Linux

just help:

strace ./bin/aux/ebtables-legacy --help
execve("./bin/aux/ebtables-legacy", ["./bin/aux/ebtables-legacy", "--help"], 0x3ffc307f3f8 /* 49 vars */) = 0
set_tid_address(0x10187d0)              = 29685
brk(NULL)                               = 0x2fef000
brk(0x2ff1000)                          = 0x2ff1000
mmap(0x2fef000, 4096, PROT_NONE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2fef000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x3ff948fd000
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=NULL} ---
+++ killed by SIGSEGV (core dumped) +++
Segmentation fault (core dumped)

and list tables:

strace -f ./ebtables-legacy -L
execve("./ebtables-legacy", ["./ebtables-legacy", "-L"], 0x3ffe7cfe910 /* 45 vars */) = 0
set_tid_address(0x10187d0)              = 29793
brk(NULL)                               = 0x2fba000
brk(0x2fbc000)                          = 0x2fbc000
mmap(0x2fba000, 4096, PROT_NONE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2fba000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x3ff9befd000
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=NULL} ---
+++ killed by SIGSEGV (core dumped) +++
Segmentation fault (core dumped)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.