Несколько rootfs через файл .wks не удается в yocto - PullRequest
2 голосов
/ 13 апреля 2020

Я генерирую два rootfs для моей машины. Один для core-image-sato и другой для swupdate-image. Я пытаюсь сохранить эти два rootfs на двух разных разделах, как описано ниже (directdisk.wks):

bootloader  --timeout=0  --append="rootwait rootfstype=ext4 video=vesafb vga=0x318 console=tty0 console=ttyS0,115200n8"
part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024 --fixed-size 100
part / --source rootfs --rootfs-dir=rootfs1 --use-uuid --fstype=ext4 --label platform --align 1024
part --source rootfs --rootfs-dir=rootfs2 --use-uuid --fstype=ext4 --label swupdate --align 1024
part /opt --use-uuid --fstype=ext4 --label user --align 1024 --fixed-size 10

Я могу сгенерировать сато-образ с двумя rootfs, выполнив команду wic create directdisk -e core-image-sato --rootfs-dir rootfs1=tmp/work/panther1-poky-linux/core-image-sato/1.0-r0/rootfs --rootfs-dir rootfs2=tmp/work/panther1-poky-linux/swupdate-image/1.0-r0/rootfs.

Но когда я заменяю --rootfs-dir=rootfs1 на --rootfs-dir rootfs1=tmp/work/panther1-poky-linux/core-image-sato/1.0-r0/rootfs и --rootfs-dir=rootfs2 на --rootfs-dir rootfs2=tmp/work/panther1-poky-linux/swupdate-image/1.0-r0/rootfs в directdisk.wks, я сталкиваюсь с проблемами компиляции.

Почему это работает с командой и не работает с файлом .wks?

Журналы ошибок

| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing shell function do_image_wic
| INFO: Creating image(s)...
| 
| Couldn't get bitbake variable from /home/panther2/warrior/build_panther1/tmp/sysroots/panther1/imgdata/rootfs1=tmp/work/panther1-poky-linux/core-image-sato/1.0-r0/rootfs.env.
| File /home/panther2/warrior/build_panther1/tmp/sysroots/panther1/imgdata/rootfs1=tmp/work/panther1-poky-linux/core-image-sato/1.0-r0/rootfs.env doesn't exist.
| Traceback (most recent call last):
|   File "/home/panther2/warrior/sources/poky/scripts/wic", line 520, in <module>
|     sys.exit(main(sys.argv[1:]))
|   File "/home/panther2/warrior/sources/poky/scripts/wic", line 515, in main
|     return hlp.invoke_subcommand(args, parser, hlp.wic_help_usage, subcommands)
|   File "/home/panther2/warrior/sources/poky/scripts/lib/wic/help.py", line 83, in invoke_subcommand
|     subcmd[0](args, usage)
|   File "/home/panther2/warrior/sources/poky/scripts/wic", line 220, in wic_create_subcommand
|     native_sysroot, options)
|   File "/home/panther2/warrior/sources/poky/scripts/lib/wic/engine.py", line 188, in wic_create
|     plugin.do_create()
|   File "/home/panther2/warrior/sources/poky/scripts/lib/wic/plugins/imager/direct.py", line 86, in do_create
|     self.create()
|   File "/home/panther2/warrior/sources/poky/scripts/lib/wic/plugins/imager/direct.py", line 196, in create
|     self._image.prepare(self)
|   File "/home/panther2/warrior/sources/poky/scripts/lib/wic/plugins/imager/direct.py", line 362, in prepare
|     imager.kernel_dir, imager.native_sysroot)
|   File "/home/panther2/warrior/sources/poky/scripts/lib/wic/partition.py", line 173, in prepare
|     kernel_dir, rootfs_dir, native_sysroot)
|   File "/home/panther2/warrior/sources/poky/scripts/lib/wic/plugins/source/rootfs.py", line 70, in do_prepare_partition
|     part.rootfs_dir = cls.__get_rootfs_dir(rootfs_dir)
|   File "/home/panther2/warrior/sources/poky/scripts/lib/wic/plugins/source/rootfs.py", line 40, in __get_rootfs_dir
|     if not os.path.isdir(image_rootfs_dir):
|   File "/home/panther2/warrior/build_panther1/tmp/work/panther1-poky-linux/core-image-sato/1.0-r0/recipe-sysroot-native/usr/lib/python3.7/genericpath.py", line 42, in isdir
|     st = os.stat(s)
| TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_image_wic (log file is located at /home/panther2/warrior/build_panther1/tmp/work/panther1-poky-linux/core-image-sato/1.0-r0/temp/log.do_image_wic.94498)
ERROR: Task (/home/panther2/warrior/sources/poky/meta/recipes-sato/images/core-image-sato.bb:do_image_wic) failed with exit code '1'
NOTE: Tasks Summary: Attempted 9173 tasks of which 9161 didn't need to be rerun and 1 failed.
NOTE: Writing buildhistory

Summary: 1 task failed:
  /home/panther2/warrior/sources/poky/meta/recipes-sato/images/core-image-sato.bb:do_image_wic
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
...