libera/#devuan-arm/ Monday, 2023-07-17

agnelivery good morning :) or whatever your tz is07:03
agnelignarface: since more or less 20 yrs using UUID was recommended because the drives might come in a different order even between reboots07:04
agneliidr exactly why, but that was due to drive initialization, order in which drivers load etc...07:05
agnelii missed the bit that your boot script is actually on emmc07:06
agnelibut then I am not sure I understand your script07:10
agneliyou have both kernels on emmc?07:10
agnelilooks like one you have on the root of the 1st partition of your emmc07:10
agneliand the other in boot directory on the same drive/partition07:11
agneliis that correct understanding, please?07:11
gnarfaceagneli: yes, this has been a known issue for SATA drives for a while now, and i do believe there was some kernel change that started it, but i didn't think it matters for these mmc devices, but no i don't think you're picturing my drive layout quite right17:49
gnarfacewhat i have is the boot script in /boot on partition 1 of the microSD and the rootfs is partition 217:50
gnarfacethe emmc also has a separate u-boot and boot.scr, a /boot for partition 1 of its own, and a rootfs as partition 217:51
gnarfaceat one point the emmc was older so it would be obvious, but then i tested that to be sure and discovered i'd it's the same version on both now, i must have updated. but that meant i couldn't tell if boot.scr from the emmc was actually booting the microSD. i hadn't considered it, but that was your theory and i realized i couldn't disprove it just based on those tests.17:52
gnarfacei haven't tested further yet to be sure one way or another17:52
gnarfaceit had definitely happened that way at some point before so it's a valid theory17:55
gnarfacebut for the boot.scr on the emmc to be working for both that would mean they'd have to be changing order in some way with the new microSD but not the old one, which would mean if i edited the boot.scr on the emmc to point to the new microsd then it could no longer boot both as per your hypothesis of how it was currently working, so at that point i gave up17:59
gnarfacei still wanted it to boot the emmc if there's no microsd present you see, and using the new microsd that way would prevent that17:59
gnarfaceer, actually no, it would mean they're changing order some way with the old microSD but not the new one, and that's why the new one doesn't work18:04
gnarfaceanyway, at some point i'll probably want to figure it out, but either way that now ruins the point of trying to swap these microSD cards18:08
gnarfacebecause now either i won't be able to boot the emmc, or i won't be able to boot the new microSD, i'll have to pick one or the other, (or else learn how to make a much more complicated boot.scr, which may be possible in theory but is also currently beyond my skill)18:09
gnarfaceor i could do all that and find out that it's a red herring and the newer microsd won't work no matter what18:09
* agneli will read it all and understand soon18:12
gnarface(which would be weird because it was working fine in a different, related device, but still not impossible)18:12
agnelibut seems you have a real complicated setup18:12
gnarfacei don't think it's all that complicated i think i'm just bad at explaining it18:12
agneliI have some ideas but I will share once I study your fresh input18:12
gnarfacebasically there's some academic value in figuring out if you're right about this or not, but whether you are or not it means this microSD is probably not going to suit as an exact drop-in replacement of the old one so i'm aborting the mission because that was the primary goal18:13
gnarfacemy assumption was that the newer microsd would work identically to the old one in every way despite being half the size, so i could put the larger, older microsd in a completely different device. if that assumption isn't true then this mission has failed regardless of the specifics of why.18:15
gnarfacei do appreciate your help though18:17
gnarfacesorry we didn't actually make any progress18:17
gnarfaceanyway, it's a good theory, but looking now at /boot/boot.scr on the emmc i believe it's not true because it clearly says root=/dev/mmcblk2p218:21
gnarfaceand that boots fine while the microSD is not present18:22
gnarfacethe boot.scr on the microsd clearly has root=/dev/mmcblk0p2 on it18:23
gnarfaceso even if there's some sneaky order switching that allows both these cards to work on the emmc's boot.scr, it won't work anymore if i switch to the new microSD18:24
gnarfacebefore i had update the emmc's u-boot install i was sure that isn't happening, but i hadn't considered the possibility it might happen with some microSD cards and not others18:25
agnelignarface: 1. if your soc has a boot sector on emmc, and you have standard, unmodified u-boot, then your boot.scr on your sdcard is _never_ read imho20:14
agnelii recommed you add echo test_emmc and echo test_sdcard to respective *.scr files, if you have serial console then you will see easily20:16
agnelibut iirc you do not, so jsut comment the boot line20:16
agneliso kernel does not overwrite u-boot output20:16
agnelithen you will know for sure which one is booting20:16
gnarfaceagneli: no, note that this is NOT a pbp, it has a different hardware boot order. unlike the pro, it will absolutely try the microSD first20:16
agneliwhere is your boot sector please?20:17
gnarfacei'm gonna test it eventually, but it definitely does at least try the microSD first, i know that for sure with this hardware. the pinebook pro internals have a different boot order because they're by a different cpu vendor20:17
agneliI believe this has nothing to do with hw where u-boot looks for the *.scr file20:18
agnelimine goes throug everything imaginable20:18
agnelieth, usb, gkw, etc20:18
gnarfacewell u-boot will look for boot.scr on the current disk, whatever it is20:18
gnarfacebut it is also an older u-boot build and possibly from before the necessary patches were mainlined20:19
gnarfacemy notes say i wrote the u-boot installs at the 8k address of each of their respective disks20:19
agneliso SoC does not have a predefined bootsector really?20:20
agneliit just choses microsd frist and emmc later looking for a bootsector?20:21
agnelihow does it know that there is actually no usable code?20:21
gnarfaceit doesn't know without trying it20:21
gnarfacei think it looks across a range on both20:21
gnarfacebut it tries the microSD first if present, then the emmc second. the pinebook pro models try the emmc first instead20:22
agnelilet us say I will write SeXdUgSnRoCkRoLL many times at that adress on the sd card20:22
agnelihow will SoC knows this is not a real code20:22
gnarfaceit may not know. there is a known issue where boot will hang if your u-boot is corrupted, and the recommended fix is to dd /dev/zero across it20:22
agnelihow SoC with no firmware to analyze the code knows that there is a valid bootloader?20:23
gnarfacei think it literally just tries to execute whatever is there20:23
gnarfaceafaik this is common for arm devices20:23
gnarfacebut it is weird20:23
agnelii have tegra2 and i have predefined bootsector devices on emmc20:24
gnarfacethat's a very fancy device though20:24
agnelicarved out of the overal emmc space20:24
agneliso basicall if the bootsecotr on sdcard is crap it will just hang the device?20:24
gnarfaceyep20:25
agneliit will not proceed to probe emmc boot sector?20:25
agneliOK that seems realistic20:25
gnarfacei think the pinebook pro has something called a "SPI" which is the thing like you said, carved from the emmc but looking like a separate device.... but get this: they ship with it empty20:26
gnarfacebut yea, i can try to make the boot.scr files each write out something unique. the u-boot build i have has display support patched in, so i just need to know the right command to echo a string, then i can be sure which one is booting20:27
gnarfacei'm just being lazy about it right now20:27
gnarfacebecause keep in mind, even if this confirms your theory, it still doesn't fix the problem, only gives us a different explanation20:28
agnelii think so, a bit yes :)20:28
agnelithose are very simple things that take like 10 minutes all of them20:28
agneliwe spent much more time discussing20:29
gnarfacetrue20:29
agnelignarface: i am saying uboot has same order but kernel changes it on the newer card20:29
agnelilet me doublecheck if it actually is not happening on my device20:30
gnarfaceyea, i understand your theory. it's not supposed to be possible from what i've been told but i admit what i've been told only amounts to hearsay20:30
gnarfaceand i also admit that your theory is possible for SATA devices and that actually has caused me problems with other machines so this is a possibly valid theory20:31
gnarfacethis machine i'm talking to you on now, it has 3 drives and they never come up in the same order anymore. i had to use UUIDs here starting some 10 years ago.20:31
agneliso...20:32
gnarfaceand it was definitely a kernel change20:32
agneliI have exactly thins on my device20:32
agnelifor uboot sdcard is 120:32
agneliwhile for kernel i is /dev/mmcblk020:32
agneliso it does switch the order20:32
agneli_kernel_ not uboot20:32
agneliu want some logs or something?20:33
agneliu saw my boot.scr20:33
agnelii am loading from 120:33
agnelii remember many year ago I did pull out a lot of hair because of this20:34
agneliso if your setup is correct then the card is being read by u-boot20:35
agneliif you just change root from dev to UUID it should work20:35
agnelithen when you pull out the sd card20:35
agneliyour emmc will take over20:35
agnelifrom what you are saying20:35
agneliso there will be no issue20:35
agneliam I wrong?20:35
gnarfacei think you're wrong on one point because when i boot from the emmc it clearly sees the rootfs as /dev/mmcblk2p2 and when i boot from the old microSD it clearly sees the rootfs as /dev/mmcblk0p220:52
gnarfacesince the newer microSD doesn't complete booting, that's still unknown20:52
gnarfacebut the theory would require that the newer microSD is actually coming up as /dev/mmcblk220:53
gnarfaceeven though the old one definitely shows up as /dev/mmbclk020:53
agnelii never had pinebook I am talking about my tegra2 based laptop20:53
gnarfacehow do i make a *.scr file that just echos a string and does nothing else?20:54
agneliby copying the first line form mine :)20:54
gnarfacei could make two different *.scr files named like test.scr and just run them manually from the boot prompt20:54
agneliand nothing else20:54
gnarfacelooking again...20:54
gnarfaceugh, the paste was deleted20:54
agnelijust write echo "dasdsadsa"20:55
agneliand nothing else20:55
gnarfaceoh, its' just that one line?20:55
gnarfaceecho "statement"20:55
gnarfacelike that?20:55
gnarfacei can try it20:55
gnarfacei need a few minutes to get more coffee20:55
agneliecho =====> devuan daedalus <=====20:55
agneliso "" is not needed20:55
gnarfaceok, noted20:55
agneliand if you can load *.scr20:56
agnelihmmm20:56
agnelii think I remember loading scripts from the prompt20:56
agnelibut I would not bet on it20:56
agnelii can test tomorrow20:56
gnarfaceyea i know you can run them from the prompt if you've built u-boot to have a prompt20:57
gnarfaceand keyboard support20:57
* agneli do not have keyboard support20:57
agneliwe have a patch but that was not accepted20:57
gnarfaceeven the shell prompt is not always enabled by default20:57
agnelii am doing all via serial20:57
agnelii never enabled the shell purposedly20:57
agneliso for my config_* it is20:58
agnelianyway, from all that we have discussed your sd card is booting, problem is further down the boot procedure20:59
agneliyou did check that card with f3, didn't you?20:59
agneliI think I asked already20:59
gnarfacef3?20:59
agneliand I think you said you did20:59
agnelifight fake flash20:59
agnelior something20:59
agneliit tests well the card21:00
gnarfaceoh, no but it was in use and never threw errors for dd or tar or cp21:00
gnarfacebut i'm considering running badblocks on it anyway21:00
gnarfacejust in case it's some rare corruption on read21:00
agneliand you are able to mount that card on some other device, I mean the / partition?21:00
agnelior even better21:01
agneliwhen you boot pb from emmc21:01
gnarfaceyea, that's how i copied the contents of the rootfs over on some of the attempts21:01
agnelican you insert the sdcard and mount?21:01
gnarfaceyea21:01
gnarfaceit really seems to be a normal microSD card except for this problem21:01
agnelithen I really see only the possibility which I am mentioning21:01
agneliwhat else could it be21:01
agnelidirect copy21:02
agnelisame uboot, same pt, same everything21:02
agnelior is it21:02
gnarfacewell, no, there's one other possibility; the pinebook could suck this much that it just randomly can't use certain perfectly good SD cards for no reason21:02
agnelifirst is 128 GB21:02
agneliand the other is 64 GB21:02
agnelibut you said you mounted the / on pb from that card while it was booted from emmc21:03
gnarfaceyea, the new one is smaller but i accounted for that. actually i tried accounting for it and not accounting for it. neither approach changed anything21:03
gnarfacethe rootfs contensts are only 8GB21:03
agnelithat means it can read the card perfectly well21:03
gnarfacehmm, yea. so why would it fail to read only on boot?21:03
gnarfacethat does seem odd21:03
agnelithis is why I am so stubborn about my theory21:04
gnarfacecould this actually be a u-boot bug somehow? specific to one card? it is an old u-boot build like i said21:04
agnelibut you did not really dd the cards directly did you?21:04
gnarfacelike i said, i tried it both ways21:04
agneliwhat does it mean both ways?21:04
gnarfacei tried a couple different times from a direct dd, and i also tried manually recreating and formatting all the partitions fresh then copying over the contents21:04
gnarfacei tried like 6 times total these two basic different ways using different computers to write, including the pinebook21:05
agneli1. dd untill it fails due to lack of space, device to device not partition to partition21:05
gnarfaceyea, but all that gets cut off is empty space, so in that case i just ran xfs_repair on it21:05
agnelibut well dd directly would not work... unless all partitions on the table are small enough to fit on the smaller card21:06
gnarfaceand like i said, it only was using 8GB so when i create the partition manually and copy it over there's no complaint21:06
agneliyour pt would be invalid21:06
gnarfacethe partition table is barely invalid in that case, it still functions. but you should know i also tried a couple times recreating the partition table in place, which works. no change though.21:07
agnelignarface: could you exactly describe procedures21:07
agneliach u r sure21:07
gnarfacelook, you have to try it yourself to be sure21:07
agnelipartition table is OK and valid21:07
agneliand you are 100% sure the copy went well21:08
gnarfacewrite a 16GB partition to a 8GB device then just delete and remake the partition in place and fsck the filesysytem. if none of the data was in the truncated part it will work fine21:08
agneliand it mounts21:08
gnarfaceyea, always mounts21:08
agnelignarface: I just did that yesterday21:08
agnelifitting 512GB into 256GB21:09
agneliheheh21:09
agnelireally we discussed about everything21:09
agnelisomehow I doubt partiton that mounts on the very same device21:09
agnelisuddenly stops working21:10
agneliand kernel versions are the same?21:10
gnarfaceyea21:10
agneliit is not like fs on that partition is much newer21:10
agnelithan the kernel?21:10
gnarfaceah, that was one of my first suspicions, so after that i used the pinebook to mkfs.xfs21:10
agnelifor example I have 3.10.x kernel I need to speclially format ext4 on amodern kernel21:11
gnarfaceno change21:11
agneliotherwise it does not want to see21:11
gnarfaceyea, i was really hoping that would be my mistake but using the xfs from the pinebook changed nothing21:11
gnarfaceand after all, it's xfs not ext421:11
gnarfaceext4 definitely had a problem like that21:11
agneliwe did discuss everything, didn't we?21:12
gnarfacei think so21:12
agnelii believe you card is OK21:12
gnarfacetrying to create some test.scr files now21:12
agneliyou might give f3 a try21:12
agnelii think that is the only way... playing with the uboot21:12
agnelibut again if what you are saying about bootsectors on pb21:13
agneliis should not hurt you21:13
agneliit should work as you want21:15
agneli"boot from the emmc it clearly sees the rootfs as /dev/mmcblk2p2"21:16
agneli"boot from the old microSD it clearly sees the rootfs as /dev/mmcblk0p2"21:16
agnelithat line about emmc should not be /dev/mmcblk _1_ p2"21:17
agnelior you have more boot devices there?21:17
gnarfaceno, something weird about the hardware, mmc device 1 is not a storage device or else unfurnished... i think it might be the wifi actually but i'm not using the internal wifi for anything21:20
gnarfaceso it calls emmc mmcblk2 and microsd mmcblk0 and there's no mmcblk121:20
gnarfacevery strange hardware but i think it was to save costs21:21
agneliI suggest that apart from echo you use printenv21:21
agnelias well21:21
gnarfacethe SoC this device is based on costs $1721:21
gnarfacehmm, i have a problem with the first test21:22
gnarfaceecho is doing nothing21:22
agnelinot build in the u-boot?21:22
agnelii think there is an option for evey boot shell command in the u-boot menuconfig, yes21:23
gnarfacecan't be that, because if i run "echo blah" at the u-boot prompt it echoes blah21:23
gnarfaceif i try to call test or test.scr it just outputs nothing21:23
agnelithen id should work in script too21:23
agnelii think it should be some load or somehting, idr21:24
gnarfacemaybe it's a u-boot bug i'm not sure, but can you show me yours again?21:24
agnelihttp://paste.debian.net/plain/128614621:25
gnarfacethanks21:26
gnarfacehmm, unles some of these later lines are somehow required to make the echo work, i don't see what could be wrong21:27
gnarfacei don't get any errors from the test.scr i made but i also don't get any output21:27
agnelino21:29
agnelithey are not required21:29
agnelibut I think the printenv will tell you how to load boot.scr21:30
agnelior some other.scr21:30
gnarfaceprintenv when run from the shell prompt outputs quite a lot21:30
agneliwhat you have in the bootcmd line if I recall correctly21:30
gnarfaceany clues as to what i should be looking for specifically?21:30
agneliyes a lot21:30
agneliprintenv bootcmd id say21:30
gnarfaceoh! i have an idea21:31
gnarfacehah21:31
gnarfacei'll delete one test.scr21:31
gnarfacethen i'll know which one i'm booting because it'll error on the one that doesn't have it21:32
agnelii just recommend you make sure there is not boot* line there21:32
agneliso screen stays for you to read21:32
gnarfaceyea, the only contents are this:21:32
gnarfaceecho =====> 16GB Pinebook internal eMMC <=====21:32
agnelii have to go, good luck :)21:33
gnarfacethanks21:34
agnelijust in case: https://u-boot.readthedocs.io/en/latest/usage/index.html#shell-commands21:34
gnarfaceargh21:39
gnarfacei think it may have been a poor choice to use "test.scr" as the file name21:39
gnarfacedamit21:39
gnarfaceyea that was dumb. native shell test was running instead of test.scr... starting over. (sigh)21:39
gnarfaceagneli: alright, well, i got some more info. adding "gnartest.scr" to both microSDs didn't work, it can't find it in either place when i add it, but... i did notice that if i run "mmc info" from the shell prompt i get 3 different responses depending on which device i'm booting from, which seems to be matching expected behavior22:02
gnarface"mmc" info reports the correct size of the microSD if the 64GB or 128GB are present, and if it's booting from eMMC it just says no cards are present22:03
gnarface...er, "mmc info" i meant to type22:03
gnarfaceso that seems to suggest to me that it's booting from the device i expect in every case, and it must just be mysteriously allergic to the 64GB microSD for no apparent reason22:03
gnarfacethat doesn't explain why nothing sees my alternate "gnartest.scr" files but maybe there's rules about what *.scr files can be named which i wasn't aware of22:04
gnarfacei think now maybe i'll run a destructive-mode read+write badblocks pass on the 64GB microSD because read corruption or silent write failure seems to be the only other possible explanation here22:05

Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!