What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

sufianabrar

New Around Here
Hi,
I am building firmware for RT-AC86U from source code asuswrt-merlin.382 in my linux viertual machine Ubuntu 16.04.1 but there are few errors.

root@ubuntu:~/asuswrt-merlin.382/release/src-rt-5.02hnd# make rt-ac86u
CONFIGURED MODEL: RT-AC86U
SPECIFIED MODEL: RT-AC86U
----------------------------------------------------------------------------
Clean old model configuration
Update model configuration
make bin
make[1]: Entering directory '/home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd'
BRCM_BOARD_ID=94906REF
# prepare config_base
# prepare prebuilt kernel binary
do nothing
hnd_router platform work
make[2]: Entering directory '/home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd'
Using profile, build config.
CURRENT_ARCH=aarch64 TOOLCHAIN_TOP= make prek
make[3]: Entering directory '/home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd'
cd /home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd/bcmdrivers; echo -e "\n# Automatically generated file -- do not modify manually\n\n" > Kconfig.autogen.tmp
cd /home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd/bcmdrivers; echo -e "\n# Automatically generated file -- do not modify manually\n\n" > Makefile.autogen.tmp
cd /home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd/bcmdrivers; echo -e "\n\$(info READING AG MAKEFILE)\n\n" >> Makefile.autogen.tmp
alldrivers=""; \
cd /home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd/bcmdrivers; \
for autodetect in $(find * -type f -name autodetect); do \
dir=${autodetect%/*}; \
driver=$(grep -i "^DRIVER\|FEATURE:" $autodetect | awk -F ': *' '{ print $2 }'); \
[ $driver ] || driver=${dir##*/}; \
[ $(echo $driver | wc -w) -ne 1 ] && echo "Error parsing $autodetect" >2 && exit 1; \
echo "Processing $driver ($dir)"; \
DRIVER=$(echo "${driver}" | tr '[:lower:]' '[:upper:]'); \
echo "\$(eval \$(call LN_RULE_AG, CONFIG_BCM_${DRIVER}, $dir, \$(LN_NAME)))" >> Makefile.autogen.tmp; \
if [ -e $dir/Kconfig.autodetect ]; then \
echo "menu \"${DRIVER}\"" >> Kconfig.autogen.tmp;\
echo "source \"../../bcmdrivers/$dir/Kconfig.autodetect\"" >> Kconfig.autogen.tmp; \
echo "endmenu " >> Kconfig.autogen.tmp; \
echo "" >> Kconfig.autogen.tmp;\
fi; \
true; \
done; \
duplicates=$(echo $alldrivers | tr " " "\n" | sort | uniq -d | tr "\n" " "); echo $duplicates; \
[ ] && echo "alldrivers: $alldrivers" && echo "duplicates: $duplicates" || true; \
if [ $duplicates ]; then \
echo "ERROR: duplicate drivers found in autodetect -- $duplicates" >&2; \
exit 1; \
fi
Processing SPU (opensource/char/spudd)
Processing MCAST (opensource/char/mcast)
Processing PDC (opensource/char/pdc)
cd /home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd/bcmdrivers; [ -e Makefile.autogen ] && cmp -s Makefile.autogen Makefile.autogen.tmp || mv Makefile.autogen.tmp Makefile.autogen
cd /home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd/bcmdrivers;[ -e Kconfig.autogen ] && cmp -s Kconfig.autogen Kconfig.autogen.tmp || mv Kconfig.autogen.tmp Kconfig.autogen
cd /home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd/bcmdrivers; rm -f Makefile.autogen.tmp Kconfig.autogen.tmp
ln -s -f /home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd/kernel/linux-4.1/include/uapi /home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd/kernel/bcm_local_kernel_include;
ln -s -f /home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd/kernel/linux-4.1/arch/mips/include/uapi /home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd/kernel/bcm_local_kernel_mips_include;
ln -s -f /home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd/kernel/linux-4.1/arch/arm/include/uapi /home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd/kernel/bcm_local_kernel_arm_include;
echo
echo -------------------------------------------
-------------------------------------------
echo ... starting kernel build at /home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd/kernel/linux-4.1
... starting kernel build at /home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd/kernel/linux-4.1
echo ARCH=arm64
ARCH=arm64
echo KERNEL_ARCH=aarch64
KERNEL_ARCH=aarch64
echo BCM_SWVERSION_FILE=/home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd/kernel/linux-4.1/include/linux/bcm_swversion.h
BCM_SWVERSION_FILE=/home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd/kernel/linux-4.1/include/linux/bcm_swversion.h
echo BCM_KF_KCONFIG_FILE=/home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd/kernel/linux-4.1/Kconfig.bcm_kf
BCM_KF_KCONFIG_FILE=/home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd/kernel/linux-4.1/Kconfig.bcm_kf
echo PROFILE_KERNEL_VER is LINUX_4_1_0
PROFILE_KERNEL_VER is LINUX_4_1_0
cd /home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd/kernel; \
if [ ! -e /home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd/kernel/linux-4.1/.untar_complete ]; then \
echo "Untarring original Linux kernel source: src-linux-4.1.tar.bz2"; \
(tar xkfpj src-linux-4.1.tar.bz2 2> /dev/null || true); \
touch /home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd/kernel/linux-4.1/.untar_complete; \
fi
#/home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd/hostTools/scripts/gendefconfig /home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd/targets/94908HND/94908HND w
cd /home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd/kernel/linux-4.1; \
#cp -f /home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd/kernel/linux-4.1/arch/arm64/defconfig /home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd/kernel/linux-4.1/.config;
#
cd /home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd/kernel/linux-4.1; \
make oldnoconfig;
make[4]: Entering directory '/home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd/kernel/linux-4.1'
make[5]: '../../.config' is up to date.
scripts/kconfig/conf --olddefconfig Kconfig
../../bcmdrivers/Kconfig.autogen:2: syntax error
Kconfig.bcm:1336: missing end statement for this entry
Kconfig:15: missing end statement for this entry
../../bcmdrivers/Kconfig.autogen:1: invalid statement
Kconfig.bcm:1338: unexpected end statement
Kconfig:20: unexpected end statement
scripts/kconfig/Makefile:84: recipe for target 'olddefconfig' failed
make[5]: *** [olddefconfig] Error 1
Makefile:565: recipe for target 'oldnoconfig' failed
make[4]: *** [oldnoconfig] Error 2
make[4]: Leaving directory '/home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd/kernel/linux-4.1'
make.hndrt:332: recipe for target 'prek' failed
make[3]: *** [prek] Error 2
make[3]: Leaving directory '/home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd'
Makefile:4039: recipe for target 'setprofile' failed
make[2]: *** [setprofile] Error 2
make[2]: Leaving directory '/home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd'
Makefile:3873: recipe for target 'bin' failed
make[1]: *** [bin] Error 2
make[1]: Leaving directory '/home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd'
Makefile:4022: recipe for target 'rt-ac86u' failed
make: *** [rt-ac86u] Error 2
root@ubuntu:~/asuswrt-merlin.382/release/src-rt-5.02hnd#


I followed all your mentioned prerequisites steps but it does not work. Please help me in this case.
 
Broadcom's HND makefiles require bash. You have to symlink /bin/sh to point to /bin/bash.
 
Double check your shell configuration, your error is related to your Makefile not using bash but some other unsupported shell instead.
 
I followed all steps which are mentioned in asus.merlin.382 to build firmware of RT-AC86U in my virtual machine ubuntu 16.04 64-bit but nothing works. Do you have any more suggestions?
 
I don't, sorry. I use 16.04 myself, and the only thing that I had to change for the specific error message you posted was to ensure that /bin/sh pointed to bash, and that the default shell was bash.

Code:
lrwxrwxrwx 1 root root 9 Aug 27 02:16 /bin/sh -> /bin/bash
 
I reinstalled again ubuntu 16.04 and all the methods mentioned in asus.merlin.382, new toolchain .(https://github.com/RMerl/am-toolchains) and symlinked
Code:
ln -sf /bin/bash /bin/sh
And now I receive two different errors during finalizing in building the firmware.
Code:
uname: Linux ubuntu 4.8.0-36-generic #36~16.04.1-Ubuntu SMP Sun Feb 5 09:39:57 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
processors: 1
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 0  0      0   2568     56    664    0    0  1976   322  228 1329  9 11 57 23  0
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                1
On-line CPU(s) list:   0
Thread(s) per core:    1
Core(s) per socket:    1
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 94
Model name:            Intel(R) Core(TM) i5-6300HQ CPU @ 2.30GHz
Stepping:              3
CPU MHz:               2302.745
BogoMIPS:              4607.99
Hypervisor vendor:     VMware
Virtualization type:   full
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              6144K
NUMA node0 CPU(s):     0
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch epb fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 invpcid rtm rdseed adx smap xsaveopt dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp
################ parallel build environment end ##################
shell is /bin/sh.  Bash version is 4.3.48(1)-release
***************************************************
ERROR: Attempting to build as root.
***************************************************
/home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd/make.common:2671: recipe for target 'prebuild_checks' failed
make[2]: *** [prebuild_checks] Error 1
make[2]: Leaving directory '/home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd'
Makefile:3873: recipe for target 'bin' failed
make[1]: *** [bin] Error 2
make[1]: Leaving directory '/home/sufian/asuswrt-merlin.382/release/src-rt-5.02hnd'
Makefile:4022: recipe for target 'rt-ac86u' failed
make: *** [rt-ac86u] Error 2
 
The explanation is pretty plain to me in that error output:

Code:
ERROR: Attempting to build as root.

Do not compile as root...
 
I have entered this command: chmod -R 777 asuswrt-merlin.382 and it resolved my issue.
Now I have generated ac86u custom firmware.
Thanks for your help.
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top