Utils/mkbootimg issues

Hi terry ,
I have created lnitrd.img , But i couldn’t create Ramdisk image . Error shown is ,

cinesoft@Cinesoft-Electronics-dept:~/project/khadas/ubuntu/u-boot/linux$ ./utils/mkbootimg --kernel linux/arch/arm64/boot/Image --ramdisk images/initrd.img -o images/ramdisk.img
bash: ./utils/mkbootimg: No such file or directory

folder “utils” is created under - /home/cinesoft/project/khadas/ubuntu.
I have copyed this file to present working directory. But i can 't build this Ramdisk image.

please help me

You can download the folder ‘utils’ from our github

$ cd /home/cinesoft/project/khadas/ubuntu
$ git clone https://github.com/khadas/utils

what’s the error information about it?
I create ramdisk successfully.

terry@Server:~/project/khadas/ubuntu$ ./utils/mkbootimg --kernel linux/arch/arm64/boot/Image --ramdisk images/initrd.img -o images/ramdisk.img
terry@Server:~/project/khadas/ubuntu$ ls -l images/ramdisk.img 
-rw-r--r-- 1 terry terry 20062208 Jun 28 19:01 images/ramdisk.img
terry@Server:~/project/khadas/ubuntu$ 

Hi terry,
Thanks for the link. But it doesn’t work. I have downloaded the folder ‘utils’ from github. The link and the command is working fine. I got a ‘utils’ folder and it contains 4 items , one of them is " mkbootimg " as an executable type . Total file size of ’ utils ’ is 8.5 Mb. But i couldn’t create Ramdisk image . Same error shows for the command " /utils/mkbootimg --kernel linux/arch/arm64/boot/Image --ramdisk images/initrd.img -o images/ramdisk.img "

Error shown is -
root@Cinesoft-Electronics-dept:/home/cinesoft/project/khadas/ubuntu/u-boot/linux# ./utils/mkbootimg --kernel linux/arch/arm64/boot/Image --ramdisk images/initrd.img -o images/ramdisk.img
bash: ./utils/mkbootimg: No such file or directory

is there is any issue related to the file " mkbootimg ". Present " mkbootimg " file has 34.5 Kb size.
is that ok?

You should go to the path ‘/home/cinesoft/project/khadas/ubuntu/’ and run './utils/mkbootimg --kernel linux/arch/arm64/boot/Image --ramdisk images/initrd.img -o images/ramdisk.img’
It is not the path ‘home/cinesoft/project/khadas/ubuntu/u-boot/linux’

Hi terry,

    I have tried the path that u have given. But the same error has been shown . I have downloaded the 'utils' file to the path u have given. But it doesn't work.

Please check the attachment.

Can you verify the file ‘mkbootimg’?

terry@Server:~/project/khadas/ubuntu$ md5sum utils/mkbootimg 
3ddea229f94b8be9d8756bdbf5288f65  utils/mkbootimg

Hi Terry,

   I have tried the command ,that you have given and it works fine. we got the output like this " 3ddea229f94b8be9d8756bdbf5288f65  utils/mkbootimg ". Please go through the attachment.

A strange problem.

Can you confirm again the properties of the utils folder:

gouwa@Wesion:~/project/khadas/ubuntu$ ls -l 
total 3639560
drwxr-xr-x  6 gouwa gouwa       4096 Mar  9 16:40 archives
drwxr-xr-x  4 gouwa gouwa       4096 Jun  7 09:31 images
drwxr-xr-x 25 gouwa gouwa       4096 Jun  6 16:38 linux
-rw-rw-r--  1 gouwa gouwa        311 Jun  5 14:23 Makefile
drwxrwxr-x  2 gouwa gouwa       4096 Jun  5 10:20 rootfs
drwxr-xr-x  2 gouwa gouwa       4096 Jun  5 19:58 scripts
drwxrwxr-x 24 gouwa gouwa       4096 Mar 10 18:47 u-boot
drwxrwxr-x  4 gouwa gouwa       4096 Apr 25 17:07 utils
gouwa@Wesion:~/project/khadas/ubuntu

And please run and below command and paste to us:

gouwa@Wesion:~/project/khadas/ubuntu$ file utils/mkbootimg 
utils/mkbootimg: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.8, not stripped
gouwa@Wesion:~/project/khadas/ubuntu$

If everything works fine, when you run mkbootimg, it should be:

gouwa@Wesion:~/project/khadas/ubuntu$ ./utils/mkbootimg 
error: no output filename specified
usage: mkbootimg
       --kernel <filename>
       --ramdisk <filename>
       [ --second <2ndbootloader-filename> ]
       [ --cmdline <kernel-commandline> ]
       [ --board <boardname> ]
       [ --base <address> ]
       [ --pagesize <pagesize> ]
       -o|--output <filename>
gouwa@Wesion:~/project/khadas/ubuntu$

Good luck!

Hi Gouwa,

Thank you so much for your valuable time. I have executed the commands, which you have given in the reply. The screen shots is showing the results we got for executing that commands. Please check the screen shots and do the needful for further processing.

The ubuntu system of your host pc is 64bit and the file ‘mkbootimg’ is 32bit
You may be need to install some libraries to support it
Please search for google.
Thanks.

Yes, I think Terry is right, you can run the below command first and try again:

$ sudo apt install lib32ncurses5-dev

Good luck!

Follow my guide and it should work :slight_smile:

Hint: apt install libc6:i386 libstdc++6:i386

To fix that problem in Ubuntu:
sudo apt-get install lib32stdc++6

You might also need:
sudo apt-get install libstdc++6

1 Like

Hi
thank you Gouwa. I have installed the libraries that you have given. That was Ok. But now i got an another error in the same command. "error: could not load kernel ‘linux/arch/arm64/boot/Image’ " I am attaching the screen shot along with the mail.

double check if you really have the file /home/cinesoft/project/khadas/ubuntu/linux/arch/arm64/boot/Image you tell him to use
you might have messed up your pathes as your filexplorer shows another location where you put Image

Hi mmeyer,

         i have read through your guide. That was nice. I have tried to compile the Kernal.  I got the following errors. 

root@Cinesoft-Electronics-dept:/home/cinesoft/project/khadas/ubuntu# make ARCH=arm64 kvim_defconfig
make: *** No rule to make target `kvim_defconfig’. Stop.

Hi Tang ,

   Thank you for the support.

Thank Dude

Hi ravelo,

thanks for the assistance. It was the fastest replay. Boot.img has been created. Thank you. That was small Directory change.

Thanks dude.

1 Like

Hi all,
I have reached at " Build Ubuntu Rootfs via a Pre-built Image ". I have chooses " Armbian_5.27_S9xxx_Ubuntu_xenial_3.14.29_mate_KODI_20170702.img ".
While i building root file system, i couldn’t mount the pre-build image . Step is given below

"$ xdg-open archives/Armbian_5.24_Amlogic-s905x_Ubuntu_xenial_3.14.29_desktop_20161223.img "

after this step a drive has been created but i couldn’t mount it. Please go through the attachment.

I am adding more screen shots…
Please check it…