Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thanatisia/py-chroot
A simple implementation of chroot made in python that starts up a REPL for traversing the chroot virtual environment
https://github.com/thanatisia/py-chroot
Last synced: 9 days ago
JSON representation
A simple implementation of chroot made in python that starts up a REPL for traversing the chroot virtual environment
- Host: GitHub
- URL: https://github.com/thanatisia/py-chroot
- Owner: Thanatisia
- License: mit
- Created: 2024-06-05T13:22:54.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-06-06T15:47:05.000Z (5 months ago)
- Last Synced: 2024-06-07T15:36:36.712Z (5 months ago)
- Language: Python
- Size: 1.19 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOGS.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# pychroot - Chroot implementation in python with TUI/REPL
## Information
### Project
+ Project Name: py-chroot
+ Package Version: v0.2.0
- Repository:
+ GitHub: https://github.com/Thanatisia/py-chroot### Description
+ A simple chroot CLI utility made in python that starts up a REPL for traversing the chroot### Motivation
- I wanted to see if I could make a proper chroot interface/shell in Python as I knew how to do the fundamental workflow on their own (i.e. individual functions to chroot into the system, print and exit)
+ The thought of making a cross-platform chroot utility came to mind, hence the project idea
+ The more I wrote, I somehow ended up with a REPL and I guess a working (albeit incredibly lackluster) shell### Demo
+ ![pychroot demo 1](resources/demo/gifs/pychroot.gif)## Setup
### Dependencies
+ python
### Pre-Requisites## Documentations
### Synopsis/Syntax
```bash
py-chroot {options}
```### Parameters
#### Positionals
#### Optionals
- With Arguments
- `-p | --prompt [custom-prompt]` : Specify the custom string you wish to set as your REPL/shell prompt
+ Type: String
- Notes
+ Ensure that you wrap your string with a single quote ('your-string') to ensure that none of the string gets executed on boot time
+ Format: `-p '"your-string"'
- `-r | --root [root-directory]` : Specify the target root directory within the root filesystem to jump into
+ Type: String
- `-m | --mount [rootfs-mount-path]` : Specify the target root filesystem mount path to chroot into
+ Type: String
- Flags
+ -h | --help
+ -v | --version### Usage
- Basic Chroot into a new root filesystem
```bash
py-chroot {-m|--mount [rootfs-mount-directory]} {-r|--root [root-directory]}
```### Terminal UI (REPL) Key Commands
- `cd [directory]` : Change directory into the specified directory path
- enter : Enter/Chroot into the specified new rootfs directory
- exit | quit : Exit the REPL shell
- exit-chroot : Exit the current chroot session to go back up to the original rootfs
- help : Display help menu (this)
- version : Display system information
- : The command will be executed on run## Wiki
## Resources
## References
+ [nessy.info - 2013-12-05 - Python chroot and exit chroot](https://nessy.info/post/2013-12-05-python-chroot-and-exit-chroot/)## Remarks