|
| 1 | +================= |
| 2 | +Project Structure |
| 3 | +================= |
| 4 | + |
| 5 | +Directory Layout |
| 6 | +---------------- |
| 7 | + |
| 8 | +:: |
| 9 | + |
| 10 | + sworkflow/ |
| 11 | + ├── sw # Main executable |
| 12 | + ├── src/ # Source modules |
| 13 | + │ ├── build.sh # Kernel build logic |
| 14 | + │ ├── build_vars.sh # Build variables |
| 15 | + │ ├── init.sh # Config generation |
| 16 | + │ ├── help.sh # Help command |
| 17 | + │ ├── version.sh # Version command |
| 18 | + │ ├── sw_functions.sh # Utility functions |
| 19 | + │ ├── sw_color.sh # Terminal colors |
| 20 | + │ └── sw_package.sh # Packaging (WIP) |
| 21 | + ├── configs/ # Device configurations |
| 22 | + ├── utils/ # Python utilities |
| 23 | + │ └── mkdtboimg.py # DTBO image creator |
| 24 | + ├── man/ # Man pages |
| 25 | + │ └── sw.1 # Main man page |
| 26 | + ├── debian/ # Debian packaging |
| 27 | + ├── docs/ # Sphinx documentation |
| 28 | + ├── tests/ # Test scripts |
| 29 | + ├── Makefile # Build system |
| 30 | + ├── setup.sh # Legacy installer |
| 31 | + └── README.md # Project readme |
| 32 | + |
| 33 | +Source Modules |
| 34 | +-------------- |
| 35 | + |
| 36 | +**sw** |
| 37 | + Main entry point. Handles command routing and path detection. |
| 38 | + |
| 39 | +**src/build.sh** |
| 40 | + Core kernel build logic. Handles: |
| 41 | + |
| 42 | + - Config loading and validation |
| 43 | + - Cross-compiler setup |
| 44 | + - Kernel compilation with make |
| 45 | + - Module installation |
| 46 | + - DTBO generation |
| 47 | + - AnyKernel3 packaging |
| 48 | + |
| 49 | +**src/init.sh** |
| 50 | + Interactive configuration generator. Creates device-specific |
| 51 | + config files with user input. |
| 52 | + |
| 53 | +**src/sw_functions.sh** |
| 54 | + Shared utility functions: |
| 55 | + |
| 56 | + - ``is_kernel_root()`` - Check if directory is a kernel tree |
| 57 | + - ``is_kernel_image_present()`` - Check for compiled kernel |
| 58 | + - ``log_info()``, ``log_error()`` - Logging functions |
| 59 | + |
| 60 | +**src/sw_color.sh** |
| 61 | + Terminal color definitions for output formatting. |
| 62 | + |
| 63 | +Installation Paths |
| 64 | +------------------ |
| 65 | + |
| 66 | +**System Installation** (``sudo make install``):: |
| 67 | + |
| 68 | + /usr/bin/sw # Executable |
| 69 | + /usr/share/sworkflow/src/ # Source modules |
| 70 | + /usr/share/sworkflow/utils/ # Python utilities |
| 71 | + /etc/sworkflow/ # Device configs |
| 72 | + /usr/share/man/man1/sw.1 # Man page |
| 73 | + |
| 74 | +**User Installation** (``make install``):: |
| 75 | + |
| 76 | + ~/.local/bin/sw # Executable |
| 77 | + ~/.local/sw/src/ # Source modules |
| 78 | + ~/.local/sw/utils/ # Python utilities |
| 79 | + ~/.local/sw/configs/ # Device configs |
| 80 | + |
| 81 | +Configuration Files |
| 82 | +------------------- |
| 83 | + |
| 84 | +Device configurations are shell scripts named ``sworkflow.<device>.config``. |
| 85 | + |
| 86 | +They are searched in order: |
| 87 | + |
| 88 | +1. ``/etc/sworkflow/`` (system) |
| 89 | +2. ``~/.local/sw/configs/`` (user) |
| 90 | +3. Current directory |
| 91 | +4. ``./configs/`` subdirectory |
| 92 | + |
| 93 | +See ``configs/sworkflow_template.config`` for available variables. |
0 commit comments