summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@gmail.com>2023-12-29 18:46:18 +0100
committerOliver Reiche <oliver.reiche@huawei.com>2024-01-10 13:21:17 +0100
commitaea952933058d1f71173f142fc1ec55a14849f48 (patch)
treed857fde70509d77e9aa35a1c0e986b217c54c942 /etc
parent19faf1fa1f5aff4854377824e6d4a8b9c0c09032 (diff)
downloadbootstrappable-toolchain-aea952933058d1f71173f142fc1ec55a14849f48.tar.gz
stage-0/busybox: Bootstrap via proper Justbuild target
Diffstat (limited to 'etc')
-rw-r--r--etc/repos.json1
-rw-r--r--etc/scripts/TARGETS6
-rw-r--r--etc/scripts/bootstrap-busybox/appletlib.c37
-rwxr-xr-xetc/scripts/bootstrap-busybox/bootstrap.sh92
-rw-r--r--etc/scripts/bootstrap-busybox/include/common_bufsiz.h3
-rw-r--r--etc/scripts/bootstrap-busybox/include/libbb.h162
6 files changed, 1 insertions, 300 deletions
diff --git a/etc/repos.json b/etc/repos.json
index 21ca974..cc85614 100644
--- a/etc/repos.json
+++ b/etc/repos.json
@@ -245,7 +245,6 @@
, "target_file_name": "stage-0-busybox.TARGETS"
, "bindings":
{ "rules": "rules/stage-0"
- , "scripts": "scripts"
, "gcc": "stage-0/gcc"
, "make": "stage-0/make"
}
diff --git a/etc/scripts/TARGETS b/etc/scripts/TARGETS
index 1fb0454..a3f7fa0 100644
--- a/etc/scripts/TARGETS
+++ b/etc/scripts/TARGETS
@@ -1,5 +1 @@
-{ "bootstrap-busybox":
- {"type": "install", "deps": [["TREE", null, "bootstrap-busybox"]]}
-, "bootstrap-ar": {"type": "install", "deps": ["bootstrap-ar.sh"]}
-, "bootstrap-make": {"type": "install", "deps": ["bootstrap-make.sh"]}
-}
+{"bootstrap-ar": {"type": "install", "deps": ["bootstrap-ar.sh"]}}
diff --git a/etc/scripts/bootstrap-busybox/appletlib.c b/etc/scripts/bootstrap-busybox/appletlib.c
deleted file mode 100644
index aa63360..0000000
--- a/etc/scripts/bootstrap-busybox/appletlib.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Minimalistic implementation of appletlib.c that does not require any header
- * generation.
- */
-#define stringify_impl(x) #x
-#define stringify(x) stringify_impl(x)
-#define concat(x,y) x##y
-#define applet_main(name) concat(name, _main)
-
-/* Define this accessor before we #define "errno" our way */
-#include <errno.h>
-static inline int *get_perrno(void) { return &errno; }
-
-#include stringify(APPLET_GROUP/APPLET_NAME.c)
-
-int main(int argc, char **argv) {
-#ifdef bb_cached_errno_ptr
- ASSIGN_CONST_PTR(&bb_errno, get_perrno());
-#endif
- return applet_main(APPLET_NAME)(argc, argv);
-}
-
-/* missing definitions from appletlib.c */
-const char *applet_name = stringify(APPLET_NAME);
-void bb_show_usage() { xfunc_die(); }
-unsigned string_array_len(char **argv) {
- char **start = argv;
- while (*argv)
- argv++;
- return argv - start;
-}
-
-/* missing definitions for tar.c (despite 'to_command' being disabled) */
-#include "bb_archive.h"
-void FAST_FUNC data_extract_to_command(archive_handle_t *archive_handle) {
- /* unused */
-}
diff --git a/etc/scripts/bootstrap-busybox/bootstrap.sh b/etc/scripts/bootstrap-busybox/bootstrap.sh
deleted file mode 100755
index a49d53c..0000000
--- a/etc/scripts/bootstrap-busybox/bootstrap.sh
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/bin/sh
-
-set -eu
-
-SRCDIR=$1
-APPLET_GROUP=$2
-APPLET_NAME=$3
-
-export CC=${CC:-cc}
-export CFLAGS="${CFLAGS:-} -D_GNU_SOURCE -Iinclude -I${SRCDIR} -I${SRCDIR}/include"
-
-DEP_SRCS="
- libbb/bb_pwd.c
- libbb/bb_strtonum.c
- libbb/concat_path_file.c
- libbb/concat_subpath_file.c
- libbb/common_bufsiz.c
- libbb/compare_string_array.c
- libbb/copyfd.c
- libbb/crc32.c
- libbb/default_error_retval.c
- libbb/endofname.c
- libbb/fclose_nonstdin.c
- libbb/fflush_stdout_and_exit.c
- libbb/full_write.c
- libbb/get_last_path_component.c
- libbb/get_line_from_file.c
- libbb/getopt32.c
- libbb/isqrt.c
- libbb/last_char_is.c
- libbb/llist.c
- libbb/makedev.c
- libbb/make_directory.c
- libbb/messages.c
- libbb/mode_string.c
- libbb/perror_msg.c
- libbb/process_escape_sequence.c
- libbb/procps.c
- libbb/ptr_to_globals.c
- libbb/read.c
- libbb/read_printf.c
- libbb/recursive_action.c
- libbb/safe_poll.c
- libbb/safe_strncpy.c
- libbb/safe_write.c
- libbb/signals.c
- libbb/skip_whitespace.c
- libbb/time.c
- libbb/verror_msg.c
- libbb/wfopen.c
- libbb/wfopen_input.c
- libbb/xatonum.c
- libbb/xfunc_die.c
- libbb/xfuncs.c
- libbb/xfuncs_printf.c
- libbb/xgetcwd.c
- libbb/xreadlink.c
- libbb/xrealloc_vector.c
- libbb/xregcomp.c
- archival/bbunzip.c
- archival/chksum_and_xwrite_tar_header.c
- archival/libarchive/data_align.c
- archival/libarchive/data_extract_all.c
- archival/libarchive/data_extract_to_stdout.c
- archival/libarchive/data_skip.c
- archival/libarchive/filter_accept_all.c
- archival/libarchive/filter_accept_reject_list.c
- archival/libarchive/find_list_entry.c
- archival/libarchive/get_header_tar.c
- archival/libarchive/header_list.c
- archival/libarchive/header_skip.c
- archival/libarchive/header_verbose_list.c
- archival/libarchive/init_handle.c
- archival/libarchive/open_transformer.c
- archival/libarchive/seek_by_jump.c
- archival/libarchive/seek_by_read.c
- archival/libarchive/unsafe_prefix.c
- archival/libarchive/unsafe_symlink_target.c
-"
-
-if [ ! -f dep.objs ]; then
- NUM=0
- for SRC in ${DEP_SRCS}; do
- # use short object file name to keep final command line short
- ${CC} ${CFLAGS} -c ${SRCDIR}/${SRC} -o ${NUM}.o
- NUM=$((${NUM}+1))
- done
- ls *.o | LC_ALL=C sort > dep.objs
-fi
-
-${CC} ${CFLAGS} -DAPPLET_GROUP=${APPLET_GROUP} -DAPPLET_NAME=${APPLET_NAME} \
- -o ${APPLET_NAME} appletlib.c $(cat dep.objs)
diff --git a/etc/scripts/bootstrap-busybox/include/common_bufsiz.h b/etc/scripts/bootstrap-busybox/include/common_bufsiz.h
deleted file mode 100644
index 91e452a..0000000
--- a/etc/scripts/bootstrap-busybox/include/common_bufsiz.h
+++ /dev/null
@@ -1,3 +0,0 @@
-enum { COMMON_BUFSIZE = 1024 };
-extern char bb_common_bufsiz1[];
-#define setup_common_bufsiz() ((void)0)
diff --git a/etc/scripts/bootstrap-busybox/include/libbb.h b/etc/scripts/bootstrap-busybox/include/libbb.h
deleted file mode 100644
index 33405c1..0000000
--- a/etc/scripts/bootstrap-busybox/include/libbb.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/* configuration */
-#define BB_VER "1.36.1"
-#define BB_EXTRA_VERSION ""
-#define BB_GLOBAL_CONST
-
-#define CONFIG_BUSYBOX_EXEC_PATH "/proc/self/exe"
-#define CONFIG_FEATURE_COPYBUF_KB 4
-#define CONFIG_SHA3_SMALL 0
-#define CONFIG_PASSWORD_MINLEN 6
-#define CONFIG_PID_FILE_PATH ""
-
-#define ENABLE_DESKTOP 0
-#define ENABLE_TAR 1
-#define ENABLE_ZCAT 0
-#define ENABLE_SELINUX 0
-#define ENABLE_KILLALL 0
-#define ENABLE_PGREP 0
-#define ENABLE_FGREP 0
-#define ENABLE_EGREP 0
-#define ENABLE_PKILL 0
-#define ENABLE_PIDOF 0
-#define ENABLE_SESTATUS 0
-#define ENABLE_SHA512SUM 0
-#define ENABLE_LOCALE_SUPPORT 0
-#define ENABLE_LONG_OPTS 0
-#define ENABLE_USE_BB_CRYPT_SHA 0
-#define ENABLE_FEATURE_VERBOSE 0
-#define ENABLE_FEATURE_SYSLOG 0
-#define ENABLE_FEATURE_CROND_D 0
-#define ENABLE_FEATURE_TOPMEM 0
-#define ENABLE_FEATURE_TOP_SMP_PROCESS 0
-#define ENABLE_FEATURE_PS_ADDITIONAL_COLUMNS 0
-#define ENABLE_FEATURE_SHOW_THREADS 0
-#define ENABLE_FEATURE_CLEAN_UP 0
-#define ENABLE_FEATURE_PRESERVE_HARDLINKS 0
-#define ENABLE_FEATURE_NON_POSIX_CP 0
-#define ENABLE_FEATURE_USE_SENDFILE 0
-#define ENABLE_FEATURE_SKIP_ROOTFS 0
-#define ENABLE_FEATURE_MOUNT_LOOP_CREATE 0
-#define ENABLE_FEATURE_AWK_LIBM 0
-#define ENABLE_FEATURE_ALLOW_EXEC 0
-#define ENABLE_FEATURE_SEAMLESS_XZ 0
-#define ENABLE_FEATURE_SEAMLESS_LZMA 0
-#define ENABLE_FEATURE_SEAMLESS_BZ2 0
-#define ENABLE_FEATURE_SEAMLESS_GZ 0
-#define ENABLE_FEATURE_SEAMLESS_Z 0
-#define ENABLE_FEATURE_TAR_CREATE 1
-#define ENABLE_FEATURE_TAR_FROM 0
-#define ENABLE_FEATURE_TAR_NOPRESERVE_TIME 0
-#define ENABLE_FEATURE_TAR_LONG_OPTIONS 0
-#define ENABLE_FEATURE_TAR_TO_COMMAND 0
-#define ENABLE_FEATURE_TAR_GNU_EXTENSIONS 0
-#define ENABLE_FEATURE_TAR_AUTODETECT 0
-#define ENABLE_FEATURE_TAR_OLDGNU_COMPATIBILITY 0
-#define ENABLE_FEATURE_TAR_OLDSUN_COMPATIBILITY 0
-#define ENABLE_FEATURE_FIND_PATH 0
-#define ENABLE_FEATURE_FIND_REGEX 0
-#define ENABLE_FEATURE_FIND_PRINT0 0
-#define ENABLE_FEATURE_FIND_TYPE 1
-#define ENABLE_FEATURE_FIND_EXECUTABLE 0
-#define ENABLE_FEATURE_FIND_PERM 0
-#define ENABLE_FEATURE_FIND_MTIME 0
-#define ENABLE_FEATURE_FIND_CTIME 0
-#define ENABLE_FEATURE_FIND_ATIME 0
-#define ENABLE_FEATURE_FIND_MMIN 0
-#define ENABLE_FEATURE_FIND_CMIN 0
-#define ENABLE_FEATURE_FIND_AMIN 0
-#define ENABLE_FEATURE_FIND_NEWER 0
-#define ENABLE_FEATURE_FIND_INUM 0
-#define ENABLE_FEATURE_FIND_SAMEFILE 0
-#define ENABLE_FEATURE_FIND_USER 0
-#define ENABLE_FEATURE_FIND_SIZE 0
-#define ENABLE_FEATURE_FIND_CONTEXT 0
-#define ENABLE_FEATURE_FIND_PAREN 1
-#define ENABLE_FEATURE_FIND_PRUNE 1
-#define ENABLE_FEATURE_FIND_QUIT 0
-#define ENABLE_FEATURE_FIND_DELETE 0
-#define ENABLE_FEATURE_FIND_EMPTY 0
-#define ENABLE_FEATURE_FIND_EXEC 0
-#define ENABLE_FEATURE_FIND_EXEC_PLUS 0
-#define ENABLE_FEATURE_FIND_GROUP 0
-#define ENABLE_FEATURE_FIND_LINKS 0
-#define ENABLE_FEATURE_FIND_NOT 1
-#define ENABLE_FEATURE_FIND_DEPTH 0
-#define ENABLE_FEATURE_FIND_MAXDEPTH 0
-#define ENABLE_FEATURE_FIND_XDEV 0
-#define ENABLE_FEATURE_BZIP2_DECOMPRESS 0
-
-#define IF_DESKTOP(...)
-#define IF_NOT_DESKTOP(...) __VA_ARGS__
-#define IF_SHELL_ASH(...)
-#define IF_SHELL_HUSH(...)
-#define IF_ECHO(...)
-#define IF_SLEEP(...)
-#define IF_PRINTF(...)
-#define IF_CHOWN(...)
-#define IF_LS(...)
-#define IF_SELINUX(...)
-#define IF_EXTRA_COMPAT(...)
-#define IF_FEATURE_SHOW_THREADS(...)
-#define IF_FEATURE_CP_REFLINK(...)
-#define IF_FEATURE_SHADOWPASSWDS(...)
-#define IF_FEATURE_MTAB_SUPPORT(...)
-#define IF_FEATURE_SKIP_ROOTFS(...)
-#define IF_FEATURE_MOUNT_LOOP_CREATE(...)
-#define IF_FEATURE_TIMEZONE(...)
-#define IF_FEATURE_AWK_GNU_EXTENSIONS(...)
-#define IF_FEATURE_GREP_CONTEXT(...)
-#define IF_FEATURE_SEAMLESS_XZ(...)
-#define IF_FEATURE_SEAMLESS_LZMA(...)
-#define IF_FEATURE_SEAMLESS_BZ2(...)
-#define IF_FEATURE_SEAMLESS_GZ(...)
-#define IF_FEATURE_SEAMLESS_Z(...)
-#define IF_FEATURE_TAR_CREATE(...) __VA_ARGS__
-#define IF_FEATURE_TAR_FROM(...)
-#define IF_FEATURE_TAR_NOPRESERVE_TIME(...)
-#define IF_FEATURE_TAR_LONG_OPTIONS(...)
-#define IF_FEATURE_TAR_TO_COMMAND(...)
-#define IF_NOT_FEATURE_TAR_CREATE(...)
-#define IF_FEATURE_TAR_OLDGNU_COMPATIBILITY(...)
-#define IF_FEATURE_TAR_OLDSUN_COMPATIBILITY(...)
-#define IF_FEATURE_FIND_PATH(...)
-#define IF_FEATURE_FIND_REGEX(...)
-#define IF_FEATURE_FIND_PRINT0(...)
-#define IF_FEATURE_FIND_TYPE(...) __VA_ARGS__
-#define IF_FEATURE_FIND_EXECUTABLE(...)
-#define IF_FEATURE_FIND_PERM(...)
-#define IF_FEATURE_FIND_MTIME(...)
-#define IF_FEATURE_FIND_CTIME(...)
-#define IF_FEATURE_FIND_ATIME(...)
-#define IF_FEATURE_FIND_MMIN(...)
-#define IF_FEATURE_FIND_CMIN(...)
-#define IF_FEATURE_FIND_AMIN(...)
-#define IF_FEATURE_FIND_NEWER(...)
-#define IF_FEATURE_FIND_INUM(...)
-#define IF_FEATURE_FIND_SAMEFILE(...)
-#define IF_FEATURE_FIND_USER(...)
-#define IF_FEATURE_FIND_SIZE(...)
-#define IF_FEATURE_FIND_CONTEXT(...)
-#define IF_FEATURE_FIND_PAREN(...) __VA_ARGS__
-#define IF_FEATURE_FIND_PRUNE(...) __VA_ARGS__
-#define IF_FEATURE_FIND_QUIT(...)
-#define IF_FEATURE_FIND_DELETE(...)
-#define IF_FEATURE_FIND_EMPTY(...)
-#define IF_FEATURE_FIND_EXEC(...)
-#define IF_FEATURE_FIND_EXEC_PLUS(...)
-#define IF_FEATURE_FIND_GROUP(...)
-#define IF_FEATURE_FIND_LINKS(...)
-#define IF_FEATURE_FIND_NOT(...) __VA_ARGS__
-#define IF_FEATURE_FIND_DEPTH(...)
-#define IF_FEATURE_FIND_MAXDEPTH(...)
-#define IF_NOT_FEATURE_FIND_MAXDEPTH(...) __VA_ARGS__
-#define IF_FEATURE_FIND_XDEV(...)
-#define IF_FEATURE_BZIP2_DECOMPRESS(...)
-
-
-/* missing declarations */
-char *strchrnul(const char *s, int c);
-
-
-/* include real libbb.h */
-#include "include/libbb.h"