how to get the sources of the snap find applications(eg: hello/hello-word). i am running snap in arm64. i tried to build the hello word in host machine for arm64 (https://snapcraft.io/docs/build-snaps/your-first-snap)
ERROR: command ‘[’/bin/sh’, ‘/tmp/tmpon0i6aeh’, ‘./configure’, ‘–prefix=’, ‘–host=arm64’]’ returned non-zero exit status 1
vinaysimha@localhost:~$ snap find hello
Name Version Developer Notes Summary
hello-world 6.3 canonical - The ‘hello-world’ of snaps
hello-takaakisuzuki-aarch 2.12 takaakisuzuki - GNU Hello, the “hello world” snap
hello-securx-snap 1.0 securx - Single-line elevator pitch for your amazing snap
hello 2.10 canonical - GNU Hello, the “hello world” snap
i want to change the macaddr0 for wifi,
echo “aa:bb:cc:dd:ee:ff” > /run/macaddr0
but it says
-bash: /run/macaddr0: Permission denied
so i guess i need to write a snap and modify the macaddr0 content.
Are you on a dragonboard ? (this is to my knowledge the only device using /run/macaddr0) …
the mac address is generated from the board serial in the initrd during boot …
You will not be able to change it as normal user, you need to use sudo and tee like:
This does not look like you have the dragonboard-kernel snap even installed (else there would be “installed:”, “tracking:” and “refreshed:” in this output) … what is the output of:
snap list
Did you use your own kernel snap to create this image ?
well, you clearly ended up with a broken initrd there … i’d suggest to try to re-builld your kernel snap in the hope it pulls in the right initrd.img with the script that creates the /run/macaddr0 file … (there might be other, less visible stuff missing)
…are actually the ones that create a binary initrd.img which gets shipped as part of the core snap (this building needs to happen in context of the rootfs build to get the right binary libs and versions of the initramfs-tools scripts etc so we can only reliably do it during core snap creation (which later becomes your rootfs on the image)).
When you build your kernel snap it downloads the latest core snap to pull the binary initrd.img out of it and to re-pack it with the initrd-modules you defined in your snapcraft.yaml
I am curently actively working on a mechanism to avoid exactly this step. In the near future you will only have a modules.img in the kernel snap created from your kernel build and not need this download step anymore … (the initrd will be merged on the fly in ram by the bootloader and the generic initrd.img half will be pulled diectly from the installed core snap).
This is still a bit away though, for the moment you have to live with the download step.
how does this cmdline param androidboot.serialno=f2103d95 get updated?
when i boot the board
[220] [220] target_display_panel_node:510: hw_id=24 panel_name=""
[220] [220] cmdline: androidboot.emmc=true androidboot.serialno=f2103d95 androidboot.baseband=apq mdss_mdp.panel=0:dsi:0:
i had updated the .serial no and saveenv , it had stored in persistent storage,
dragonboard410c => printenv args
args=androidboot.emmc=true androidboot.serialno=f2103d98 androidboot.baseband=apq mdss_mdp.panel=0:dsi:0
But still after rebooting the board, the mac address shows
vinaysimha@localhost:~$ ifconfig -a | grep wlan0
wlan0 Link encap:Ethernet HWaddr 02:00:f2:10:3d:95
it should be 02:00:f2:10:3d:98. Did the booting process is different, it is not picking the cmdline from presistent storage of env.
It is read from the ROM by the bootloader (like normally MAC addresses are read from a readonly source in the hardware as well, since they have to be a uniqe number and identify model and vendor (the /run/macaddr0 thing is actually a workaround that upstream created for a brokeness in the driver that does not read the MAC from the cards ROM))