openSUSE:OpenSUSE on your ARM board

Jump to: navigation, search

openSUSE on your ARM board

Pre-built images for ARM boards are available:

Click on your board and follow instructions.

If no pre-built images are available for your board, download the root file system (aarch64 rootfs or armv7 rootfs) below.

Geeko-white.png
Tumbleweed aarch64
http://download.opensuse.org/ports/aarch64/tumbleweed/appliances/
Geeko-white.png
Tumbleweed armv7
http://download.opensuse.org/ports/armv7hl/tumbleweed/appliances/
Geeko-white.png
Leap 15.2 aarch64
http://download.opensuse.org/ports/aarch64/distribution/leap/15.2/appliances/
Geeko-white.png
Leap 15.2 armv7
http://download.opensuse.org/ports/armv7hl/distribution/leap/15.2/appliances/

And make your own SD card to boot on, with first bootloader (manufacturer specific), U-Boot (configured for your board) and a kernel (configured for your board) if openSUSE does not provide it.

root password for the openSUSE prebuilt images is linux

Building an upstream kernel or u-boot

openSUSE provides ARM crosscompilers. Some examples of building a kernel (note: the 32bit defconfigs typically do not include EFI support and you will need that to boot so you need to adjust the config)

zypper in cross-arm-gcc7 cross-aarch64-gcc7
make ARCH=arm CROSS_COMPILE=arm-suse-linux-gnueabi- O=/scratch/arm-kernel sunxi_defconfig
make ARCH=arm CROSS_COMPILE=arm-suse-linux-gnueabi- O=/scratch/arm-kernel -j16
make ARCH=arm64 CROSS_COMPILE=aarch64-suse-linux- O=/scratch/arm64-kernel defconfig
make ARCH=arm64 CROSS_COMPILE=aarch64-suse-linux- O=/scratch/arm64-kernel -j16

Booting from network

First, download the JeOS rootfs and install archives as explained above.

$ mkdir rootfs
$ sudo tar xJf openSUSE-*-ARM-*.tar.xz -C rootfs

Set up QEMU translation for ARM binaries:

# zypper in qemu-linux-user
# qemu-binfmt-conf.sh

Prepare the environment:

# mount --bind /proc rootfs/proc
# mount --bind /sys rootfs/sys
# mount --bind /dev rootfs/dev
# cp /etc/resolv.conf rootfs/etc/
# cp /usr/bin/qemu-arm* rootfs/usr/bin
# chroot rootfs

If you use this for an aarch64 system, copy /usr/bin/qemu-aarch64* instead.

You can now run commands like you would on an ARM board, for example:

# zypper in grub2-efi
# grub2-mknetdir  --net-directory=/srv/tftpboot --subdir=/boot/grub2-armv7
# zypper up
# zypper in tftpboot-installation-openSUSE-Tumbleweed-armv7hl
# zypper in -d u-boot-orangepizero
# zypper in dtb-sun8i

Use --subdir with grub2-mknetdir so that you can write separate grub.cfg for each architecture. You will need to load different kernel binary on each.

Once you're done, type

# exit

and you're back in your previous filesystem.

And do not forget to umount proc, sys and dev:

# umount rootfs/proc
# umount rootfs/sys
# umount rootfs/dev

You can use u-boot binaries with vendor-specific tools to install/boot u-boot on your board.

You can use the tftpboot directory you created to for a netboot installation source.

You now should have rootfs/srv/tftpboot/boot/grub2-something/ containing arm-efi or arm64-efi subdirectory.

Edit the grub2.cfg there to contain something like

menuentry 'Tumbleweed Install' {
echo Loading linux
linux (tftp)openSUSE-Tumbleweed-armv7l/boot/armv7l/linux instsys=tftp://<your tftp server>/openSUSE-Tumbleweed-armv7l/boot/armv7l/root install=http://download.opensuse.org/ports/armv7hl/tumbleweed/repo/oss/ console=ttyS0,115200 loglevel=6 earlyprintk=serial
echo Loading initrd
initrd (tftp)openSUSE-Tumbleweed-armv7l/boot/armv7l/initrd
echo booting
boot
}

menuentry 'Tumbleweed Rescue' {
echo Loading linux
linux (tftp)openSUSE-Tumbleweed-armv7l/boot/armv7l/linux instsys=tftp://<your tftp server>/openSUSE-Tumbleweed-armv7l/boot/armv7l/root rescue=http://download.opensuse.org/ports/armv7hl/tumbleweed/repo/oss/ console=ttyS0,115200 loglevel=6 earlyprintk=serial
echo Loading initrd
initrd (tftp)openSUSE-Tumbleweed-armv7l/boot/armv7l/initrd
echo booting
boot
}

You can also use something like

set arch=armv7hl
set kernelarch=armv7l
source /boot/grub2/grub.cfg

and replace armv7l and armv7hl with $kernelarch and $arch in the above example to get one menu for all architectures.

Move this grub directory to /srv/tftpboot on your machine and install a dhcp and tftp server. Create a directory for your distribution as well and put the files from install.tar there. Example:

mv rootfs/srv/tftpboot/boot /srv/tftpboot

or if you already have grub for different platform

mv rootfs/srv/tftpboot/boot/grub2-* /srv/tftpboot/boot/

Move the tftpboot images data from the rootfs

mv rootfs/usr/share/tftpboot-installation/openSUSE-Tumbleweed-armv7l /srv/tftpboot

u-boot looks for a device tree in /dtb on the tftp server. It is useful to provide current device tree because the one shipped in u-boot typically lags behind what is in the kernel.

mkdir /srv/tftpboot/dtb/
cp -v roofs.armv7/boot/dtb-*/*.dtb
cp sun8i-h2-plus-orangepi-zero.dtb /srv/tftpboot/dtb/

Now if you configure the dhcp server to send boot/grub2-armv7/arm-efi/core.efi your board should boot the grub2.cfg file you just wrote. You can use the below boot command if the default bootscript does not boot load grub from network:

dhcp ${kernel_addr_r} && tftpboot ${fdt_addr_r} dtb/${fdtfile} && bootefi ${kernel_addr_r} ${fdt_addr_r}

If you want to use the same dhcp configuration with multiple platforms you will need to differentiate the platform by the DHCP options the board sends. For u-boot the armv7 dhcp discover packet looks like this:

  Client-Ethernet-Address 02:42:49:9c:98:f8 (oui Unknown)
  Vendor-rfc1048 Extensions
    Magic Cookie 0x63825363
    DHCP-Message Option 53, length 1: Discover
    MSZ Option 57, length 2: 576
    ARCH Option 93, length 2: 21
    NDI Option 94, length 3: 1.0.0
    Vendor-Class Option 60, length 12: "U-Boot.armv7"
    Parameter-Request Option 55, length 5: 
      Subnet-Mask, Default-Gateway, Domain-Name-Server, Hostname
      RP

Which corresponds to 32bit u-boot configuration

CONFIG_BOOTP_PXE_CLIENTARCH=0x15 (21)
CONFIG_BOOTP_VCI_STRING="U-Boot.armv7"

For Raspberry Pi 3b+ 64bit u-boot you get

CONFIG_BOOTP_PXE_CLIENTARCH=0x16 (22)
CONFIG_BOOTP_VCI_STRING="U-Boot.armv8"

For Pi Zero (armv6) you get

CONFIG_BOOTP_PXE_CLIENTARCH=0x15 (21)
CONFIG_BOOTP_VCI_STRING="U-Boot.arm"

dnsmasq example:

dhcp-vendorclass=set:armv6,U-Boot.arm
dhcp-vendorclass=set:armv7,U-Boot.armv7
dhcp-vendorclass=set:arm64,U-Boot.armv8
dhcp-boot=tag:armv6,boot/grub2-armv6/arm-efi/core.efi,tftpserver,10.11.12.13
dhcp-boot=tag:armv7,boot/grub2-armv7/arm-efi/core.efi,tftpserver,10.11.12.13
dhcp-boot=tag:arm64,boot/grub2-arm64/arm64-efi/core.efi,tftpserver,10.11.12.13

See also