Why snap_core and snap_kernel in boot cmdline

@ogra: Sorry for delay in replies.

Please find below kernel command line arguments
Kernel command line: console=ttyS0,115200 console=tty0 root=/dev/disk/by-label/writable rng_core.default_quality=700 net.ifnames=0 init=/lib/systemd/systemd ro panic=-1 fixrtc snap_core=core_2331.snap snap_kernel=olimex-a20-olinuxino-lime2-linux_x1.snap

This problem (system stuck at “initrd: mounting /run” state) after reset is coming frequently. I have connected via serial USB cable through UART0 interface.

well, if you do not have a monitor attached, try dropping the console=tty0 option, then all console output shold stay on serial even after switching to userspace …

Hello Ogra,
First of all thank you for your support that made me to develop the core image for Olimex Lime 2 platform boards.
As per your suggestions we modified u-boot source code to
a) Support raw initrd image
b) To boot from micro-SD card
Hope I am correct here.

Now I am trying to build a self programming core image for Olimex platform boards which will initially load from SD card and then self programs will run and flash the image into eMMC so that after reset system shall boot from programmed image and SD card can be use for other purpose.

Query :
a) Do we have any self program (any script file) supported that will program the core image (uboot image + uboot environment + kernel image) into eMMC for first time when system comes up?
b) Assuming we have a self program that will program the image (uboot image + uboot environment + kernel image) into eMMC. As we have modified u-boot image to boot from SD card . So is the same modified u-boot image shall work when system shall try to boot from eMMC?

Appreciate your support here.

I think @ondra can help out here, he added a similar install feature to our dragonboard gadget snap via:

it requires to build (and ship) two different u-boot binaries and some scripting in uboot.env.in

Hello Ogra,

Thanks for your support here.
I tried to follow the design here as mentioned in above link. I did changes in gadget snap and shipped two boot-loader images. Now initially system came up with core image present in SD card.

I followed below steps after that:
a) Copied the eMMC boat-loader image in eMMC at offset : 8192
b) Created two partitions in eMMC and copy the content of SD card partitions into corresponding partitions in eMMC (i.e. /dev/mmcblk0p1 -> /dev/mmcblk1p1 and /dev/mmcblk0p2 -> /dev/mmcblk1p2 ; /dev/mmcblk0 is SD card and /dev/mmcblk1 is eMMC)
c) Removed the SD card and reset the system

After reset the system was able to load boad-loader that was copied in eMMC from SD card and able to run under new environment. It was able to load kernel, init-ramdisk and fdt image from boot partition in eMMC.
After Uncompressing Linux and booting kernel it got stuck before starting initrd image. Please find below the snippet of console logs of non working case.

Non-Working
U-Boot SPL 2017.11-rc4-00012-g021a8ae-dirty (Nov 13 2017 - 00:10:21)
DRAM: 1024 MiB
CPU: 912000000Hz, AXI/AHB/APB: 3/2/2
Trying to boot from MMC2

U-Boot 2017.11-rc4-00012-g021a8ae-dirty (Nov 13 2017 - 00:10:21 -0500) Allwinner Technology

CPU: Allwinner A20 (SUN7I)
Model: Olimex A20-OLinuXino-LIME2-eMMC
I2C: ready
DRAM: 1 GiB
MMC: SUNXI SD/MMC: 0, SUNXI SD/MMC: 1
reading uboot-emmc.env
In: serial
Out: serial
Err: serial
Allwinner mUSB OTG (Peripheral)
SCSI: SATA link 0 timeout.
AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: ncq stag pm led clo only pmp pio slum part ccc apst
Net: eth0: ethernet@01c50000
Warning: usb_ether using MAC address from ROM
, eth1: usb_ether
starting USB…
USB0: USB EHCI 1.00
USB1: USB OHCI 1.0
USB2: USB EHCI 1.00
USB3: USB OHCI 1.0
scanning bus 0 for devices… 1 USB Device(s) found
scanning bus 2 for devices… 1 USB Device(s) found
scanning usb for storage devices… 0 Storage Device(s) found
Hit any key to stop autoboot: 2 1 0
reading olimex-a20-olinuxino-lime2-linux_x1.snap/kernel.img
6308440 bytes read in 389 ms (15.5 MiB/s)
reading olimex-a20-olinuxino-lime2-linux_x1.snap/dtbs/sun7i-a20-olinuxino-lime2-emmc.dtb
35116 bytes read in 62 ms (552.7 KiB/s)
reading olimex-a20-olinuxino-lime2-linux_x1.snap/initrd.img
4719915 bytes read in 293 ms (15.4 MiB/s)

Flattened Device Tree blob at 43000000

Booting using the fdt blob at 0x43000000
Loading Ramdisk to 49b7f000, end 49fff52b … OK
Loading Device Tree to 49b73000, end 49b7e92b … OK

Starting kernel …

Uncompressing Linux… done, booting the kernel.
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.10.17-olimex (root@arunmakakr-VirtualBox) (gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.4) ) #1 SMP Wed Sep 13 12:47:21 IST 2017 ()
[ 0.000000] CPU: ARMv7 Processor [410fc074] revision 4 (ARMv7), cr=50c5387d
[ 0.000000] CPU: div instructions available: patching division code
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt:Machine model: Olimex A20-OLinuXino-LIME2-eMMC
[ 0.000000] cma: Reserved 16 MiB at 0x7f000000
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: Using PSCI v0.1 Function IDs from DT
[ 0.000000] percpu: Embedded 15 pages/cpu @ef6be000 s30412 r8192 d22836 u61440
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 260416
[ 0.000000] Kernel command line: console=ttyS0,115200 console=tty0 sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_fb_mem_reserve=16 root=/dev/disk/by-label/writable net.ifnames=0 init=/lib/systemd/systemd ro rng_core.default_quality=700 panic=-1 fixrtc snap_core=core_3249.snap snap_kernel=olimex-a20-olinuxino-lime2-linux_x1.snap
[ 0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Memory: 1004868K/1048576K available (7168K kernel code, 811K rwdata, 2188K rodata, 1024K init, 316K bss, 27324K reserved, 16384K cma-reserved, 245760K highmem)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xf0800000 - 0xff800000 ( 240 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xf0000000 ( 768 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf800000 - 0xbfe00000 ( 6 MB)
[ 0.000000] .text : 0xc0008000 - 0xc0800000 (8160 kB)
[ 0.000000] .init : 0xc0b00000 - 0xc0c00000 (1024 kB)
[ 0.000000] .data : 0xc0c00000 - 0xc0ccae04 ( 812 kB)
[ 0.000000] .bss : 0xc0ccc000 - 0xc0d1b0a0 ( 317 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[ 0.000000] Hierarchical RCU implementation.
[ 0.000000] Build-time adjustment of leaf fanout to 32.
[ 0.000000] RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=2
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (phys).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[ 0.000007] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[ 0.000020] Switching to timer-based delay loop, resolution 41ns
[ 0.000589] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.000843] clocksource: hstimer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 12741736309 ns
[ 0.001045] Console: colour dummy device 80x30
[ 0.001872] console [tty0] enabled
[ 0.001914] Calibrating delay loop (skipped), value calculated using timer frequency… 48.00 BogoMIPS (lpj=240000)
[ 0.001962] pid_max: default: 32768 minimum: 301
[ 0.002116] Security Framework initialized
[ 0.002206] AppArmor: AppArmor initialized
[ 0.002266] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.002296] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.003204] CPU: Testing write buffer coherency: ok
[ 0.003279] ftrace: allocating 33815 entries in 67 pages
[ 0.053975] /cpus/cpu@0 missing clock-frequency property
[ 0.054033] /cpus/cpu@1 missing clock-frequency property
[ 0.054061] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.054414] Setting up static identity map for 0x40100000 - 0x4010004c
[ 0.055521] smp: Bringing up secondary CPUs …
[ 0.066303] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[ 0.066414] smp: Brought up 1 node, 2 CPUs
[ 0.066462] SMP: Total of 2 processors activated (96.00 BogoMIPS).
[ 0.066483] CPU: All CPU(s) started in HYP mode.
[ 0.066502] CPU: Virtualization extensions available.
[ 0.067571] devtmpfs: initialized
[ 0.078324] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 4
[ 0.078700] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.078753] futex hash table entries: 512 (order: 3, 32768 bytes)
[ 0.079573] xor: measuring software checksum speed
[ 0.176225] arm4regs : 1135.600 MB/sec
[ 0.276268] 8regs : 789.200 MB/sec
[ 0.376318] 32regs : 811.200 MB/sec
[ 0.476370] neon : 1152.800 MB/sec
[ 0.476390] xor: using function: neon (1152.800 MB/sec)
[ 0.476521] pinctrl core: initialized pinctrl subsystem
[ 0.477766] NET: Registered protocol family 16
[ 0.479039] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.506456] cpuidle: using governor ladder
[ 0.536467] cpuidle: using governor menu
[ 0.537485] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.537524] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.666690] raid6: int32x1 gen() 173 MB/s
[ 0.786841] raid6: int32x1 xor() 152 MB/s
[ 0.907012] raid6: int32x2 gen() 224 MB/s
[ 1.026945] raid6: int32x2 xor() 173 MB/s
[ 1.147080] raid6: int32x4 gen() 264 MB/s
[ 1.267112] raid6: int32x4 xor() 169 MB/s
[ 1.387184] raid6: int32x8 gen() 227 MB/s
[ 1.507336] raid6: int32x8 xor() 155 MB/s
[ 1.627291] raid6: neonx1 gen() 421 MB/s
[ 1.747370] raid6: neonx1 xor() 318 MB/s
[ 1.867493] raid6: neonx2 gen() 559 MB/s
[ 1.987537] raid6: neonx2 xor() 414 MB/s
[ 2.107621] raid6: neonx4 gen() 625 MB/s
[ 2.227647] raid6: neonx4 xor() 435 MB/s
[ 2.347785] raid6: neonx8 gen() 610 MB/s
[ 2.467845] raid6: neonx8 xor() 417 MB/s
[ 2.467868] raid6: using algorithm neonx4 gen() 625 MB/s
[ 2.467888] raid6: … xor() 435 MB/s, rmw enabled
[ 2.467907] raid6: using intx1 recovery algorithm
[ 2.468244] reg-fixed-voltage ahci-5v: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/ahci_pwr_pin@1, deferring probe
[ 2.468327] reg-fixed-voltage usb0-vbus: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/usb0_vbus_pin@0, deferring probe
[ 2.468391] reg-fixed-voltage usb1-vbus: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/usb1_vbus_pin@0, deferring probe
[ 2.468454] reg-fixed-voltage usb2-vbus: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/usb2_vbus_pin@0, deferring probe
[ 2.469980] SCSI subsystem initialized
[ 2.470592] usbcore: registered new interface driver usbfs
[ 2.470690] usbcore: registered new interface driver hub
[ 2.470808] usbcore: registered new device driver usb
[ 2.471048] media: Linux media interface: v0.10
[ 2.471118] Linux video capture interface: v2.00
[ 2.471210] pps_core: LinuxPPS API ver. 1 registered
[ 2.471231] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti giometti@linux.it
[ 2.471279] PTP clock support registered
[ 2.472912] clocksource: Switched to clocksource arch_sys_counter
[ 2.537643] VFS: Disk quotas dquot_6.6.0
[ 2.537764] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 2.538293] AppArmor: AppArmor Filesystem Enabled
[ 2.548558] NET: Registered protocol family 2
[ 2.549300] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[ 2.549415] TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
[ 2.549557] TCP: Hash tables configured (established 8192 bind 8192)
[ 2.549660] UDP hash table entries: 512 (order: 2, 16384 bytes)
[ 2.549741] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[ 2.549997] NET: Registered protocol family 1
[ 2.550584] RPC: Registered named UNIX socket transport module.
[ 2.550619] RPC: Registered udp transport module.
[ 2.550638] RPC: Registered tcp transport module.
[ 2.550657] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 2.550992] Trying to unpack rootfs image as initramfs…
[ 2.859099] Freeing initrd memory: 4612K
[ 2.859784] hw perfevents: no interrupt-affinity property for /pmu, guessing.
[ 2.860118] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 5 counters available
[ 2.861309] audit: initializing netlink subsys (disabled)
[ 2.861574] audit: type=2000 audit(2.820:1): initialized
[ 2.862479] workingset: timestamp_bits=14 max_order=18 bucket_order=4
[ 2.871475] zbud: loaded
[ 2.875331] NFS: Registering the id_resolver key type
[ 2.875403] Key type id_resolver registered
[ 2.875424] Key type id_legacy registered
[ 2.875462] nfs4filelayout_init: NFSv4 File Layout Driver Registering…
[ 2.875485] Installing knfsd (copyright © 1996 okir@monad.swb.de).
[ 2.876923] JFS: nTxBlock = 8014, nTxLock = 64116
[ 2.887595] SGI XFS with ACLs, security attributes, realtime, no debug enabled
[ 2.896342] Key type asymmetric registered
[ 2.896447] bounce: pool size: 64 pages
[ 2.896761] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
[ 2.896969] io scheduler noop registered
[ 2.896994] io scheduler deadline registered
[ 2.897411] io scheduler cfq registered (default)
[ 2.898527] sun4i-usb-phy 1c13400.phy: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/usb0_id_detect_pin@0, deferring probe
[ 2.902660] sun7i-a20-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 2.970195] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[ 2.973512] console [ttyS0] disabled
[ 2.993755] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 43, base_baud = 1500000) is a U6_16550A
[ 3.894619] console [ttyS0] enabled
[ 3.902818] brd: module loaded
[ 3.914009] loop: module loaded
[ 3.918190] [drm] Initialized
[ 3.922159] libphy: Fixed MDIO Bus: probed
[ 3.926970] sun7i-dwmac 1c50000.ethernet: no regulator found
[ 3.932715] sun7i-dwmac 1c50000.ethernet: no reset control found
[ 3.938791] sun7i-dwmac 1c50000.ethernet: Ring mode enabled
[ 3.944388] sun7i-dwmac 1c50000.ethernet: DMA HW capability register supported
[ 3.951628] sun7i-dwmac 1c50000.ethernet: Normal descriptors
[ 3.971597] libphy: stmmac: probed
[ 3.975092] sun7i-dwmac 1c50000.ethernet (unnamed net_device) (uninitialized): PHY ID 001cc915 at 0 IRQ POLL (stmmac-0:00) active
[ 3.986773] sun7i-dwmac 1c50000.ethernet (unnamed net_device) (uninitialized): PHY ID 001cc915 at 1 IRQ POLL (stmmac-0:01)
[ 3.998804] ehci_hcd: USB 2.0 ‘Enhanced’ Host Controller (EHCI) Driver
[ 4.005383] ehci-platform: EHCI generic platform driver
[ 4.011033] ohci_hcd: USB 1.1 ‘Open’ Host Controller (OHCI) Driver
[ 4.017282] ohci-platform: OHCI generic platform driver
[ 4.022912] usbcore: registered new interface driver usb-storage
[ 4.029647] mousedev: PS/2 mouse device common for all mice
[ 4.036057] sunxi-rtc 1c20d00.rtc: rtc core: registered rtc-sunxi as rtc0
[ 4.042865] sunxi-rtc 1c20d00.rtc: RTC enabled
[ 4.047447] i2c /dev entries driver
[ 4.052021] axp20x-i2c 0-0034: AXP20x variant AXP209 found
[ 4.072883] input: axp20x-pek as /devices/platform/soc@01c00000/1c2ac00.i2c/i2c-0/0-0034/axp20x-pek/input/input0
[ 4.083861] ldo1: supplied by axp-ipsout
[ 4.088105] ldo2: supplied by axp-ipsout
[ 4.093248] ldo3: supplied by axp-ipsout
[ 4.097929] ldo4: supplied by axp-ipsout
[ 4.102778] dcdc2: supplied by axp-ipsout
[ 4.107650] dcdc3: supplied by axp-ipsout
[ 4.112657] axp20x-i2c 0-0034: AXP20X driver loaded
[ 4.120131] sunxi-wdt 1c20c90.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[ 4.129418] random: fast init done
[ 4.133220] sunxi-mmc 1c0f000.mmc: Got CD GPIO
[ 4.193175] sunxi-mmc 1c0f000.mmc: base:0xf0e1a000 irq:27
[ 4.200737] ledtrig-cpu: registered to indicate activity on CPUs
[ 4.206897] hidraw: raw HID events driver © Jiri Kosina
[ 4.212465] usbcore: registered new interface driver usbhid
[ 4.218063] usbhid: USB HID core driver
[ 4.222350] Initializing XFRM netlink socket
[ 4.227427] NET: Registered protocol family 10
[ 4.233080] Segment Routing with IPv6
[ 4.236826] NET: Registered protocol family 17
[ 4.241302] NET: Registered protocol family 15
[ 4.245824] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[ 4.258886] 8021q: 802.1Q VLAN Support v1.8
[ 4.263150] Key type dns_resolver registered
[ 4.267790] Registering SWP/SWPB emulation handler
[ 4.273408] registered taskstats version 1
[ 4.277618] zswap: loaded using pool lzo/zbud
[ 4.284353] Btrfs loaded, crc32c=crc32c-generic
[ 4.310210] Key type encrypted registered
[ 4.314301] AppArmor: AppArmor sha1 policy hashing enabled
[ 4.422989] ahci-sunxi 1c18000.sata: controller can’t do PMP, turning off CAP_PMP
[ 4.430546] ahci-sunxi 1c18000.sata: SSS flag set, parallel bus scan disabled
[ 4.437771] ahci-sunxi 1c18000.sata: AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl platform mode
[ 4.446770] ahci-sunxi 1c18000.sata: flags: ncq sntf stag pm led clo only pio slum part ccc
[ 4.456441] scsi host0: ahci-sunxi
[ 4.460242] ata1: SATA max UDMA/133 mmio [mem 0x01c18000-0x01c18fff] port 0x100 irq 33
[ 4.468771] ehci-platform 1c14000.usb: EHCI Host Controller
[ 4.474437] ehci-platform 1c14000.usb: new USB bus registered, assigned bus number 1
[ 4.482446] ehci-platform 1c14000.usb: irq 30, io mem 0x01c14000
[ 4.512945] ehci-platform 1c14000.usb: USB 2.0 started, EHCI 1.00
[ 4.519285] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 4.526115] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 4.533367] usb usb1: Product: EHCI Host Controller
[ 4.538254] usb usb1: Manufacturer: Linux 4.10.17-olimex ehci_hcd
[ 4.544367] usb usb1: SerialNumber: 1c14000.usb
[ 4.549741] hub 1-0:1.0: USB hub found
[ 4.553569] hub 1-0:1.0: 1 port detected
[ 4.558367] ehci-platform 1c1c000.usb: EHCI Host Controller
[ 4.564046] ehci-platform 1c1c000.usb: new USB bus registered, assigned bus number 2
[ 4.572044] ehci-platform 1c1c000.usb: irq 34, io mem 0x01c1c000
[ 4.602933] ehci-platform 1c1c000.usb: USB 2.0 started, EHCI 1.00
[ 4.609282] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
[ 4.616114] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 4.623369] usb usb2: Product: EHCI Host Controller
[ 4.628256] usb usb2: Manufacturer: Linux 4.10.17-olimex ehci_hcd
[ 4.634370] usb usb2: SerialNumber: 1c1c000.usb
[ 4.639644] hub 2-0:1.0: USB hub found
[ 4.643480] hub 2-0:1.0: 1 port detected
[ 4.648184] ohci-platform 1c14400.usb: Generic Platform OHCI controller
[ 4.654889] ohci-platform 1c14400.usb: new USB bus registered, assigned bus number 3
[ 4.662862] ohci-platform 1c14400.usb: irq 31, io mem 0x01c14400
[ 4.737134] usb usb3: New USB device found, idVendor=1d6b, idProduct=0001
[ 4.743959] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 4.751197] usb usb3: Product: Generic Platform OHCI controller
[ 4.757139] usb usb3: Manufacturer: Linux 4.10.17-olimex ohci_hcd
[ 4.763255] usb usb3: SerialNumber: 1c14400.usb
[ 4.769420] hub 3-0:1.0: USB hub found
[ 4.773261] hub 3-0:1.0: 1 port detected
[ 4.778013] ohci-platform 1c1c400.usb: Generic Platform OHCI controller
[ 4.784729] ohci-platform 1c1c400.usb: new USB bus registered, assigned bus number 4
[ 4.792708] ohci-platform 1c1c400.usb: irq 35, io mem 0x01c1c400
[ 4.794402] ata1: SATA link down (SStatus 0 SControl 300)
[ 4.877147] usb usb4: New USB device found, idVendor=1d6b, idProduct=0001
[ 4.883978] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 4.891217] usb usb4: Product: Generic Platform OHCI controller
[ 4.897159] usb usb4: Manufacturer: Linux 4.10.17-olimex ohci_hcd
[ 4.903272] usb usb4: SerialNumber: 1c1c400.usb
[ 4.908528] hub 4-0:1.0: USB hub found
[ 4.912357] hub 4-0:1.0: 1 port detected
[ 4.917205] usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[ 4.925038] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[ 4.930809] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 5
[ 4.938964] usb usb5: New USB device found, idVendor=1d6b, idProduct=0002
[ 4.945794] usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 4.953050] usb usb5: Product: MUSB HDRC host driver
[ 4.958025] usb usb5: Manufacturer: Linux 4.10.17-olimex musb-hcd
[ 4.964139] usb usb5: SerialNumber: musb-hdrc.1.auto
[ 4.969838] hub 5-0:1.0: USB hub found
[ 4.973668] hub 5-0:1.0: 1 port detected
[ 5.015434] vcc3v0: disabling
[ 5.018436] vcc3v3: disabling
[ 5.021412] vcc5v0: disabling
[ 5.024441] usb0-vbus: disabling
[ 5.029094] Freeing unused kernel memory: 1024K

Requesting you to provide any pointers here. It seems it is getting stuck in ubuntu_core_roots script.

Try using only the serial console arg on your kernel cmdline (drop “console=tty0”), so the initrd scripts output to your serial port (else you fly blind) …

Did you make sure the writable partition you created on the eMMC actually has a proper label ? the script looks for the “writable” and “snappy-boot” labels, both need to exist on the target partitions.

I tried with serial console arg option and found that local-premount script was unable to find “writable” partition.

Snippet
[ 5.029883] vcc5v0: disabling
[ 5.032918] usb0-vbus: disabling
[ 5.037938] Freeing unused kernel memory: 1024K
Loading, please wait…
starting version 229
Begin: Loading essential drivers … done.
Begin: Running /scripts/init-premount … done.
Begin: Mounting root file system … Begin: Running /scripts/nfs-top … done.
Begin: Running /scripts/nfs-premount … done.
Begin: Running /scripts/local-top … done.
Begin: Running /scripts/local-premount … findfs: unable to resolve ‘LABEL=writable’
done.
cannot find ‘writable’ partition

But when I created the partition then I applied “writable” label correctly to partition. Please find below the output
fdisk /dev/mmcblk1 -l
Disk /dev/mmcblk1: 3.6 GiB, 3867148288 bytes, 7553024 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x218fd85f

Device Boot Start End Sectors Size Id Type
/dev/mmcblk1p1 * 2048 264191 262144 128M c W95 FAT32 (LBA)
/dev/mmcblk1p2 264192 7553023 7288832 3.5G 83 Linux
root@localhost:~#
root@localhost:~# fatlabel /dev/mmcblk1p1
snappy-boot
root@localhost:~#
root@localhost:~# e2label /dev/mmcblk1p2
writable
root@localhost:~#

Appreciate your support here

hmm, does your kernel have full support for the eMMC … ?

the initrd should give you a shell after the error, if you manually run:

findfs LABEL=writable

does it find anything … also, is there anything in /dev/disk/by-label at that point ?

I am currently checking for that eMMC support in kernel.

After the error I entered into shell provided by initrd. When I manually run the above command then I got the error message:

(initramfs) findfs LABEL=writable
findfs: unable to resolve 'LABEL=writable’
(initramfs)

At this point there is no disk directory in /dev folder. I tried to find /dev/mmcblk1 in that shell but I am not able to find that.
What could be possible reason for that? Appreciate your support here.

Well, as i wrote earlier, it is likely that your eMMC support lives in a module that you do not have in the initrd, just compiling the eMMC support into the kernel would be the fastest fix here … or alternatively if your kernel snap uses the snapcraft kernel plugin you can add it to the initramfs-modules stanza in snapcraft.yaml

Thanks Ogra for your support

I enabled eMMC support in kernel image then after that system was able to boot up from eMMC. Snap applications are working fine.

I will definitely let you know of my further findings/observations.

1 Like

@ArunMakkar, were you able to resolve this through changing the snapcraft.yaml kernel? I seem to be getting the exact same issue. How did you enable eMMC?