📄 doc_modules
字号:
How to create own modules for your LiveCD-----------------------------------------To create a module for your LiveCD, create an emptydirectory somewhere, for example in /tmp/newmod.Then create the essential module content in this directory.Each module should contain these files: ./preinsert # /tmp/newmod/preinsert ./postinsert # /tmp/newmod/postinsert ./manual # /tmp/newmod/manualand it should contain these directories: ./data # /tmp/newmod/data/The directory ./data should contain the whole filesystem(all changed or new files and directories). Let's assumethat ./data is the new root here, so if you wish to include/bin/bash in your module, place it in ./data/bin/bash(or in /tmp/newmod/data/bin/bash in this example).The content of ./data directory could be created fromslackware's TGZ package by using "installpkg -root ./data packagename.tgz"(or by "installpkg -root /tmp/newmod/data/ packagename.tgz" in this example)Finaly, create the module by usingdir2img /tmp/newmod/ /tmp/modulename.imgThe first argument is the module directoryThe second argument is the new name for your moduleModule insertion works this way-------------------------------At first, module is mounted in /mnt/livecd/modulenameand preinsert file is started - only in the case it'smarked as executable, so be sure to chmod it correctly(for example by using chmod a+x preinsert).Then, the whole filesystem from ./data is inserted inthe Live filesystem. For example ./data/bin/bash will become/bin/bash, etc. This insertion is done by using symlinks(for new files) and by mount calls with "--rbind" option(for new directories).Finaly, postinsert file is started (if marked as executable)to perform some post-insertion operations.What is ./manual file for? Normally, the module is insertedat the boot phase, so all your modified or new rc-scriptsare started by your distribution automatically. The problemis with including the module by using moduse script../manual is executed only in the case if the module is includedby moduse tool, so it should contain all commands neccessaryto start appropriate rc-scripts automatically.Note----Please keep the number of your modules as small as possible.Each inserted module could consume alot of resources (severalmount calls, several loop devices and lots of symlinks), so it's alwaysbetter to include all files you wish in a single module.10 modules is OK, but 1000 modules is not ok.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -