=== sugoi1 is now known as sugoi [08:22] waveform: this is great, I can template the config.txt then and and be confident parameters will port across cleanly to ubuntu, thank you [08:49] in 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] I may have just screwed something up due to miss-reading how the image triggers cloud-init [08:55] ikonia, 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 boot [08:56] this 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 reboot [08:56] waveform: 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] (yeah, if I do a reset, I expect it to re-do the whole lot) [09:52] I'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] raspi-config nonint do_spi 0 and raspi-config nonint do_i2c 0 [09:53] along with a serial serup of raspi-config nonint do_serial_cons 1 and raspi-config nonint do_serial_hw 0 [09:53] any suggestions on how I could approach these results on the ubuntu image without raspi-config ? it looks like more than just config.txt updates [09:53] (trying to track changes on a raspbian image and port the changes over to ubuntu's image) [09:55] right -- 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.txt [09:55] but then I'm probably far too used to evil sed hackery [09:56] alternatively 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:57] I can change the parameters / add / remove params with my ansible template fine, I'm just not clear on the parameters that are impacting [09:58] I'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 great [09:58] trying to set the right config.txt (and anything additional for those last raspi-config commands I think is all I have outstanding [09:59] based on what you've said I then assume that do_i2c 0 is the same as dtparam=i2c_arm=off [10:01] IIRC, 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 memory [10:03] trying to map raspi-config commands to text based file changes is harder than I'd hoped, any input is very welcome, [10:03] most of them where straight forward a to track just diffing the config.txt, some of them not so much [10:04] oooh, 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 scripts [10:04] so "raspi-config nonint spi 0" means turn SPI *on* [10:04] (which it already is on the Ubuntu images) [10:05] so, 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] likewise for i2c [10:05] (I knew there was something bizarre about the nonint behaviour that I remembered!) [10:06] yeah, that's possibly why it didn't show those channges as they are already set to on explicitly [10:07] the seriel option seems to use enable_uart, but I'm not clear how yet [10:07] and the second serial option I haven't managed to map yet [10:10] hmm do_serial_cons and do_serial_hw appear to be in later versions of raspi-config that I haven't had time to merge yet [10:10] looks like they just broke out some of the functionality that was originally interactive only though [10:11] okay ... let me see [10:12] do_serial 0 sets up enable_uart=1 in the config.txt and adds console=serial0,115200 to the kernel cmdline.txt [10:12] ahhh it changes the command line ! [10:13] I'd not been tracking that yet [10:13] do_serial 1 or do_serial 2 ... erm ... just trying to wrap my head around some bizarre shell ... [10:13] tought right ! [10:13] tough [10:13] interesting, console=serial0,115200 multipath=off dwc_otg.lpm_enable=0 console=tty1 root=LABEL=writable rootfstype=ext4 rootwait fixrtc [10:14] so that's the default from 24.04 image [10:14] it's alresady set [10:14] yes, we enable the serial console by default on the server images [10:14] (not on the desktop images) [10:14] this is looking easier than I'd hoped for the last 4 settings :) [10:14] however, if you're running a sensor on the serial interface you want enable_uart=1 but you *don't* want the console=serial0 bit [10:15] oooh, maybe not [10:15] (so you want the port enabled but you don't want getty to go and stuff a console on it) [10:15] yeah, that makes sense, but then why does the raspi-config setting add that, if you're correct (which you are) [10:15] well, it adds that for do_serial 0 [10:15] unless the final command then removes it [10:15] however, do_serial 1 disables everything (I think?) and do_serial 2 enables the port, but disables the console ... again, I think [10:16] so the exact command the raspbian config uses is [10:16] "sudo raspi-config nonint do_serial_cons 1", [10:16] "sudo raspi-config nonint do_serial_hw 0" [10:16] so there is no '2' option in there [10:16] yeah, those don't exist in the older raspi-config which we've got in ubuntu [10:16] but I agreee with what you're saying [10:16] let me pull the latest and have a look [10:17] thank 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] okay, do_serial_hw just adds/removes the enable_uart=1 line [10:17] so do_serial_hw 0 will *add* enable_uart=1 [10:18] do_serial_cons now handles the serial console bit, so do_serial_cons 1 will *remove* console=serial0,115200 from cmdline.txt [10:18] I'd got that from the line above ! not the second [10:18] (with sed) [10:18] I've really miss-read this [10:19] specifically, 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] https://github.com/RPi-Distro/raspi-config/blob/4832cbd76054b09d7b0627501e7a3e7b4004edaf/raspi-config#L1288-L1292 [10:21] I see that it's doing, but it makes no sense as it's still putting the tty on the serial console [10:21] oh wait, is ttyAM0 the sensor interface [10:22] what's your kernel command line at runtime (i.e. cat /proc/cmdline not the content of /boot/firmware/cmdline.txt) [10:22] ahhh [10:22] the rasbian box (configred correctly) is booting with [10:23] coherent_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=GB [10:23] okay, so it's got the serial pins configured but no console on it [10:25] which makes sense as there is a sensor hanging off it [10:41] for my own education, how did you see the pins are configured in that boot line ? [13:42] ikonia, 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 enabled [13:51] noted, thank you === sugoi1 is now known as sugoi === sugoi1 is now known as sugoi