Porting ubuntu core to IMX6/am335x issue?

Can you please use triple backticks above and below pasted content, else it is really hard to read (and losses formatting too)

this is my auto-import.assert, when insert the udisk, it alway tell me to ā€œPress enter to configureā€.

if MxZc2QJWIe09yxtEQ3yfFbHd56xWZ9HW is the brand-id used in the model assertion you used for building the image, then iā€™m out of ideas here, perhaps @pedronis can help further ā€¦

EDIT: oh, wait ā€¦ (the broken formatting tricked me) ā€¦ your model assertion of the device seems to be rsb4220, but your system-user assertion defines model: advantech, this cant work indeed, the name of the model needs to match.

Dear orga:
How can I add a boot start script into core image (not that by snap insatll to insatll)?
that is , when I use ubuntu-image generate a image, the scripts is in the /writeable/etc/ā€¦/.

Thanks
Best Regards
Qing

you can just put it on the SD card after you wrote the image to SD ā€¦

Dear ograļ¼š
Thank youļ¼
When I try to access EMMC/SD/udisk flashļ¼Œ which interface I should useļ¼Ÿ

Best Regards
Qing

do you mean from a snap package ? there is no interface for general disk access, a snap will only be able to access certain bits of the filesystem in context of its own sandboxing ā€¦

the list of environment variables that point to writable locations on disk is in:

1 Like

Dear orga:
How can I make our am335x device support usb-gadget function in ubuntu core snap?
how can add the interface for the gadget-init.sh ?

Best Regards
Qing

if you use your own kernel snap you can simply compile g_serial (and all its dependencies) into the kernel ā€¦ alternatively you can also use:

    kernel-initrd-modules:
      - g_serial
      - u_serial
      - usb_f_acm
      - libcomposite

in the snapcraft.yaml of your kernel snap in case you are fine to load g_serial as module and only have the serial port available once the initrd is unpacked ā€¦

one other (rather hackish) approach is to use an initrd snippet in your gadget that puts a script and systemd unit in place on first boot ā€¦

an example for a gadget that ships an initrd snippet is:

1 Like

Dear orgaļ¼š
How can I enable the watchdog in my app snapļ¼Ÿ apparmor always denied the app as belowļ¼š

Log: apparmor=ā€œDENIEDā€ operation=ā€œopenā€ profile=ā€œsnap.block-test.watchdogā€ name="/dev/watchdog" pid=2355 comm=ā€œAutoRun_WTDā€ requested_mask=ā€œwā€ denied_mask=ā€œwā€ fsuid=0 ouid=0

Best Regards
Qing

Hardware watchdog is supported by default after snapd 2.34.

You can use the ā€œsnap setā€ command to config the watchdog parameters[1].

Eg
$ snap set core watchdog.runtime-timeout=1m
Set a timeout value in seconds (or in other time units if suffixed with ā€œmsā€, ā€œminā€, ā€œhā€, ā€œdā€, ā€œwā€). The watchdog hardware (/dev/watchdog) or the kernel option systemd.watchdog-device=) will be programmed to automatically reboot the system if it is not contacted within the specified timeout interval.

$ snap set core watchdog.shutdown-timeout=10m
It works as a safety net to ensure that the reboot takes place even if a clean reboot attempt times out. Note that the shutdown-timeout applies only to the second phase of the reboot, i.e. after all regular services are already terminated, and after the system and service manager process (PID 1) got replaced by the systemd-shutdown binary.

The backend is integrated with systemd[2], you can check the configuration in /etc/systemd/system.conf.d/10-snapd-watchdog.conf

[1] Merge pull request #5309 from alfonsosanchezbeato/support-systemd-watā€¦ Ā· snapcore/snapd@a64ba63 - https://github.com/snapcore/snapd/commit/a64ba631863bc9bfab8d2f98a4df8a0ac4974935
[2] https://www.freedesktop.org/software/systemd/man/systemd-system.conf.html

1 Like

Hiļ¼Œogra.
The initrd.img in my image generated by ubuntu-image seem to be different from core.snap. It seem to be the one in kernel.snap. And ubuntu-image do not put the one in core.snap in the image file.What is the different between the two initrd.img files?

When you build the kernel snap, snapcraft downloads the core snap and copies initrd.img-core into your kernel snap, if you added any extra kernel-initrd-modules: or kernel-initrd-firmware: in your snapcraft.yaml it will re-pack this initrd and add the required modules.

The one in core is the generic initrd containing all generic scripts and bits needed to boot. Most of the time this is simply copied directly in place from the core snap, only if your snapcraft.yaml of the kernel snap enforces the use extra firmare or modules via the above options it is modified.

The initrd used during boot is always the one coming from the kernel snap. At image build time ubuntu-image will take care that it lives in a place where your boot setup can find it via the snap_kernel= uboot.env variable.