diff --git a/busyboxes/mipsel/busybox b/busyboxes/mipsel/busybox new file mode 100755 index 0000000..dd40c22 Binary files /dev/null and b/busyboxes/mipsel/busybox differ diff --git a/cpio-fs-mipsel/init b/cpio-fs-mipsel/init new file mode 100755 index 0000000..955ea96 Binary files /dev/null and b/cpio-fs-mipsel/init differ diff --git a/cpio-fs-mipsel/oldinit b/cpio-fs-mipsel/oldinit new file mode 100755 index 0000000..97a4511 Binary files /dev/null and b/cpio-fs-mipsel/oldinit differ diff --git a/cpio-fs-mipsel/readme.txt b/cpio-fs-mipsel/readme.txt new file mode 100644 index 0000000..47f5273 --- /dev/null +++ b/cpio-fs-mipsel/readme.txt @@ -0,0 +1 @@ +binary files from routeros mipsel 7.7! diff --git a/for_ftp_upload/pub/OWL/bin/busybox b/for_ftp_upload/pub/OWL/bin/busybox index a5d7f1a..dd40c22 100755 Binary files a/for_ftp_upload/pub/OWL/bin/busybox and b/for_ftp_upload/pub/OWL/bin/busybox differ diff --git a/globals.sh b/globals.sh index cc33da2..c41f28f 100644 --- a/globals.sh +++ b/globals.sh @@ -6,7 +6,8 @@ #rb5009 #TARGET_ARCH="aarch64" #rb3011(ipq806x), rb450dx4(ipq401x) -TARGET_ARCH="arm" +#TARGET_ARCH="arm" +TARGET_ARCH="mipsel" #ath79, ramips #TARGET_ARCH="mips" @@ -35,6 +36,12 @@ TOOLS_BINS_PREFIX="openwrt-linux" export STAGING_DIR=$OPENWRT_DIR/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl } + +[ ${TARGET_ARCH} = "mipsel" ] && { + OPENWRT_DIR=/home/prog/openwrt/2023-openwrt/openwrt-2023 + export STAGING_DIR=$OPENWRT_DIR/staging_dir/toolchain-mipsel_24kc_gcc-11.2.0_musl +} + [ -z "${GCC}" ] && { GCC=$STAGING_DIR/bin/${TARGET_ARCH}-${TOOLS_BINS_PREFIX}-gcc OBJDUMP=$STAGING_DIR/bin/${TARGET_ARCH}-${TOOLS_BINS_PREFIX}-objdump diff --git a/init/compile.sh b/init/compile.sh index 58cc2a7..18fe3e7 100755 --- a/init/compile.sh +++ b/init/compile.sh @@ -28,7 +28,7 @@ CPIO_FS="../cpio-fs-${TARGET_ARCH}" $GCC $GCC_ARGS ./init.c -o ${CPIO_FS}/init $OBJCOPY --strip-all ${CPIO_FS}/init ${CPIO_FS}/init -#exit 0 +exit 0 cd ../ ./pack-kernel.sh diff --git a/unpack-kernel.sh b/unpack-kernel.sh index e0a16af..c86a98b 100755 --- a/unpack-kernel.sh +++ b/unpack-kernel.sh @@ -11,6 +11,9 @@ kernel_bin_binwalk(){ _kernel_bin_binwalk=$(binwalk ./bins/kernel.bin) echo "${_kernel_bin_binwalk}" } +kernel_bin_binwalk_rawelf() { + binwalk ./bins/kernel.bin --raw "\177ELF" +} get_xz_offsets(){ kernel_bin_binwalk | grep "xz compressed data" | sed -n 's/^\([0-9]\+\).*/\1/p' @@ -52,9 +55,20 @@ extract_kernel_elf(){ offsets=`kernel_bin_binwalk | sed -n 's/ELF,//p' | sed -n 's/^\([0-9]\+\).*/\1/p'` local elf_last_offset local first_xz_offset + [ -z "${offsets}" ] && { + echo "Warning: trying Raw ELF signatures search !" + offsets=`kernel_bin_binwalk_rawelf | sed -n 's/Raw signature//p' | sed -n 's/^\([0-9]\+\).*/\1/p'` + [ -z "${offsets}" ] && { + echo "NO ELF offsets found in kernel.bin !!!" + exit 100 + } + } for offset in ${offsets}; do elf_last_offset=${offset} done + [ -z "${elf_last_offset}" ] && { + [ -z "${elf_last_offset}" ] && exit 100 + } [ -n "${elf_last_offset}" ] && { offsets=$(get_xz_offsets) for offset in ${offsets}; do