]> git.ipfire.org Git - thirdparty/dracut.git/blame - modules.d/05busybox/module-setup.sh
busybox module: parse busybox defined functions dynamically
[thirdparty/dracut.git] / modules.d / 05busybox / module-setup.sh
CommitLineData
95d2dabc
HH
1#!/bin/bash
2# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
3# ex: ts=8 sw=4 sts=4 et filetype=sh
4
5check() {
6 type -P busybox >/dev/null || return 1
7
8 return 255
9}
10
11depends() {
12 return 0
13}
14
15install() {
29b10e65 16 local _i _progs _path
6a0b3ccf 17 inst busybox /usr/bin/busybox
4a855e6b
AW
18 for _i in `/sbin/busybox | sed -ne '1,/Currently/!{s/,//g; s/busybox//g; p}'`
19 do
20 _progs="$_progs $_i"
21 done
95d2dabc
HH
22
23 # FIXME: switch_root should be in the above list, but busybox version hangs
24 # (using busybox-1.15.1-7.fc14.i686 at the time of writing)
25
29b10e65 26 for _i in $_progs; do
4a855e6b
AW
27 _path=$(find_binary "$_i")
28 [ -z "$_path" ] && continue
29b10e65 29 if [[ $_path != ${_path#/usr} ]]; then
4a855e6b 30 ln -sf ../../usr/bin/busybox "$initdir/$_path"
2a72df9c 31 else
4a855e6b 32 ln -sf ../usr/bin/busybox "$initdir/$_path"
2a72df9c 33 fi
95d2dabc 34 done
95d2dabc
HH
35}
36