LinuxQuestions.org
Help answer threads with 0 replies.
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 10-05-2016, 02:29 AM   #1
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 1,595
Blog Entries: 2

Rep: Reputation: 391Reputation: 391Reputation: 391Reputation: 391
Arrow Banana PI Slackware and alternate partition layout


hi,
I've got an Banana Pi M1 for the role of an dedicated NAS.

Being able to get it to boot Slackware-current I can report that it works.

However there are wishes open and I try use this thread to address some of my concerns and solutions I found and still seek.

Also I hope this thread to be the reference for users to wishing to get the Banana PI doing other than bare a storage for the LAN.

So far i got:
- Install it with the serial converter and provided howto (kind thanks!)
tips: make sure You have an quality MMC/SD card with good quality contacts

- Booting to OS and running services over network

Didn't check yet:
- SATA (waiting for cables to arrive)

Checked but didn't work:
- USB - one can't just plug a USB device to the B_Pi and have it working. While i have no doubt the hardware woks, there are B_Pi specific issues I'm gonna have to delve in yet and I will report back.


What I want to further investigate and share here:

Booting from a offline editable partition, as R_pi has currently and making a HOWTO
why: To be able to prepare a MMC/SD card and just plug it to serve; To be able to tweak the various boot options (boot sources, OS locations etc, hardware settings)

So far I stuck in building the Linaro tool chain around GCC 4.9 (quite a pile of things?) and then try to make the boot as accessible to editing as practical - with no additional hardware required (in the sense of serial converters or USB cables) besides an Card reader.

I would optionally try to explore the OTG option for building an boot-able partition by the means of only a USB cable - to whatever destination is possible (MMC/USB/SATA) and report the limitations and requirements for each.

P.S.
this will take quite some time and I'm on a tight schedule, so don't hold your breath
 
Old 10-05-2016, 02:49 AM   #2
drmozes
Slackware Contributor
 
Registered: Apr 2008
Location: Surrey, England
Distribution: Slackware
Posts: 854

Rep: Reputation: 642Reputation: 642Reputation: 642Reputation: 642Reputation: 642Reputation: 642
Quote:
Originally Posted by SCerovec View Post
So far i got:
- Install it with the serial converter and provided howto (kind thanks!)
You can also install it using the HDMI port if you change the boot parameters, but I prefer using the serial port because I can paste in the boot parameters in to a terminal easily.

I was wondering whether I could tftp a u-boot script and call it but didn't find out how to do that yet.

Quote:
Checked but didn't work:
- USB - one can't just plug a USB device to the B_Pi and have it working. While i have no doubt the hardware woks, there are B_Pi specific issues I'm gonna have to delve in yet and I will report back.
I have a USB keyboard, ethernet and SD card reader on mine. Is there a particular USB device that doesn't work? Perhaps there is no Kernel module for it.

Quote:
Booting from a offline editable partition, as R_pi has currently and making a HOWTO
I don't know what you mean by offline - if it's plugged into the device then it's online. Do you mean it's inaccessible to Linux once booted? I'm not sure why anybody would want to do this unless you wanted to hide the location of the Kernel and initrd, but then it makes Kernel upgrades a pain.

Quote:
why: To be able to prepare a MMC/SD card and just plug it to serve; To be able to tweak the various boot options (boot sources, OS locations etc, hardware settings)
As I see it you could do this and still have the ready to serve SD card fully visible to the running OS.
Have you looked at the mini root? You can probably modify this to achieve your goal.


Quote:
So far I stuck in building the Linaro tool chain around GCC 4.9 (quite a pile of things?)
Why gcc 4.9 and why the Linaro tool chain?

Once you're done - docs.slackware.com will welcome your project documentation.

Last edited by drmozes; 10-05-2016 at 02:57 AM.
 
Old 10-07-2016, 03:40 PM   #3
justwantin
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Slackware, Slackwarearm
Posts: 752

Rep: Reputation: 92
Quote:
So far I stuck in building the Linaro tool chain around GCC 4.9 (quite a pile of things?)
Have you tried http://crosstool-ng.org? It's a fully automated build that worked for me in Slack 14.1 and in current before 14.2. Didn't use it for much beyond building u-boot. If your bpi m1 is up and running, perhaps you could try x-toolchain

The Bpi M1 is sold by Sinovoip while Banana Pi is sold by Lemaker. I wonder if they are exactly the same now as they were supposedly in first production runs.
 
1 members found this post helpful.
Old 10-09-2016, 06:45 AM   #4
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 1,595

Original Poster
Blog Entries: 2

Rep: Reputation: 391Reputation: 391Reputation: 391Reputation: 391
Red face

Quote:
Originally Posted by drmozes View Post
You can also install it using the HDMI port if you change the boot parameters, but I prefer using the serial port because I can paste in the boot parameters in to a terminal easily.
Thank You for the excellent HOWTO, it helped a lot!
Quote:
I was wondering whether I could tftp a u-boot script and call it but didn't find out how to do that yet.



I have a USB keyboard, ethernet and SD card reader on mine. Is there a particular USB device that doesn't work? Perhaps there is no Kernel module for it.
I just so happen to have an RPi B, the one with the 7805 type of voltage regulator, and anything i tried on B_Pi was off the R_Pi.
It's an desktop USB keyboard i had at hand.
further an USB stick failed to be accessed, so I figured to check for latest u_boot upstream?
Quote:

I don't know what you mean by offline - if it's plugged into the device then it's online. Do you mean it's inaccessible to Linux once booted? I'm not sure why anybody would want to do this unless you wanted to hide the location of the Kernel and initrd, but then it makes Kernel upgrades a pain.



As I see it you could do this and still have the ready to serve SD card fully visible to the running OS.
Have you looked at the mini root? You can probably modify this to achieve your goal.

Nothing as exotic as that, offline simply means off the device:
I always have an alternative PC at hand, and want be able to do "fiddly" stuff wile the OS is offline. Even better yet, to access the boot parameters online while the OS runs and apply them via reboot.
So far, to interact with boot parameters i need be in boot shell? and on a terminal, be it serial or virtual?
Quote:

Why gcc 4.9 and why the Linaro tool chain?
I supposedly need this to build latest u_boot?
BTW it did succeed to build, didn't have time to play with it any further.
Yet.
Quote:
Once you're done - docs.slackware.com will welcome your project documentation.
May I count on Your generous help sir, for final redaction?
 
Old 10-09-2016, 06:56 AM   #5
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 1,595

Original Poster
Blog Entries: 2

Rep: Reputation: 391Reputation: 391Reputation: 391Reputation: 391
Thumbs up

@justwantin
I just coonfigured it in a separate directory than the extracted code:
Code:
$ tar xf ${srcarchive}
$ mkdir ${builddir}
$ cd ${builddir}
$ ../${srcdir}/configure
$ make -j4
for I have a quadcore CPU.
after a while it was done and I need more time to test any further

some pictures will be posted then too
 
Old 10-10-2016, 04:54 AM   #6
drmozes
Slackware Contributor
 
Registered: Apr 2008
Location: Surrey, England
Distribution: Slackware
Posts: 854

Rep: Reputation: 642Reputation: 642Reputation: 642Reputation: 642Reputation: 642Reputation: 642
Quote:
Originally Posted by SCerovec View Post
I always have an alternative PC at hand, and want be able to do "fiddly" stuff wile the OS is offline. Even better yet, to access the boot parameters online while the OS runs and apply them via reboot.
Yes that'd be cool. I think the easiest option is to replace the hard coded u-boot config (as my docs suggest) with a command to load a script from the file system instead -similar to LILO.
That'd be an interesting project to do, but it'd need a fair bit of work I think. Debian has something similar already.

I might have a look into that, although I'd rather someone else works on it as I have no time to commit to it.

Quote:
So far, to interact with boot parameters i need be in boot shell? and on a terminal, be it serial or virtual?
You just need to get access to the u-boot command prompt which is either by serial cable or with a USB keyboard and HDMI.

Quote:
I supposedly need this to build latest u_boot?
You don't need the Linaro toolchain to build u-boot - just any recent gcc.

Quote:
May I count on Your generous help sir, for final redaction?
Depends what it's about and whether I'd have any valuable input, but you can post it here.
 
Old 10-10-2016, 05:06 AM   #7
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 1,595

Original Poster
Blog Entries: 2

Rep: Reputation: 391Reputation: 391Reputation: 391Reputation: 391
Talking

Quote:
Originally Posted by drmozes View Post
Yes that'd be cool. I think the easiest option is to replace the hard coded u-boot config (as my docs suggest) with a command to load a script from the file system instead -similar to LILO.
That'd be an interesting project to do, but it'd need a fair bit of work I think. Debian has something similar already.

I might have a look into that, although I'd rather someone else works on it as I have no time to commit to it.
That's what I was after here
Quote:
You just need to get access to the u-boot command prompt which is either by serial cable or with a USB keyboard and HDMI.

You don't need the Linaro toolchain to build u-boot - just any recent gcc.
mine u_boot somehow failed to build, i will investigate and report back
Quote:

Depends what it's about and whether I'd have any valuable input, but you can post it here.
Excellent
This was exactly what i was hoping for! on to business :
below find the attached first few photos:
The B_Pi front n back
The Keyboard that failed to register
Illustration of an "headless setup" for an NAS (Network Accessible Storage)
Current installation setup - exotic HW requirements.
next post more photos to come...
.. stay tuned ...
Attached Thumbnails
Click image for larger version

Name:	CAN_I_HAZ_PANANA_PIEZ.jpg
Views:	14
Size:	198.2 KB
ID:	23200   Click image for larger version

Name:	B_Pi_back-1GBRAM_n_Alwinner_A20.jpg
Views:	15
Size:	208.0 KB
ID:	23201   Click image for larger version

Name:	Desktop_USB_keyboard.jpg
Views:	16
Size:	189.0 KB
ID:	23202   Click image for larger version

Name:	headless_setup.jpg
Views:	12
Size:	125.2 KB
ID:	23203   Click image for larger version

Name:	HW_lab_setup.jpg
Views:	14
Size:	96.7 KB
ID:	23204  


Last edited by SCerovec; 10-10-2016 at 05:53 AM. Reason: cleared up the build failure
 
Old 10-10-2016, 05:18 AM   #8
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 1,595

Original Poster
Blog Entries: 2

Rep: Reputation: 391Reputation: 391Reputation: 391Reputation: 391
Post

... last time on armed kitchen (the series )...

my best case scenario:

I get to install the u_boot SPL "behind" the partition sectors (track zero)
this loads the script from an filesystem (preferably ext4)
this script handles loading the:
  1. kernel
  2. intrd
  3. commandline parameters
and that script resides on the root partition

compromises:
- I can accept a small boot partition as Debian uses ATM
- I can accept multi stage boot as long as i end up having said script in userspace and runtime.

TBD:
if there are any and which differences of my B_pi and Lemaker's Banana-pro and Banana-pi?

Those who can, please post photos of involved devices?

more photos:
The fel-key (USB boot enable key) etc
SATA connectors and USB-power plug
yet another top view
an cordless input pad planned for use
reference: R_pi model B
Attached Thumbnails
Click image for larger version

Name:	FEL_key_GLAN_twinUSB_n_IRsens.jpg
Views:	10
Size:	142.3 KB
ID:	23205   Click image for larger version

Name:	SATA_power_HDMI_n_FEL-key.jpg
Views:	11
Size:	158.0 KB
ID:	23206   Click image for larger version

Name:	inbuild_mic_UART_RC-jack_etc.jpg
Views:	11
Size:	201.9 KB
ID:	23207   Click image for larger version

Name:	Wireless_HID_pad.jpg
Views:	12
Size:	102.6 KB
ID:	23208   Click image for larger version

Name:	hoorible_photo_R_Pi_mod_B.JPG
Views:	17
Size:	169.1 KB
ID:	23209  


Last edited by SCerovec; 10-10-2016 at 05:51 AM. Reason: added photo
 
Old 10-10-2016, 06:24 AM   #9
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 1,595

Original Poster
Blog Entries: 2

Rep: Reputation: 391Reputation: 391Reputation: 391Reputation: 391
one of the non obvious dependencies:
Code:
dtc
device-tree-compiler
to be installed by sbotools or any other preferred method
 
Old 10-10-2016, 07:57 AM   #10
drmozes
Slackware Contributor
 
Registered: Apr 2008
Location: Surrey, England
Distribution: Slackware
Posts: 854

Rep: Reputation: 642Reputation: 642Reputation: 642Reputation: 642Reputation: 642Reputation: 642
Quote:
Originally Posted by SCerovec View Post
one of the non obvious dependencies:
Code:
dtc
device-tree-compiler
to be installed by sbotools or any other preferred method
This is the same thing, and it's in the 'd' series on ARM (d/device-tree-compiler) but I don't include a build script for x86/64.
 
Old 10-10-2016, 08:26 AM   #11
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 1,595

Original Poster
Blog Entries: 2

Rep: Reputation: 391Reputation: 391Reputation: 391Reputation: 391
dtc (see above) and the Linaro toolchain are needed to build a custom (more recent?) banana pi u_boot image.
I build it on my x86 host, so I must cross compile it, so I happen to need Linaro's toolchain?
Allthough this time i use the pre-built one, and this way i harness the Slackware's legendary binary compatibility , but note it's a 64bit package!

further:
Note: "SPL" stands for "Secondary Program Loader"
(from the u_boot README)

...getting there here some of the path passed already:
Quote:
Toolchain HOWTOs:
https://eewiki.net/display/linuxonar...ssCompiler:GCC
(note: ~180Mb download)

URIs:
http://www.linaro.org/downloads/
Code:
wget -c https://releases.linaro.org/components/toolchain/binaries/5.3-2016.05/arm-linux-gnueabihf/gcc-linaro-5.3.1-2016.05-x86_64_arm-linux-gnueabihf.tar.xz
tar xf gcc-linaro-5.3.1-2016.05-x86_64_arm-linux-gnueabihf.tar.xz
export CC=`pwd`/gcc-linaro-5.3.1-2016.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
${CC}gcc --version #<== note it's 5.3.1 and not shipped 5.3.0 of Slackware!
make ARCH=arm CROSS_COMPILE=${CC} distclean
make ARCH=arm CROSS_COMPILE=${CC} Bananapi_defconfig
make ARCH=arm CROSS_COMPILE=${CC} xconfig # <== note: here i tweak the config a bit ;)
make ARCH=arm CROSS_COMPILE=${CC}

...
  COPY    spl/u-boot-spl.bin
  CFG     spl/u-boot-spl.cfg
  MKSUNXI spl/sunxi-spl.bin
  OBJCOPY u-boot-nodtb.bin
  CAT     u-boot-dtb.bin
  COPY    u-boot.bin
  MKIMAGE u-boot.img
  CAT     u-boot-sunxi-with-spl.bin
  OBJCOPY u-boot.srec
  SYM     u-boot.sym
  CFG     u-boot.cfg
  COPY    u-boot.dtb
  MKIMAGE u-boot-dtb.img
... stay tuned ...
 
Old 10-10-2016, 08:29 AM   #12
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 1,595

Original Poster
Blog Entries: 2

Rep: Reputation: 391Reputation: 391Reputation: 391Reputation: 391
Quote:
Originally Posted by drmozes View Post
This is the same thing, and it's in the 'd' series on ARM (d/device-tree-compiler) but I don't include a build script for x86/64.
But i didn't know about this, this is why I choose to mention it, as it's not a common knowledge thing among x86 dwellers

the device three is altogether a fresh thing for me too...

Cross compiling the more even , but i manage somehow...

Kind thanks for the support, hope i don't spam anyone?
 
Old 10-10-2016, 09:49 AM   #13
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 1,595

Original Poster
Blog Entries: 2

Rep: Reputation: 391Reputation: 391Reputation: 391Reputation: 391
Cool

so, having built all the files needed, it's time we prepare our SD card to carry the OS.
I recommend Gparted, as there is a separate live CD as well as a package for Slackware.
BEWARE:
with Gparted one can easily destroy mountains of data; Use with extreme caution and mandatory backup!
- note to self: warning issued - conscience clear.

attached please find images of proposed partition layout
after tayloring Your space, navigate to the build dir of the u-boot and execute as root:
Code:
# dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8
where /dev/sdb is Your future MMC card and not Yout host OS disk!

now it's time to sync and perform an eject just to be sure.

next time we work on boot.cmd and the
Code:
/boot
directory.

If You accidentally have erased Your hard drive now is a good time to panic, otherwise have a nice time.

P.S.
only reason to use an FAT primary boot partition is to have the boot editable by an non GNU OS, which I find by itself ridiculous, as usually we want to provide an vmlinuz/zImage and probably a proper initrd? Am i wrong? Would they be downloaded anyway, and I just am sawing the branch I'm sitting on by this choice? I mean even Androids read ext4 by now?
this:https://www.paragon-software.com/home/extfs-windows/
Attached Thumbnails
Click image for larger version

Name:	Partitions32GB.jpg
Views:	14
Size:	42.3 KB
ID:	23210  

Last edited by SCerovec; 10-10-2016 at 10:01 AM. Reason: reconsideration^2
 
Old 10-10-2016, 12:27 PM   #14
drmozes
Slackware Contributor
 
Registered: Apr 2008
Location: Surrey, England
Distribution: Slackware
Posts: 854

Rep: Reputation: 642Reputation: 642Reputation: 642Reputation: 642Reputation: 642Reputation: 642
Quote:
Originally Posted by SCerovec View Post
only reason to use an FAT primary boot partition is to have the boot editable by an non GNU OS, which I find by itself ridiculous, as usually we want to provide an vmlinuz/zImage and probably a proper initrd? Am i wrong? Would they be downloaded anyway, and I just am sawing the branch I'm sitting on by this choice? I mean even Androids read ext4 by now?
this:https://www.paragon-software.com/home/extfs-windows/
Just bare in mind that the Slackware packaging for the Kernels use symlinks and expect /boot to have a file system compatible with them, and for this u-boot only supports ext2/3/4 (as far as I know).

Last edited by drmozes; 10-10-2016 at 12:33 PM.
 
1 members found this post helpful.
Old 10-10-2016, 01:01 PM   #15
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 1,595

Original Poster
Blog Entries: 2

Rep: Reputation: 391Reputation: 391Reputation: 391Reputation: 391
Post

Quote:
Originally Posted by drmozes View Post
Just bare in mind that the Slackware packaging for the Kernels use symlinks and expect /boot to have a file system compatible with them, and for this u-boot only supports ext2/3/4 (as far as I know).
One more reason we go for ext4, so ext4 it is:

I just finished doing the initial booting phase:
boot.cmd file:
Code:
setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p1 rootwait panic=10 ro
setenv fdt_addr 0x43000000
setenv kernel_addr_r 0x47000000
setenv ramdisk_addr_r 0x48000000

load mmc 0:1 ${fdt_addr} boot/dtb/${fdtfile}
load mmc 0:1 ${kernel_addr_r} boot/zImage-armv7
load mmc 0:1 ${ramdisk_addr_r} boot/initrd-armv7

fdt addr ${fdt_addr} 0x40000
bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr}
here is obvious that I used the values from the excellent HOWTO

next it has to be converted to boot.scr by means of the following command:
Code:
mkimage -C none -A arm -T script -d boot.cmd boot.scr
the mkimage is built in the tools directory of the u-boot tree.

if not converted it won't boot.

before partitioning the MMC card, it is strongly advised to zero out the beginning of the medium:
Code:
dd if=/dev/zero of=/dev/sdb count=4k
and start from scratch, as the environment of the SPL is maintained "in between" any managed storage space - only manual zeroing "takes care".

further I intend to check and document the method of LAN based installation:

best case:

1. zero out the beginning
2. make "empty dos label"
3. tailor MMC/SSD card partitions
4. put setup to boot from "ROOT" partition into RAM (pre-built /boot.scr file )
5. upload "our stuff" to "HOME"/ftp/pub/slackwarearm for installation
6. boot to online ssh server
7. accept a login to setup

therefrom it would be straight forward?

and to end setup with copying the (canonic?) /boot.scr file over the one belonging to setup?

note: the boot.scr seems to need be in the root directory of an partition?
...to be continued...
 
  


Reply

Tags
arm7, bananam1, boot, install, slackware


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
slackware arm on banana pi? inkscape Slackware - ARM 8 06-14-2015 04:39 AM
[SOLVED] Alternate keyboard layout in Openbox kexolino Linux - Newbie 1 07-03-2011 06:34 AM
Modifying partition layout & partition order rm_-rf_windows Linux - General 3 06-28-2007 05:16 AM
alternate partition table format for linux trabant Linux - Software 0 09-21-2005 08:27 AM
Installing gentoo with an alternate partition scheme Goatdemon Linux - Distributions 3 03-26-2003 04:27 AM

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

All times are GMT -5. The time now is 01:51 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration