HCL:Raspberry Pi2

Jump to: navigation, search
Raspberry Pi 2

The Raspberry Pi 2 is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video.

Technical Data

openSUSE in Raspberry Pi 2

Writing a disk image to the SD card

  1. Download the image you want (Leap is stable, Tumbleweed is rolling) from here:
    Geeko-white.png
    Tumbleweed
    JeOS image E20 image XFCE image LXQT image GNOME image KDE image X11 image

    If the direct links above do not work for you, please check the general download directory for the images.

  2. As root extract the image onto your SD card (replace sdX with the device name of your SD card).
    WARNING: all previous data on the SD card will be lost. Check first if the device you have selected is really your SD card!
     xzcat [image].raw.xz | dd bs=4M of=/dev/sdX iflag=fullblock oflag=direct status=progress; sync
  3. Insert the SD card with the openSUSE image into your board.
  4. Connect the board to your PC via serial port (optional, but helpful for debugging; USB-TTL serial cable needed).
  5. Connect the board to your monitor (via DVI/HDMI, optional).
  6. Power on the board.
  7. Walk through the first boot steps.
  8. Ethernet is configured to request an IP via DHCP, check your DHCP server for the board IP if used.
  9. Have a lot of fun...
Default login is root:linux, works on serial console, via ssh, GUI.

Tips for openSUSE Tumbleweed (upstream)

If you don't see any kernel output on serial or HDMI, you can add earlycon=pl011,0x3f201000,115200n8 to the kernel command line (e.g., by editing the GRUB menu item).

First start / Login

The SD card is formatted in the traditional DOS format. On the first boot with this micro SD card, the card will be repartitioned by the image to have 3 partitions and will be in the GPT format (GUID Partition Table):

  1. a small FAT partition
  2. a large EXT4 partition (takes whatever the other 2 leave behind)
  3. a SWAP partition.

In case after first start a reboot does not work the GPT backup at the end of the card (1024 bytes) may have confused the system. In that case clear that part of the SD card using the script:

 card=/dev/sdX
 ssize=$(/usr/sbin/blockdev --getss $card)
 [ $ssize -ne 512 ] && echo "sectorsize not equal 512" && exit 1
 size=$(/usr/sbin/blockdev --getsz $card)
 dd if=/dev/zero of=$card obs=$ssize seek=$(($size-2)) count=2

Additional software for Raspberry Pi 2

Some additional software is available for Raspberry Pi 2. Some are in official openSUSE repositories, others are in Packman repositories.

Packman repos

Please follow instructions from Additional_package_repositories#Packman

Multimedia

In multimedia software, you may want to install:

  • omxplayer: a command line media player making use of Raspberry Pi 2 video hardware acceleration
  • kodi-noX-raspberry-pi2: a media center (without X server and including Raspberry Pi 2 video hardware acceleration)

Configuring the openSUSE system on the Raspberry Pi 2

Using the system headless

A headless system does not have a display and a keyboard connected. It is only connected to the network using the UTP interface.

  1. After inserting the micro-SD card, connecting to Ethernet and connecting power, the system will start and partition the SD card as shown above. It will also start the ssh daemon. Although the lights on the Ethernet port show an active connection it may take up to 10 minutes before the system can accept an ssh connection.
  2. Connect to the system using ssh and the login information, user: root password: linux and the IP address the system received from your DHCP server in your network. You may need to consult the DHCP server to find the given IP address.
  3. Use zypper to install the necessary services and applications (the system already contains a link to the repository containing this software).
  4. If you are not familiar using config files for services and application, but you are using YaST, you can install a number of YaST modules and use the ncurses interface to YaST to configure your system.

SuSEfirewall2

Icon-warning.png
Warning: The openSUSE image does not have a firewall installed by default!

To install Firewall and manage it with YaST2, you need to install Yast2 and iptables:

 zypper install yast2-firewall iptables SuSEfirewall2

Configure Boot & System startup parameters /boot/config.txt

Icon-warning.png
Warning: You may need to adjust some parameters in the file config.txt (see openSUSE:Raspberry_Pi#Custom_configuration:_config.txt) in the DOS partition to have a proper display on your screen.

Using a keyboard

Icon-warning.png
Warning: As default you will get an American keyboard layout. Keep this in mind, when entering the password ...
  1. Manual way of updating keyboard :
 
 zypper install vim
 vi /etc/sysconfig/keyboard
  1. Change to i.e. ( sample for standard german 105 keytype´s) :
  KEYTABLE="de-latin1-nodeadkeys"

reboot your Pi after changes.

Manual Network Setup for Static IP

Steps to Setup Static Network on Factory OpenSuSE Image below
Assume your network is an Class C 192.168.1.x with Router/gateway/dns a at .1 and your local domain called "local" -- note that a .local domain does break several things. Use f.e. "invalid" instead


echo "default 192.168.1.1 - -" >/etc/sysconfig/network/routes

cp -p /etc/sysconfig/network/ifcfg-eth0_orig
cat << EOF >/etc/sysconfig/network/ifcfg-eth0
STARTMODE='auto'
BOOTPROTO='static'
BROADCAST='192.168.1.255'
ETHTOOL_OPTIONS=''
IPADDR='192.168.1.20/24'
MTU=''
NAME='eth0'
NETWORK='192.168.1.0'
REMOTE_IPADDR=''
USERCONTROL='no'
#
EOF
cp -p /etc/resolv.conf /etc/resolv.conf.orig
cat << EOF >/etc/resolv.conf
nameserver 192.168.1.1
domain local
search local
#
EOF

For permanent DNS / NTP settings edit the /etc/sysconfig/network/config settings instead of /etc/resolv.conf & /etc/ntp.conf upon your own needs.
 NETCONFIG_DNS_STATIC_SERVERS
 NETCONFIG_DNS_STATIC_SEARCHLIST
 NETCONFIG_DNS_RESOLVER_OPTIONS
 NETCONFIG_NTP_STATIC_SERVERS

echo "192.168.1.20 MyPIHostname.local  MyPIHostname >>/etc/hosts

echo MyPIHostname >/etc/HOSTNAME

g

and do : 
rcnetwork reload 
rcntp reload "

Disable IPV6

Steps for disabling ipv6:

echo "net.ipv6.conf.all.disable_ipv6=1" >/etc/sysctl.d/disableipv6.conf



The non-systemd way (typically for 12.2 and earlier)
Code:     sysctl -p

The systemd way (12.3 and later although the above should still work indefinitely)
Code:    systemctl restart systemd-sysctl.service


Disable LINKLOCAL / Zeroconf / 169.254.0.0/16 on headless

The link-local (169.254.0.0/16) zero conf network may not always be required - i.e., at headless to disable it do the following steps:

Change "NOZEROCONF" to yes.

vi /etc/sysconfig/network/config 
NOZEROCONF="yes"

save it exec : rcnetwork restart

Troubleshooting RPi

The RPi2 troubleshooting should be similar to the Raspberry Pi (1) troubleshooting here:

Moved to openSUSE:Raspberry_Pi#Troubleshooting_RPi

Boot from USB

If you are using a Raspberry Pi 2B v1.2, you can enable USB boot by updating OTP memory. For that, you need to boot once from an SD card with a Config.txt file on 1st partition (along the Raspberry Pi firmware) which include the following line:

 program_usb_boot_mode=1

Once done, your Raspberry Pi 2B v1.2 will try to start from USB, if no SD card.

More information on: https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md

See also

TODO