File tree Expand file tree Collapse file tree 1 file changed +11
-12
lines changed Expand file tree Collapse file tree 1 file changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -40,11 +40,9 @@ function prepare_docker {
40
40
}
41
41
42
42
function compile_and_install {
43
- local C_FILE=$1
44
- local BIN_FILE=$2
45
- local OUTPUT_DIR=$( dirname $BIN_FILE )
46
- mkdir -pv $OUTPUT_DIR
47
- gcc -Wall -o $BIN_FILE $C_FILE
43
+ local SRC=$1
44
+ local BIN=" ${SRC% .* } "
45
+ gcc -Wall -o $BIN $SRC
48
46
}
49
47
50
48
# Build a rootfs
@@ -190,22 +188,23 @@ function build_al_kernel {
190
188
}
191
189
192
190
function prepare_and_build_rootfs {
193
- BIN =overlay/usr/local/bin
191
+ BIN_DIR =overlay/usr/local/bin
194
192
195
- tools =(init fillmem fast_page_fault_helper readmem)
193
+ SRCS =(init.c fillmem.c fast_page_fault_helper.c readmem.c )
196
194
if [ $ARCH == " aarch64" ]; then
197
- tools +=(devmemread)
195
+ SRCS +=(devmemread.c )
198
196
fi
199
197
200
- for tool in ${tools [@]} ; do
201
- compile_and_install $BIN / $tool .c $BIN / $tool
198
+ for SRC in ${SRCS [@]} ; do
199
+ compile_and_install $BIN_DIR / $SRC
202
200
done
203
201
204
202
build_rootfs ubuntu-24.04 noble
205
203
build_initramfs
206
204
207
- for tool in ${tools[@]} ; do
208
- rm $BIN /$tool
205
+ for SRC in ${SRCS[@]} ; do
206
+ BIN=" ${SRC% .* } "
207
+ rm $BIN_DIR /$BIN
209
208
done
210
209
}
211
210
You can’t perform that action at this time.
0 commit comments