LinuxQuestions.org
Review your favorite Linux distribution.
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 01-24-2020, 09:02 PM   #1
justwantin
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Slackware, Slackwarearm
Posts: 878

Rep: Reputation: 120Reputation: 120
Slackwarearm on an Orangepi Zero 512MB DDR


I recently purchased an Orangepi Zero 512 with expansion board and case for a data logging project A Bananapi Pro with an SSD drive was a little too much for the job and I liked the idea of 3 USB ports.

While the Orangepi Zero is not supported it is possible to install Slackwarearm current on it. Hopefully what follows will be or use to someone else with an Orangepi Zero or some other unsupported board.

I had earlier built a bootable sdcard.img for the Zero using buildroot on my x86 desktop so I had both the the u-boot-sunxi-with-spl.bin plus a known good dtb all file. Here's a good tutorial on using buildroot. For the Orangepi Zero use orangepi_zero_defconfig.
Code:
bash-5.0$ ls opi-buildroot/output/images
boot.scr     rootfs.ext4		      u-boot-sunxi-with-spl.bin
boot.vfat    sdcard.img			      u-boot.bin
rootfs.ext2  sun8i-h2-plus-orangepi-zero.dtb  zImage
To set up the sdcard I first wiped the sdcard partition table, then used dd to copy the u-boot-sunxi-with-spl.bin to the sdcard. I created created and formatted an ext4 partition on the card after which I copied sun8i-h2-plus-orangepi-zero.dtb, isolinux/initrd-armv7.img and kernels/armv7/zImage-armv7 to the sdcard.
Code:
dd if=/dev/zero of=/dev/sdx bs=1M count=1

dd if=u-boot-sunxi-with-spl.bin of=/dev/sdx bs=1024 seek=8

<snipped>
Device     Boot Start    End Sectors  Size Id Type
/dev/sdd1  *     2048 411647  409600  200M 83 Linux

bash-5.0# ls
boot.cmd  initrd-armv7.img		   zImage-armv7
boot.scr  sun8i-h2-plus-orangepi-zero.dtb
I use a a boot.cmd file create a boot.scr (image) which tells u-boot what to do. U-boot will look for boot.scr in the first partion of the sdcard.
Code:
# boot.cmd to boot from first partition on an SD card
#
setenv fdt_addr 0x43000000
setenv kernel_addr_r 0x47000000
setenv ramdisk_addr_r 0x48000000
setenv bootargs console=ttyS0,115200n8 TERM=screen-256color root=/dev/mmcblk0p1 rw waitforroot=3 rootfstype=ext4
#
ext4load mmc 0:1 ${fdt_addr} sun8i-h2-plus-orangepi-zero.dtb
ext4load mmc 0:1 ${kernel_addr_r} zImage-armv7
ext4load mmc 0:1 ${ramdisk_addr_r} initrd-armv7.img
bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr}
#
# Create u-boot boot image named boot.scr with:
# mkimage -C none -A arm -T script -d boot.cmd boot.scr
After using this boot.cmd to create a boot.scr with the command on the last line of boot.cmd I was able to boot into the slackwarearm installer on the Orangepi Zero. Then I reformatted the sdcard inserted a usb stick with the slackwarearm source and installed slackwarearm. After the install I copied in a new boot.cmd and set it up to boot the zImage and initrd.img now installed in the /boot directory

Theres not much grunt in the Orangepi Zero. An install of the a, ap, d, k, l, n and tcl package groups took around 2 1/2 hours and I really didn't need everything installed so I decided to install the slackwarearm mini root filesystem and then install whatever else I needed when I needed it. I set up a boot, swap and root partion on my sdcard.
Code:
<snipped>
Device     Boot   Start      End  Sectors  Size Id Type
/dev/sdd1  *       2048   309247   307200  150M 83 Linux
/dev/sdd2        309248  1382399  1073152  524M 82 Linux swap
/dev/sdd3       1382400 15523839 14141440  6.8G 83 Linux
Next I downloaded the mini root file system, installed the kernel and modules to the mini root filesystem,
Code:
ROOT=miniroot-01142020/ installpkg slackwarearm-current/slackware/a/kernel*.txz

bash-5.0# ls /mnt/sdd1
System.map-armv7	 dtb		      sun8i-h2-plus-orangepi-zero.dtb
System.map-armv7-5.4.10  dtb-5.4.10	      zImage-armv7
boot.cmd		 initrd-armv7	      zImage-armv7-5.4.10
boot.scr		 initrd-armv7-5.4.10		config-armv7-5.4.10
copied the contents of the mini root boot directory to the first (/boot) partition and copied everything else, except /boot, to the third (/) partition. /etc/rc.d/rc.keymap had to be changed since I use a US keymap, I had to edit /etc/fstab and new boot.cmd was required.
Code:
<snipped>
/dev/mmcblk0p1	/boot	ext4	errors=remount-ro   0  1
/dev/mmcblk0p2	none	swap	sw		    0  0
/dev/mmcblk0p2  /	ext4	errors=remount-ro   0  1

# boot.cmd to boot from /boot on first partition on an SD card
# withh root on the 3rd partition.
#
setenv fdt_addr 0x43000000
setenv kernel_addr_r 0x47000000
setenv ramdisk_addr_r 0x48000000
setenv bootargs console=ttyS0,115200n8 root=/dev/mmcblk0p3 rw waitforroot=3 rootfstype=ext4
#
ext4load mmc 0:1 ${fdt_addr} sun8i-h2-plus-orangepi-zero.dtb
ext4load mmc 0:1 ${kernel_addr_r} zImage-armv7
ext4load mmc 0:1 ${ramdisk_addr_r} initrd-armv7
bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr}
#
# Create u-boot boot image named boot.scr with:
# mkimage -C none -A arm -T script -d boot.cmd boot.scr
After booting into the new system I could then mount a USB stick with the Slackwarearm source and use installpkg to install anything else I need.

Interestingly changing one line of the boot.cmd directly above will allow me to boot this same system on this sdcard on one pf my Bananapi Pro's if I have the DTB directory installed in /boot.
Code:
ext4load mmc 0:1 ${fdt_addr} sun8i-h2-plus-orangepi-zero.dtb
# Change to:
ext4load mmc 0:1 ${fdt_addr} dtb/sun7i-a20-bananapro.dtb

Last edited by justwantin; 01-26-2020 at 10:20 AM. Reason: tyop
 
Old 01-26-2020, 08:46 AM   #2
drmozes
Slackware Contributor
 
Registered: Apr 2008
Distribution: Slackware
Posts: 1,552

Rep: Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314
Hi Justin

Quote:
Originally Posted by justwantin View Post
I recently purchased an Orangepi Zero 512 with expansion board and case for a data logging project A Bananapi Pro with an SSD drive was a little to much for the job and I liked the idea of 3 USB ports.
Thanks for posting this. I don't have one of these so it's good to know that it works.


The orange Pi zero SD card images and u-boot binary are on the FTP site already - they're just not mentioned within the installation documents:
Code:
root@zippy:~/armedslack/boardsupport/u-boot/bin# ls -la orange*zero*
lrwxrwxrwx 1 root root     48 Dec  4 12:34 orangepi_zero.sdcard_latest.img.xz -> orangepi_zero.u-boot-2020.01-rc4_1_sdcard.img.xz
-rw-r--r-- 1 root root 212080 Dec  4 12:32 orangepi_zero.u-boot-2020.01-rc4_1.bin.xz
-rw-r--r-- 1 root root 212956 Dec  4 12:34 orangepi_zero.u-boot-2020.01-rc4_1_sdcard.img.xz
lrwxrwxrwx 1 root root     41 Dec  4 12:26 orangepi_zero.u-boot-latest.bin.xz -> orangepi_zero.u-boot-2020.01-rc4_1.bin.xz
root@zippy:~/armedslack/boardsupport/u-boot/bin#
The DTB is also installed with the kernel_armv7 package. The only missing thing is the pre-built u-boot script to boot the Slackware installer (to save pasting in the commands to the u-boot console). I've added that in for the next batch.

Quote:
# mkimage -C none -A arm -T script -d boot.cmd boot.scr[/CODE]After using this boot.cmd to create a boot.scr with the command on the last line of boot.cmd I was able to boot into the slackwarearm installer on the Orangepi Zero.
This is good to know, too. I wasn't sure how well the installer would work on machines with <1GB - because the installer itself (once unpacked into RAM) occupies a large memory footprint.


Quote:
Interestingly changing one line of the boot.cmd directly above will allow me to boot this same system on this sdcard on one pf my Bananapi Pro's if I have the DTB directory installed in /boot.
Code:
ext4load mmc 0:1 ${fdt_addr} sun8i-h2-plus-orangepi-zero.dtb
# Change to:
ext4load mmc 0:1 ${fdt_addr} dtb/sun7i-a20-bananapro.dtb
Yep, this is the purpose of the DTB system. You have a generic Kernel, and the DTBs are the 'map' of the hardware - as there's no way in ARM to probe the physical environment.

I can't add this as "supported" because I don't have one: perhaps you might want to document this on docs.slackware.com under the ARM section? but you can make it easier since the u-boot binaries et al are already present.

Last edited by drmozes; 01-26-2020 at 08:50 AM.
 
1 members found this post helpful.
Old 01-26-2020, 10:18 AM   #3
justwantin
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Slackware, Slackwarearm
Posts: 878

Original Poster
Rep: Reputation: 120Reputation: 120
@drmozes
Quote:
The orange Pi zero SD card images and u-boot binary are on the FTP site already
Yeah, I see them. I'll do a test drive tomorrow.
Quote:
The DTB is also installed with the kernel_armv7 package.
I got stuck in a rut. Couldn't build a u-boot-sunxi-with-spl.bin on u-boot-01-2020-rc5 that would let me boot a kernel. Maybe the problem was my own but the buildroot u-boot-sunxi-with-spl.bin and dtb blob were working ok so I used them.
Quote:
The only missing thing is the pre-built u-boot script to boot the Slackware installer (to save pasting in the commands to the u-boot console). I've added that in for the next batch.
I've been installing and booting with u-boot scripts for awhile now. Once I understood how to use them they seemed an easier way to go.
Quote:
This is good to know, too. I wasn't sure how well the installer would work on machines with <1GB - because the installer itself (once unpacked into RAM) occupies a large memory footprint.
It takes no time at all to bring up the installer on the zero. no noticeable delay working through setup. I did another install today with 1GB swapon before running setup seems to have cut time to install packages by around 30 minutes but it was still slow going.
Quote:
perhaps you might want to document this on docs.slackware.com under the ARM section?
Yup ... thought about adding to the wiki. Maybe if I figure out how to do that I'll also do one about enabling the two usb ports on the zero's expansion board as well.

Cheers
 
Old 01-27-2020, 09:36 AM   #4
justwantin
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Slackware, Slackwarearm
Posts: 878

Original Poster
Rep: Reputation: 120Reputation: 120
Quote:
The orange Pi zero SD card images and u-boot binary are on the FTP site already - they're just not mentioned within the installation documents:
Both your orangepi-zero img and bin worked just fine today. Brings up u-boot just fine but had to to pipe the xzcat output to dd with the bin file.
Code:
xzcat orangepi_zero.u-boot-latest.bin.xz | dd of=/dev/sdxx bs=1024 seek=8
Quote:
I wasn't sure how well the installer would work on machines with <1GB - because the installer itself (once unpacked into RAM) occupies a large memory footprint.
This what free looks like with 512MB swapon before running setup.
Code:
root@slackware:/# free
              total        used        free      shared  buff/cache   available
Mem:         505068       43096      362732           0       99240      368500
Swap:        524284           0      524284
Quote:
The only missing thing is the pre-built u-boot script to boot the Slackware installer (to save pasting in the commands to the u-boot console). I've added that in for the next batch.
After having a squiz at your uboot.build script I had a go today at a script that automates setting up an sdcard for an Orangpi Zero install with everything needed to run a non-tftp install in the first partition of the sdcard which can then become /boot. Had me thinking of long ago Sarpi installs.
Code:
Device         Boot   Start      End  Sectors  Size Id Type
/dev/mmcblk0p1 *       2048   411647   409600  200M 83 Linux
/dev/mmcblk0p2       411648  1460223  1048576  512M 82 Linux swap
/dev/mmcblk0p3      1460224 15523839 14063616  6.7G 83 Linux

root@slackware:/# ls /mmcblk0p1/
boot.cmd  dtb/       initrd-armv7.img  zImage-armv7
boot.scr  finis.sh*
That script finis.sh is to be run in /mnt/boot post install to edit boot.cmd, run mkimage and do a little housekeeping.

Last edited by justwantin; 01-27-2020 at 09:40 AM.
 
2 members found this post helpful.
  


Reply

Tags
buildroot, install slackwarearm, orangpi zero



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
OrangePi 4's defconfig dodoLQ Slackware - ARM 2 01-14-2020 05:59 AM
HDMI audio on orangepi pc v 1.2 interndan Slackware - ARM 2 12-27-2019 09:45 AM
Orangepi - any one with experience? using GPIO? pmknkaek Linux - Embedded & Single-board computer 6 06-16-2019 09:21 PM
HP pav 2200+ 1.8ghz 512 MB DDR 80 gig hhd +32 ddr sdram Puppy install brucek50 Puppy 2 12-22-2010 09:05 AM
Best Optimization Flags for a 512mb (ddr) equipped Athlon XP 1.8 ghz? haimeltjnfg Linux - Software 4 08-30-2004 12:52 AM

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

All times are GMT -5. The time now is 12:54 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
Open Source Consulting | Domain Registration