Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warning shown as error in mkfs.vfat command, should be ignored. #8

Open
dirksavage88 opened this issue Feb 7, 2022 · 9 comments
Open

Comments

@dirksavage88
Copy link

dirksavage88 commented Feb 7, 2022

This warning message flags as an error on my system: "mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows" when trying to build an sd card image using command colcon acceleration linux vanilla --install-dir install-kv260

https://github.com/ros-acceleration/colcon-acceleration/blob/adfc44d0ea37a3df43743e635195548a6b5123b6/colcon_acceleration/subverb/linux.py#L427-L446

Build fails and the SD card img is generated, but does not get past u-boot menu. Temporary fix below and I am able to generate the image and run the vadd publisher example on the kv260.

I have fixed the issue on my end with an if/else:

warning_msg = "warning"

if warning_msg in errs:
pass
else:
sys.exit(1)

But I wonder if the bash script can ignore the warning instead of reporting as an error, this would be a better solution.

@vmayoral
Copy link
Contributor

vmayoral commented Feb 7, 2022

Thanks for raising this @dirksavage88, can you paste in here the actual full error you're getting?

@dirksavage88
Copy link
Author

Thanks for raising this @dirksavage88, can you paste in here the actual full error you're getting?

Screenshot from 2022-02-07 19-13-01

@vmayoral
Copy link
Contributor

vmayoral commented Feb 8, 2022

Mmmm that doesn't tell me much, sorry. This is working fine in my development environment so I'll need to find a way to reproduce it so that I can debug it and fix it.

Is there anything special about your dev. environment? Could you maybe try and add more information on the topic?

@dirksavage88
Copy link
Author

I am running ubuntu 20.04 on a VM (virtualbox). There is nothing modified about the system, it's pretty standard.

@vmayoral
Copy link
Contributor

Thanks @dirksavage88, I don’t seem to be able to reproduce this in my Ubuntu 20.04 dev. machine. Do you think you could provide a Dockerfile that shows the issue in here so that I can debug it and fix it?

@jasvinderkhurana have you or anyone in the team experienced this?

@jlamperez
Copy link

jlamperez commented Apr 15, 2022

Hi, I am having the same problem as @dirksavage88 ,

I am running,

$ xhost +
$ docker run -it --rm --gpus all \
-e DISPLAY=$DISPLAY \
-v /tmp/.X11-unix/:/tmp/.X11-unix \
-v /tools/Xilinx/:/tools/Xilinx \
osrf/ros:rolling-desktop-focal

Inside the docker installing

sudo apt-get update
sudo apt install locales
sudo locale-gen en_US.UTF-8

sudo apt-get install libtinfo5
sudo apt-get install libxtst6

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install lib32stdc++6 libgtk2.0-0:i386 libfontconfig1:i386 libx11-6:i386 libxext6:i386 \
libxrender1:i386 libsm6:i386 libxtst6:i386

And then installing KRS as pointed out in https://xilinx.github.io/KRS/sphinx/build/html/docs/install.html

I am trying the ROS 2 publisher example, and I get:

root@c5d5045f607b:~/krs_ws/src# $ colcon build --build-base=build-kv260 --install-base=install-kv260 --merge-install --mixin kv260 --packages-select ament_acceleration ament_vitis vadd_publisher
bash: $: command not found
root@c5d5045f607b:~/krs_ws/src# cd ..
root@c5d5045f607b:~/krs_ws# $ colcon build --build-base=build-kv260 --install-base=install-kv260 --merge-install --mixin kv260 --packages-select ament_acceleration ament_vitis vadd_publisher
bash: $: command not found
root@c5d5045f607b:~/krs_ws# colcon build --build-base=build-kv260 --install-base=install-kv260 --merge-install --mixin kv260 --packages-select ament_acceleration ament_vitis vadd_publisher
ERROR:colcon.colcon_core.package_selection:Exception in package selection extension 'override_check': argument --allow-overriding: conflicting option string: --allow-overriding
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/colcon_core/package_selection/__init__.py", line 109, in _add_package_selection_arguments
    retval = extension.add_arguments(parser=group)
  File "/usr/lib/python3/dist-packages/colcon_override_check/package_selection/override_check.py", line 52, in add_arguments
    parser.add_argument(
  File "/usr/lib/python3/dist-packages/colcon_mixin/mixin/mixin_argument.py", line 100, in add_argument
    return super().add_argument(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/colcon_core/argument_parser/destination_collector.py", line 46, in add_argument
    argument = super().add_argument(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/colcon_core/argument_parser/type_collector.py", line 34, in add_argument
    ret = super().add_argument(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/colcon_core/argument_parser/__init__.py", line 171, in add_argument
    return self._parser.add_argument(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/colcon_defaults/argument_parser/defaults.py", line 78, in add_argument
    argument = super().add_argument(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/colcon_core/argument_parser/destination_collector.py", line 46, in add_argument
    argument = super().add_argument(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/colcon_core/argument_parser/type_collector.py", line 34, in add_argument
    ret = super().add_argument(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/colcon_core/argument_parser/__init__.py", line 171, in add_argument
    return self._parser.add_argument(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/colcon_argcomplete/argument_parser/argcomplete/__init__.py", line 49, in add_argument
    argument = self._parser.add_argument(*args, **kwargs)
  File "/usr/lib/python3.8/argparse.py", line 1398, in add_argument
    return self._add_action(action)
  File "/usr/lib/python3.8/argparse.py", line 1602, in _add_action
    action = super(_ArgumentGroup, self)._add_action(action)
  File "/usr/lib/python3.8/argparse.py", line 1412, in _add_action
    self._check_conflict(action)
  File "/usr/lib/python3.8/argparse.py", line 1551, in _check_conflict
    conflict_handler(action, confl_optionals)
  File "/usr/lib/python3.8/argparse.py", line 1560, in _handle_conflict_error
    raise ArgumentError(action, message % conflict_string)
argparse.ArgumentError: argument --allow-overriding: conflicting option string: --allow-overriding

[0.413s] WARNING:colcon.colcon_core.package_selection:Some selected packages are already built in one or more underlay workspaces:
	'launch' is in: /root/krs_ws/install, /opt/ros/rolling
If a package in a merged underlay workspace is overridden and it installs headers, then all packages in the overlay must sort their include directories by workspace order. Failure to do so may result in build failures or undefined behavior at run time.
If the overridden package is used by another package in any underlay, then the overriding package in the overlay must be API and ABI compatible or undefined behavior at run time may occur.

If you understand the risks and want to override a package anyways, add the following to the command line:
	--allow-overriding launch

This may be promoted to an error in a future release of colcon-override-check.
[0.420s] WARNING:colcon.colcon_core.verb:Some selected packages are already built in one or more underlay workspaces:
	'ament_acceleration' is in: /root/krs_ws/install
	'ament_vitis' is in: /root/krs_ws/install
	'vadd_publisher' is in: /root/krs_ws/install
If a package in a merged underlay workspace is overridden and it installs headers, then all packages in the overlay must sort their include directories by workspace order. Failure to do so may result in build failures or undefined behavior at run time.
If the overridden package is used by another package in any underlay, then the overriding package in the overlay must be API and ABI compatible or undefined behavior at run time may occur.

If you understand the risks and want to override a package anyways, add the following to the command line:
	--allow-overriding ament_acceleration ament_vitis vadd_publisher

This may be promoted to an error in a future release of colcon-core.
Starting >>> ament_acceleration
Finished <<< ament_acceleration [0.14s]                  
Starting >>> ament_vitis
Finished <<< ament_vitis [0.12s]                
Starting >>> vadd_publisher
Finished <<< vadd_publisher [0.20s]                     

Summary: 3 packages finished [0.82s]

Is this --allow-overriding behavior correct?

root@c5d5045f607b:~/krs_ws# colcon acceleration linux vanilla --install-dir install-kv260
SECURITY WARNING: This class invokes explicitly a shell via the shell=True argument of the Python subprocess library, and uses admin privileges to manage raw disk images. It is the user's responsibility to ensure that all whitespace and metacharacters passed are quoted appropriately to avoid shell injection vulnerabilities.
- Creating a new base image using /root/krs_ws/acceleration/firmware/select/rootfs.cpio.gz ...
- Image successfully created
Something went wrong while creating sd card image.
Review the output: chown: cannot access '/root/krs_ws/acceleration/firmware/select/sd_card.img': No such file or directory

And I am not able to create the sd card.

How did you fix this?

@jlamperez
Copy link

Installing the next packages it starts to create the image

sudo apt-get install gdisk
sudo apt-get install parted
sudo apt-get install cpio

but I have the next error related to losetup,

root@c5d5045f607b:~/krs_ws# colcon acceleration linux vanilla --install-dir install-kv260
SECURITY WARNING: This class invokes explicitly a shell via the shell=True argument of the Python subprocess library, and uses admin privileges to manage raw disk images. It is the user's responsibility to ensure that all whitespace and metacharacters passed are quoted appropriately to avoid shell injection vulnerabilities.
- Creating a new base image using /root/krs_ws/acceleration/firmware/select/rootfs.cpio.gz ...
- Detected previous sd_card.img raw image, moving to sd_card.img.old.
Something went wrong while creating sd card image.
Review the output: losetup: cannot find an unused loop device: No such device

@jlamperez
Copy link

After installing mkfs.vfat with sudo apt-get install dosfstools and accessing the docker with privileged and mapping dev like this:

docker run -it --rm --gpus all \
--privileged -e DISPLAY=$DISPLAY \
-v /tmp/:/tmp/ -v /tools/Xilinx/:/tools/Xilinx -v /dev:/dev \
osrf/ros:rolling-desktop-focal

I am able to create the image

root@bb1d1e11d3f3:~/krs_ws# colcon acceleration linux vanilla --install-dir install-kv260
SECURITY WARNING: This class invokes explicitly a shell via the shell=True argument of the Python subprocess library, and uses admin privileges to manage raw disk images. It is the user's responsibility to ensure that all whitespace and metacharacters passed are quoted appropriately to avoid shell injection vulnerabilities.
- Creating a new base image using /root/krs_ws/acceleration/firmware/select/rootfs.cpio.gz ...
- Image successfully created
- Confirmed availability of raw image file at: /root/krs_ws/acceleration/firmware/select/sd_card.img
- Finished inspecting raw image, obtained UNITS and STARTSECTOR for partition: 1.
- Image mounted successfully at: /tmp/sdcard_img_p1
- Found kernel file /root/krs_ws/acceleration/firmware/select/kernel/Image
- Kernel deployed successfully (/root/krs_ws/acceleration/firmware/select/kernel/Image).
- Found boot script file: /root/krs_ws/acceleration/firmware/select/boot_scripts/boot.scr.default
- Boot script deployed successfully (/root/krs_ws/acceleration/firmware/select/boot_scripts/boot.scr.default).
- Found file: /root/krs_ws/acceleration/firmware/select/ramdisk.cpio.gz.u-boot
- File added successfully (/root/krs_ws/acceleration/firmware/select/ramdisk.cpio.gz.u-boot).
- Found device tree file: /root/krs_ws/acceleration/firmware/select/device_tree/system.dtb.default
- Device tree deployed successfully (/root/krs_ws/acceleration/firmware/select/device_tree/system.dtb.default).
- Found device BOOT.BIN file: /root/krs_ws/acceleration/firmware/select/bootbin/BOOT.BIN.default
- Device BOOT.BIN deployed successfully (/root/krs_ws/acceleration/firmware/select/bootbin/BOOT.BIN.default).
- Umounted the raw image.
- Verified that install/ is available in the current colcon workspace
- Confirmed availability of raw image file at: /root/krs_ws/acceleration/firmware/select/sd_card.img
- Finished inspecting raw image, obtained UNITS and STARTSECTOR P1/P2
- Image mounted successfully at: /tmp/sdcard_img_p2
No prior overlay colcon workspace found at: /tmp/sdcard_img_p2/krs_ws, creating it.
- Copied 'install-kv260' directory as a colcon overlay workspace in the raw image  at location /krs_ws
- Created and copied in rootfs /opt/ros/rolling/setup.bash.
- Umounted the raw image.
- Confirmed availability of raw image file at: /root/krs_ws/acceleration/firmware/select/sd_card.img
- Finished inspecting raw image, obtained UNITS and STARTSECTOR for partition: 2.
- Image mounted successfully at: /tmp/sdcard_img_p2
- Umounted the raw image.

I am not seeing the mkfs.vfat error @dirksavage88

@Claxl
Copy link

Claxl commented Nov 14, 2024

Hello there!
I've faced the same error of @dirksavage88 and I hard fixed by modifying at line 425 of the disk_image script that is found at this path

krs_ws/acceleration/firmware/select/imagebuilder/scripts/

By just modifing boot with his upper letter version

sudo mkfs.vfat -F 32 -n BOOT /dev/mapper/diskimage1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants