GithubHelp home page GithubHelp logo

Comments (6)

steverweber avatar steverweber commented on June 23, 2024

even with validate_postnonchroot_template disabled i'll git issues with how the command is split on space.

So I think it would be best to add a new option: PostChrootBashCmds

and have code like:

PostChrootBashCmds = ['echo hello', 'curl http://ascript | sh']
with ChrootOpen(target_dir) as _:
    for cmd in PostChrootBashCmds:
        subprocess.call(['/bin/bash', '-c', cmd])

from ister.

bryteise avatar bryteise commented on June 23, 2024

So do you want a non-chroot and chroot version of this post install shell command runner?

Also giving the shell commands the chroot location in an environment variable seems like the best way to go in the non-chroot case, is that fitting with your use case?

from ister.

steverweber avatar steverweber commented on June 23, 2024

I think the chroot version is more helpfull but having the none chroot version would be a nice extra.

agree passing in the chroot path as an env var is the way to go.

If you do go to add these. Perhaps also add a PreBashCmds. This would allow some way to shim in support for odd things like perhaps raid drivers.

from ister.

bryteise avatar bryteise commented on June 23, 2024

I have code working for the both chroot and non-chroot post handlers. I'm curious when exactly you'd like the pre handlers to be run though. I'd guess you'd get the most flexability from having them run directly after template validation but that could be too early. From my perspective having commands run after validation and before any actual processing would be enough to support raid. Any more details for your use case would be handy here.

from ister.

steverweber avatar steverweber commented on June 23, 2024

I didn't have a true use case for the pre command.

debian has something like this d-i preseed/early_command it runes before the partitioner, so after validation should be a good place.

from ister.

bryteise avatar bryteise commented on June 23, 2024

@steverweber #105 created in response to this issue.

from ister.

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.