GithubHelp home page GithubHelp logo

gokrazy / freeze Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 0.0 6 KB

Little helper to create tar balls of an executable together with its ELF shared library dependencies. Useful for prototyping with gokrazy: https://gokrazy.org/prototyping/

License: BSD 3-Clause "New" or "Revised" License

Go 100.00%

freeze's Introduction

GitHub Actions CI Go Report Card

Overview

With gokrazy, you can deploy your Go programs as appliances to a Raspberry Pi or PC (→ supported platforms).

For a long time, we were unhappy with having to care about security issues and Linux distribution maintenance on our various Raspberry Pis.

Then, we had a crazy idea: what if we got rid of memory-unsafe languages and all software we don’t strictly need?

Turns out this is feasible. gokrazy is the result.

→ Learn more at gokrazy.org

GitHub Repository structure

Documentation

gokrazy.org uses hugo for creating and generating the website. You can find the hugo install instructions here: Install Hugo. With hugo you can write documentation in Markdown and generate a static website from it.

The website subdirectory is hugo’s root directory. In order to preview the documentation or to re-generate the website, switch the directory to website.

To preview the website, run the hugo webserver:

hugo serve

Generate the website:

hugo

The updated website content will be stored in the ./docs directory. Do not update anything here manually.

freeze's People

Contributors

stapelberg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

freeze's Issues

libresolv / libnss are not frozen (for iperf3, or wget)

When name resolution (via getaddrinfo) is broken due to lack of libnss*.so and libresolv*.so, iperf3 fails to start with an opaque error message (iperf3: error - unable to send control message: Bad file descriptor).

Looks like libnss_dns* and libresolv* are the minimum files we need for name resolution to work.

Refactor the way dependencies are foudn?

There are a couple of issues with the FindShLibs() function:

  • Some executables like /usr/sbin/nft b0rk at no arguments passed and exit with an exit status of 1. I kid you not 🤦‍♂️ Whoever designed the nft tool this way, shame 😅
  • Furthermore, I found that the LD_TRACE_LOADED_OBJECTS=1 seems to be a GNU LIBC thing only? This does not work on Alpine for example which uses musl? (I could be wrong) but I wasn't able to use freeze on Alpine.

[comment] same need, same solution

I came across the same need when packaging a python application into a standalone folder.

I used the same trick : embed libs given by ldd with the exe into a tarball. Work pretty well.

Since I'm more a shell guy than a go guy, I used the following:

# cd into dist folder
ldd $1       |  # list shared libs
  awk '$2 == "=>" { print $3 }' |  # format ldd output
  sort -u    |  # remove duplicated
  tar c -T - |  # tar from file list from stdin
  tar x         # untar in current folder

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.