]> git.ipfire.org Git - thirdparty/dracut.git/blob - modules.d/05busybox/module-setup.sh
busybox/module-setup.sh: do not create absolute symlinks
[thirdparty/dracut.git] / modules.d / 05busybox / module-setup.sh
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
5 check() {
6 type -P busybox >/dev/null || return 1
7
8 return 255
9 }
10
11 depends() {
12 return 0
13 }
14
15 install() {
16 inst busybox /sbin/busybox
17
18 # List of shell programs that we use in other official dracut modules, that
19 # must be supported by the busybox installed on the host system
20 progs="echo grep usleep [ rmmod insmod mount uname umount setfont kbd_mode stty gzip bzip2 chvt readlink blkid dd losetup tr sed seq ps more cat rm free ping netstat vi ping6 fsck ip hostname basename mknod mkdir pidof sleep chroot ls cp mv dmesg mkfifo less ln modprobe"
21
22 # FIXME: switch_root should be in the above list, but busybox version hangs
23 # (using busybox-1.15.1-7.fc14.i686 at the time of writing)
24
25 for i in $progs; do
26 path=$(find_binary "$i")
27 if [[ $path != ${path#/usr} ]]; then
28 ln -s ../../sbin/busybox "$initdir/$path"
29 else
30 ln -s ../sbin/busybox "$initdir/$path"
31 fi
32 done
33
34 }
35