diff options
author | Oliver Reiche <oliver.reiche@gmail.com> | 2023-12-29 18:46:18 +0100 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2024-01-10 13:21:17 +0100 |
commit | aea952933058d1f71173f142fc1ec55a14849f48 (patch) | |
tree | d857fde70509d77e9aa35a1c0e986b217c54c942 /src | |
parent | 19faf1fa1f5aff4854377824e6d4a8b9c0c09032 (diff) | |
download | bootstrappable-toolchain-aea952933058d1f71173f142fc1ec55a14849f48.tar.gz |
stage-0/busybox: Bootstrap via proper Justbuild target
Diffstat (limited to 'src')
-rw-r--r-- | src/bootstrap/include/stage-0-busybox.TARGETS | 211 | ||||
-rw-r--r-- | src/bootstrap/stage-0-busybox.TARGETS | 280 |
2 files changed, 459 insertions, 32 deletions
diff --git a/src/bootstrap/include/stage-0-busybox.TARGETS b/src/bootstrap/include/stage-0-busybox.TARGETS new file mode 100644 index 0000000..3e6d8ce --- /dev/null +++ b/src/bootstrap/include/stage-0-busybox.TARGETS @@ -0,0 +1,211 @@ +{ "bootstrap-headers": + { "type": "install" + , "files": {"original/libbb.h": ["FILE", null, "libbb.h"]} + , "deps": + [ "applet_metadata.h" + , "ar_.h" + , "bb_archive.h" + , "bb_e2fs_defs.h" + , "busybox.h" + , "dump.h" + , "fix_u32.h" + , "grp_.h" + , "inet_common.h" + , "libbb.h" + , "liblzo_interface.h" + , "platform.h" + , "pwd_.h" + , "rtc_.h" + , "shadow_.h" + , "unicode.h" + , "usage.src.h" + , "volume_id.h" + , "xatonum.h" + , "xregex.h" + , "common_bufsiz.h" + ] + } +, "common_bufsiz.h": + { "type": "file_gen" + , "name": "common_bufsiz.h" + , "data": + { "type": "join" + , "separator": "\n" + , "$1": + [ "enum { COMMON_BUFSIZE = 1024 };" + , "extern char bb_common_bufsiz1[];" + , "#define setup_common_bufsiz() ((void)0)" + ] + } + } +, "libbb.h": + { "type": "file_gen" + , "name": "libbb.h" + , "data": + { "type": "join" + , "separator": "\n" + , "$1": + [ "/* 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 original libbb.h */" + , "#include \"original/libbb.h\"" + ] + } + } +}
\ No newline at end of file diff --git a/src/bootstrap/stage-0-busybox.TARGETS b/src/bootstrap/stage-0-busybox.TARGETS index dff331d..8ffb80e 100644 --- a/src/bootstrap/stage-0-busybox.TARGETS +++ b/src/bootstrap/stage-0-busybox.TARGETS @@ -1,7 +1,16 @@ { "bootstrap": - { "type": "export" - , "flexible_config": ["ARCH", "TARGET_ARCH", "TOOLCHAIN_CONFIG", "ENV"] - , "target": "bootstrap-essentials" + { "type": "install" + , "files": + { "bin/awk": "bootstrap-awk" + , "bin/cmp": "bootstrap-cmp" + , "bin/sed": "bootstrap-sed" + , "bin/diff": "bootstrap-diff" + , "bin/patch": "bootstrap-patch" + , "bin/tar": "bootstrap-tar" + , "bin/bzip2": "bootstrap-bzip2" + , "bin/grep": "bootstrap-grep" + , "bin/find": "bootstrap-find" + } } , "toolchain": { "type": "export" @@ -9,39 +18,246 @@ , "target": "busybox" } , "files": {"type": "install", "deps": [["TREE", null, "."]]} -, "staged_bootstrap_sources": - { "type": "install" - , "dirs": - [["files", "src"], [["@", "scripts", "", "bootstrap-busybox"], "."]] +, "bootstrap-awk": + { "type": "export" + , "flexible_config": ["ARCH", "TARGET_ARCH", "TOOLCHAIN_CONFIG", "ENV"] + , "fixed_config": {"APPLET_GROUP": "editors", "APPLET_NAME": "awk"} + , "target": "configured-applet" } -, "bootstrap-essentials": - { "type": ["@", "rules", "CC/foreign/shell", "data"] - , "project": ["staged_bootstrap_sources"] - , "cmds": - [ "cd bootstrap-busybox" - , "./bootstrap.sh ../src editors awk >>build.log 2>&1 || (cat build.log && exit 1)" - , "./bootstrap.sh ../src editors cmp >>build.log 2>&1 || (cat build.log && exit 1)" - , "./bootstrap.sh ../src editors sed >>build.log 2>&1 || (cat build.log && exit 1)" - , "./bootstrap.sh ../src editors diff >>build.log 2>&1 || (cat build.log && exit 1)" - , "./bootstrap.sh ../src editors patch >>build.log 2>&1 || (cat build.log && exit 1)" - , "./bootstrap.sh ../src archival tar >>build.log 2>&1 || (cat build.log && exit 1)" - , "./bootstrap.sh ../src archival bzip2 >>build.log 2>&1 || (cat build.log && exit 1)" - , "./bootstrap.sh ../src findutils grep >>build.log 2>&1 || (cat build.log && exit 1)" - , "./bootstrap.sh ../src findutils find >>build.log 2>&1 || (cat build.log && exit 1)" - , "mv awk cmp sed diff patch tar bzip2 grep find ${DESTDIR}/bin/" +, "bootstrap-cmp": + { "type": "export" + , "flexible_config": ["ARCH", "TARGET_ARCH", "TOOLCHAIN_CONFIG", "ENV"] + , "fixed_config": {"APPLET_GROUP": "editors", "APPLET_NAME": "cmp"} + , "target": "configured-applet" + } +, "bootstrap-sed": + { "type": "export" + , "flexible_config": ["ARCH", "TARGET_ARCH", "TOOLCHAIN_CONFIG", "ENV"] + , "fixed_config": {"APPLET_GROUP": "editors", "APPLET_NAME": "sed"} + , "target": "configured-applet" + } +, "bootstrap-diff": + { "type": "export" + , "flexible_config": ["ARCH", "TARGET_ARCH", "TOOLCHAIN_CONFIG", "ENV"] + , "fixed_config": {"APPLET_GROUP": "editors", "APPLET_NAME": "diff"} + , "target": "configured-applet" + } +, "bootstrap-patch": + { "type": "export" + , "flexible_config": ["ARCH", "TARGET_ARCH", "TOOLCHAIN_CONFIG", "ENV"] + , "fixed_config": {"APPLET_GROUP": "editors", "APPLET_NAME": "patch"} + , "target": "configured-applet" + } +, "bootstrap-tar": + { "type": "export" + , "flexible_config": ["ARCH", "TARGET_ARCH", "TOOLCHAIN_CONFIG", "ENV"] + , "fixed_config": {"APPLET_GROUP": "archival", "APPLET_NAME": "tar"} + , "target": "configured-applet" + } +, "bootstrap-bzip2": + { "type": "export" + , "flexible_config": ["ARCH", "TARGET_ARCH", "TOOLCHAIN_CONFIG", "ENV"] + , "fixed_config": {"APPLET_GROUP": "archival", "APPLET_NAME": "bzip2"} + , "target": "configured-applet" + } +, "bootstrap-grep": + { "type": "export" + , "flexible_config": ["ARCH", "TARGET_ARCH", "TOOLCHAIN_CONFIG", "ENV"] + , "fixed_config": {"APPLET_GROUP": "findutils", "APPLET_NAME": "grep"} + , "target": "configured-applet" + } +, "bootstrap-find": + { "type": "export" + , "flexible_config": ["ARCH", "TARGET_ARCH", "TOOLCHAIN_CONFIG", "ENV"] + , "fixed_config": {"APPLET_GROUP": "findutils", "APPLET_NAME": "find"} + , "target": "configured-applet" + } +, "configured-applet": + { "type": "configure" + , "arguments_config": ["TOOLCHAIN_CONFIG"] + , "config": + { "type": "singleton_map" + , "key": "TOOLCHAIN_CONFIG" + , "value": + { "type": "map_union" + , "$1": + [ { "type": "var" + , "name": "TOOLCHAIN_CONFIG" + , "default": {"type": "empty_map"} + } + , {"type": "singleton_map", "key": "STATIC_RUNLIBS", "value": true} + ] + } + } + , "target": "bootstrap-applet" + } +, "bootstrap-applet": + { "type": ["@", "rules", "CC", "binary"] + , "arguments_config": ["APPLET_NAME"] + , "name": [{"type": "var", "name": "APPLET_NAME"}] + , "pure C": ["yes"] + , "srcs": ["bootstrap-sources"] + , "private-hdrs": ["bootstrap-headers"] + , "private-defines": ["_GNU_SOURCE"] + } +, "bootstrap-headers": + { "type": "install" + , "deps": + [ ["./", "include", "bootstrap-headers"] + , "libbb/xatonum_template.c" + , "editors/awk.c" + , "editors/cmp.c" + , "editors/sed.c" + , "editors/diff.c" + , "editors/patch.c" + , "archival/tar.c" + , "archival/bzip2.c" + , "archival/libarchive/bz/bzlib.h" + , "archival/libarchive/bz/bzlib_private.h" + , "archival/libarchive/bz/blocksort.c" + , "archival/libarchive/bz/bzlib.c" + , "archival/libarchive/bz/compress.c" + , "archival/libarchive/bz/huffman.c" + , "findutils/grep.c" + , "findutils/find.c" ] - , "outs": - [ "bin/awk" - , "bin/cmp" - , "bin/sed" - , "bin/diff" - , "bin/patch" - , "bin/tar" - , "bin/bzip2" - , "bin/grep" - , "bin/find" + } +, "bootstrap-sources": + { "type": "install" + , "deps": + [ "appletlib.c" + , "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" ] } +, "appletlib.c": + { "type": "file_gen" + , "arguments_config": ["APPLET_NAME", "APPLET_GROUP"] + , "name": "appletlib.c" + , "data": + { "type": "join" + , "separator": "\n" + , "$1": + [ "/*" + , " * Minimalistic implementation of appletlib.c that does not require any header" + , " * generation." + , " */" + , "" + , "/* Define this accessor before we #define \"errno\" our way */" + , "#include <errno.h>" + , "static inline int *get_perrno(void) { return &errno; }" + , "" + , { "type": "join" + , "$1": + [ "#include \"" + , {"type": "var", "name": "APPLET_GROUP"} + , "/" + , {"type": "var", "name": "APPLET_NAME"} + , ".c\"" + ] + } + , "" + , "int main(int argc, char **argv) {" + , "#ifdef bb_cached_errno_ptr" + , " ASSIGN_CONST_PTR(&bb_errno, get_perrno());" + , "#endif" + , { "type": "join" + , "$1": + [ " return " + , {"type": "var", "name": "APPLET_NAME"} + , "_main(argc, argv);" + ] + } + , "}" + , "" + , "/* missing definitions from appletlib.c */" + , { "type": "join" + , "$1": + [ "const char *applet_name = \"" + , {"type": "var", "name": "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 */" + , "}" + ] + } + } , "staged-gcc": {"type": "install", "dirs": [[["@", "gcc", "", "toolchain"], "gcc"]]} , "busybox": |