LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM
User Name
Password
Slackware - ARM This forum is for the discussion of Slackware ARM.

Notices


Reply
  Search this Thread
Old 12-23-2023, 06:19 PM   #1
difdif
LQ Newbie
 
Registered: Feb 2004
Distribution: Slackware
Posts: 8

Rep: Reputation: 4
Lightbulb PinebookPro installation instructions - additional method to update SPI flash


I've been following the installation instructions for Slackware on the PinebookPro.

The instructions on installing the boot loader to SPI flash weren't working for me - I could not get the existing system to boot from the SD card, Armbian kept loading. Taking the EMMC out completely did not help - whatever was on the existing SPI would not boot from SD. The Reset and Recovery buttons made no difference.

I eventually found these instructions. I extracted the file spi_loader.img from the Slackware flash-spi-pinebookpro.img and then from the running Armbian system used

Code:
flash_erase /dev/mtd0 0 0
dd if=spi_loader.img of=/dev/mtd0
That worked ok and was much easier and more successful than the "Bypass SPI flash" methods in the instructions. Maybe this could be added as a third method to help if someone already has a running system in place.
 
Old 12-24-2023, 06:45 AM   #2
drmozes
Slackware Contributor
 
Registered: Apr 2008
Distribution: Slackware
Posts: 1,543

Rep: Reputation: 1313Reputation: 1313Reputation: 1313Reputation: 1313Reputation: 1313Reputation: 1313Reputation: 1313Reputation: 1313Reputation: 1313Reputation: 1313
Quote:
Originally Posted by difdif View Post
I've been following the installation instructions for Slackware on the PinebookPro.

The instructions on installing the boot loader to SPI flash weren't working for me - I could not get the existing system to boot from the SD card, Armbian kept loading.
This is good timing! Pine64 sent a replacement mainboard for Slackware's Pinebook Pro, which arrived this week. I know a couple of people here had similar challenges with newer Pinebook Pro's and I was wondering what I might encounter.


Armbian? have they switched from Manjaro?

Where would Armbian have been booting from? the SPI flash is only 128MB so I guess it's possible they have a small footprint OS there. I'll find out what's on mine soon!
If they're still using U-Boot, unless it's been disabled, you can press enter to interrupt the boot sequence and use U-Boot's built-in command to erase the flash, or boot directly from SD card from the U-Boot console/command prompt.

Quote:

I eventually found these instructions. I extracted the file spi_loader.img from the Slackware flash-spi-pinebookpro.img and then from the running Armbian system used

Code:
flash_erase /dev/mtd0 0 0
dd if=spi_loader.img of=/dev/mtd0
That worked ok and was much easier and more successful than the "Bypass SPI flash" methods in the instructions. Maybe this could be added as a third method to help if someone already has a running system in place.
I will add this in. You should be able to get away without flashing the Slackware U-Boot because the immutable first stage boot loader will try booting from SD card if there's nothing in the SPI flash, which will enable you to boot the Slackware flashing image as described in the instructions.

For the documentation: how do you login to the Armbian installation - is there a root password?

Thanks for the post!
 
Old 12-24-2023, 09:42 AM   #3
glorsplitz
Senior Member
 
Registered: Dec 2002
Distribution: slackware!
Posts: 1,308

Rep: Reputation: 368Reputation: 368Reputation: 368Reputation: 368
Quote:
Originally Posted by drmozes View Post
This is good timing! Pine64 sent a replacement mainboard for Slackware's Pinebook Pro, which arrived this week.
Seriously? wow that's cool! Did you contact them or are they checking out things as in -> here?
 
Old 12-24-2023, 09:45 AM   #4
difdif
LQ Newbie
 
Registered: Feb 2004
Distribution: Slackware
Posts: 8

Original Poster
Rep: Reputation: 4
Hi - I'm glad this is good timing!

I bought the Pinebook Pro second hand so I don't know what had been done to it. It came without an EMMC, and initially using Manjaro on an SD card I could not get any life out of it beyond an LED going orange. There is a sticker inside indicating it's a 2019 model.

I bought an EMMC and installed that along with the NVME adapter - still no joy with Manjaro. I switched to the Armbian Bookworm Cinnamon image on an SD and this booted up ok. It has a utility to copy the installation over first to the EMMC, and after booting from that (no SD card needed by that stage) it allowed transfer of the system over to the NVME drive. I might or might not have flashed something to the SPI, I didn't really know what I was doing and can't remember. That all worked - at least I knew the hardware worked although I didn't really want to use Armbian.

From memory the Armbian first start up required setting a user password, but I don't recall setting a root password. Switching to root required entering the user password (seems a strange arrangement after being used to Slackware) - I think in the same way Raspberry Pi OS does.

I then accidentally messed up the Armbian distribution by running a slackware make_world.sh script without really thinking what I was doing. That overwrote most of coreutils in the /bin directory (I think something it needed was missing so instead of creating the coreutils package it overwrote the main filesystem). Login became impossible, but I was later able to log in over ssh.

Logged into Armbian over ssh I could switch to root. apt-get was not functional as ls, rm, mv, cp and many other things had been replaced by symlinks to symlinks in a loop between /bin and /usr/bin. I restored coreutils by copying files from the installation SD card using the version of cp on the SD card to begin the process. This restored the ability to do anything and was about the time I saw you'd put out the instructions for the Pinebook Pro. I ran the flash_erase to get a bootloader that would read SD cards again, to begin moving the machine to Slackware.

Armbian might be worth a look as they have definitely got a boot process that works without the SD card. I think it's relying on the EMMC instead, but I could be wrong. At one point I had an SD with Slackware flash-spi-pinebookpro.img copied to it using dd. Although it would not boot to do the flash write its presence allowed Armbian to boot from the NVME drive without the EMMC present.

It's been a long process and quite a few mistakes and things learnt along the way. I haven't tried the U-Boot commands to overwrite the flash, but maybe that will be useful in future. With the machine being second hand I'm not sure what bootloader was on there to start with really.
 
Old 12-25-2023, 10:40 AM   #5
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,900

Rep: Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050
PinebookPro installation instructions - additional method to update SPI flash

I ended up shorting the SPI flash chip with a pair of tweezers. I have a couple months old pinebook pro and this works. I left my emmc module installed, but flipped the hardware switch to disable.

The main thing is you should also purchase a serial console cable from pine64 and save yourself a lot of headaches.

Edit: I forgot to mention that the reason this works is the pbpro expects to always boot spi flash first if it has anything written to it. Shorting it forces the next in line media to be the SD card.

Last edited by mralk3; 12-25-2023 at 10:47 AM.
 
Old 12-25-2023, 11:57 AM   #6
drmozes
Slackware Contributor
 
Registered: Apr 2008
Distribution: Slackware
Posts: 1,543

Rep: Reputation: 1313Reputation: 1313Reputation: 1313Reputation: 1313Reputation: 1313Reputation: 1313Reputation: 1313Reputation: 1313Reputation: 1313Reputation: 1313
Quote:
Originally Posted by difdif View Post
Armbian might be worth a look as they have definitely got a boot process that works without the SD card. I think it's relying on the EMMC instead, but I could be wrong.
I'll add a note that if you can't prevent the Linux distro booting, you can obtain root and dd a few MB of /dev/zero to /dev/mtd0. That'll suffice to boot the Slackware SD card flashing image.

I replaced the main board in the PbPro yesterday (video coming in Jan), and there either wasn't anything in SPI flash or it was U-Boot which booted from the SD Card (as it will by default).

Slackware opts for an SD card as the /boot location due to its exceptional portability across various Hardware Models. This choice offers flexibility for the OS's root partition to reside on any storage type. The boot loader's limited or unreliable support for storage devices is bypassed by the guaranteed bootability from an SD card. This ensures a reliable boot-up sequence by initiating the OS InitRD/Linux from an SD card, initializing drivers, and enabling stable storage access.

However, the HoneyComb LX2 differs as its firmware allows booting from NVME and the SATA controller, eliminating the necessity for an SD card.

While installing Slackware on the eMMC or placing /boot on it is possible (albeit undocumented), I advise against it due to the eMMC's limited lifespan. In my experience, I unintentionally damaged mine within a month during development.

SD cards share a similar limited lifespan, making them unsuitable for hosting the OS. However, using them for /boot is acceptable due to the minimal I/O demands in that location.
 
Old 12-25-2023, 11:57 AM   #7
drmozes
Slackware Contributor
 
Registered: Apr 2008
Distribution: Slackware
Posts: 1,543

Rep: Reputation: 1313Reputation: 1313Reputation: 1313Reputation: 1313Reputation: 1313Reputation: 1313Reputation: 1313Reputation: 1313Reputation: 1313Reputation: 1313
Quote:
Originally Posted by glorsplitz View Post
Seriously? wow that's cool! Did you contact them or are they checking out things as in -> here?
I asked on the Pine64 forum.
 
  


Reply

Tags
bootloader, flash



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PinebookPro sysfs and kernel justwantin Slackware - ARM 2 09-28-2023 07:55 PM
No sound on PinebookPro justwantin Slackware - ARM 1 09-11-2023 07:45 AM
DTS configuration for SPI BUS with spi-mux Zano Linux - Kernel 0 08-28-2021 12:45 PM
Beginner instructions to install Knoppix on second flash drive on PC using Flash-Knoppix carrt7 Linux - Newbie 1 12-07-2020 12:18 AM
FLASH FLASH XP Home and Samba Fix FLASH FLASH zollodav Linux - Networking 1 02-19-2006 01:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM

All times are GMT -5. The time now is 01:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration