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!

cancel
Showing results for 
Search instead for 
Did you mean: 
Observer zaku89
Observer
515 Views
Registered: ‎05-30-2018

bash shell not available

Hi

 

I am following the UG1144 and try to run Linux on the board UltraZed SOM.

https://www.xilinx.com/support/documentation/sw_manuals/xilinx2017_1/ug1144-petalinux-tools-reference-guide.pdf

 

 

My environment is:

Host: Ubuntu 16.04 64bit (Vbox)

Petalinux: 2017.4

 

 

I followed the manual and make it boot up.

(Here I have use petalinux-config -c rootfs to configure the rootfs:

in File system package->base->shell

I enable all the three options: bash bash-dbg bash-dev

)

 

But when I try to run a .sh file. with ./ a.sh (which require /bin/bash). An error occurs that

 

-sh: ./a.sh: not found

 

Then I try to cd into the /bin/ and there is no bash there.

And when I type in "ba" and TAB

only below four option

 

root@uz3eg-2016-2:~# base
base64              base64.coreutils    basename            basename.coreutils

 

Then I take out the SD card and mount it onto my Virtual Machine (Ubuntu 16.04)

/media/rootfs

, and change to /media/rootfs/bin/

the bash is there.

 

ubuntu@ubuntu:/media$ ls -la /media/rootfs/bin/bash
-rwxr-xr-x 1 root root 864264 Dec 13  2017 /media/rootfs/bin/bash

 

Does anyone has some suggestion on how to make bash working on the rootfs on board?

 

Thank you in advance.

 

0 Kudos
3 Replies
Moderator
Moderator
501 Views
Registered: ‎04-24-2017

Re: bash shell not available

Hi @zaku89,

 

From your logs actually you are not booting 2017.4 petalinux images on Ultrazed.

 

root@uz3eg-2016-2:~# base
base64              base64.coreutils    basename            basename.coreutils

 

By default Ultrazed is boot mode is set to eMMC. When Ultrazed boards are shipped from Avnet they have 2016.2 images on eMMC.

 

To override the default boot args to SD just add this in project-spec/meta-user/recipes-bsp/u-boot/files/platform-top.h

 

#include <configs/platform-auto.h>

/* Extra U-Boot Env settings */
#define CONFIG_EXTRA_ENV_SETTINGS \
	SERIAL_MULTI \ 
	CONSOLE_ARG \ 
	PSSERIAL0 \ 
	"nc=setenv stdout nc;setenv stdin nc;\0" \ 
	"ethaddr=00:0a:35:00:22:01\0" \
	"importbootenv=echo \"Importing environment from SD ...\"; " \ 
		"env import -t ${loadbootenv_addr} $filesize\0" \ 
	"loadbootenv=load mmc $sdbootdev:$partid ${loadbootenv_addr} ${bootenv}\0" \ 
	"sd_uEnvtxt_existence_test=test -e mmc $sdbootdev:$partid /uEnv.txt\0" \ 
	"uenvboot=" \ 
	"if run sd_uEnvtxt_existence_test; then" \ 
		"run loadbootenv" \ 
		"echo Loaded environment from ${bootenv};" \ 
		"run importbootenv; \0" \ 
	"sdboot=echo boot Petalinux; run uenvboot ; mmcinfo && fatload mmc 0 ${netstart} ${kernel_img} && bootm \0" \ 
	"autoload=no\0" \ 
	"clobstart=0x10000000\0" \ 
	"netstart=0x10000000\0" \ 
	"dtbnetstart=0x11800000\0" \ 
	"loadaddr=0x10000000\0" \ 
	"boot_img=BOOT.BIN\0" \ 
	"load_boot=tftpboot ${clobstart} ${boot_img}\0" \ 
	"update_boot=setenv img boot; setenv psize ${bootsize}; setenv installcmd \"install_boot\"; run load_boot ${installcmd}; setenv img; setenv psize; setenv installcmd\0" \ 
	"install_boot=mmcinfo && fatwrite mmc 0 ${clobstart} ${boot_img} ${filesize}\0" \ 
	"bootenvsize=0x40000\0" \ 
	"bootenvstart=0x100000\0" \ 
	"eraseenv=sf probe 0 && sf erase ${bootenvstart} ${bootenvsize}\0" \ 
	"jffs2_img=rootfs.jffs2\0" \ 
	"load_jffs2=tftpboot ${clobstart} ${jffs2_img}\0" \ 
	"update_jffs2=setenv img jffs2; setenv psize ${jffs2size}; setenv installcmd \"install_jffs2\"; run load_jffs2 test_img; setenv img; setenv psize; setenv installcmd\0" \ 
	"sd_update_jffs2=echo Updating jffs2 from SD; mmcinfo && fatload mmc 0:1 ${clobstart} ${jffs2_img} && run install_jffs2\0" \ 
	"install_jffs2=sf probe 0 && sf erase ${jffs2start} ${jffs2size} && " \ 
		"sf write ${clobstart} ${jffs2start} ${filesize}\0" \ 
	"kernel_img=image.ub\0" \ 
	"load_kernel=tftpboot ${clobstart} ${kernel_img}\0" \ 
	"update_kernel=setenv img kernel; setenv psize ${kernelsize}; setenv installcmd \"install_kernel\"; run load_kernel ${installcmd}; setenv img; setenv psize; setenv installcmd\0" \ 
	"install_kernel=mmcinfo && fatwrite mmc 0 ${clobstart} ${kernel_img} ${filesize}\0" \ 
	"cp_kernel2ram=mmcinfo && fatload mmc 1 ${netstart} ${kernel_img}\0" \ 
	"dtb_img=system.dtb\0" \ 
	"load_dtb=tftpboot ${clobstart} ${dtb_img}\0" \ 
	"update_dtb=setenv img dtb; setenv psize ${dtbsize}; setenv installcmd \"install_dtb\"; run load_dtb test_img; setenv img; setenv psize; setenv installcmd\0" \ 
	"sd_update_dtb=echo Updating dtb from SD; mmcinfo && fatload mmc 0:1 ${clobstart} ${dtb_img} && run install_dtb\0" \ 
	"fault=echo ${img} image size is greater than allocated place - partition ${img} is NOT UPDATED\0" \ 
	"test_crc=if imi ${clobstart}; then run test_img; else echo ${img} Bad CRC - ${img} is NOT UPDATED; fi\0" \ 
	"test_img=setenv var \"if test ${filesize} -gt ${psize}\\; then run fault\\; else run ${installcmd}\\; fi\"; run var; setenv var\0" \ 
	"netboot=tftpboot ${netstart} ${kernel_img} && bootm\0" \ 
	"default_bootcmd=run cp_kernel2ram && bootm ${netstart}\0" \ 
""

/* Allow large image.ub to be loaded correctly */
#undef CONFIG_SYS_BOOTMAPSZ
Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
Observer zaku89
Observer
476 Views
Registered: ‎05-30-2018

Re: bash shell not available

Hi Sandeep,

 

Thank you for your suggestion!

It is this problem, the booted one is not the Image I prepared in SD card, actually it is the prebuit one in mmc.

 

But when I paste your txt into the platform-top.h to replace the previous content and rebuild the system.

Every time I power on the board it will reboot U-boot itself repeatly.

Is there other ways like modifing the bootargs or setenv in the u-boot command line ?

 

I tried to use this command in the console of Uboot

env set sdbootdev 1

 

Then it will boot and stuck at

 

Xilinx Zynq MP First Stage Boot Loader
Release 2017.4   Oct 11 2018  -  18:22:51
NOTICE:  ATF running on XCZU3EG/silicon v4/RTL5.1 at 0xfffea000, with PMU firmware
NOTICE:  BL31: Secure code at 0x0
NOTICE:  BL31: Non secure code at 0x8000000
NOTICE:  BL31: v1.3(release):47af34b
NOTICE:  BL31: Built : 01:23:07, Oct 12 2018


U-Boot 2017.01 (Oct 11 2018 - 18:20:20 -0700) Xilinx ZynqMP ZCU102 revB

I2C:   ready
DRAM:  2 GiB
ERROR: usb dr_mode not found

at /home/ubuntu/zu3eg_JH_17_4/build/tmp/work/plnx_aarch64-xilinx-linux/u-boot-xlnx/v2017.01-xilinx-v2017.4+gitAUTOINC+5fa7d2ed06-r0/git/drivers/usb/common/common.c:32/usb_get_dr_mode()
EL Level:       EL2
Chip ID:        xczu3eg
MMC:   sdhci@ff160000: 0 (eMMC), sdhci@ff170000: 1 (SD)
zynqmp_qspi_ofdata_to_platdata: CLK 299999997
SF: Detected n25q256a with page size 512 Bytes, erase size 128 KiB, total 64 MiB
In:    serial
Out:   serial
Err:   serial
Net:   ZYNQ GEM: ff0b0000, phyaddr ffffffff, interface gmii
PHY is not detected
GEM PHY init failed
No ethernet found.
U-BOOT for zu3eg_JH

ZYNQ GEM: ff0b0000, phyaddr ffffffff, interface gmii
mdio_register: non unique device name 'eth0'
ZYNQ GEM: ff0b0000, phyaddr ffffffff, interface gmii
mdio_register: non unique device name 'eth0'
ZYNQ GEM: ff0b0000, phyaddr ffffffff, interface gmii
mdio_register: non unique device name 'eth0'
ZYNQ GEM: ff0b0000, phyaddr ffffffff, interface gmii
mdio_register: non unique device name 'eth0'
No ethernet found.
ZYNQ GEM: ff0b0000, phyaddr ffffffff, interface gmii
mdio_register: non unique device name 'eth0'
Hit any key to stop autoboot:  0
ZynqMP> env set sdbootdev 1
ZynqMP> boot
Device: sdhci@ff160000
Manufacturer ID: 13
OEM: 14e
Name: Q2J55
Tran Speed: 200000000
Rd Block Len: 512
MMC version 5.0
High Capacity: Yes
Capacity: 7.1 GiB
Bus Width: 8-bit
Erase Group Size: 512 KiB
HC WP Group Size: 8 MiB
User Capacity: 7.1 GiB WRREL
Boot Capacity: 16 MiB ENH
RPMB Capacity: 4 MiB ENH
reading image.ub
16541048 bytes read in 1401 ms (11.3 MiB/s)
## Loading kernel from FIT Image at 10000000 ...
   Using 'conf@2' configuration
   Trying 'kernel@0' kernel subimage
     Description:  Linux Kernel
     Type:         Kernel Image
     Compression:  uncompressed
     Data Start:   0x100000d8
     Data Size:    16507392 Bytes = 15.7 MiB
     Architecture: AArch64
     OS:           Linux
     Load Address: 0x00080000
     Entry Point:  0x00080000
     Hash algo:    sha1
     Hash value:   fc3a8b2f1893a155e4f88b49c8a9f66618217de6
   Verifying Hash Integrity ... sha1+ OK
## Loading fdt from FIT Image at 10000000 ...
   Using 'conf@2' configuration
   Trying 'fdt@0' fdt subimage
     Description:  Flattened Device Tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x10fbe3d0
     Data Size:    32349 Bytes = 31.6 KiB
     Architecture: AArch64
     Hash algo:    sha1
     Hash value:   ff4e3c8abbe9d7d6d0a4d2f96317d09611e98d3c
   Verifying Hash Integrity ... sha1+ OK
   Booting using the fdt blob at 0x10fbe3d0
ZYNQ GEM: ff0b0000, phyaddr ffffffff, interface gmii
mdio_register: non unique device name 'eth0'
   Loading Kernel Image ... OK
   Loading Device Tree to 0000000007ff5000, end 0000000007fffe5c ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.9.0-xilinx-v2017.4 (ubuntu@ubuntu) (gcc version 6.2.1 20161016 (Linaro GCC 6.2-2016.11) ) #1 SMP Sun Oct 14 22:33:36 PDT 2018
[    0.000000] Boot CPU: AArch64 Processor [410fd034]
[    0.000000] earlycon: cdns0 at MMIO 0x00000000ff000000 (options '115200n8')
[    0.000000] bootconsole [cdns0] enabled
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: UEFI not found.
[    0.000000] cma: Reserved 1024 MiB at 0x0000000040000000
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.0 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: MIGRATE_INFO_TYPE not supported.
[    0.000000] percpu: Embedded 22 pages/cpu @ffffffc03ff76000 s52376 r8192 d29544 u90112
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: enabling workaround for ARM erratum 845719
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 517120
[    0.000000] Kernel command line: earlycon clk_ignore_unused earlyprintk root=/dev/mmcblk0p2 rw rootwait cma=1024M
[    0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)
[    0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes)
[    0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes)
[    0.000000] Memory: 999680K/2097152K available (10300K kernel code, 1080K rwdata, 3760K rodata, 960K init, 405K bss, 48896K reserved, 1048576K cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     modules : 0xffffff8000000000 - 0xffffff8008000000   (   128 MB)
[    0.000000]     vmalloc : 0xffffff8008000000 - 0xffffffbebfff0000   (   250 GB)
[    0.000000]       .text : 0xffffff8008080000 - 0xffffff8008a90000   ( 10304 KB)
[    0.000000]     .rodata : 0xffffff8008a90000 - 0xffffff8008e40000   (  3776 KB)
[    0.000000]       .init : 0xffffff8008e40000 - 0xffffff8008f30000   (   960 KB)
[    0.000000]       .data : 0xffffff8008f30000 - 0xffffff800903e200   (  1081 KB)
[    0.000000]        .bss : 0xffffff800903e200 - 0xffffff80090a37cc   (   406 KB)
[    0.000000]     fixed   : 0xffffffbefe7fd000 - 0xffffffbefec00000   (  4108 KB)
[    0.000000]     PCI I/O : 0xffffffbefee00000 - 0xffffffbeffe00000   (    16 MB)
[    0.000000]     vmemmap : 0xffffffbf00000000 - 0xffffffc000000000   (     4 GB maximum)
[    0.000000]               0xffffffbf00000000 - 0xffffffbf01c00000   (    28 MB actual)
[    0.000000]     memory  : 0xffffffc000000000 - 0xffffffc080000000   (  2048 MB)
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  Build-time adjustment of leaf fanout to 64.
[    0.000000]  RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=64, nr_cpu_ids=4
[    0.000000] NR_IRQS:64 nr_irqs:64 0
[    0.000000] GIC: Adjusting CPU interface base to 0x00000000f902f000
[    0.000000] GIC: Using split EOI/Deactivate mode
[    0.000000] arm_arch_timer: Architected cp15 timer(s) running at 33.33MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x7b0074340, max_idle_ns: 440795202884 ns
[    0.000003] sched_clock: 56 bits at 33MHz, resolution 30ns, wraps every 2199023255543ns
[    0.008244] Console: colour dummy device 80x25
[    0.012498] console [tty0] enabled
[    0.015863] bootconsole [cdns0] disabled

 

 

any idea? Thank you!

0 Kudos
Highlighted
Observer ishahak
Observer
461 Views
Registered: ‎01-31-2018

Re: bash shell not available

I may suggest a few things from my few months of experience. It might or might not solve your problems.

Instead of changing platform-top.h, I'm doing the following:

reboot the SOM and hit [enter] to stop at U-Boot. Then follow these instructions:

 

ZynqMP> 

#reset back to default of U-Boot setup:

env default -f -a

 

#setup MAC address. Will also affect the kernel! 

#Default is 00:0a:35:00:22:01 but when having multiple cards you must make it unique!

setenv ethaddr 00:0a:35:00:22:03 

#fix kernel loader - it is confusing between the internal and external flash memories:

setenv cp_kernel2ram 'echo "[[FIXED]]"; mmc dev 1 && mmcinfo && fatload mmc 1 ${netstart} ${kernel_img}'

 

#fix cmd-line for kernel.

#This is MY setup, in which I use (1) NFS for the rootfs, (2) reserve the top 512MB for memory shared with FPGA

# and (3) allows using "uioctl" to access FPGA registers (by adding &axi2regs_0 {compatible = "generic-uio";}; in system-user.dtsi)

 

setenv bootargs 'console=ttyPS0,115200n8 earlyprintk ip=dhcp root=/dev/nfs rootfstype=nfs nfsroot=192.168.0.133:/usr/nfs/my-rootfs,port=2049,tcp rw loglevel=7 nfsrootdebug uio_pdrv_genirq.of_id="generic-uio" clk_ignore_unused mem=1536M memmap=1536M@512M'

 

#alternatively, instead of NFS, use a second partition of the SD card, formatted as EXT4 from Ubuntu, as the rootfs: 

setenv bootargs 'console=ttyPS0,115200n8 earlyprintk ip=dhcp rootfstype=ext4 root=/dev/mmcblk1p2 rw loglevel=7 uio_pdrv_genirq.of_id="generic-uio" clk_ignore_unused mem=1536M memmap=1536M@512M'

 

#make everything permanent:

saveenv

---

Another tip I can share: I'm using buildroot to create the rootfs, instead of petalinux. It is easier to rebuild and configure. see my post here.

 

I hope this helps.

-Itay

 

Tags (2)
0 Kudos