Skip to content

Tools, things, stuff, miscellaneous, etc., for Chrome OS / Chromium OS

Notifications You must be signed in to change notification settings

midipix/crosware

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

crosware

Tools, things, stuff, miscellaneous, detritus, junk, etc., primarily for Chrome OS / Chromium OS. Eventually this will be a development-ish environment for Chrome OS on both ARM and x86 (32-bit and 64-bit for both). It should work on "normal" Linux too (Armbian, CentOS, Debian, Raspbian, Ubuntu - glibc for now since jgit requires a jdk).

bootstrap

To bootstrap, using /usr/local/crosware with initial downloads in /usr/local/tmp:

# allow your regular user to write to /usr/local
sudo chgrp ${GROUPS} /usr/local
sudo chmod 2775 /usr/local

# run the bootstrap
# use curl to download the primary shell script
# this in turn downloads a jdk, jgit and a toolchain
bash <(curl -kLs https://raw.githubusercontent.com/ryanwoodsmall/crosware/master/bin/crosware) bootstrap

# source the environment
source /usr/local/crosware/etc/profile
which crosware

install some packages

# install some stuff
crosware install make busybox toybox

# update environment
source /usr/local/crosware/etc/profile

# see what we just installed
which -a make busybox toybox \
| xargs realpath \
| xargs toybox file

update

To get new recipes:

crosware update

And to re-bootstrap (for any updated zulu, jgitsh, statictoolchain installs):

crosware bootstrap

further usage

Run crosware without any arguments to see usage; i.e, a (possibly outdated) example:

usage: crosware [command]

commands:
  bootstrap : bootstrap crosware
  env : dump source-/eval-able crosware etc/profile
  help : show help
  install : attempt to build/install a package from a known recipe
  list-available : list available recipes which are not installed
  list-funcs : list crosware shell functions
  list-installed : list installed recipes
  list-recipes : list build recipes
  list-recipe-versions : list recipes with version number
  list-upgradable : list installed packages with available upgrades
  profile : show .profile addition
  run-func : run crosware shell function
  set : run 'set' to show full crosware environment
  show-env : run 'env' to show crosware environment
  uninstall : uninstall some packages
  update : attempt to update existing install of crosware
  upgrade : uninstall then install a recipe
  upgrade-all : upgrade all packages with different recipe versions

alpine

Alpine (https://alpinelinux.org/) uses musl libc (http://musl-libc.org) and as such cannot use the Zulu JDK as distributed. To bootstrap using the system-supplied OpenJDK from Alpine repos:

export CW_EXT_JAVA=true
apk update
apk upgrade
apk add bash curl openjdk8
cd /tmp
curl -kLO https://raw.githubusercontent.com/ryanwoodsmall/crosware/master/bin/crosware
bash crosware bootstrap

Make sure the environment variable CW_EXT_JAVA is set to true (or just something other than false) to use system Java. Please note that /usr/local/crosware/etc/profile contains bashisms, and does not work on BusyBox ash, so set your SHELL accordingly. If Zulu is installed on a non-glibc distro, remove the files and directory:

  • /usr/local/crosware/etc/profile.d/zulu.sh
  • /usr/local/crosware/var/inst/zulu
  • /usr/local/crosware/software/zulu/

notes

Ultimately I'd like this to be a self-hosting virtual distribution of sorts, targeting all variations of 32-/64-bit x86 and ARM on Chrome OS. A static-only GCC compiler using musl-libc (with musl-cross-make) is installed as part of the bootstrap; this sort of precludes things like emacs, but doesn't stop anyone from using a musl toolchain to build a glibc-based shared toolchain. Planning on starting out with shell script-based recipes for configuring/compiling/installing versioned "packages." Initial bootstrap looks something like:

  • get a JDK (Azul Zulu OpenJDK)
  • get jgit.sh (standalone)
  • get static bootstrapped compiler
  • checkout rest of project
  • build GNU make
  • build native busybox, toolbox, sed, etc.
  • build a few libs / support (ncurses, openssl, slang, zlib, bzip2, lzma, libevent, pkg-config)
  • build a few packages (curl, vim w/syntax hightlighting, screen, tmux, links, lynx - mostly because I use them)

environment

Environment stuff to figure out how to handle:

  • PATH (working)
  • PKG_CONFIG_LIBDIR/PKG_CONFIG_PATH (working)
  • CC (working)
  • CFLAGS (working)
  • CPP (working)
  • CPPFLAGS (working)
  • CXX (working)
  • LDFLAGS (working)
  • MANPAGER (working)
  • MANPATH
  • ACLOCAL_PATH
  • EDITOR (vim?)
  • PAGER (working, set to less (gnu or busybox))

stuff to figure out

See the to-do list

links

Chromebrew looks nice and exists now: https://github.com/skycocker/chromebrew

Alpine and Sabotage are good sources of inspiration and patches:

The Alpine folks distribute a chroot installer (untested):

And I wrote a little quick/dirty Alpine chroot creator that works on Chrome/Chromium OS; no Docker or other software necessary.

And the musl wiki has some pointers on patches and compatibility:

Mes (and m2) might be useful at some point.

Suckless has a list of good stuff:

Mark Williams Company open sourced Coherent; might be a good source for SUSv3/SUSv4/POSIX stuff:

Newer static musl compilers (GCC 6+) are "done," and should work to compile (static-only) binaries on Chrome OS:

recipes

Bootstrap recipes:

  • zulu azul zulu openjdk jvm
  • jgitsh standalone jgit shell script
  • statictoolchain musl-cross-make static toolchain

Working recipes:

Recipes to consider:

env \
  CPPFLAGS= \
  CXXFLAGS= \
  LDFLAGS='-static' \
  CFLAGS='-fPIC -Wl,-static' \
  ./configure \
    --prefix=${ridir} \
    --config-musl \
    --enable-static \
    --libpaths=${cwsw}/statictoolchain/current/${triplet}/lib \
    --crtprefix=${cwsw}/statictoolchain/current/${triplet}/lib \
    --elfinterp=${cwsw}/statictoolchain/current/${triplet}/lib/ld.so \
    --sysincludepaths=${cwsw}/statictoolchain/current/${triplet}/include
make CPPFLAGS= CXXFLAGS= LDFLAGS='-static' CFLAGS='-Wl,-static -fPIC'
make install

Bootstrap recipes that need work (i.e., arch-specific versions installed into /usr/local/tmp/bootstrap, archive, etc.); these could be used to create a fully functional build environment/initrd/chroot/container/etc.

  • 9base
  • bash
  • busybox
  • coreutils
  • curl (https, static mbedtls binary is probably best candidate)
  • dropbear
  • git (https/ssh, could replace jgit, not require a jdk?)
  • make
  • openssl
  • sbase
  • statictoolchain
  • toybox
  • ubase
  • utillinux

About

Tools, things, stuff, miscellaneous, etc., for Chrome OS / Chromium OS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%