В Пнд, 27/12/2010 в 18:16 +0300, Ivan Matveev пишет: > On Mon, 27 Dec 2010 08:33:09 +0300 > Gennady Kupava <[email protected]> wrote: > > > Hi, > > > > > I don't want to go back to u-boot. > > > > I disagree - going to Qi is going back, going to u-boot is going > > forward :) > > I like Qi's minimalism, automatic setup of many options and text config > files.
"Automatic" setup is done by person who provide you with Qi. If someone start supply u-boot_env with distros, u-boot setup will be equally "automatic". It's also possible to setup u-boot like qi, 'read kernel first from sd part 1, boot if loads, then try from sd part 2, boot if loads, then from nand'. All with 10 lines in config file. Just noone need it. What 'text config files' in Qi you talking about? Does it have config files at all? If you mean ability to append kernel parameters this not like u-boot config files, only 1% of that flexibility. Minimalism? You mean that Qi works only on Freerunner, has no support to anything else? Or that you need to use NOR u-boot to flash something to NAND as qi can't do it? Or that nothing except kernel parameters may be configured without recompilation? Or that it can't display anything on screen so you have to decode errors by amount of blinks? Or that it adds 'quiet' kernel options by default, so you can't see boot logs? > I'v tried u-boot just to be shure. > Per istructions at > http://wiki.openmoko.org/wiki/U-boot-gena2x > I'v downloaded: > http://www.bsdmn.com/openmoko/uboot/binary/u-boot_g2x_1.udfu > http://www.bsdmn.com/openmoko/uboot/config/environment.in > http://svn.openmoko.org/trunk/src/host/devirginator/crc32.pl > http://svn.openmoko.org/trunk/src/host/devirginator/envedit.pl > > Didn't edit environment.in because don't know what to put there. You must edit it to boot, mine is only example suitable only for my custom setup. > From http://wiki.openmoko.org/wiki/U-boot-gena2x: > " > If you switching from qi, just run boot your distro with Qi, do > cat /proc/cmdline and compare/update parameters in config file. > " > Cant do that because I can only boot from SD but the params will be > different then? So lets use the sample environment.in as it is. > > ./envedit.pl -s 262144 -f environment.in > u-boot_env.in > > dfu-util -a u-boot -D u-boot_g2x_2.udfu > dfu-util -a u-boot_env -D u-boot_env.in > > A press on the power button. FR emits a barely audible click and then > nothing, the screen stays blank. This only may happen if you battery discharged or 'default' boot way is not setup properly. Try menu with power+aux like described on wiki. > OK, at least I'v removed supposedly offending options from u-boot_env > partition. > Lets try qi-v30.udfu again. TADA! It boots ubifs QtMoko from NAND. > So I think something was wrong with u-boot_env partition, params > stored in there or the partition size. I think qi is NOT reading u-boot_env, so you just had different Qi version before. > > > > echo 'rootflags=compr=zlib' > p1/append-GTA02 > > > > Are you sure qi is really reading this? i am sure it is not. > I agree. In Qi sources I could only find that it reads 'usb' file from > 'identity-ext2' partition. > > > No, you need ensure that this options REALLY passed to kernel > > somehow. I almost sure they not. > In this case I had to make sure some options are NOT passed to the > kernel :). All the right options are compiled in Qi. > > > > Can I modify u-boot environment from QtMoko running from SD? > > > > u-boot can boot any known distro without problems, from sd, ubi or > > jffs2. in hard cases of unusual fses you can just put kernel to splash > > NAND partition (named 'depr' in your qi) and boot it with rootfs on > > sd. > Thanks I'll keep that in mind in case of a hard case. > > > I think it is also possible to make such config that appends kernel > > params load from file on external fs, like in qi, but who needs > > this... > I think its not external fs that matters but u-boot_env > format. Seem i didn't describe my idea very well. I think it's possible to write such env for u-boot, that will read text 'append' portion of kernel params like qi does. So, you'll have similar fun of editing text files with kernel options, like you have in Qi. > > dfu-util -a u-boot_env -U u-boot_env.in > > Now we have u-boot_env.in file containing params. How do we study whats > inside? Strings? Errr. Oh yes we have envedit.pl. How do we use > it, and where is the doc? Run it with no params, it outputs > '���6'. > Look inside, there is: > -i file read environment from file (default: use empty " > -p print environment in human-readable form to stdout\n". > > ./envedit.pl -i u-boot_env.in4.problemed -p > warning: environment is 262144 bytes, expected 16384 > CRC error: expected 0x7b25213d, got 0x8f4d6b85 > > Oh yes there is -s option. > > ./envedit.pl -s 262144 -i u-boot_env.in4.problemed -p > > At last it works! But the output doesn't look like the environment.in. > How do I compile the output back in to u-boot_env.in4 after editing? I don't understand why do you need to download it and edit? What do you want to find in your verison in flash? Default settings? If you wrote it initially and have environment.in (above), you already have readable and editable version. Never tried this way. > Can this be done from FR with no PC? nandump, edit, crc32, nandwrite? > Oh my... As Martix already wrote, you can edit it in u-boot command line. But on freerunner, you also can use fw_printenv/fw_setenv from uboot-envtools debian package. > If u-boot_env partition contained a decent ext2(like identity-ext2 > partition does) you could download it with dfu-utl, mount, edit files, > put back to the phone. > On a booted FR you could just > mount -t ext2 /dev/mtdblock2 /mnt/whatever > edit files... I think where is no need in FS then it can be avoided. > Thank you for the discussion, it gave me a kick in the right direction. Anyway, problem solved. Gennady. _______________________________________________ Openmoko community mailing list [email protected] http://lists.openmoko.org/mailman/listinfo/community

