News:

Attention: For security reasons,please choose a user name *different* from your login name.
Also make sure to choose a secure password and change it regularly.

Main Menu

TE0726 ZynqBerry/Looking for rootfs image file for Debian/Jessie.

Started by watari, July 14, 2016, 03:01:44 AM

Previous topic - Next topic

watari

Hi all

I'd like to learn a boot sequence via systemd on Linux (Debian/Jessie) with Zynq.
Then, I found good example which is Debian/Jessie on ZynqBerry.
And I manually got gzipped linux.bin file which has linux kernel and minimal root file before I extracted minimal root file from image.ub.
Because gzipped linux.bin file has linux kernel and minimal root file.
However I could not extract minimal root file from gzipped linux.bin file.

[Question/Request]
1) Could you release minimal root file (rootfs file) for boot sequence, if possible ?
2) Could you teach me how to extract minimal root file from image.ub file via "dumpimage" tool which is released by u-boot tools, if possible ?

[My purpose]
I'd like to know how to change root directory (/) via systemd by using some files in minimal root file using during linux boot sequence.
(ex. how to describe some commands (swich_root) via busybox and how to start "systemd" as PID is 1.)
I think that minimal root file has what I want to know.

[Note]
I already had an ability to extract minimal root file from legacy uImage format file.
But Debian/Jessie on ZynqBerry only provides three file (BOOT.BIN, image.ub and system.dtb) in /boot (1st partition of SD card).
I could not have an ability to extract minimal root file from image.ub (unified boot image file).

Thank you.
Best regards,

Antti Lukats

in case the of Debian, the image.ub DOES NOT include the rootfs at all, hence you can not extract it.

the rootfs must live in the second partition of the SD card, you can just see it, if you look at the SD card with some linux host that supports the ext filesystem.

on windows you do not see it..

watari

Hi Antti Lukats

Thank you for your reply.

Here is the information of image.ub.
According to this information, the person builds image.ub via Xilinx PetaLinux tool.
And this PetaLinux tool requests linux kernel image and minimal rootfs file to build image.ub via mkimage.
So, I think that this file (Image 0) has linux kernel and minimal rootfs file.

If this file (Image 0) has no minimal rootfs file, how does Linux mount / (actual root) on the second partition of SD card via systemd ?

Could you help me ?

% /home/watari/tools/dumpimage -l ./image.ub
FIT description: PetaLinux arm uImage with single Linux kernel and FDT blob
Created:         Tue May 24 17:06:42 2016
Image 0 (kernel@1)
  Description:  PetaLinux Kernel
  Created:      Tue May 24 17:06:42 2016
  Type:         Kernel Image
  Compression:  gzip compressed
  Data Size:    3516691 Bytes = 3434.27 kB = 3.35 MB
  Architecture: ARM
  OS:           Linux
  Load Address: 0x00008000
  Entry Point:  0x00008000
  Hash algo:    crc32
  Hash value:   fa8980c5
Image 1 (fdt@1)
  Description:  Flattened Device Tree blob
  Created:      Tue May 24 17:06:42 2016
  Type:         Flat Device Tree
  Compression:  uncompressed
  Data Size:    21061 Bytes = 20.57 kB = 0.02 MB
  Architecture: ARM
  Hash algo:    crc32
  Hash value:   0417a8f8
Default Configuration: 'conf@1'
Configuration 0 (conf@1)
  Description:  PetaLinux Boot Linux kernel with FDT blob
  Kernel:       kernel@1
  FDT:          fdt@1

Thank you.
Best regards

Antti Lukats

you must be looking at wrong image.ub

if rootfs is external, then petalinux does not incluce any rootfs, not full not minimal, just none, only kernel image and optionally devicetree are included in image.ub

if you select location for rootfs SD Card, then rotofs is no longer included in image.ub

I really fail to see what  or why you are trying todo.

1) you build u-boot, kernel and devicetree with petalinux and select external (SD) rootfs

2) you prepare rootfs using debian tools, or whatever you like

those two are completly separate build processes

and you should pretty much never use dumpimage, there should be no need, if you build the images, you know whats inside.. no need to dump them








watari

Hi Antti Lukats

Thank you for your explanation.

My previous understanding is below.

[My previous understanding]
image.ub = kernel image (vmlinux), minimal rootfs and optional device tree blob.
uImage = build from zImage via mkimage (u-boot tool)
                uImage is similar image.ub.
zImage = gzipped uImage with self-extract program.

As you mentioned before, I have some mistakes and my current understanding is below.

[My current understanding]
image.ub = kernel image (vmlinux) and optional device tree blob.
uImage = build from zImage via mkimage (u-boot tool)
                uImage and image.ub are different.
zImage = gzipped uImage with self-extract program.


What I really want to do is that linux kernel or script file via systemd mounts actual root f(/) during boot sequence.
I know that I need mount with following command.

% mount -T ext3 /dev/mmcblk0p2

I find close solution in this customized Debian/Jessie for ZynqBerry.

However this customized Debian/Jessie for ZynqBerry is NOT built by myself.
I only download the following URL.

http://www.trenz-electronic.de/download/d0/Trenz_Electronic/d1/TE0726/d2/Reference%20Designs/d3/Debian_8.4.html

I'd like to ask built person how to mount actual root via systemd or initrd during boot sequence.

Do I have a big mistake in my understanding ?
Is it perhaps that I just describe "root=/dev/mmcblk0p2" at kernel build configuration file ?
If yes, what is the purpose of minimal rootfs ?

Thank you.
Best regards,

Antti Lukats

Hi

image.ub (or anyother name you choose for kernel image) can be

a) kernel + DT + rootfs
or
b) kernel + DT
or
c) kernel

all those options you can choose in petalinux menuconfig.

our zynqberry ref design arch includes a script that builds the debian rootfs image

You can set the rootfs mount point as you want, if it is static you can enter it in petalinux menuconfig, if you want to dynamically change it, you need todo some more clever stuff, here we ca not help you.





watari

Hi Antti Lukats

Thank you for your explanation.

I got it.
Also I find the solution for my query in AR#66636 at Xilinx.
I will try it to resolve my query.

Thanks a lot.
Best regards,

Antti Lukats


watari

Hi Antti Lukats

Yes. AR#66636 is for MPSoC.
But I find how to enable rootfs as 2nd partition of SD card.
So, I think that it's useful for me.

I will try it as soon as possible.

Thank you.
Best regards,

Antti Lukats

to enable rootfs on second partition you just do it in petalinux menuconfig, there is option for this in the menu, no need look for any answer records. just type

petalinux-config

and make the selection as needed!

watari

Hi Antti Lukats

Thank you for your kindly explanation.

Got it.
I will try it.

Thanks a lot.
Best regards,