UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

Reply

Petalinux 2016.4 boot from SD with ext4 rootfs

Accepted Solution Solved
Visitor
Posts: 9
Registered: ‎06-30-2016
Accepted Solution

Petalinux 2016.4 boot from SD with ext4 rootfs

Hello Everyone!

 

I updated my Petalinux Tools 2016.1 to 2016.4 and I'm not able to configure the SD Card ext filesystem for rootfs anymore.

 

Following the latest Reference Guide UG144 I created a new project and imported my hardware description. 

 

In petalinux-config I selected Image Packaging Configuration > SD card as the RootFS type.

 

After successful petalinux-build no rootfs.cpio file is generated as written in the reference guide, but a file named rootfs.ext4. The CPIO image is only generated when the default INTRAMFS packaging is selected. 

 

I created the BOOT.bin image with

 

petalinux-package --boot --fsbl zynq_fsbl.elf --fpga base_zynq_design_wrapper.bit --u-boot

and copied BOOT.BIN and image.ub to the first FAT32 partition of my SD-Card. I copied the rootfs.ext4 image using DD to the second partition. 

 

Linux is booting and my bootargs are set correctly to the second partition of my SD-Card:

cat /proc/cmdline 
bootargs = "console=ttyPS0,115200 earlyprintk root=/dev/mmcblk0p2 rw rootwait";

 

Now the problem:

 

The rootfs seems to be a initramfs disk and /dev/mmcblk0p2 is mounted to /run/media/mmcblk0p2 

 

I already tried to disable intramfs support with petalinux-config -c kernel and also extracted the CPIO image as written in the reference guide with no success. 

 

Can anyone help me please with this issue? 

I want to have my file system (including home directory) on the second partition of the SD card to keep changes. 

 

With Petalinux 2016.1 it was working, I'm using the ZC706 Board und Ubuntu 16.04.

 

Here is the earlyprintk:

 

U-Boot 2016.07 (Jan 10 2017 - 16:42:44 +0100)

DRAM:  ECC disabled 1 GiB
MMC:   sdhci@e0100000: 0
SF: Detected S25FL128S_64K with page size 512 Bytes, erase size 128 KiB, total 32 MiB
*** Warning - bad CRC, using default environment

## Error: flags type check failure for "serverip" <= "AUTO" (type: i)
himport_r: can't insert "serverip=AUTO" into hash table
In:    serial
Out:   serial
Err:   serial
Net:   ZYNQ GEM: e000b000, phyaddr -1, interface rgmii-id
eth0: ethernet@e000b000
U-BOOT for

ethernet@e000b000 Waiting for PHY auto negotiation to complete.... done
BOOTP broadcast 1
DHCP client bound to address 192.168.1.113 (9 ms)
Hit any key to stop autoboot:  4  3  2  1  0 
Device: sdhci@e0100000
Manufacturer ID: 27
OEM: 5048
Name: SD16G 
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 14.5 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
reading image.ub
9840584 bytes read in 927 ms (10.1 MiB/s)
## Loading kernel from FIT Image at 01000000 ...
   Using 'conf@1' configuration
   Verifying Hash Integrity ... OK
   Trying 'kernel@0' kernel subimage
     Description:  Linux Kernel
     Type:         Kernel Image
     Compression:  uncompressed
     Data Start:   0x010000d4
     Data Size:    3862376 Bytes = 3.7 MiB
     Architecture: ARM
     OS:           Linux
     Load Address: 0x00008000
     Entry Point:  0x00008000
     Hash algo:    sha1
     Hash value:   81f56b7b6e61c520fef68e6b6af6195e6c6c13bf
   Verifying Hash Integrity ... sha1+ OK
## Loading ramdisk from FIT Image at 01000000 ...
   Using 'conf@1' configuration
   Trying 'ramdisk@0' ramdisk subimage
     Description:  ramdisk
     Type:         RAMDisk Image
     Compression:  uncompressed
     Data Start:   0x013b3244
     Data Size:    5960082 Bytes = 5.7 MiB
     Architecture: ARM
     OS:           Linux
     Load Address: unavailable
     Entry Point:  unavailable
     Hash algo:    sha1
     Hash value:   92d21b45e0a51186229e8bb42a343aa75ac8a2a5
   Verifying Hash Integrity ... sha1+ OK
## Loading fdt from FIT Image at 01000000 ...
   Using 'conf@1' configuration
   Trying 'fdt@0' fdt subimage
     Description:  Flattened Device Tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x013af130
     Data Size:    16483 Bytes = 16.1 KiB
     Architecture: ARM
     Hash algo:    sha1
     Hash value:   2121da3b143f4f77f2d758d3de94a5354602a5a9
   Verifying Hash Integrity ... sha1+ OK
   Booting using the fdt blob at 0x13af130
   Loading Kernel Image ... OK
   Loading Ramdisk to 07a50000, end 07fff192 ... OK
   Loading Device Tree to 07a48000, end 07a4f062 ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0x0

Linux version 4.6.0-xilinx (juem@guybrush) (gcc version 5.2.1 20151005 (Linaro GCC 5.2-2015.11-2) ) #1 SMP PREEMPT Tue Jan 10 16:45:18 CET 2017

CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d

CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache

Machine model: zynq_naventik

bootconsole [earlycon0] enabled

cma: Reserved 16 MiB at 0x3f000000

Memory policy: Data cache writealloc

percpu: Embedded 12 pages/cpu @ef7d2000 s19776 r8192 d21184 u49152

Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260608

Kernel command line: console=ttyPS0,115200 earlyprintk root=/dev/mmcblk0p2 rw rootwait uio_pdrv_genirq.of_id=generic-uio

PID hash table entries: 4096 (order: 2, 16384 bytes)

Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)

Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)

Memory: 1008504K/1048576K available (5288K kernel code, 233K rwdata, 1868K rodata, 1024K init, 229K bss, 23688K reserved, 16384K cma-reserved, 245760K highmem)

Virtual kernel memory layout:

    vector  : 0xffff0000 - 0xffff1000   (   4 kB)

    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)

    vmalloc : 0xf0800000 - 0xff800000   ( 240 MB)

    lowmem  : 0xc0000000 - 0xf0000000   ( 768 MB)

    pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)

    modules : 0xbf000000 - 0xbfe00000   (  14 MB)

      .text : 0xc0008000 - 0xc07fd098   (8149 kB)

      .init : 0xc0800000 - 0xc0900000   (1024 kB)

      .data : 0xc0900000 - 0xc093a720   ( 234 kB)

       .bss : 0xc093a720 - 0xc0973de4   ( 230 kB)

Preemptible hierarchical RCU implementation.

	Build-time adjustment of leaf fanout to 32.

	RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.

RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=2

NR_IRQS:16 nr_irqs:16 16

efuse mapped to f0802000

slcr mapped to f0804000

L2C: platform modifies aux control register: 0x72360000 -> 0x72760000

L2C: DT/platform modifies aux control register: 0x72360000 -> 0x72760000

L2C-310 erratum 769419 enabled

L2C-310 enabling early BRESP for Cortex-A9

L2C-310 full line of zeros enabled for Cortex-A9

L2C-310 ID prefetch enabled, offset 1 lines

L2C-310 dynamic clock gating enabled, standby mode enabled

L2C-310 cache controller enabled, 8 ways, 512 kB

L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x76760001

zynq_clock_init: clkc starts at f0804100

Zynq clock init

sched_clock: 64 bits at 333MHz, resolution 3ns, wraps every 4398046511103ns

clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0x4ce07af025, max_idle_ns: 440795209040 ns

Switching to timer-based delay loop, resolution 3ns

clocksource: ttc_clocksource: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 537538477 ns

timer #0 at f080c000, irq=17

Console: colour dummy device 80x30

Calibrating delay loop (skipped), value calculated using timer frequency.. 666.66 BogoMIPS (lpj=3333333)

pid_max: default: 32768 minimum: 301

Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)

Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)

CPU: Testing write buffer coherency: ok

CPU0: thread -1, cpu 0, socket 0, mpidr 80000000

Setting up static identity map for 0x100000 - 0x100058

CPU1: thread -1, cpu 1, socket 0, mpidr 80000001

Brought up 2 CPUs

SMP: Total of 2 processors activated (1333.33 BogoMIPS).

CPU: All CPU(s) started in SVC mode.

devtmpfs: initialized

VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4

clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns

pinctrl core: initialized pinctrl subsystem

NET: Registered protocol family 16

DMA: preallocated 256 KiB pool for atomic coherent allocations

cpuidle: using governor menu

hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.

hw-breakpoint: maximum watchpoint size is 4 bytes.

zynq-ocm f800c000.ocmc: ZYNQ OCM pool: 256 KiB @ 0xf0880000

zynq-pinctrl 700.pinctrl: zynq pinctrl initialized

vgaarb: loaded

SCSI subsystem initialized

usbcore: registered new interface driver usbfs

usbcore: registered new interface driver hub

usbcore: registered new device driver usb

media: Linux media interface: v0.10

Linux video capture interface: v2.00

pps_core: LinuxPPS API ver. 1 registered

pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>

PTP clock support registered

EDAC MC: Ver: 3.0.0

Advanced Linux Sound Architecture Driver Initialized.

clocksource: Switched to clocksource arm_global_timer

NET: Registered protocol family 2

TCP established hash table entries: 8192 (order: 3, 32768 bytes)

TCP bind hash table entries: 8192 (order: 4, 65536 bytes)

TCP: Hash tables configured (established 8192 bind 8192)

UDP hash table entries: 512 (order: 2, 16384 bytes)

UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)

NET: Registered protocol family 1

RPC: Registered named UNIX socket transport module.

RPC: Registered udp transport module.

RPC: Registered tcp transport module.

RPC: Registered tcp NFSv4.1 backchannel transport module.

hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available

futex hash table entries: 512 (order: 3, 32768 bytes)

workingset: timestamp_bits=28 max_order=18 bucket_order=0

jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.

bounce: pool size: 64 pages

io scheduler noop registered

io scheduler deadline registered

io scheduler cfq registered (default)

dma-pl330 f8003000.dmac: Loaded driver for PL330 DMAC-241330

dma-pl330 f8003000.dmac: 	DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16

e0000000.serial: ttyPS0 at MMIO 0xe0000000 (irq = 144, base_baud = 3125000) is a xuartps

console [ttyPS0] enabled

bootconsole [earlycon0] disabled

 


Accepted Solutions
Observer
Posts: 23
Registered: ‎01-17-2017

Re: Petalinux 2016.4 boot from SD with ext4 rootfs

I too was having this issue. I think I finally figured it out.

***NOTE: I am not sure whether the last thing I did fixed it or if it is the whole setup.

In petalinux-config

 goto misc/config System Configuration
→ Subsystem AUTO Hardware Settings → Advanced bootable images storage Settings → dtb image settings

Make sure this is set to SD.

 

After Building..

And Packaging...

Copy the BOOT.BIN, image.ub, system.dtb onto the first partition

Do a

mkfs.ext3 <second partition>

Copy the rootfs.cpio to the second partition

in the second partition do

/mnt/sd_rootf/$ sudo pax -r -c -f rootfs.cpio

Note that I found that as a discrepency in the documentation, the -rcf does not seem to work with pax (at least the version I am using)

 

This seems to work for me. I am not sure whether it was going to ext3 v. ext4? The sequence above was the sequence I attempting things (i.e. I first started by putting the system.dtb into the boot partition.) What happened then Is I attempted to boot without doing anything to the second partition.

This gave me:

Waiting for root device /dev/mmcblk0p2...
mmc0: new high speed SDHC card at address cb4a
mmcblk0: mmc0:cb4a B08GK 7.46 GiB
 mmcblk0: p1 p2
EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
EXT4-fs (mmcblk0p2): warning: mounting fs with errors, running e2fsck is recommended
EXT4-fs (mmcblk0p2): recovery complete
EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
VFS: Mounted root (ext4 filesystem) on device 179:2.
devtmpfs: error mounting -2
Freeing unused kernel memory: 1024K (c0800000 - c0900000)
Kernel panic - not syncing: No working init found.  Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.
CPU0: stopping
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.6.0-xilinx #1
Hardware name: Xilinx Zynq Platform
[<c010e48c>] (unwind_backtrace) from [<c010a6b0>] (show_stack+0x10/0x14)
[<c010a6b0>] (show_stack) from [<c02d05b4>] (dump_stack+0x80/0x9c)
[<c02d05b4>] (dump_stack) from [<c010cbc4>] (ipi_cpu_stop+0x3c/0x70)
[<c010cbc4>] (ipi_cpu_stop) from [<c010d440>] (handle_IPI+0x64/0x84)
[<c010d440>] (handle_IPI) from [<c0101400>] (gic_handle_irq+0x74/0x90)
[<c0101400>] (gic_handle_irq) from [<c010b094>] (__irq_svc+0x54/0x90)
Exception stack(0xc0901f30 to 0xc0901f78)
1f20:                                     00000000 00000000 2ef97000 ef7d61c0
1f40: 00000001 ef7d55c0 d832cbca 00000000 d77e2ee0 00000000 00000000 00000001
1f60: 00000008 c0901f80 c0492228 c049224c 60000113 ffffffff
[<c010b094>] (__irq_svc) from [<c049224c>] (cpuidle_enter_state+0xe0/0x1b4)
[<c049224c>] (cpuidle_enter_state) from [<c014a25c>] (cpu_startup_entry+0x184/0x1d0)
[<c014a25c>] (cpu_startup_entry) from [<c0800bbc>] (start_kernel+0x2ec/0x34c)
---[ end Kernel panic - not syncing: No working init found.  Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.

At which point I decided to just mkfs.ext3 the second partion and unpack the cpio file there.

Now I seem to be booting ok.

 

Hopefully this works for you. I spent the last week pounding on this.

View solution in original post


All Replies
Adventurer
Posts: 61
Registered: ‎11-09-2015

Re: Petalinux 2016.4 boot from SD with ext4 rootfs

hi @juem

   it seems you use "e0000000.serial"as ttyPS0,most demo boards use "e0001000.serial" as ttyPS0.

make sure you set the right serial in your ipi ,dts.

BestRegards

 

Visitor
Posts: 9
Registered: ‎06-30-2016

Re: Petalinux 2016.4 boot from SD with ext4 rootfs

Thanks, but I think this is not the problem. I'm not using ttyPS0, only for the earlyprintk output and this is working. As I said, I can log in with ssh, but the file system is mounted as ram disk althrough I selected SD card in petalinux-config.

 

 

Moderator
Posts: 292
Registered: ‎12-04-2016

Re: Petalinux 2016.4 boot from SD with ext4 rootfs

Hi 

 

Possibility of hanging at this point would be because, you have both UART0 and UART1 enabled in the hardware.

 

Just for a quick check, you can modify your system_conf.dtsi file as below:

In the alias part, add one line:

serial1 = &uart0;

 

Let's First Check the above solution. If it works then I would recommend next not to edit anything in above dtsi file, Instead make changes in system-top.dts. 

Try disabling UART0 by modify system-top.dts to disable UART0: 

In system-top.dts, at the end of the file add:

&uart0 {

              status = "disabled";

};

Let me know if it works

 

Best Regards

Shabbir

Xilinx Employee
Posts: 2,089
Registered: ‎04-17-2011

Re: Petalinux 2016.4 boot from SD with ext4 rootfs

I can see your concern here. It is correct that the image.ub contains an INITRAMFS file system instead of selecting SD card and even with the rootfs.ext4 present in /root it loads the INITRAMFS in image.ub present in /boot. I am re-checking the steps provided in the documentation and would suggest a solution in this thread.
Regards,
Debraj
----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
Visitor
Posts: 9
Registered: ‎06-30-2016

Re: Petalinux 2016.4 boot from SD with ext4 rootfs

 

@shabbirk 

I set the alias in the dt-recipes as you proposed. This gives me the same output as before and additional lines below (at the end of my thread).

The Kernel image is already loaded from INITRAMFS at this point. The problem must occur earlier.

 

@debrajr 

In Petalinux Reference Guide UG1144 2016.4 page 48 rootfs.cpio should be corrected to rootfs.ext4 image and there is another mistake on page 24 "Generate boot image" (double --fsbl and usage of a pmufw file). 

 

$ petalinux-package --boot --fsbl <FSBL image> --fsbl <FSBL image> --pmufw
<PATH_TO_PMU_FW_ELF> --u-boot

 

I found a new Known Issue AR# 68522 for Zynq-Ultrascale. Maybe this solution can be transferred to Zynq devices?

 

 

 

e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 145, base_baud = 3125000) is a xuartps
�console [ttyPS0] enabled
console [ttyPS0] enabled

bootconsole [earlycon0] disabled
bootconsole [earlycon0] disabled

xdevcfg f8007000.devcfg: ioremap 0xf8007000 to f0870000
[drm] Initialized drm 1.1.0 20060810
brd: module loaded
loop: module loaded
m25p80 spi0.0: found s25fl128s, expected m25p80
m25p80 spi0.0: s25fl128s (32768 Kbytes)
4 ofpart partitions found on MTD device spi0.0
Creating 4 MTD partitions on "spi0.0":
0x000000000000-0x000000500000 : "boot"
0x000000500000-0x000000520000 : "bootenv"
0x000000520000-0x000000fa0000 : "kernel"
0x000000fa0000-0x000002000000 : "spare"
CAN device driver interface
gpiod_set_value: invalid GPIO
libphy: MACB_mii_bus: probed
macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 148 (00:0a:35:00:1e:53)
Marvell 88E1116R e000b000.etherne:07: attached PHY driver [Marvell 88E1116R] (mii_bus:phy_addr=e000b000.etherne:07, irq=-1)
e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
usbcore: registered new interface driver usb-storage
mousedev: PS/2 mouse device common for all mice
i2c /dev entries driver
cdns-i2c e0004000.i2c: 400 kHz mmio e0004000 irq 141
EDAC MC: ECC not enabled
Xilinx Zynq CpuIdle Driver started
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
mmc0: SDHCI controller on e0100000.sdhci [e0100000.sdhci] using DMA
ledtrig-cpu: registered to indicate activity on CPUs
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
NET: Registered protocol family 10
sit: IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
can: controller area network core (rev 20120528 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20120528)
can: broadcast manager protocol (rev 20120528 t)
can: netlink gateway (rev 20130117) max_hops=1
Registering SWP/SWPB emulation handler
hctosys: unable to open rtc device (rtc0)
ALSA device list:
  No soundcards found.
Freeing unused kernel memory: 1024K (c0800000 - c0900000)

INIT: mmc0: new high speed SDHC card at address 0007
version 2.88 bootingmmcblk0: mmc0:0007 SD16G 14.5 GiB 
 mmcblk0: p1 p2


FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
EXT4-fs (mmcblk0p2): recovery complete
EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
random: dd urandom read with 1 bits of entropy available
Thu Jan 19 09:36:39 UTC 2017

Starting internet superserver: inetd.


INIT: Entering runlevel: 5


Configuring network interfaces... IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
udhcpc (v1.24.1) started

Sending discover...

Sending discover...

macb e000b000.ethernet eth0: link up (100/Full)
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Sending discover...

Sending select for 192.168.1.113...

Lease of 192.168.1.113 obtained, lease time 86400

/etc/udhcpc.d/50default: Adding DNS 192.168.1.1

done.

Starting Dropbear SSH server: Generating key, this may take a while...

Public key portion is:

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDMcUaEgPovUwwKhAuEpFTj39XF+tn5axDbVAjAEf49+RdXG1vxI8VNoy/GeRSI8zgLifdgi9OQVqskZMkICsGfAK571WNz18Lzag4qOS0gBagtjcvk8kr5OZ55iBF1cSh+sEuen2B7y+hG1Nc9tdvQGBXD7SJrGHUqZAAOZZXMwxzkjqfLN3ckli9qErWZJm4TnFvLAWlwhhlMi12Yk6TjA1Dy3g/KJw9titearPkYY2M9qlZXEbwo4zJ9GN9c4qg4iWhoTHX96e+UKhXG4IGC+5rFxOFojYtqMc0T4Kr1rw4w4yRyFJ+ekC2hmuiSlxnJKWLRBSXuFfTFWPstkCz3 root@plnx_arm

Fingerprint: md5 0d:30:8d:d6:9e:dc:fa:b4:dc:42:71:c9:bd:27:96:96

dropbear.

starting Busybox HTTP Daemon: httpd... done.

Starting syslogd/klogd: done

Starting tcf-agent: OK

PetaLinux 2016.4 plnx_arm /dev/ttyPS0

plnx_arm login: 

 

Moderator
Posts: 292
Registered: ‎12-04-2016

Re: Petalinux 2016.4 boot from SD with ext4 rootfs

Hello

 

I dont think this solution is applicable for ZC702 or 706. We are not using PMU firmware here.

Alternatively, for your issue, you can also give a try disabling early printk both in kernel command line args and menuconfig

 

Best Regards

Shabbir

 

Xilinx Employee
Posts: 2,089
Registered: ‎04-17-2011

Re: Petalinux 2016.4 boot from SD with ext4 rootfs

@juem

@debrajr
In Petalinux Reference Guide UG1144 2016.4 page 48 rootfs.cpio should be corrected to rootfs.ext4 image and there is another mistake on page 24 "Generate boot image" (double --fsbl and usage of a pmufw file).

This has been noted.
Regards,
Debraj
----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
Observer
Posts: 23
Registered: ‎01-17-2017

Re: Petalinux 2016.4 boot from SD with ext4 rootfs

I too was having this issue. I think I finally figured it out.

***NOTE: I am not sure whether the last thing I did fixed it or if it is the whole setup.

In petalinux-config

 goto misc/config System Configuration
→ Subsystem AUTO Hardware Settings → Advanced bootable images storage Settings → dtb image settings

Make sure this is set to SD.

 

After Building..

And Packaging...

Copy the BOOT.BIN, image.ub, system.dtb onto the first partition

Do a

mkfs.ext3 <second partition>

Copy the rootfs.cpio to the second partition

in the second partition do

/mnt/sd_rootf/$ sudo pax -r -c -f rootfs.cpio

Note that I found that as a discrepency in the documentation, the -rcf does not seem to work with pax (at least the version I am using)

 

This seems to work for me. I am not sure whether it was going to ext3 v. ext4? The sequence above was the sequence I attempting things (i.e. I first started by putting the system.dtb into the boot partition.) What happened then Is I attempted to boot without doing anything to the second partition.

This gave me:

Waiting for root device /dev/mmcblk0p2...
mmc0: new high speed SDHC card at address cb4a
mmcblk0: mmc0:cb4a B08GK 7.46 GiB
 mmcblk0: p1 p2
EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
EXT4-fs (mmcblk0p2): warning: mounting fs with errors, running e2fsck is recommended
EXT4-fs (mmcblk0p2): recovery complete
EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
VFS: Mounted root (ext4 filesystem) on device 179:2.
devtmpfs: error mounting -2
Freeing unused kernel memory: 1024K (c0800000 - c0900000)
Kernel panic - not syncing: No working init found.  Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.
CPU0: stopping
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.6.0-xilinx #1
Hardware name: Xilinx Zynq Platform
[<c010e48c>] (unwind_backtrace) from [<c010a6b0>] (show_stack+0x10/0x14)
[<c010a6b0>] (show_stack) from [<c02d05b4>] (dump_stack+0x80/0x9c)
[<c02d05b4>] (dump_stack) from [<c010cbc4>] (ipi_cpu_stop+0x3c/0x70)
[<c010cbc4>] (ipi_cpu_stop) from [<c010d440>] (handle_IPI+0x64/0x84)
[<c010d440>] (handle_IPI) from [<c0101400>] (gic_handle_irq+0x74/0x90)
[<c0101400>] (gic_handle_irq) from [<c010b094>] (__irq_svc+0x54/0x90)
Exception stack(0xc0901f30 to 0xc0901f78)
1f20:                                     00000000 00000000 2ef97000 ef7d61c0
1f40: 00000001 ef7d55c0 d832cbca 00000000 d77e2ee0 00000000 00000000 00000001
1f60: 00000008 c0901f80 c0492228 c049224c 60000113 ffffffff
[<c010b094>] (__irq_svc) from [<c049224c>] (cpuidle_enter_state+0xe0/0x1b4)
[<c049224c>] (cpuidle_enter_state) from [<c014a25c>] (cpu_startup_entry+0x184/0x1d0)
[<c014a25c>] (cpu_startup_entry) from [<c0800bbc>] (start_kernel+0x2ec/0x34c)
---[ end Kernel panic - not syncing: No working init found.  Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.

At which point I decided to just mkfs.ext3 the second partion and unpack the cpio file there.

Now I seem to be booting ok.

 

Hopefully this works for you. I spent the last week pounding on this.

Observer
Posts: 23
Registered: ‎01-17-2017

Re: Petalinux 2016.4 boot from SD with ext4 rootfs

*** Follow up ***

I redid the steps using ext4 and it seems to be working for me now. The issue that made me think to change to ext3 was a flaky sd-card. However, I do not believe the sd-card is the root problem with the initial booting issue.