Provide a way to flash leste (or u-boot) directly
13:12 Pali: hi
13:13 Pali: do you have suggestion/idea on flashing u-boot to n900 directly, to use with leste, without needing to flash/update fremantle
(just to install u-boot)
13:14 prepare firmware image with uboot only?
13:14 also, there were tools to create firmware images afair
13:14 yeah, I guess so.
13:15 I just wonder if it's already been done or not
13:15 last time i asked for flashable fremantle+cssu images folks just pointed to image creation tools and licensing issues
13:15 but i guess with leste it's not a problem anymore
13:17 https://talk.maemo.org/showpost.php?p=659865&postcount=6
13:19 and fiasco-gen in particular
13:22 https://talk.maemo.org/showthread.php?t=74121
13:22 seems to be quite descriptive
13:29 Wizzup, in upower only changed some commits description
13:29 Added some hotplugging stuff to MCE
13:30 changed order of tail commits in battery plugin
13:33 KotCzarny: ty
13:33 spinal84: ok, will try to plug raspi in soon
13:34 Wizzup: 0xFFFF can generate any fiasco image
13:34 ooh?
13:34 KotCzarny: problem with fremantle+cssu image is that nokia closed blobs are not redistributable
13:34 therefore they cannot be put into "public" image
13:35 ~0xFFFF
13:35 pali, how come this information wasnt known to me! (about 0xffff)
13:35 https://github.com/pali/0xFFFF
13:35 it is tool for flashing fiasco images to Nokia N-devices
13:35 it can also generate fiasco image from kernel/bootloader/rootfs/...
13:36 and can also unpack fiasco image
13:36 it is open source alternative to flasher-3.5 and fiasco-gen Nokia's applications
13:36 i knew about flashing part, didnt know it can also manipulate
13:36 images
13:36 fiasco is format which stores all images in one file
13:37 might be that the name need to change to: open free fiasco firmware fool
13:37 darn, is there any tool related word starting with f?
13:37 I see. I was mostly looking an image to 'boot' to u-boot and allow users to do things from there. I assumed u-boot-flasher probably
flashes u-boot from within fremantle, so something like that could be good enough
13:38 KotCzarny: futility ?
13:38 too b0rgish
13:38 for uboot you need to 1) flash uboot+kernel into nand; 2) store additional images to MyDocs; and 3) generate boot menu script
13:39 and everything is done on fremantle
13:39 so simple image with bootmenu would not work without installing it on fremantle
13:39 I realised about the script, but I didn't realise more images were needed
13:39 0xFFFF is basically future complete for N900, the only missing part is flashing eMMC images... https://github.com/pali/0xFFFF/issues/6
13:40 I see
13:44 Pali: do you have any specific recommendations in this case for making it easy to 'flash' leste? or at least bootloader for leste
13:44 leste itself could run on sd card, so don't -need- to flash emmc
13:45 do you want dual boot?
13:45 maemo5 and leste?
13:45 or just flashing leste into device and removing maemo5?
13:46 dual boot is ok, then I can install u-boot from maemo5
13:46 pali, can 0xffff read current nand contents?
13:46 say I have refurbished n900, now I have to install maemo5, install cssu, update it, install u-boot
13:46 just to be able to boot leste easily
13:46 I want to make it easier to boot (directly or via u-boot) to leste
13:47 you can flash uboot image into n900 via flasher
13:47 and then in uboot choose boot from sd card
13:47 uboot in this case loads some uboot script from sd card for booting
13:47 ah, ok. so the option 'boot from sd card' is in u-boot image, it's not loaded from emmc?
13:48 so if you provide it, then it can load your own kernel/initramfs with cmdline and boot it
13:48 no
13:48 great!
13:48 but if uboot see in eMMC bootmenu script, it loads it and replace "boot from sd card menu"
13:48 so we might want to build our own u-boot and provide it with sane defaults
13:48 KotCzarny: no :-( this is limitation of Nokia's NOLO loader
13:48 best would be ability to move original kernel to initfs and put uboot in kernel's place
13:49 iirc it's not too hard to replace u-boot built-in config
13:49 yes, you can build your own u-boot with custom config
13:49 default u-boot for n900 loads config from eMMC
13:50 rather not config, but bootmenu script
13:50 *nod*
13:50 ok, then I think I'll manage
13:50 but because it is uboot script, you can put there any config
13:50 I will try to look at it tonight
13:50 other option is to prepare eMMC image with your config :-)
13:50 but 0xffff cannot flash that yet, right?
13:50 but 0xFFFF cannot flash eMMC images yet
13:51 mhm
13:51 https://github.com/pali/0xFFFF/issues/6
13:51 wizzup, alternative would be running own os to populate emmc
13:51 via flasher boot
13:52 or you can prepare kernel+initramfs image for just loading without flashing, which updates eMMC uboot bootmenu config
13:52 and it will be passed to 0xFFFF for load+boot just after flashing uboot
13:52 and you do not need to modify uboot at all
13:53 right
13:53 KotCzarny: uboot cannot read n900's nand
13:53 ok, quite some options :)
13:53 so moving kernel into initfs place does not help anything
13:53 oh?
13:53 darn
13:53 anyway, kernel place in nand is large enough to store both uboot and kernel
13:54 and there is already uboot with stock 2.6.28 image (appended to end of uboot)
13:54 which is used by default
13:54 spinal84: works, shall I merge PRs and issue new builds?
13:55 so this problem was already solved (NOLO loads that "combined image" into RAM and uboot can find where that appened kernel image
starts in RAM)
13:55 KotCzarny: there is bug in uboot for accessing n900's onenand memory
3:55 I do not know if it was fixed or not, but in 2012 it was still there
13:56 * Wizzup notes: see if we have leste logo in u-boot :D
I skimmed through the chatlog. I'd love to have a way to install an alternative OS on the N900 without doing anything in the stock Maemo first. It would be nice if whatever you guys come up would also support booting postmarketOS from the SD card, like it is possible now with u-boot. Then we could switch between both OS by just inserting another SD card.
@MerlijnWajer: can you describe what approach you'll be working on (as you've assigned it to yourself)?
(Brief answer, will cover this in more detail later)
Part of this ticket would be to figure out what the best way would be. I think there are two distinct use cases here:
- People have a phone without fremantle (or with old/nonfunctional) and they don't care about fremantle.
- People have fremantle and don't want to throw it away.
For 2. - this is what we already have, they just update fremantle and install u-boot on it. 1. is more interesting, the main take away is that we can: 1a. flash u-boot using 0xffff with sensible default config (and make sure it doesn't attempt to read emcc/fremantle config if any) 1b. from u-boot, optionally read config from microsd card (if any) 1c. allow users to pick/select from default config (boot from sdcard, boot to emmc, etc)
Next to that, there is the question of getting Leste/pmos on the eMMC. This is not super important, and also harder, at least with normal flasher operation, since 0xffff doesn't support it. A simple way would be to load microsd card with an installer and then install to eMMC.
I'm happy for others to pick this up, btw.
I think it would be nice to also provide a FIASCO image or some other option to flash Leste rootfs to the 256MB NAND which is faster than eMMC or SD card. In the past, we would have had the optification problem but recent kernels provide OverlayFS which might be a simple/useful way to overcome this.
So I've built the latest u-boot master for rx-51 and I can load it with 0xFFFF now, after compiling libusb 0.1 (I made a static build, so it'll be easy to distribute to people):
merlijn@gentoo-x230 ~/0xFFFF $ sudo ./src/0xFFFF -m test/u-boot.bin -l
0xFFFF v0.8 // Open Free Fiasco Firmware Flasher
Not a local device
Waiting for USB device...
Found USB device: RX-51/RM-680/RM-696 (0x421:0x106) in Cold flashing mode
USB device product string: (not detected)
USB device serial number string: (not detected)
Claiming USB interface...
Error: usb_claim_interface failed: Bad file descriptor
Waiting for USB device...
Found USB device: SU-18/RX-34/RX-44/RX-48/RX-51/RM-680/RM-696 (0x421:0x105) in NOLO mode
USB device product string: Nokia N900 (Update mode)
USB device serial number string: MUM526378
Detected USB device: RX-51
Initializing NOLO...
Device: RX-51
HW revision: 2101
NOLO version: 1.4.14
Kernel version: 2.6.28-20094803.3+0m5
Initfs version: (not detected)
Software release version: RX-51_2009SE_21.2011.38-1_PR_MR0
Content eMMC version: RX-51_2009SE_1.2009.41-1.FRANCE-BENELUX
Root device: flash
USB host mode: disabled
R&D mode: disabled
Load image:
File: test/u-boot.bin
Image type: kernel
Image size: 259840 bytes
Sending image header...
Sending image...
100% [#################################################################]
Done
merlijn@gentoo-x230 ~/0xFFFF $ sudo ./src/0xFFFF -b
0xFFFF v0.8 // Open Free Fiasco Firmware Flasher
Not a local device
Waiting for USB device...
Found USB device: SU-18/RX-34/RX-44/RX-48/RX-51/RM-680/RM-696 (0x421:0x105) in NOLO mode
USB device product string: Nokia N900 (Update mode)
USB device serial number string: MUM526378
Detected USB device: RX-51
Initializing NOLO...
Device: RX-51
HW revision: 2101
NOLO version: 1.4.14
Kernel version: 2.6.28-20094803.3+0m5
Initfs version: (not detected)
Software release version: RX-51_2009SE_21.2011.38-1_PR_MR0
Content eMMC version: RX-51_2009SE_1.2009.41-1.FRANCE-BENELUX
Root device: flash
USB host mode: disabled
R&D mode: disabled
Booting kernel with default cmdline...
But it seems like u-boot itself has some issues. I think it can't read from sd card, or something similar. We might want to check out a git tag that is known to work and meanwhile report bugs upstream. I haven't tried to actually "flash" this to the device yet, but I assume that will just work.
Using u-boot bin from here works:
http://maemo.org/packages/package_instance/view/fremantle_extras-testing_free_armel/u-boot-bootimg/2013.04-2/
So there might be an issue with upstream u-boot. The screen backlight is very low though, which is a nuisance.
@ollieparanoid I'll wrap this up soon, but as far as I can see, you will just be able to pick 'External SD card' from boot menu and then you can boot directly to postmarketOS. Once I finish this I'll post some instructions on the wiki.
There is a statically linked 0xFFFF binary available here for 64 bit intel arches:
https://maedevu.maemo.org/images/n900/tools/
It uses libusb 0.1. In the same directory, the u-boot packaged in Fremantle is provided. It can be tested like so:
sudo ./0xFFFF -m test/u-boot-2013.04-2.bin -l
sudo ./0xFFFF -b
Then you will be presented with u-boot pretty much directly. Select 'External SD card' and you should see Leste boot.
It can be flashed directly to the N900 like so:
BIG FAT WARNING: THIS WILL REPLACE YOUR KERNEL AND HOSE EXISTING FREMANTLE SYSTEM:
sudo ./0xFFFF -m test/u-boot-2013.04-2.bin -f
sudo ./0xFFFF -b
Took initial stab at documenting this: https://leste.maemo.org/Nokia_N900#If_you_don.27t_want_to_use.2Finstall_Fremantle.2C_or_want_to_install_quickly
Still need to file bugs for upstream u-boot.
I come across this issue as well, there is one n900 with a broken touchscreen. I tried to compile the u-boot tag v2023.04 with below and then run 0xFFFF -m kernel:u-boot.bin -l -b, it works well for me, for anyone who want to try you can download a prebuilt u-boot.bin here [take the risk by yourself :)] https://yangrr.fedorapeople.org/n900/u-boot/
--- a/configs/nokia_rx51_defconfig
+++ b/configs/nokia_rx51_defconfig
@@ -9,7 +9,7 @@ CONFIG_OPTIMIZE_INLINING=y
CONFIG_LTO=y
# CONFIG_FIT is not set
CONFIG_SUPPORT_RAW_INITRD=y
-CONFIG_BOOTDELAY=30
+CONFIG_BOOTDELAY=5
CONFIG_AUTOBOOT_KEYED=y
CONFIG_AUTOBOOT_MENU_SHOW=y
CONFIG_USE_BOOTCOMMAND=y
@@ -25,7 +25,7 @@ CONFIG_CMD_BOOTZ=y
# CONFIG_BOOTM_PLAN9 is not set
# CONFIG_BOOTM_RTEMS is not set
# CONFIG_BOOTM_VXWORKS is not set
-CONFIG_CMD_BOOTMENU=y
+# CONFIG_CMD_BOOTMENU is not set
# CONFIG_CMD_ELF is not set
# CONFIG_CMD_IMI is not set
# CONFIG_CMD_XIMG is not set