GithubHelp home page GithubHelp logo

chroot builds about kiss HOT 4 CLOSED

kisslinux avatar kisslinux commented on May 29, 2024
chroot builds

from kiss.

Comments (4)

dylanaraps avatar dylanaraps commented on May 29, 2024 1

This can already be done right now (though manually). The installation tarball is also a fully working chroot environment.

A simple script could be written to automatically create/destroy KISS chroot environments while doing a build in this environment in-between.

I'll think about how best to implement this though it shouldn't be too difficult.

from kiss.

a-schaefers avatar a-schaefers commented on May 29, 2024 1

It looks slick, sorry I'm late to this, I haven't even been able to test it yet.

from kiss.

dylanaraps avatar dylanaraps commented on May 29, 2024

This simple script will setup and create a simple KISS chroot and drop you inside of it. Once you type exit the chroot is then destroyed. The script will download/extract the original chroot tarball once (cache) and will then simply cp the original to a temporary and unique directory.

You can make any modifications you like to the kiss-chroot/ directory as this will remain untouched by the script unless it is removed. Think of this as how you could add a repository etc. You'd just need to kiss-chroot into the "master" and make any changes you'd like to include in each temporary chroot.

To reset the chroot master simply remove kiss-chroot/. To reset and redownload the chroot simply remove kiss-chroot/ and kiss-chroot.tar.xz.

To make more sense of it, here's what the directory hierarchy looks like:

kiss-chroot.tar.xz  # The cached chroot tarball. 
kiss-chroot/        # The "master"/"base" chroot (make your changes here).
chroot-$pid/        # A copy of kiss-chroot/ which is created/destroyed using the script.
#!/bin/sh -e
#
# Create/destroy temporary chroots.

log() {
    printf '\033[31;1m->\033[m %s.\n' "$@"
}

clean() {
    log "Destroying chroot"
    su -c "rm -rf chroot-$pid" || clean
}

pid=$$

cd "${cac_dir:=$KISS_ROOT${XDG_CACHE_HOME:-$HOME/.cache}/kiss}"

[ -f kiss-chroot.tar.xz ] || {
    log "Downloading chroot tarball"
    wget https://dl.getkiss.org/kiss-chroot.tar.xz
}

[ -d kiss-chroot ] || {
    log "Extracting chroot"
    tar xvf kiss-chroot.tar.xz
}

log "Creating temporary chroot"
cp -a kiss-chroot "chroot-$pid"

trap clean EXIT INT

log "Entering chroot"
su -c "kiss-chroot chroot-$pid"

from kiss.

dylanaraps avatar dylanaraps commented on May 29, 2024

Any thoughts on the above script?

from kiss.

Related Issues (20)

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.