View Issue Details

IDProjectCategoryView StatusLast Update
0001353Kali LinuxKali Package Bugpublic2014-06-23 21:33
ReporterkarkassaAssigned Tosteev  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformarmhfOSKaliOS Version1.0
Product Version1.0.6 
Summary0001353: Failed to Build Utilite Pro image - Ultimate Pentesting PwnBox (2013)
Description

I tried to build the Utilite Pro image but it fails due to the fact that the path of the cross compiler (and its libraries) is not in the path.

Another small related issue is that you have to say yes or no to 2 things after "PCI Express support (IMX_PCIE) [Y/n] y":
"PCI Express EP mode in the IMX6 RC/EP interconnection system (IMX_PCIE_EP_MODE_IN_EP_RC_SYS) [N/y] (NEW)" and "PCI Express RC mode in the IMX6 RC/EP interconnection system" (See compile log).

The error happens when building on 32 or 64 bit OS.

Steps To Reproduce

Follow the tutorial "Ultimate Pentesting PwnBox (2013) – Utilite Pro"

Additional Information

Compile log is attached (end of the log where you can see all the errors).

I might have a patch to fix it but I still need to test it (it's building right now).

Attached Files
partial_compile_log_utilite_pro.txt (3,827 bytes)   
patching file net/mac80211/tx.c
Hunk #1 succeeded at 785 (offset 108 lines).
make: arm-linux-gnueabihf-gcc: Command not found
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/lex.zconf.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf --silentoldconfig Kconfig
*
* Restart config...
*
*
* Freescale MXC Implementations
*
Freescale CPU family:
  1. MX1-based (ARCH_MX1)
  2. MX2-based (ARCH_MX2)
  3. MX25-based (ARCH_MX25)
  4. MX3-based (ARCH_MX3)
  5. i.MX50 + i.MX53 (ARCH_MX503)
  6. i.MX51 (ARCH_MX51)
> 7. MX6-based (ARCH_MX6)
choice[1-7]: 7
MAX_ORDER (FORCE_MAX_ZONEORDER) [14] 14
Support i.MX 6Quad Armadillo2 platform (MACH_MX6Q_ARM2) [N/y/?] n
Support i.MX 6SoloLite Armadillo2 platform (MACH_MX6SL_ARM2) [N/y/?] n
Support i.MX 6SoloLite EVK platform (MACH_MX6SL_EVK) [N/y/?] n
Support i.MX 6Quad SABRE Lite platform (MACH_MX6Q_SABRELITE) [N/y/?] n
Support i.MX 6Quad SABRESD platform (MACH_MX6Q_SABRESD) [N/y/?] n
Support i.MX 6Quad SABRE Auto platform (MACH_MX6Q_SABREAUTO) [N/y/?] n
Support CompuLab CM-FX6 module (MACH_CM_FX6) [Y/n/?] y
Support i.MX 6Quad HDMIDONGLE platform (MACH_MX6Q_HDMIDONGLE) [N/y/?] n
*
* MX6 Options:
*
PCI Express support (IMX_PCIE) [Y/n] y
  PCI Express EP mode in the IMX6 RC/EP interconnection system
(IMX_PCIE_EP_MODE_IN_EP_RC_SYS) [N/y] (NEW)
  PCI Express RC mode in the IMX6 RC/EP interconnection system
(IMX_PCIE_RC_MODE_IN_EP_RC_SYS) [N/y] (NEW)
USB Host 1 support (USB_EHCI_ARC_H1) [Y/n/m] y
FSL USB OTG support (USB_FSL_ARC_OTG) [Y/n/m] y
Internal LDO in MX6Q/DL bypass (MX6_INTER_LDO_BYPASS) [N/y/?] n
MX6 clk setting for smooth UI transtion from bootloader to kernel
(MX6_CLK_FOR_BOOTUI_TRANS) [N/y/?] n
i.MX Bluetooth rfkill interface support (MACH_IMX_BLUETOOTH_RFKILL)
[N/m/y/?] n
Route ENET interrupts to GPIO (MX6_ENET_IRQ_TO_GPIO) [N/y/?] n
#
# configuration written to .config
#
make: arm-linux-gnueabihf-gcc: Command not found
  CHK     include/linux/version.h
  UPD     include/linux/version.h
  CHK     include/generated/utsrelease.h
  UPD     include/generated/utsrelease.h
  HOSTCC  scripts/genksyms/genksyms.o
  SHIPPED scripts/genksyms/lex.c
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/pnmtologo
  CC      scripts/mod/empty.o
/bin/sh: 1: arm-linux-gnueabihf-gcc: not found
make[2]: *** [scripts/mod/empty.o] Error 127
make[1]: *** [scripts/mod] Error 2
make[1]: *** Waiting for unfinished jobs....
  SHIPPED scripts/genksyms/parse.h
  SHIPPED scripts/genksyms/keywords.c
  SHIPPED scripts/genksyms/parse.c
  HOSTCC  scripts/genksyms/lex.o
  HOSTCC  scripts/genksyms/parse.o
  Generating include/generated/mach-types.h
  CC      kernel/bounds.s
/bin/sh: 1: arm-linux-gnueabihf-gcc: not found
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2
make: *** Waiting for unfinished jobs....
  HOSTLD  scripts/genksyms/genksyms
make: *** [scripts] Error 2
make: arm-linux-gnueabihf-gcc: Command not found
cp: cannot stat
`/root/utilite_pro/kali-arm-build-scripts/utilite-1.0/kernel/modules.builtin':
No such file or directory
make: *** [_modinst_] Error 1
cp: cannot stat `arch/arm/boot/uImage': No such file or directory
Cloning into 'firmware'...
remote: Counting objects: 913, done.
remote: Compressing objects: 100% (701/701), done.
remote: Total 913 (delta 204), reused 889 (delta 189)
Receiving objects: 100% (913/913), 34.41 MiB | 99 KiB/s, done.
Resolving deltas: 100% (204/204), done.
del devmap : loop0p2
del devmap : loop0p1
Removing temporary build files
Generating sha1sum for kali-1.0-utilite.img
Compressing kali-1.0-utilite.img
Generating sha1sum for kali-1.0-utilite.img.xz
kali_utilite_fix_compilation.diff (749 bytes)   
diff --git a/utilite.sh b/utilite.sh
index a648382..5126c93 100755
--- a/utilite.sh
+++ b/utilite.sh
@@ -8,6 +8,8 @@ if [[ $# -eq 0 ]] ; then
     exit 0
 fi
 
+CUR_DIR=`pwd`/..
+
 basedir=`pwd`/utilite-$1
 
 # Package installations for various sections. 
@@ -183,7 +185,7 @@ patch -p1 --no-backup-if-mismatch < ../patches/mac80211.patch
 cp ${basedir}/../kernel-configs/utilite.config .config
 touch .scmversion
 export ARCH=arm
-export CROSS_COMPILE=arm-linux-gnueabihf-
+export CROSS_COMPILE=$CUR_DIR/gcc-arm-linux-gnueabihf-4.7/bin/arm-linux-gnueabihf-
 make -j $(grep -c processor /proc/cpuinfo) uImage modules
 make modules_install INSTALL_MOD_PATH=${basedir}/root
 cp arch/arm/boot/uImage ${basedir}/bootp/uImage-cm-fx6
fix_umount_loop_unmount_if_errors_with_previous_script_run.diff (297 bytes)   
diff --git a/utilite.sh b/utilite.sh
index a648382..aec95f3 100755
--- a/utilite.sh
+++ b/utilite.sh
@@ -147,6 +147,9 @@ device="/dev/mapper/${device}"
 bootp=${device}p1
 rootp=${device}p2
 
+umount $bootp
+umount $rootp
+
 # Create file systems
 mkfs.vfat $bootp
 mkfs.ext4 $rootp
utilite_pro_check_cross_compiler.diff (962 bytes)   
diff --git a/utilite.sh b/utilite.sh
index a648382..4959820 100755
--- a/utilite.sh
+++ b/utilite.sh
@@ -10,6 +10,13 @@ fi
 
 basedir=`pwd`/utilite-$1
 
+# Check the cross compiler exist before downloading all packages
+export CROSS_COMPILE=arm-linux-gnueabihf-
+if [ $(compgen -c $CROSS_COMPILE | wc -l) -eq 0 ] ; then
+	echo "Missing cross compiler. Set it up in PATH."
+	exit 1
+fi
+
 # Package installations for various sections. 
 # This will build a minimal XFCE Kali system with the top 10 tools.
 # This is the section to edit if you would like to add more packages.
@@ -183,7 +190,6 @@ patch -p1 --no-backup-if-mismatch < ../patches/mac80211.patch
 cp ${basedir}/../kernel-configs/utilite.config .config
 touch .scmversion
 export ARCH=arm
-export CROSS_COMPILE=arm-linux-gnueabihf-
 make -j $(grep -c processor /proc/cpuinfo) uImage modules
 make modules_install INSTALL_MOD_PATH=${basedir}/root
 cp arch/arm/boot/uImage ${basedir}/bootp/uImage-cm-fx6

Activities

steev

steev

2014-04-14 20:44

manager   ~0002007

Thanks for the note about the kernel config, I'm working on getting them updated and pushed out and hope to have that done by the end of the week.

The patch to add the path to the cross compiler won't be accepted as the readme lists a different place, however, we don't set a required place for it. You should follow the readme instructions from the kali-arm-build-scripts repository for how to export the cross compiler so that the script doesn't throw an error. Documentation > blog posts.

I do appreciate the work that you did on this though, and the umounting of bootp/rootp are good and I'll incorporate it across all the scripts shortly as well.

Thanks again!

Mister_X

Mister_X

2014-04-14 22:53

reporter   ~0002008

I had no idea there was a README until you said so, I just followed the tutorial. The tutorial should be updated to reflect the additional step in the README.

It would be great if the utilite.sh script was checking that the cross compiler exist at the beginning before downloading a lot of stuff and failing. Do you need a patch for that?

steev

steev

2014-04-15 00:28

manager   ~0002009

The blog post existed before the README, sorry about that. I'll see what I can do about getting the blog post updated.

I agree on the checking that the cross compiler exists - patches are always welcome, and it's something that I've been meaning to add because yeah, it really sucks to get that far and have it die because you forgot a step. If you want to supply a patch that checks that the CROSS_COMPILER exists, that's great, and I can rework it across them. I think the best course is to just check the PATH for an arm-linux-gnueabi- or arm-linux-gnueabihf- exists, rather than CROSS_COMPILER itself exists. The former is for armel and the latter is for armhf.

Mister_X

Mister_X

2014-04-15 04:22

reporter   ~0002010

I'll give you a patch for that tomorrow.

Mister_X

Mister_X

2014-04-16 00:23

reporter   ~0002011

Let me know what you think of the patch.

steev

steev

2014-04-16 01:06

manager   ~0002012

The patch looks good, I'll be testing it here and apply with a minor modification to them. We just want to make sure that it's set, so if it isn't I'll tell them to look in the README file.

Mister_X

Mister_X

2014-04-22 00:53

reporter   ~0002013

Do you know when it will be integrated?

steev

steev

2014-04-22 00:55

manager   ~0002014

I'm working on it now - I want to integrate it across all the scripts, I'm just verifying that they all work still. I also want to do the new kernel config for the Utilite at least when I push it.

steev

steev

2014-06-23 21:33

manager   ~0002088

The fixes are in the script now, so closing this bug. Thanks for the report and the work on it.

Issue History

Date Modified Username Field Change
2014-06-04 15:19 karkassa New Issue
2014-06-04 15:19 karkassa Issue generated from: 0001210
2014-06-23 21:33 steev Note Added: 0002088
2014-06-23 21:33 steev Status new => resolved
2014-06-23 21:33 steev Resolution open => fixed
2014-06-23 21:33 steev Assigned To => steev
2014-06-29 19:52 vichet Issue cloned: 0001460