-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathidlebox.bbuild
More file actions
142 lines (120 loc) · 2.8 KB
/
idlebox.bbuild
File metadata and controls
142 lines (120 loc) · 2.8 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#!/bin/sh
set -eu
# Package metadata
pkgname="idlebox"
pkgver="2.0.0"
pkgdesc="idlebox stuff test thing h"
homepage="https://bedrocklinux.org/"
license="MIT"
depends=""
backup=""
# Build time information
makearch="
noarch
"
makebins="
cat
chmod
mkdir
sh
"
makedepends=""
source=""
sha256sums=""
build() {
cat <<'secondEOFhehehhehhehje' > "${pkgdir}/bedrock/share/brl-fetch/distros/
#!/bedrock/libexec/busybox sh
#
# idlebox bootstrap support
#
# This is free and unencumbered software released into the public domain.
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any means.
#
# For more information, please refer to <https://unlicense.org/>
#
# Copyleft (ↄ) The Odd Cell <me@oddcell.ca>
#
# shellcheck source=src/slash-bedrock/libexec/brl-fetch
. /bedrock/share/common-code
trap 'fetch_abort "Unexpected error occurred."' EXIT
check_supported() {
false
}
speed_test_url() {
echo "${target-release}-${distro_arch}-linux-musl/busybox"
}
list_mirrors() {
cat <<EOF
https://busybox.net/downloads/binaries/
EOF
}
list_architectures() {
cat <<EOF
i686
x86_64
EOF
}
default_release() {
echo "1.35.0"
}
list_releases() {
cat <<EOF
1.35.0
EOF
}
brl_arch_to_distro() {
case "$1" in
"x86_64") echo "x86_64" ;;
"i686") echo "i686" ;;
*) abort "Unsupported architecture: $1" ;;
esac
}
fetch() {
case "${distro_arch}" in
"i686") busybox_name="busybox" ;;
"x86_64") busybox_name="busybox" ;;
*) abort "Unsupported architecture: ${distro_arch}" ;;
esac
step "Downloading BusyBox binary"
busybox_url="${target_mirror}1.35.0-${distro_arch}-linux-musl/${busybox_name}"
download "${busybox_url}" "${bootstrap_dir}/busybox"
chmod +x "${bootstrap_dir}/busybox"
step "Installing BusyBox to stratum"
mkdir -p "${target_dir}/sbin"
cp "${bootstrap_dir}/busybox" "${target_dir}/sbin/busybox"
chmod +x "${target_dir}/sbin/busybox"
step "Creating symlinks to BusyBox applets"
cd "${target_dir}/sbin"
for applet in $(./busybox --list); do
ln -sf busybox "$applet"
echo "Linking applet $applet to busybox"
done
ln -s sbin "${target_dir}/bin"
step "Creating minimal inittab and rcS"
mkdir -p "${target_dir}/etc/init.d"
cat > "${target_dir}/etc/inittab" <<'EOF'
::sysinit:/etc/init.d/rcS
::respawn:/bin/login
::ctrlaltdel:/bin/reboot
EOF
cat > "${target_dir}/etc/init.d/rcS" <<'EOF'
#!/bin/sh
echo "[idlebox] rcS starting..."
mount -t proc proc /proc
mount -t sysfs sys /sys
mount -o remount,rw /
ifconfig lo up
ifconfig eth0 up || true
udhcpc -i eth0 || true
echo "[idlebox] rcS complete."
EOF
chmod +x "${target_dir}/etc/init.d/rcS"
}
secondEOFhehehhehhehje
}
upstream_pkgver() {
# No upstream source which could become outdated
echo "2.0.0"
}