blob: f93d304e9b9901263727f20b27ed3b9d96accdba (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
#!/bin/bash
[ -z "$BB_GIT" ] && declare -rg BB_GIT="https://git.busybox.net/busybox"
[ -z "$BB_BRANCH" ] && declare -rg BB_BRANCH="1_37_0"
build() (
local base_url="https://git.openslx.org/openslx-ng/mltk.git/plain/core/modules/busybox/"
set -e
git clone --depth 1 "$BB_GIT" --branch "$BB_BRANCH" "${moddir}/src" \
|| git clone --depth 1 "https://github.com/mirror/busybox.git" "${moddir}/src" \
|| return 1
# apply patches
cd "${moddir}/src"
for _patch in "$base_url"/{fbsplash-fillbg,rtcwake-compat}.patch ; do
if ! curl -m 10 -L "$_patch" | git apply -; then
derror "Failed to apply: $_patch"
return 1
fi
done
cp "${moddir}/openslx.config" "${moddir}/src/.config"
yes '' | make oldconfig
make -j busybox
)
check() {
if ! [ -x "${moddir}/src/busybox" ] && ! build; then
derror "Failed to build busybox."
kill $$
return 1
fi
return 255
}
depends() {
echo ""
}
install() {
if [ ! -s "${moddir}/src/busybox" ]; then
derror "Failed to find busybox binary in build directory!"
return 1
fi
if ! inst "${moddir}/src/busybox" "/bin/busybox"; then
derror "Could not install busybox"
return 1
fi
# manually install, /bin etc. are read-only in initrd
local applet
for applet in $("${moddir}/src/busybox" --listfull); do
if [ -e "${initdir}/${applet}" ]; then
# real tool probably exists
continue
fi
ln -sfn /bin/busybox "${initdir}/${applet}" \
|| dwarn "Could not install busybox applet: $applet"
done
slx_service "s3-install-busybox-stage4" "Install busybox into stage 4" \
--wafter "initrd-root-fs.target" \
--after "s3-install-busybox.service"
}
|