/srv/irclogs.ubuntu.com/2024/09/12/#ubuntu-arm.txt

=== sugoi1 is now known as sugoi
ikoniawaveform: this is great, I can template the config.txt then and and be confident parameters will port across cleanly to ubuntu, thank you08:22
ikoniain the 24.04.1 image, unless I clear the cloud-init status, cloud-init is only run on initial boot / instructed to run again 08:49
ikoniaI may have just screwed something up due to miss-reading how the image triggers cloud-init08:49
waveformikonia, sort of -- IIRC it does run every boot but it'll only do certain tasks (the majority of them, like user creation, key import, package installation, etc.) on the first boot08:55
waveformthis can be *partially* reset by "sudo cloud-init clean" which won't undo everything but will set cloud-init to redo its "initial" run on the next reboot08:56
ikoniawaveform: ahh, that maybe where I have miss-read/understood, one of my tasks I break out to a shell, I assumed that would be a one time thing only, but it looks like it's doing it each time(08:56
ikonia(yeah, if I do a reset, I expect it to re-do the whole lot)08:56
ikoniaI've managed to port almost all my config from raspbian to the 24.04 image, I've got a couple of grey areas that I'm not sure how to approach on ubuntu's image. most of the raspi-config params just do an update to config.txt, but there are 4 I'm not sure if more is going on 09:52
ikoniaraspi-config nonint do_spi 0 and raspi-config nonint do_i2c 009:52
ikoniaalong with a serial serup of raspi-config nonint do_serial_cons 1 and raspi-config nonint do_serial_hw 009:53
ikoniaany suggestions on how I could approach these results on the ubuntu image without raspi-config ? it looks like more than just config.txt updates09:53
ikonia(trying to track changes on a raspbian image and port the changes over to ubuntu's image) 09:53
waveformright -- disabling the spi in config.txt I'd probably just do with something like this in runcmd: sed -i -e 's/^dtparam=spi=on/#dtparam=spi=on' /boot/firmware/config.txt09:55
waveformbut then I'm probably far too used to evil sed hackery09:55
waveformalternatively you might install raspi-config via the packages: key and then add your "raspi-config nonint do_spi 0" to runcmd instead (I *think* raspi-config should work for those items on ubuntu but I'd have to double check and unfortunately I'm in the midst of ISO tests today)09:56
ikoniaI can change the parameters / add / remove params with my ansible template fine, I'm just not clear on the parameters that are impacting09:57
ikoniaI've got cloud-init setup fine (few bits to optimise needed) so that it configures the host to either checkin to ansible or puppet which then updates the config on second boot, whcih works great09:58
ikoniatrying to set the right config.txt (and anything additional for those last raspi-config commands I think is all I have outstanding09:58
ikoniabased on what you've said I then assume that do_i2c 0 is the same as dtparam=i2c_arm=off09:59
waveformIIRC, yes -- but then I have a vague memory that nonint did some weird things. Hang on, I'll have a quick look and see if I can refresh my memory10:01
ikoniatrying to map raspi-config commands to text based file changes is harder than I'd hoped, any input is very welcome, 10:03
ikoniamost of them where straight forward a to track just diffing the config.txt, some of them not so much 10:03
waveformoooh, that's it ... the number in "nonint" (non-interactive) mode equates to the *return value* of whiptail, so 0 is True, and 1 is False ... because shell scripts10:04
waveformso "raspi-config nonint spi 0" means turn SPI *on*10:04
waveform(which it already is on the Ubuntu images)10:04
waveformso, technically you could skip that or if you wanted to make absolutely sure you could do something like "echo dbparam=spi=on >> /boot/firmware/config.txt"10:05
waveformlikewise for i2c10:05
waveform(I knew there was something bizarre about the nonint behaviour that I remembered!)10:05
ikoniayeah, that's possibly why it didn't show those channges as they are already set to on explicitly 10:06
ikoniathe seriel option seems to use enable_uart, but I'm not clear how yet10:07
ikoniaand the second serial option I haven't managed to map yet10:07
waveformhmm do_serial_cons and do_serial_hw appear to be in later versions of raspi-config that I haven't had time to merge yet10:10
waveformlooks like they just broke out some of the functionality that was originally interactive only though10:10
waveformokay ... let me see10:11
waveformdo_serial 0 sets up enable_uart=1 in the config.txt and adds console=serial0,115200 to the kernel cmdline.txt10:12
ikoniaahhh it changes the command line ! 10:12
ikoniaI'd not been tracking that yet10:13
waveformdo_serial 1 or do_serial 2 ... erm ... just trying to wrap my head around some bizarre shell ...10:13
ikoniatought right !10:13
ikoniatough10:13
ikoniainteresting, console=serial0,115200 multipath=off dwc_otg.lpm_enable=0 console=tty1 root=LABEL=writable rootfstype=ext4 rootwait fixrtc10:13
ikoniaso that's the default from 24.04 image10:14
ikoniait's alresady set10:14
waveformyes, we enable the serial console by default on the server images10:14
waveform(not on the desktop images)10:14
ikoniathis is looking easier than I'd hoped for the last 4 settings :) 10:14
waveformhowever, if you're running a sensor on the serial interface you want enable_uart=1 but you *don't* want the console=serial0 bit10:14
ikoniaoooh, maybe not10:15
waveform(so you want the port enabled but you don't want getty to go and stuff a console on it)10:15
ikoniayeah, that makes sense, but then why does the raspi-config setting add that, if you're correct (which you are) 10:15
waveformwell, it adds that for do_serial 010:15
ikoniaunless the final command then removes it10:15
waveformhowever, do_serial 1 disables everything (I think?) and do_serial 2 enables the port, but disables the console ... again, I think10:15
ikoniaso the exact command the raspbian config uses is10:16
ikonia        "sudo raspi-config nonint do_serial_cons 1",10:16
ikonia        "sudo raspi-config nonint do_serial_hw 0"10:16
ikoniaso there is no '2' option in there10:16
waveformyeah, those don't exist in the older raspi-config which we've got in ubuntu10:16
ikoniabut I agreee with what you're saying10:16
waveformlet me pull the latest and have a look10:16
ikoniathank you, I'm trying to work it through at the moment myself, almost all done, these last few where causing a bit of confusion 10:17
waveformokay, do_serial_hw just adds/removes the enable_uart=1 line10:17
waveformso do_serial_hw 0 will *add* enable_uart=110:17
waveformdo_serial_cons now handles the serial console bit, so do_serial_cons 1 will *remove* console=serial0,115200 from cmdline.txt10:18
ikoniaI'd got that from the line above ! not the second10:18
waveform(with sed)10:18
ikoniaI've really miss-read this 10:18
waveformspecifically, it's line 1288-1293 in the bookworm branch of raspi-config (and it's taking the serial0 branch -- I *think* the AMA0 stuff only applies to pre-4 Pis IIRC)10:19
waveformhttps://github.com/RPi-Distro/raspi-config/blob/4832cbd76054b09d7b0627501e7a3e7b4004edaf/raspi-config#L1288-L129210:19
ikoniaI see that it's doing, but it makes no sense as it's still putting the tty on the serial console 10:21
ikoniaoh wait, is ttyAM0 the sensor interface10:21
waveformwhat's your kernel command line at runtime (i.e. cat /proc/cmdline not the content of /boot/firmware/cmdline.txt)10:22
waveformahhh10:22
ikoniathe rasbian box (configred correctly) is booting with 10:22
ikoniacoherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_headphones=0 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_hdmi=0  smsc95xx.macaddr=B8:27:EB:32:03:0A vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000  console=tty1 root=PARTUUID=775741a6-02 rootfstype=ext4 fsck.repair=yes rootwait cfg80211.ieee80211_regdom=GB10:23
waveformokay, so it's got the serial pins configured but no console on it10:23
ikoniawhich makes sense as there is a sensor hanging off it10:25
ikoniafor my own education, how did you see the pins are configured in that boot line ? 10:41
waveformikonia, 8250.nr_uarts=1 usually indicates you've got one hardware uart enabled -- it's not entirely conclusive because on the 4 and 5 there are multiple hardware uarts that can be enabled, which don't have to be the main one the serial console is on, but in the vast majority of cases that just means the regular serial pins are enabled13:42
ikonianoted, thank you13:51
=== sugoi1 is now known as sugoi
=== sugoi1 is now known as sugoi

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!