npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

wafers

v1.2.1

Published

Named file system wafer stack trees

Downloads

9

Readme

wafers

Named file system wafer stack trees

Why

I use this to compose bootable root filesystems for linux containers. I don't want all of Docker and machinectl clone is really only useful with btrfs (overlayfs feels like a better fit to me at the moment).

How

overlayfs and a bit of bash.

Usage

$ wafers stack name [parent]
$ wafers unstack stack1 [stack2] [..]

Commands

stack

Create a new stack based on the wafer name.

  • name
    The uppermost of a stack of wafers you want to create at ${STACKS}/name. The ancestry of this wafer is recursively traced automatically to produce the full stack.
  • [parent]
    If the wafer name does not yet exist, it can be created automatically as long as a parent is specified to base it on.

unstack

Assume each positional argument corresponds to a wafer stack in $STACKS, and unstack each one.

Environment variables

WAFERS

Set this to override default value of /var/lib/wafers.

STACKS

Set this to override default value of /var/lib/machines.

Example

# create and cd to $WAFERS (/var/lib/wafers by default)
$ mkdir -p /var/lib/wafers
$ cd /var/lib/wafers

# create a directory tree to represent a base wafer
$ mkdir -p archbase/data

# get some bootable rootfs in there
$ pacstrap -cdi archbase/data base --ignore linux --ignore linux-firmware 

# create a new wafer on top of another wafer and recursively mount
# the resulting stack into $STACKS (/var/lib/machines by default)
$ wafers stack archbase2 archbase
2 wafers stacked at /var/lib/machines/archbase2

# have a look at the raw wafer
$ tree archbase2/data
archbase2/data

0 directories, 0 files

# and have a look at the mounted stack
$ ls /var/lib/machines/archbase2
bin  boot  dev  etc  home  lib  lib64  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var

# boot into the stack with your fav container tool, make a change, get back out
$ systemd-nspawn -bD /var/lib/machines/archbase2
Spawning container archbase2 on /var/lib/machines/archbase2.
Press ^] three times within 1s to kill container.
systemd 237 running in system mode. (+PAM -AUDIT -SELINUX -IMA -APPARMOR +SMACK -SYSVINIT +UTMP ..snip
Detected virtualization systemd-nspawn.
Detected architecture x86-64.

Welcome to Arch Linux!

[  OK  ] Started Dispatch Password Requests to Console Directory Watch.
[  OK  ] Reached target Remote File Systems.
..snip
[  OK  ] Reached target Multi-User System.
[  OK  ] Reached target Graphical Interface.

Arch Linux 4.15.3-300.fc27.x86_64 (console)

archbase2 login: root
Last login: Fri Feb 23 03:14:32 on pts/0
[root@archbase2 ~]$ useradd -s/bin/bash -m jesse
[root@archbase2 ~]$
Container archbase2 terminated by signal KILL.

# have another look at the raw wafer to see where useradd made changes to the stack
$ tree archbase2/data
archbase2/data
├── etc
│   ├── group
│   ├── group-
│   ├── gshadow
│   ├── gshadow-
│   ├── machine-id
│   ├── passwd
│   ├── passwd-
│   ├── resolv.conf
│   ├── shadow
│   └── shadow-
├── home
│   └── jesse
├── root
└── var
    └── log
        ├── btmp
        ├── faillog
        ├── journal
        │   └── 7ee3294689ca4a9394ad8a34cc44d1d8     
        │       ├── [email protected]~
        │       └── system.journal
        ├── lastlog
        ├── tallylog
        └── wtmp

# unstack
wafers unstack archbase2

# restack (note parent wafer is only required the first time)
wafers stack archbase2

# you can also stack wafers that have no parent(s)
wafers stack archbase

# use with machinectl
machinectl start archbase
machinectl shell archbase

License

MIT