mirror of
https://github.com/adron-s/mtik_initrd_hacks.git
synced 2025-12-09 23:34:39 +01:00
add support for RouterOS 7.7 and mmips(LtAP)
This commit is contained in:
parent
28419d1b1b
commit
838bbe133c
8 changed files with 24 additions and 2 deletions
BIN
busyboxes/mipsel/busybox
Executable file
BIN
busyboxes/mipsel/busybox
Executable file
Binary file not shown.
BIN
cpio-fs-mipsel/init
Executable file
BIN
cpio-fs-mipsel/init
Executable file
Binary file not shown.
BIN
cpio-fs-mipsel/oldinit
Executable file
BIN
cpio-fs-mipsel/oldinit
Executable file
Binary file not shown.
1
cpio-fs-mipsel/readme.txt
Normal file
1
cpio-fs-mipsel/readme.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
binary files from routeros mipsel 7.7!
|
||||
Binary file not shown.
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue