remove ? from _module

This commit is contained in:
Tobias Powalowski 2023-10-19 21:02:16 +02:00
parent 855ea85243
commit 8ec107e165
5 changed files with 80 additions and 16 deletions

View file

@ -95,9 +95,6 @@ _module() {
# discovered and added. # discovered and added.
# $1: module name # $1: module name
_CHECK="" _MOD="" _SOFT=() _DEPS=() _FIELD="" _VALUE="" _FW=() _CHECK="" _MOD="" _SOFT=() _DEPS=() _FIELD="" _VALUE="" _FW=()
if [[ "${1}" == *\? ]]; then
set -- "${1%?}"
fi
_CHECK="${1%.ko*}" _CHECK="${_CHECK//-/_}" _CHECK="${1%.ko*}" _CHECK="${_CHECK//-/_}"
# skip expensive stuff if this module has already been added # skip expensive stuff if this module has already been added
(( _INCLUDED_MODS["${_CHECK}"] == 1 )) && return (( _INCLUDED_MODS["${_CHECK}"] == 1 )) && return

View file

@ -7,7 +7,7 @@ _run ()
### add pcspkr ### add pcspkr
_module pcspkr _module pcspkr
### add init modules ### add init modules
_map _module zram? btrfs? zstd? libcrc32c? _map _module zram btrfs zstd libcrc32c
### keyboard modules ### keyboard modules
_all_modules -f '_cs|ssb-hcd' '/usb/host' _all_modules -f '_cs|ssb-hcd' '/usb/host'
_all_modules '/hid/hid-(alps|apple|asus|belkin|cherry|chicony|corsair|elan|hyperv|kensignton|lenovo|logitech|magicmouse|microsoft|razer|redragon|roccat|samsung|sony|speedlink|steelseries)' _all_modules '/hid/hid-(alps|apple|asus|belkin|cherry|chicony|corsair|elan|hyperv|kensignton|lenovo|logitech|magicmouse|microsoft|razer|redragon|roccat|samsung|sony|speedlink|steelseries)'

View file

@ -6,7 +6,7 @@ _run ()
{ {
_all_modules '/fs/(btrfs|cifs|exfat|ext4|f2fs|fat|hfs|hfsplus|isofs|jfs|nfs|nfsd|nilfs2|nls|ntfs3|udf|xfs|vboxsf)' _all_modules '/fs/(btrfs|cifs|exfat|ext4|f2fs|fat|hfs|hfsplus|isofs|jfs|nfs|nfsd|nilfs2|nls|ntfs3|udf|xfs|vboxsf)'
_all_modules '/(lib/|kernel|arch/*)/crypto' _all_modules '/(lib/|kernel|arch/*)/crypto'
_map _module crypto-crc32c? crypto-crc32? libcrc32c? configfs? nls_cp437? nls_ascii? _map _module crypto-crc32c crypto-crc32 libcrc32c configfs nls_cp437 nls_ascii
_map _binary mkswap badblocks blkid debugfs dumpe2fs e2fsck \ _map _binary mkswap badblocks blkid debugfs dumpe2fs e2fsck \
e2image e2undo findfs fsck logsave mkfs.ext2 resize2fs chattr lsattr e2freefrag filefrag \ e2image e2undo findfs fsck logsave mkfs.ext2 resize2fs chattr lsattr e2freefrag filefrag \
jfs_debugfs jfs_fsck jfs_fscklog jfs_logdump jfs_mkfs jfs_tune mkfs.xfs xfs_copy xfs_db xfs_estimate xfs_fsr xfs_io \ jfs_debugfs jfs_fsck jfs_fscklog jfs_logdump jfs_mkfs jfs_tune mkfs.xfs xfs_copy xfs_db xfs_estimate xfs_fsr xfs_io \

View file

@ -4,7 +4,7 @@
_run() { _run() {
### init modules ### init modules
_map _module vfat? iso9660? nls_cp437? nls_ascii? cdrom? exfat? _map _module vfat iso9660 nls_cp437 nls_ascii cdrom exfat
_map _binary bash sh blkid mount mountpoint switch_root bsdcpio mkfs.btrfs setfont \ _map _binary bash sh blkid mount mountpoint switch_root bsdcpio mkfs.btrfs setfont \
/usr/lib/systemd/systemd-udevd udevadm systemd-tmpfiles kmod insmod modprobe \ /usr/lib/systemd/systemd-udevd udevadm systemd-tmpfiles kmod insmod modprobe \
gzip uname cat cp dmesg grep ln ls mv rm umount lsblk rmmod cut sed find mkdir dialog gzip uname cat cp dmesg grep ln ls mv rm umount lsblk rmmod cut sed find mkdir dialog

View file

@ -1061,17 +1061,84 @@ There are the following configuration files for ISO creation:
</ul> </ul>
<h4 data-number="7.2.3.3" id="archboot-cpio.sh"><span class="header-section-number">7.2.3.3</span> <strong>archboot-cpio.sh</strong></h4> <h4 data-number="7.2.3.3" id="archboot-cpio.sh"><span class="header-section-number">7.2.3.3</span> <strong>archboot-cpio.sh</strong></h4>
<ul> <ul>
<li>The archboot initrd toolchain uses its own cpio generator.</li> <li>The archboot initrd toolchain uses its <strong>own</strong> cpio generator.</li>
<li>objdump is used for library detecton. It's faster than ldd!</li> <li><strong>objdump</strong> is used for library detection. It's faster than ldd!</li>
<li>libraries for binaries outside of bin/ are not detected!</li> <li>libraries for binaries outside of bin/ are <strong>not</strong> detected!</li>
<li>libraries outside of lib/ are not checked!</li> <li>libraries outside of lib/ are <strong>not</strong> checked!</li>
<li>tar is used for creating/moving files and directories. It's faster than mkdir, install and cp!</li> <li><strong>tar</strong> is used for copying/moving files and directories. It's faster than mkdir, install and cp!</li>
<p></p>
<li> <strong>Only</strong> options supported in <strong>config</strong> files:<br>
<strong>_KERNEL, _HOOKS, _COMP, COMP_OPTS</strong></li>
<li> <strong>Only</strong> functions supported in <strong>HOOK</strong> files:<br>
<strong>_map, _dir, _full_dir, _binary, _file, _file_rename, _symlink, _module, _all_modules</strong></li>
</ul> </ul>
Options supported in <strong>/etc/archboot/&lt;yourconfig&gt;.conf</strong> files:<br>
<table>
<thead>
<tr class="header">
<th>Option</th>
<th>Usage</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>_KERNEL=""</td>
<td>defines used kernel</td>
<tr class="even">
<td>_HOOKS=()</td>
<td>Array that defines the used hooks</td>
</tr>
<tr class="odd">
<td>_COMP=""</td>
<td>defines used compression method</td>
</tr>
<tr class="even">
<td>_COMP_OPTS=()</td>
<td>defines compression method options</td>
</tr>
</tbody>
</table>
Functions supported in <strong>/usr/lib/archboot/cpio/hooks/&lt;hook&gt;</strong> files:<br>
<table>
<thead>
<tr class="header">
<th>Function</th>
<th>Usage</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>_map &lt;function&gt; &lt;args&gt;</td>
<td>redo &lt;function&gt; on &lt;args&gt;</td>
<tr class="even">
<td>_dir &lt;directory&gt;</td>
<td>Only creates &lt;directory&gt; on &lt;rootfs&gt;</td>
</tr>
<tr class="odd">
<td>_full_dir &lt;directory&gt;</td>
<td>Copies the &lt;full directory&gt; as is to &lt;rootfs&gt;</td>
</tr>
<tr class="even">
<td>_binary &lt;binary&gt;</td>
<td>Adds &lt;binary&gt; to rootfs, PATH is added,<br>libraries are detected</td>
</tr>
<tr class="odd">
<td>_file &lt;file&gt;</td>
<td>Adds &lt;file&gt; as is to rootfs</td>
</tr>
<tr class="even">
<td>_file_rename &lt;file&gt; &lt;file_rootfs&gt;</td>
<td>Adds &lt;file&gt; as is to rootfs &lt;file_rootfs&gt;</td>
</tr>
<tr class="odd">
<td>_symlink &lt;linkname&gt; &lt;linkedfile&gt;</td>
<td>Adds symlink &lt;linkname&gt; to &lt;linkedfile&gt; on &lt;rootfs&gt;</td>
</tr>
<tr class="even">
<td>_module &lt;module&gt;</td>
<td>Adds kernel &lt;module&gt; to &lt;rootfs&gt;</td>
</tr>
<tr class="odd">
<td>_all_modules -f &lt;exlude_pattern&gt; &lt;pattern&gt;</td>
<td>Adds all kernel modules &lt;pattern&gt; to &lt;rootfs&gt;,<br>use -f flag to exclude modules</td>
</tr>
</tbody>
</table>
<h4 data-number="7.2.3.4" id="archboot-x86_64-iso.sh"><span class="header-section-number">7.2.3.4</span> <strong>archboot-x86_64-iso.sh</strong></h4> <h4 data-number="7.2.3.4" id="archboot-x86_64-iso.sh"><span class="header-section-number">7.2.3.4</span> <strong>archboot-x86_64-iso.sh</strong></h4>
<p>Script for image creation from running system or for use in archboot container.</p> <p>Script for image creation from running system or for use in archboot container.</p>
<table> <table>