About findfs: unable to resolve 'LABEL=writable'


#1

Sorry for the frequent posting and the almost same problem in the forum.
I have searched in the forum for the information.Refer to this post I add mmc and squashfs modules to the initrd.But it’s still the same.Here is my yaml file.

kconfigs:
  - CONFIG_LOCALVERSION="-4.9"
  - CONFIG_SQUASHFS=m
  - CONFIG_SQUASHFS_XATTR=y 
  - CONFIG_SQUASHFS_XZ=y
  - CONFIG_MMC_BLOCK=m
kernel-initrd-modules:
  - squashfs
  - mmc-block

When starting kernel it will block at

Begin: Running /scripts/local-premount ... 

The code in scripts is

wait-for-root "LABEL=writable" "${ROOTDELAY:-180}" >/dev/null || true

And in initramfs mode, ls cannot show /dev/mmc*.
If i build mmc_block and squashfs in kernel,it’ll will block at kernel-initrd-modules.
If i use this yaml show below

kconfigs:
  - CONFIG_LOCALVERSION="-4.9"
  - CONFIG_SQUASHFS=y
  - CONFIG_SQUASHFS_XATTR=y 
  - CONFIG_SQUASHFS_XZ=y
  - CONFIG_MMC_BLOCK=y
kernel-initrd-modules:
  - squashfs
  - mmc-block

It will report:

FileNotFoundError: [Errno 2] No such file or directory: 'mmc_block' -> './parts/kernel/build/initrd-staging/../../../mmc_block'

Refer to this post,I need to build it as module
And refer to this post, it’s same to build in kernel or in kernel-initrd-modules.So my yaml file change to this:

kconfigs:
  - CONFIG_LOCALVERSION="-4.9"
  - CONFIG_SQUASHFS=y
  - CONFIG_SQUASHFS_XATTR=y 
  - CONFIG_SQUASHFS_XZ=y
  - CONFIG_MMC_BLOCK=y

It’s still the same problem. But /dev/mmc* can be showed in initrd mode.

(initramfs) ls /dev/mmcblk1*
/dev/mmcblk1rpmb   /dev/mmcblk1p1     /dev/mmcblk1boot0
/dev/mmcblk1p2     /dev/mmcblk1boot1  /dev/mmcblk1

I burn uboot.imx in UDA,not in bootpartion. I enable mmc boot from UDA not from boot_partion_1. I’m not sure if it will influence the initrd.
In the image,there is no lable writable…
And i do not modify apparmor…If it need to modify apparmor first?


#3

I try to modify kernel config refer to this post,but still cannot add CONFIG_NET_NS

While we will not prevent you from building this kernel snap, we suggest you take a look at these:
CONFIG_DEVPTS_MULTIPLE_INSTANCES (4.8.x and earlier versions only)
CONFIG_NET_NS 

It’s still the same. block at writable patition.
But apparmor is not modified to sample-kernel.I’m trying to modify apparmor…


#4

this should not be needed during the boot process (it is needed for snapd later though, so you better make it work, but will not cause any issues in the actual boot)…

do you see a label with:

$ ls -l /dev/disk/by-label/
total 0
lrwxrwxrwx 1 root root 15 Oct 17 20:20 system-boot -> ../../mmcblk0p1
lrwxrwxrwx 1 root root 15 Oct 17 20:20 writable -> ../../mmcblk0p2

also were there any errors when you used ubuntu-image to create the image ? typically ubuntu-image makes sure to apply the writable label to the right partition at creation time.


#5

Thanks for your reply.
There is no label named writable…

(initramfs) ls -l /dev/disk/by-label/                                           
lrwxrwxrwx    1        15 system-boot -> ../../mmcblk1p1                        
(initramfs) 

And there is no error while ubuntu-image working…only some warning…But i use pre-downloaded core.snap…

Warning: for backwards compatibility, `ubuntu-image` fallbacks to `ubuntu-image snap` if no subcommand is given
-o/--output is deprecated; use -O/--output-dir instead
DEBUG:ubuntu-image:-> [ 0] make_temporary_directories
DEBUG:ubuntu-image:-> [ 1] prepare_gadget_tree
DEBUG:ubuntu-image:-> [ 2] prepare_image
Copying "./core_5546.snap" (core)
Copying "./tsimx6-kernel_4.4.30_armhf.snap" (tsimx6-kernel)
Copying "./tsimx6-gadget_16-0.1_amd64.snap" (tsimx6-gadget)
tsimx6-kernel already prepared, skipping
tsimx6-gadget already prepared, skipping
core already prepared, skipping
WARNING: "tsimx6-kernel", "tsimx6-gadget" were installed from local snaps disconnected from a store and cannot be refreshed subsequently!
DEBUG:ubuntu-image:-> [ 3] load_gadget_yaml
DEBUG:ubuntu-image:-> [ 4] populate_rootfs_contents
DEBUG:ubuntu-image:-> [ 5] populate_rootfs_contents_hooks
DEBUG:ubuntu-image:-> [ 6] calculate_rootfs_size
DEBUG:ubuntu-image:-> [ 7] pre_populate_bootfs_contents
DEBUG:ubuntu-image:-> [ 8] populate_bootfs_contents
DEBUG:ubuntu-image:-> [ 9] prepare_filesystems
DEBUG:ubuntu-image:-> [10] populate_filesystems
DEBUG:ubuntu-image:-> [11] make_disk
DEBUG:ubuntu-image:-> [12] generate_manifests
DEBUG:ubuntu-image:-> [13] finish
DEBUG:ubuntu-image:-> [14] close

And is it diffcult to modify 4.1.x or 4.9.x kernel to core kernel? I want to make sure that i’m not on the wrong ways…My board is 6ull.It’s not supported in sample-kernel and the supported kernel version is 4.1 and 4.9 modified by NXP.The apparmor I have tried to modify according to commits.But a lot of files are changed . I have gave up to modify it from NXP kernel.
But it seem that someone in forum have make it.Here is the post.So I want to try add 6ull support to core kernel or just change imx6ull to imx6ul in hardware…
Can you give me some advices about it?Thanks…


#6

ubuntu-image should always create the writable partition by default … did you create an entry in the gadget.yaml (that might confuse it) ? else i wonder if the pre-downloaded core somehow breaks something here … try using an --extra-snaps option with it and point directly to the file to see if that makes any difference.

regarding the kernel, you could take a look at my linux-genric-allwinner snap in the store, it is 4.15 based and might have imx6ull upstream support already …


#7

I’m grateful for your help.And here is my gadget:

device-tree: imx6ull-14x14-evk-emmc.dtb
device-tree-origin: kernel
volumes:
  disk:
    bootloader: u-boot
    schema: mbr
    structure:
      - name: u-boot
        type: bare
        size: 786432
        offset: 1024
        content:
          - image: u-boot.imx
      - name: system-boot
        type: 0C
        filesystem: vfat
        filesystem-label: system-boot
        size: 128M
defaults:
  99T7MUlRhtI3U0QFgl5mXXESAiSwt776:
    service:
      rsyslog:
        disable: true

I add defaults but i do not know what it means…
I have already using --extra-snaps ./core_5546.snap to make image…
Are there someting wrong with the names of kernel and gadget? I get the names ‘tsimx6’ to build my own image…
And here is my ubuntu-image build command:

ubuntu-image \
    -c stable \
  	    --image-size 524288000 \
    --extra-snaps ./tsimx6-kernel_4.4.30_armhf.snap \
    --extra-snaps ./tsimx6-gadget_16-0.1_amd64.snap \
    -o ./test.img \
    mgma3.model \
    --debug

I have tried linux-genric-allwinner.It support 6ull but still block at cannot find writable partition…I’ll check about burning process…It seem that something wrong with it…I use mfgtool to burn the image to emmc. The image is 500mb but it showed only (65 MB, 62 MiB) copied…
And may i ask for the source of linux-genric-allwinner? It’ll be a great help for me if i get the source code…


#8

drop this, it is really only needed for KVM images where you need a pre-defined device size, on real HW it is rather pointless and just extends the time for flashing the image. by default the images self-expand on first boot to the detected disk size.

if you do not use an SD and dd to write to it, but use mfgtools to write to an eMMC make sure you write the whole image to the whole device (/dev/mmcblk1), not to any partitions (/dev/mmcblk1pX).


#9

Very thanks for your advice. The image can burn into emmc and it works well.

But when building kernel of linux-genric-allwinner,it report error when it generate .config file.

Sorry, Snapcraft ran into an error when trying to running through its lifecycle that generated the following traceback:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/snapcraft/plugins/kbuild.py", line 140, in assemble_ubuntu_config
with open(os.path.join('debian', 'debian.env'), 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'debian/debian.env'

Can you give me some suggestions about this error?Thanks.


#10

how exactly are you building linux-generic-allwinner ?
(i use build.snapcraft.io pointing it to my GH repo of it… (https://github.com/ogra1/linux-generic-allwinner))

i cant remember but i think i never tried to cross build it …


#11

…i use snapcraft --target-arch=armhf…
But it is rebuilding in arm environment now…Hope it goes well…


#12

just as a FYI … i just had a “snapcraft --target-arch=armhf” finishing fine here using my github tree on a 16.04 host … so i’m not sure why you ran into this issue above …


#13

it seem something wrong with snapcraft version 2.42.1…i remove it and reinstall snapcraft version 2.43.1. it built successful now…and another host build in KVM and cross compile both failed… version of snapcraft is 2.42.1…
As it takes almost 2h to build kernel.snap…can i just remove something that not clean build area just to rebuild it? the change will be done to src manually…


#15

i’m sorry to bother you again…
I have enter ubuntu core but when i reboot the board it report that:

         Starting Reboot...
[ 1636.189243] watchdog: watchdog0: watchdog did not stop!
[ 1636.679403] watchdog: watchdog0: watchdog did not stop!
snapd system-shutdown helper: started.
snapd system-shutdown helper: no reboot parameter
snapd system-shutdown helper: - was able to unmount writable cleanly
snapd system-shutdown helper: - rebooting.

and will pirnt:

 reading tsimx6-kernel_x1.snap/kernel.img
** Unable to read file tsimx6-kernel_x1.snap/kernel.img **
reading tsimx6-kernel_x1.snap/initrd.img
** Unable to read file tsimx6-kernel_x1.snap/initrd.img **
reading tsimx6-kernel_x1.snap/dtbs/imx6ull-14x14-evk.dtb
** Unable to read file tsimx6-kernel_x1.snap/dtbs/imx6ull-14x14-evk.dtb **
Bad Linux ARM zImage magic!
Booting from net ...
No ethernet found.
No ethernet found.
Wrong Image Format for bootm command
ERROR: can't get kernel image!

restart the power supply will not cause this problem…

about create system user i read about this document. but something wrong with make-system-user.run, report :

 dropping privs did not work

So i create it manualy refer to this.
this is my assertion:

type: system-user
authority-id: KNuf5O5acEuveKsJLuZAHdKs6CXEoHTGi
brand-id: KNuf5O5acEuveKsJLuZAHdKs6CXEoHTGi
email: cyndent1992@gmail.com
models:
  - tsimx6
name: test
password: test
series:
  - 16
since: 2016-10-24T07:12:10+00:00
until: 2017-10-24T07:12:10+00:00
username: test
sign-key-sha3-384: 

when i drop this file to /home/usr ,restart the power supply, it will block at starting kernel…and i do nothing but put it in board…


#16

The reboot output looks perfectly fine as it should …

if you do a fatls from the u-boot commandline, can you see that dir (perhaps you need some extra “mmc init” or something similar in your uboot.env )?

i think it needs to go somewhere else … but that should not affect your booting, i guess this is just a coincidence. have you tried to use a usb stick instead and put the assertion on there ? … also the configuration UI should come up on the serial terminal, just set up the user interactively for now.


#17

thanks i’ll check about the uboot.env, it’s not much changed from the souce…
this board only have mini-usb host(a big mistake)…it can not use usb stick ,so i want to put it in …

do you mean when i put the system user’s assertion to the board, and reboot it ,it will show the configuration UI to set up system user?


#18

no, it should show “Please press enter” on the serial console after it finished booting … if you then press enter it should present you the interactive gui to set up networking and the user account.


#19

Hi,ogra
The problem of can not find zImage after rebooting seem nothing to do with uboot.env…
When the first enter the core system,I type snap list and it show

No snaps are installed yet. Try 'snap install hello-world'.

and snap changes show:

ID   Status  Spawn               Ready               Summary
1    Error   today at 05:00 UTC  today at 05:02 UTC  Initialize system state

After a while it show:

root@localhost:/var/lib/snapd/seed/snaps# snap list
Name  Version    Rev   Tracking  Publisher   Notes
core  16-2.35.2  5546  stable    canonical✓  core
root@localhost:/var/lib/snapd/seed/snaps# snap changes 
ID   Status   Spawn               Ready               Summary
1    Error    today at 05:00 UTC  today at 05:02 UTC  Initialize system state
2    Undoing  today at 05:08 UTC  -                   Initialize system state

and fail after a while…

root@localhost:/var/lib/snapd/seed/snaps# snap changes 
ID   Status  Spawn               Ready               Summary
1    Error   today at 05:00 UTC  today at 05:02 UTC  Initialize system state
2    Error   today at 05:08 UTC  today at 05:09 UTC  Initialize system state

the kernel config donot have this configrution:

CONFIG_DEBUG_RODATA 
CONFIG_DEBUG_SET_MODULE_RONX 
CONFIG_DEVPTS_MULTIPLE_INSTANCES (4.8.x and earlier versions only)

These configurations can not be found in source code…
These warnings are printed before building:

scripts/kconfig/conf  --silentoldconfig Kconfig
security/Kconfig:393:warning: defaults for choice values not supported
security/Kconfig:397:warning: defaults for choice values not supported
security/Kconfig:401:warning: defaults for choice values not supported
security/Kconfig:405:warning: defaults for choice values not supported
security/Kconfig:409:warning: defaults for choice values not supported

Can you give me some suggestions for me?
Thanks


#20

this is telling you that the initial first-boot-install of your snaps (kernel/gadget) fails (which likely also causes your second-boot issue) … what is the output of:

snap change 1

also, a full journalctl dump would be good… if you can, please paste one to https://paste.ubuntu.com and link it here.

this is fine (note how the last one even says 4.8 and earlier (you are on 4.15), the first two are for debugging), none of these values are esssential.

this is again just a warning (and obviously does not stop the kernel from compiling), the build falls back to proper values here.


#21

Thanks for reply.Here is the link

2018-10-26T05:01:34Z ERROR snap "tsimx6-gadget" supported architectures (amd64) are incompatible with this system (armhf)

My gadget snapcraft is:

architectures:
  - armhf
build: |
  CROSS_COMPILE=arm-linux-gnueabi- make

How can i change this architectures (amd64)?


#22

use the following architectures entry instead …

architectures:
  - build-on: amd64
    run-on: armhf