embed-me / meta-ebaz4205

meta-layer for EBAZ4205
GNU General Public License v3.0
12 stars 13 forks source link

Adding extra packages to the build #3

Open barbiani opened 3 years ago

barbiani commented 3 years ago

Hi,

I am following this article and trying to add packages to poky/meta-ebaz4205/recipes-core/images/ebaz4205-image-standard-wic.bb by adding:

IMAGE_INSTALL_append = "apt gnupg curl parted e2fsprogs python3-pynq"

The final image size increases by 200MB but it does not seem to carry these binaries.

It looks like that /dev/mmcblk0p2 is not mounted as root. I am certailny missing something.

What is the proper way to add packages to the final image but not also to initramfs?

Thanks.

embed-me commented 3 years ago

Hi,

The syntax for appending requires a space before the first entry eg.: IMAGE_INSTALL_append = " apt" Please have a look at the Yocto Mega Manual

You can also have a look at "recipes-core/images/ebaz4205-image-standard.bb" since this image already appends multiple packages.

If your mmcblk0p2 is not mounted as root, ensure that the sd-card is prepared as described, try to mount it manually to verify its functionality, and check your uboot BOOTARGS variable.

barbiani commented 3 years ago

Looks like everything I did is correct, but it does not switch from the ramfs to ext4 root.

The aditional packages are in /dev/mmcblk0p2.

And I changed the kernel branch to 5.4.

U-Boot 2019.07 (Apr 12 2021 - 04:07:35 +0000)

CPU:   Zynq 7z010
Silicon: v3.1
DRAM:  ECC disabled 256 MiB
MMC:   mmc@e0100000: 0
Loading Environment from SPI Flash... Invalid bus 0 (err=-19)
*** Warning - spi_flash_probe_bus_cs() failed, using default environment

In:    serial@e0001000
Out:   serial@e0001000
Err:   serial@e0001000
Net:   ZYNQ GEM: e000b000, phyaddr 0, interface rgmii-id

Warning: ethernet@e000b000 (eth0) using random MAC address - 02:ef:31:36:51:ea
eth0: ethernet@e000b000
538 bytes read in 21 ms (24.4 KiB/s)
Importing environment from SD ...
Hit any key to stop autoboot:  0
gpio: pin 20 (gpio 20) value is 0
Device: mmc@e0100000
Manufacturer ID: 3
OEM: 5344
Name: SL08G
Bus Speed: 20000000
Mode: SD High Speed (50MHz)
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 7.4 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
gpio: pin 54 (gpio 54) value is 0
gpio: pin 55 (gpio 55) value is 0
538 bytes read in 11 ms (46.9 KiB/s)
Loaded environment from uEnv.txt
Importing environment from SD ...
Copying Linux from SD to RAM...
4453656 bytes read in 479 ms (8.9 MiB/s)
24356 bytes read in 18 ms (1.3 MiB/s)
19270464 bytes read in 2029 ms (9.1 MiB/s)
gpio: pin 54 (gpio 54) value is 1
   Warning: value of pin is still 0
gpio: pin 55 (gpio 55) value is 0
Handoff to Linux kernel...
## Booting kernel from Legacy Image at 02080000 ...
   Image Name:   Linux-5.4.0-xilinx-v2019.2
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4453592 Bytes = 4.2 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 04000000 ...
   Image Name:   ebaz4205-image-standard-ebaz4205
   Image Type:   ARM Linux RAMDisk Image (uncompressed)
   Data Size:    19270400 Bytes = 18.4 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 02000000
   Booting using the fdt blob at 0x2000000
   Loading Kernel Image ... OK
   Loading Ramdisk to 0d8d7000, end 0eb37b00 ... OK
   Loading Device Tree to 0d8ce000, end 0d8d6f23 ... OK

Starting kernel ...

Booting Linux on physical CPU 0x0
Linux version 5.4.0-xilinx-v2019.2 (oe-user@oe-host) (gcc version 9.2.0 (GCC)) #1 SMP PREEMPT Mon Apr 12 01:57:44 UTC 2021
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt: Machine model: xlnx,zynq-7000
Memory policy: Data cache writealloc
cma: Reserved 16 MiB at 0x0f000000
percpu: Embedded 15 pages/cpu s31884 r8192 d21364 u61440
Built 1 zonelists, mobility grouping on.  Total pages: 65024
Kernel command line: earlyprintk console=ttyPS0,115200 root=/dev/mmcblk0p2 rw rootwait
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
mem auto-init: stack:off, heap alloc:off, heap free:off
Memory: 213368K/262144K available (6144K kernel code, 208K rwdata, 1872K rodata, 1024K init, 133K bss, 32392K reserved, 16384K cma-reserved, 0K highmem)
rcu: Preemptible hierarchical RCU implementation.
rcu:    RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
        Tasks RCU enabled.
rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
efuse mapped to (ptrval)
slcr mapped to (ptrval)
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
random: get_random_bytes called from start_kernel+0x260/0x420 with crng_init=0
zynq_clock_init: clkc starts at (ptrval)
Zynq clock init
ps_clk frequency not specified, using 33 MHz.
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
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: 1024 (order: 0, 4096 bytes, linear)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
CPU: Testing write buffer coherency: ok
CPU0: Spectre v2: using BPIALL workaround
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x100000 - 0x100060
rcu: Hierarchical SRCU implementation.
smp: Bringing up secondary CPUs ...
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
CPU1: Spectre v2: using BPIALL workaround
smp: Brought up 1 node, 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
futex hash table entries: 512 (order: 3, 32768 bytes, linear)
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 @ 0x(ptrval)
e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 24, base_baud = 6249999) is a xuartps
printk: console [ttyPS0] enabled
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
mc: Linux media interface: v0.10
videodev: 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
FPGA manager framework
Advanced Linux Sound Architecture Driver Initialized.
clocksource: Switched to clocksource arm_global_timer
thermal_sys: Registered thermal governor 'step_wise'
NET: Registered protocol family 2
tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
TCP established hash table entries: 2048 (order: 1, 8192 bytes, linear)
TCP bind hash table entries: 2048 (order: 2, 16384 bytes, linear)
TCP: Hash tables configured (established 2048 bind 2048)
UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
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.
PCI: CLS 0 bytes, default 64
Trying to unpack rootfs image as initramfs...
Freeing initrd memory: 18820K
hw perfevents: no interrupt-affinity property for /pmu@f8891000, guessing.
hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
workingset: timestamp_bits=30 max_order=16 bucket_order=0
jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
io scheduler mq-deadline registered
io scheduler kyber registered
zynq-pinctrl 700.pinctrl: zynq pinctrl initialized
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
brd: module loaded
loop: module loaded
libphy: Fixed MDIO Bus: probed
CAN device driver interface
libphy: MACB_mii_bus: probed
ICPlus IP101A/G e000b000.ethernet-ffffffff:00: attached PHY driver [ICPlus IP101A/G] (mii_bus:phy_addr=e000b000.ethernet-ffffffff:00, irq=POLL)
macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 26 (02:ef:31:36:51:ea)
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
input: buttons as /devices/soc0/buttons/input/input0
i2c /dev entries driver
cdns-wdt f8005000.watchdog: Xilinx Watchdog Timer with timeout 10s
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.mmc [e0100000.mmc] using ADMA
ledtrig-cpu: registered to indicate activity on CPUs
clocksource: ttc_clocksource: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 537538477 ns
timer #0 at (ptrval), irq=39
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
nand: device found, Manufacturer ID: 0xef, Chip ID: 0xf1
nand: Winbond W29N01HV
nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
pl353_nand_calculate_hwecc status failed
pl353_nand_calculate_hwecc status failed
pl353_nand_calculate_hwecc status failed
pl353_nand_calculate_hwecc status failed
Bad block table not found for chip 0
pl353_nand_calculate_hwecc status failed
pl353_nand_calculate_hwecc status failed
pl353_nand_calculate_hwecc status failed
pl353_nand_calculate_hwecc status failed
Bad block table not found for chip 0
Scanning device for bad blocks
Bad block table written to 0x000007fe0000, version 0x01
Bad block table written to 0x000007fc0000, version 0x01
4 fixed-partitions partitions found on MTD device W29N01HV
Creating 4 MTD partitions on "W29N01HV":
0x000000000000-0x000001ffffff : "partition0"
mtd: partition "partition0" doesn't end on an erase/write block -- force read-only
0x000002000000-0x000005ffffff : "partition1"
mmc0: new high speed SDHC card at address aaaa
mtd: partition "partition1" doesn't end on an erase/write block -- force read-only
mmcblk0: mmc0:aaaa SL08G 7.40 GiB
0x000004000000-0x000009ffffff : "partition2"
mtd: partition "partition2" extends beyond the end of device "W29N01HV" -- size truncated to 0x4000000
 mmcblk0: p1 p2
0x000006000000-0x00000dffffff : "partition3"
mtd: partition "partition3" extends beyond the end of device "W29N01HV" -- size truncated to 0x2000000
fpga_manager fpga0: Xilinx Zynq FPGA Manager registered
NET: Registered protocol family 10
Segment Routing with IPv6
sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
NET: Registered protocol family 17
can: controller area network core (rev 20170425 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20170425)
can: broadcast manager protocol (rev 20170425 t)
can: netlink gateway (rev 20190810) max_hops=1
Registering SWP/SWPB emulation handler
of-fpga-region fpga-full: FPGA Region probed
hctosys: unable to open rtc device (rtc0)
of_cfs_init
of_cfs_init: OK
ALSA device list:
  No soundcards found.
Freeing unused kernel memory: 1024K
Run /init as init process
systemd[1]: System time before build time, advancing clock.
systemd[1]: Failed to lookup module alias 'autofs4': Function not implemented
systemd[1]: systemd 243.2+ running in system mode. (-PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT -GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD -IDN2 -IDN -PCRE2 default-hierarchy=hybrid)
systemd[1]: Detected architecture arm.

Welcome to EBAZ4205 Distro 1.0 (zeus)!

systemd[1]: Set hostname to <ebaz4205-zynq7>.
random: systemd: uninitialized urandom read (16 bytes read)
systemd[1]: Initializing machine ID from random generator.
systemd[1]: /lib/systemd/system/dbus.socket:5: ListenStream= references a path below legacy directory /var/run/, updating /var/run/dbus/system_bus_socket → /run/dbus/system_bus_socket; please update the unit file accordingly.
systemd[1]: /lib/systemd/system/rpcbind.socket:5: ListenStream= references a path below legacy directory /var/run/, updating /var/run/rpcbind.sock → /run/rpcbind.sock; please update the unit file accordingly.
random: systemd: uninitialized urandom read (16 bytes read)
systemd[1]: system-getty.slice: unit configures an IP firewall, but the local system does not support BPF/cgroup firewalling.
systemd[1]: (This warning is only shown for the first unit using IP firewalling.)
systemd[1]: Created slice system-getty.slice.
[  OK  ] Created slice system-getty.slice.
random: systemd: uninitialized urandom read (16 bytes read)
systemd[1]: Created slice system-serial\x2dgetty.slice.
[  OK  ] Created slice system-serial\x2dgetty.slice.
[  OK  ] Created slice User and Session Slice.
[  OK  ] Started Dispatch Password …ts to Console Directory Watch.
[  OK  ] Started Forward Password R…uests to Wall Directory Watch.
[  OK  ] Reached target Paths.
[  OK  ] Reached target Remote File Systems.
[  OK  ] Reached target Slices.
[  OK  ] Reached target Swap.
[  OK  ] Listening on Syslog Socket.
[  OK  ] Listening on initctl Compatibility Named Pipe.
[  OK  ] Listening on Journal Socket (/dev/log).
[  OK  ] Listening on Journal Socket.
[  OK  ] Listening on Network Service Netlink Socket.
[  OK  ] Listening on udev Control Socket.
[  OK  ] Listening on udev Kernel Socket.
         Mounting Temporary Directory (/tmp)...
         Starting Journal Service...
         Mounting NFSD configuration filesystem...
         Mounting Kernel Configuration File System...
         Starting Remount Root and Kernel File Systems...
         Starting Apply Kernel Variables...
         Starting udev Coldplug all Devices...
[  OK  ] Started Journal Service.
[  OK  ] Mounted Temporary Directory (/tmp).
[FAILED] Failed to mount NFSD configuration filesystem.
See 'systemctl status proc-fs-nfsd.mount' for details.
[DEPEND] Dependency failed for NFS server and services.
[DEPEND] Dependency failed for NFS Mount Daemon.
[  OK  ] Mounted Kernel Configuration File System.
[  OK  ] Started Remount Root and Kernel File Systems.
[  OK  ] Started Apply Kernel Variables.
         Starting Flush Journal to Persistent Storage...
systemd-journald[72]: Received client request to flush runtime journal.
         Starting Create System Users...
[  OK  ] Started Flush Journal to Persistent Storage.
[  OK  ] Started Create System Users.
         Starting Create Static Device Nodes in /dev...
[  OK  ] Started Create Static Device Nodes in /dev.
[  OK  ] Reached target Local File Systems (Pre).
         Mounting /var/volatile...
         Starting udev Kernel Device Manager...
[  OK  ] Started udev Coldplug all Devices.
[  OK  ] Started udev Kernel Device Manager.
[  OK  ] Mounted /var/volatile.
         Starting Network Service...
         Starting Load/Save Random Seed...
[  OK  ] Started Network Service.
macb e000b000.ethernet eth0: unable to generate target frequency: 25000000 Hz
macb e000b000.ethernet eth0: link up (100/Full)
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
random: fast init done
[  OK  ] Found device /dev/mmcblk0p1.
         Mounting /media/mmcblk0p1...
FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[  OK  ] Mounted /media/mmcblk0p1.
[  OK  ] Reached target Local File Systems.
         Starting Rebuild Dynamic Linker Cache...
         Starting Create Volatile Files and Directories...
[  OK  ] Started Rebuild Dynamic Linker Cache.
[  OK  ] Started Create Volatile Files and Directories.
         Starting Run pending postinsts...
         Starting Rebuild Journal Catalog...
         Starting Network Name Resolution...
         Starting Network Time Synchronization...
         Starting Update UTMP about System Boot/Shutdown...
[  OK  ] Started Rebuild Journal Catalog.
         Starting Update is Completed...
[  OK  ] Started Update UTMP about System Boot/Shutdown.
[  OK  ] Started Update is Completed.
[  OK  ] Started Network Time Synchronization.
[  OK  ] Started Network Name Resolution.
[  OK  ] Started Run pending postinsts.
[  OK  ] Reached target Network.
[  OK  ] Reached target Host and Network Name Lookups.
[  OK  ] Reached target System Initialization.
[  OK  ] Started Daily Cleanup of Temporary Directories.
[  OK  ] Reached target System Time Set.
[  OK  ] Reached target System Time Synchronized.
[  OK  ] Reached target Timers.
[  OK  ] Listening on D-Bus System Message Bus Socket.
[  OK  ] Listening on dropbear.socket.
[  OK  ] Listening on RPCbind Server Activation Socket.
[  OK  ] Reached target Sockets.
[  OK  ] Reached target Basic System.
[  OK  ] Started Kernel Logging Service.
[  OK  ] Started System Logging Service.
[  OK  ] Started D-Bus System Message Bus.
[  OK  ] Started Getty on tty1.
         Starting RPC Bind Service...
[  OK  ] Started Serial Getty on ttyPS0.
[  OK  ] Reached target Login Prompts.
         Starting Login Service...
[  OK  ] Started RPC Bind Service.
[  OK  ] Started NFS status monitor for NFSv2/3 locking..
[  OK  ] Started Login Service.
[  OK  ] Reached target Multi-User System.
         Starting Update UTMP about System Runlevel Changes...
[  OK  ] Started Update UTMP about System Runlevel Changes.
random: crng init done
random: 7 urandom warning(s) missed due to ratelimiting
[  OK  ] Started Load/Save Random Seed.

EBAZ4205 Distro 1.0 ebaz4205-zynq7 ttyPS0

ebaz4205-zynq7 login: root
Password:
root@ebaz4205-zynq7:~# cat /media/mmcblk0p1/uEnv.txt
machine_name=ebaz4205-zynq7
kernel_image=uImage
loadkernel=load mmc 0 ${kernel_load_address} ${kernel_image}
devicetree_image=ebaz4205-zynq7.dtb
loaddtb=load mmc 0 ${devicetree_load_address} ${devicetree_image}
ramdisk_image=ebaz4205-image-standard-ebaz4205-zynq7.cpio.gz.u-boot
loadramdisk=load mmc 0 ${ramdisk_load_address} ${ramdisk_image}
bootargs=earlyprintk console=ttyPS0,115200 root=/dev/mmcblk0p2 rw rootwait
bitstream_image=boot.bin
bitstream_type=load
fpga_config=fpga ${bitstream_type} 0 ${bitstream_load_address} ${filesize}
root@ebaz4205-zynq7:~# mount -t ext4 /dev/mmcblk0p2 /mnt
EXT4-fs (mmcblk0p2): recovery complete
EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
ext4 filesystem being mounted at /mnt supports timestamps until 2038 (0x7fffffff)
root@ebaz4205-zynq7:~# ls /mnt
bin         dev         home        lost+found  mnt         run         sys         usr
boot        etc         lib         media       proc        sbin        tmp         var
root@ebaz4205-zynq7:~# df -m
Filesystem           1M-blocks      Used Available Use% Mounted on
devtmpfs                   104         0       104   0% /dev
tmpfs                      122         0       122   0% /dev/shm
tmpfs                      122         8       113   7% /run
tmpfs                      122         0       122   0% /sys/fs/cgroup
tmpfs                      122         0       122   0% /tmp
tmpfs                      122         0       122   0% /var/volatile
/dev/mmcblk0p1              52        30        22  58% /media/mmcblk0p1
/dev/mmcblk0p2             299       163       116  58% /mnt
root@ebaz4205-zynq7:~#
embed-me commented 3 years ago

Please also provide the output of cat /etc/fstab and mount.

barbiani commented 3 years ago
root@ebaz4205-zynq7:~# cat /etc/fstab
/dev/root            /                    auto       defaults               1  1
/dev/mmcblk0p1       /media/mmcblk0p1     auto       defaults,noatime,async 0  0
proc                 /proc                proc       defaults               0  0
devpts               /dev/pts             devpts     mode=0620,gid=5        0  0
tmpfs                /run                 tmpfs      mode=0755,nodev,nosuid,strictatime 0  0
tmpfs                /var/volatile        tmpfs      defaults               0  0

root@ebaz4205-zynq7:~# mount
none on / type rootfs (rw)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,relatime)
devtmpfs on /dev type devtmpfs (rw,nosuid,size=106684k,nr_inodes=26671,mode=755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /var/volatile type tmpfs (rw,relatime)
/dev/mmcblk0p1 on /media/mmcblk0p1 type vfat (rw,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/mmcblk0p2 on /mnt type ext4 (rw,relatime)
embed-me commented 3 years ago

Ok, the mount command verifies that noting was mounted as rootfs. You should have rootfs on / type rootfs (rw). Your fstab file looks fine to me. Can you mount the rootfs using mount -a? How did you prepare the SD-Card for the image?

barbiani commented 3 years ago

I took ebaz4205-image-standard-wic-ebaz4205-zynq7.wic and wrote to the card with win32diskimager.

root@ebaz4205-zynq7:~# mount -a -v
/                        : ignored
/media/mmcblk0p1         : already mounted
/proc                    : already mounted
/dev/pts                 : already mounted
/run                     : already mounted
/var/volatile            : already mounted
root@ebaz4205-zynq7:~# fsck /dev/mmcblk0p2 -V
fsck from util-linux 2.34
[/sbin/fsck.ext4 (1) -- /dev/mmcblk0p2] fsck.ext4 /dev/mmcblk0p2
e2fsck 1.45.3 (14-Jul-2019)
root: clean, 10087/40000 files, 180627/319688 blocks
embed-me commented 3 years ago

Seems like you have already modified the provided meta-ebaz4205 sources since you seem to use kernel Linux version 5.4.0-xilinx-v2019.2 instead of 4.19.0-xilinx-v2019.2, correct?

I have not seen this issue before, but it might be related to the kernel command-line root parameter not being passed to the kernel as expected. What does cat /proc/cmdline show?

barbiani commented 3 years ago

Yes I modified the branch to 5.4 and its hash but left the 2019.2 string.

I did look around and everything else seemed to be correct... so I wrote to you.

root@ebaz4205-zynq7:~# cat /proc/cmdline
earlyprintk console=ttyPS0,115200 root=/dev/mmcblk0p2 rw rootwait
embed-me commented 3 years ago

So far everything looks fine to me and since I do not have a modified version for kernel 5.4 I think you are on your own. I would focus on the /etc/fstab file since all the information seems to be there for the kernel to mount the rootfs. Good luck.

barbiani commented 3 years ago

Of course it is easier to ge with what was already tested.. so I did revert the kernel back to 4.19.

ebaz4205-zynq7 login: root
Password:
root@ebaz4205-zynq7:~# uname -a
Linux ebaz4205-zynq7 4.19.0-xilinx-v2019.2 #1 SMP PREEMPT Wed Apr 14 06:33:46 UTC 2021 armv7l GNU/Linux
root@ebaz4205-zynq7:~# mount
rootfs on / type rootfs (rw)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,relatime)
devtmpfs on /dev type devtmpfs (rw,nosuid,size=107192k,nr_inodes=26798,mode=755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /var/volatile type tmpfs (rw,relatime)
/dev/mmcblk0p1 on /media/mmcblk0p1 type vfat (rw,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)

I am far from an expert, but I was expecting to see /dev/mmcblk0p2 mounted at /.

root@ebaz4205-zynq7:~# df -m
Filesystem           1M-blocks      Used Available Use% Mounted on
devtmpfs                   105         0       105   0% /dev
tmpfs                      122         0       122   0% /dev/shm
tmpfs                      122         8       114   7% /run
tmpfs                      122         0       122   0% /sys/fs/cgroup
tmpfs                      122         0       122   0% /tmp
tmpfs                      122         0       122   0% /var/volatile
/dev/mmcblk0p1              52        30        22  58% /media/mmcblk0p1
root@ebaz4205-zynq7:~# cat /proc/cmdline
earlyprintk console=ttyPS0,115200 root=/dev/mmcblk0p2 rw rootwait
root@ebaz4205-zynq7:~# cat /etc/fstab
/dev/root            /                    auto       defaults               1  1
/dev/mmcblk0p1       /media/mmcblk0p1     auto       defaults,noatime,async 0  0
proc                 /proc                proc       defaults               0  0
devpts               /dev/pts             devpts     mode=0620,gid=5        0  0
tmpfs                /run                 tmpfs      mode=0755,nodev,nosuid,strictatime 0  0
tmpfs                /var/volatile        tmpfs      defaults               0  0
barbiani commented 3 years ago

Might be related.

https://forums.xilinx.com/t5/Embedded-Linux/Petalinux-2016-4-boot-from-SD-with-ext4-rootfs/m-p/743039/highlight/true#M18085

from another page...

  1. In the menu that will pop when you execute $petalinux-config --get-hw-description=. Select the following: Image Packaging Configuration tab Root Filesystem Type SD card device node of SD device /dev/mmcblk0p2 Subsystem AUTO Hardware Settings SD/SDIO Settings Primary SD/SDIO psu_sd_0 ...
barbiani commented 3 years ago

I was able to build petalinux 2020.3 using your setup as a guide and the ext4 partition was correctly mounted as root without initramfs.

root@zynq:~# df -m
Filesystem           1M-blocks      Used Available Use% Mounted on
/dev/root                 2475        24      2304   1% /
devtmpfs                   113         0       113   0% /dev
tmpfs                      122         0       122   0% /run
tmpfs                      122         0       122   0% /var/volatile
/dev/mmcblk0p2            2475        24      2304   1% /media/sd-mmcblk0p2
/dev/mmcblk0p1             166         7       159   4% /media/sd-mmcblk0p1