Update arm integration test

Existing panda build was outdated and non functional.
Move the test to a more popular target and write the
image description to use technology matching the
suse arm development effort. Target is now Rpi(64bit)
This commit is contained in:
Marcus Schäfer 2018-05-08 16:31:57 +02:00
parent ff08c21259
commit b446cdef24
No known key found for this signature in database
GPG Key ID: AD11DD02B44996EF
10 changed files with 278 additions and 1045 deletions

View File

@ -1,4 +1,4 @@
Virtualization:Appliances:Images:Testing_x86 x86_64
Virtualization:Appliances:Images:Testing_arm armv7l
Virtualization:Appliances:Images:Testing_arm aarch64
Virtualization:Appliances:Images:Testing_s390 s390x
Virtualization:Appliances:Images x86_64

View File

@ -1,111 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<image schemaversion="6.9" name="openSUSE-Tumbleweed-ARM-JeOS-panda">
<description type="system">
<author>Marcus Schaefer</author>
<contact>ms@suse.com</contact>
<specification>
openSUSE Tumbleweed JeOS image for ARM (panda) boards
</specification>
</description>
<preferences>
<type image="oem" initrd_system="dracut" filesystem="ext4" fsmountoptions="noatime,nobarrier" bootloader="grub2" firmware="efi" editbootconfig="uboot-image-panda-setup" editbootinstall="uboot-image-panda-install" kernelcmdline="quiet splash=silent plymouth.enable=0 rootflags=size=100% console=ttyS2,115200n8 vram=16M">
<oemconfig>
<oem-swap>true</oem-swap>
<oem-swapsize>500</oem-swapsize>
<oem-skip-verify>true</oem-skip-verify>
</oemconfig>
</type>
<version>2016.03.09</version>
<packagemanager>zypper</packagemanager>
<locale>en_US</locale>
<keytable>us</keytable>
<timezone>Europe/Berlin</timezone>
<rpm-excludedocs>true</rpm-excludedocs>
<bootloader-theme>openSUSE</bootloader-theme>
<bootsplash-theme>openSUSE</bootsplash-theme>
</preferences>
<users>
<user password="$1$wYJUgpM5$RXMMeASDc035eX.NbYWFl0" home="/root" name="root" groups="root"/>
</users>
<repository type="rpm-md" alias="kiwi-next-generation">
<source path="obs://Virtualization:Appliances:Staging/openSUSE_Factory_ARM"/>
</repository>
<repository type="rpm-md">
<source path="obs://openSUSE:Factory:ARM/standard"/>
</repository>
<repository type="rpm-md">
<source path="obs://openSUSE:Factory/ports"/>
</repository>
<packages type="bootstrap">
<package name="kernel-default"/>
<package name="u-boot-omap4panda"/>
<package name="dtb-omap4"/>
<package name="aaa_base-extras"/>
<package name="acl"/>
<package name="alsa"/>
<package name="audit"/>
<package name="bluez"/>
<package name="branding-openSUSE"/>
<package name="gio-branding-openSUSE"/>
<package name="cracklib-dict-full"/>
<package name="dracut"/>
<package name="e2fsprogs"/>
<package name="elfutils"/>
<package name="filesystem"/>
<package name="fipscheck"/>
<package name="gettext-runtime"/>
<package name="glibc-locale"/>
<package name="gpg2"/>
<package name="grub2"/>
<package name="grub2-arm-efi"/>
<package name="ifplugd"/>
<package name="insserv-compat"/>
<package name="iproute2"/>
<package name="iputils"/>
<package name="iw"/>
<package name="kernel-firmware"/>
<package name="krb5"/>
<package name="less"/>
<package name="libudev1"/>
<package name="libyui-ncurses-pkg8"/>
<package name="lvm2"/>
<package name="kmod-compat"/>
<package name="ncurses-utils"/>
<package name="net-tools"/>
<package name="ntp"/>
<package name="openssh"/>
<package name="openSUSE-build-key"/>
<package name="openSUSE-release"/>
<package name="pkg-config"/>
<package name="python-base"/>
<package name="sudo"/>
<package name="sysconfig"/>
<package name="sysconfig-netconfig"/>
<package name="udev"/>
<package name="shadow"/>
<package name="sg3_utils"/>
<package name="SuSEfirewall2"/>
<package name="systemd"/>
<package name="systemd-sysvinit"/>
<package name="systemd-logger"/>
<package name="timezone"/>
<package name="util-linux-systemd"/>
<package name="usbutils"/>
<package name="which"/>
<package name="wicked"/>
<package name="wicked-service"/>
<package name="vim"/>
<package name="wget"/>
<package name="wireless-tools"/>
<package name="wpa_supplicant"/>
<package name="unzip"/>
<package name="curl"/>
<package name="systemd-presets-branding-openSUSE"/>
<package name="dracut-kiwi-oem-repart"/>
<package name="libgcc_s1"/>
<package name="libgomp1"/>
<package name="libsystemd0"/>
<package name="systemd-presets-branding-openSUSE"/>
</packages>
</image>

View File

@ -1,174 +0,0 @@
#!/bin/bash
# vim: sw=4 et
#================
# FILE : config.sh
#----------------
# PROJECT : OpenSuSE KIWI Image System
# COPYRIGHT : (c) 2006 SUSE LINUX Products GmbH. All rights reserved
# :
# AUTHOR : Marcus Schaefer <ms@suse.de>
# :
# BELONGS TO : Operating System images
# :
# DESCRIPTION : configuration script for SUSE based
# : operating systems
# :
# :
# STATUS : BETA
#----------------
#======================================
# Functions...
#--------------------------------------
test -f /.kconfig && . /.kconfig
test -f /.profile && . /.profile
#======================================
# Greeting...
#--------------------------------------
echo "Configure image: [$kiwi_iname]..."
#======================================
# Setup baseproduct link
#--------------------------------------
suseSetupProduct
#======================================
# Activate services
#--------------------------------------
suseInsertService sshd
suseInsertService boot.device-mapper
suseInsertService ntpd
suseInsertService NetworkManager
suseRemoveService avahi-dnsconfd
suseRemoveService avahi-daemon
#==========================================
# remove unneeded packages
#------------------------------------------
suseRemovePackagesMarkedForDeletion
#======================================
# Add missing gpg keys to rpm
#--------------------------------------
suseImportBuildKey
#==========================================
# remove package docs
#------------------------------------------
rm -rf /usr/share/doc/packages/*
rm -rf /usr/share/doc/manual/*
rm -rf /opt/kde*
if ! rpmqpack | grep -q vim-enhanced; then
#======================================
# only basic version of vim is
# installed; no syntax highlighting
#--------------------------------------
sed -i -e's/^syntax on/" syntax on/' /etc/vimrc
fi
#======================================
# Import GPG Key
#--------------------------------------
t=$(mktemp)
cat - <<EOF > $t
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2.0.15 (GNU/Linux)
mQENBEkUTD8BCADWLy5d5IpJedHQQSXkC1VK/oAZlJEeBVpSZjMCn8LiHaI9Wq3G
3Vp6wvsP1b3kssJGzVFNctdXt5tjvOLxvrEfRJuGfqHTKILByqLzkeyWawbFNfSQ
93/8OunfSTXC1Sx3hgsNXQuOrNVKrDAQUqT620/jj94xNIg09bLSxsjN6EeTvyiO
mtE9H1J03o9tY6meNL/gcQhxBvwuo205np0JojYBP0pOfN8l9hnIOLkA0yu4ZXig
oKOVmf4iTjX4NImIWldT+UaWTO18NWcCrujtgHueytwYLBNV5N0oJIP2VYuLZfSD
VYuPllv7c6O2UEOXJsdbQaVuzU1HLocDyipnABEBAAG0NG9wZW5TVVNFIFByb2pl
Y3QgU2lnbmluZyBLZXkgPG9wZW5zdXNlQG9wZW5zdXNlLm9yZz6JATwEEwECACYC
GwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAUCU2dN1AUJHR8ElQAKCRC4iy/UPb3C
hGQrB/9teCZ3Nt8vHE0SC5NmYMAE1Spcjkzx6M4r4C70AVTMEQh/8BvgmwkKP/qI
CWo2vC1hMXRgLg/TnTtFDq7kW+mHsCXmf5OLh2qOWCKi55Vitlf6bmH7n+h34Sha
Ei8gAObSpZSF8BzPGl6v0QmEaGKM3O1oUbbB3Z8i6w21CTg7dbU5vGR8Yhi9rNtr
hqrPS+q2yftjNbsODagaOUb85ESfQGx/LqoMePD+7MqGpAXjKMZqsEDP0TbxTwSk
4UKnF4zFCYHPLK3y/hSH5SEJwwPY11l6JGdC1Ue8Zzaj7f//axUs/hTC0UZaEE+a
5v4gbqOcigKaFs9Lc3Bj8b/lE10Y
=i2TA
-----END PGP PUBLIC KEY BLOCK-----
EOF
rpm --import $t
rm -f $t
#======================================
# SuSEconfig
#--------------------------------------
suseConfig
#======================================
# Add Factory repo
#--------------------------------------
zypper ar -f \
http://download.opensuse.org/ports/armv7hl/tumbleweed/repo/oss/ openSUSE-Ports-Tumbleweed-repo-oss
#======================================
# Add xorg config with fbdev
#--------------------------------------
mkdir -p /etc/X11/xorg.conf.d/
cat > /etc/X11/xorg.conf.d/20-fbdev.conf <<EOF
Section "Device"
Identifier "fb gfx"
Driver "fbdev"
Option "fb" "/dev/fb0"
EndSection
EOF
#======================================
# Add tty devices to securetty
#--------------------------------------
cat >> /etc/securetty <<EOF
ttyO0
ttyO2
ttyAMA0
ttyAMA2
ttymxc0
ttymxc1
EOF
#======================================
# Bring up eth device automatically
#--------------------------------------
mkdir -p /etc/sysconfig/network/
case "$kiwi_iname" in
*)
cat > /etc/sysconfig/network/ifcfg-eth0 <<-EOF
BOOTPROTO='dhcp'
MTU=''
REMOTE_IPADDR=''
STARTMODE='onboot'
EOF
;;
esac
#======================================
# Configure ntp
#--------------------------------------
# tell e2fsck to ignore the time differences
cat > /etc/e2fsck.conf <<EOF
[options]
broken_system_clock=true
EOF
for i in 0 1 2 3; do
echo "server $i.opensuse.pool.ntp.org iburst" >> /etc/ntp.conf
done
#======================================
# Load panel-tfp410 before omapdrm
#--------------------------------------
cat > /etc/modprobe.d/50-omapdrm.conf <<EOF
# Ensure that panel-tfp410 is loaded before omapdrm
softdep omapdrm pre: panel-tfp410
EOF
#======================================
# Umount kernel filesystems
#--------------------------------------
baseCleanMount
exit 0

View File

@ -1,251 +0,0 @@
#!/bin/bash
set -x
diskname=$1
flavor=panda
(
if [ -d EFI ]; then
# We're on an EFI build, so kiwi doesn't copy u-boot over.
# This is a hack to chdir into the obs-build dir to find
# our u-boot binaries nevertheless.
cd /usr/src/packages/KIWIROOT-oem/
fi
#==========================================
# adjust Raspberry Pi partition table
#------------------------------------------
if [ -f "boot/vc/bootcode.bin" ]; then
# change first partition's name
# mark second partition bootable (checked by U-Boot)
# convert GPT to hybrid GPT
echo "c
1
vcboot
x
a
2
2
64
r
h
1 2 3
n
c
n
82
y
83
n
w
y" > gdisk.tmp
/usr/src/packages/KIWIROOT-oem/usr/sbin/gdisk /dev/loop0 < gdisk.tmp
rm -f gdisk.tmp
fi
#==========================================
# install MLO as raw
#------------------------------------------
if [ -f "boot/MLO" ];then
echo "Installing MLO (SPL)..."
opt="count=1 seek=1 conv=notrunc"
if ! dd if=boot/MLO of=$diskname bs=128k $opt; then
echo "Couldn't install MLO on $diskname"
exit 1
fi
echo "Installing U-Boot..."
opt="seek=1 conv=notrunc"
if ! dd if=boot/u-boot.img of=$diskname bs=384k $opt; then
echo "Couldn't install U-Boot on $diskname"
exit 1
fi
# /.../
# To avoid any issues when parted leaves x86 boot code
# in the MBR we better clear that part of the image
# ----
dd if=/dev/zero of=$diskname bs=440 count=1 conv=notrunc
fi
#==========================================
# install Origen SPL & u-boot as raw
#------------------------------------------
if [ -f "boot/origen-spl.bin" ];then
echo "Installing SPL..."
if ! dd if=boot/origen-spl.bin of=$diskname seek=1 conv=notrunc; then
echo "Couldn't install SPL on $diskname"
exit 1
fi
echo "Installing U-Boot..."
if ! dd if=boot/u-boot.bin of=$diskname seek=65 conv=notrunc; then
echo "Couldn't install u-boot on $diskname"
exit 1
fi
fi
#==========================================
# install Odroid (exynos4) BL* & u-boot as raw
#------------------------------------------
if [ -f "boot/E4412_S.bl1.HardKernel.bin" ];then
echo "Installing BL1..."
if ! dd if=boot/E4412_S.bl1.HardKernel.bin of=$diskname seek=1 conv=notrunc; then
echo "Couldn't install BL1 on $diskname"
exit 1
fi
echo "Installing BL2..."
if ! dd if=boot/bl2.signed.bin of=$diskname seek=31 conv=notrunc; then
echo "Couldn't install BL2 on $diskname"
exit 1
fi
echo "Installing U-Boot..."
if ! dd if=boot/u-boot.bin of=$diskname seek=63 conv=notrunc; then
echo "Couldn't install u-boot on $diskname"
exit 1
fi
if ! dd if=boot/E4412_S.tzsw.signed.bin of=$diskname seek=2111 conv=notrunc; then
echo "Couldn't install TrustZone S/W on $diskname"
exit 1
fi
fi
#==========================================
# install Odroid X3 (exynos5) BL* & u-boot as raw
#------------------------------------------
if [ -f "boot/bl1.bin.hardkernel" ];then
echo "Installing BL1..."
if ! dd if=boot/bl1.bin.hardkernel of=$diskname seek=1 conv=notrunc; then
echo "Couldn't install BL1 on $diskname"
exit 1
fi
echo "Installing BL2..."
if ! dd if=boot/bl2.bin.hardkernel of=$diskname seek=31 conv=notrunc; then
echo "Couldn't install BL2 on $diskname"
exit 1
fi
echo "Installing U-Boot..."
if ! dd if=boot/u-boot.bin of=$diskname seek=63 conv=notrunc; then
echo "Couldn't install u-boot on $diskname"
exit 1
fi
if ! dd if=boot/tzsw.bin.hardkernel of=$diskname seek=719 conv=notrunc; then
echo "Couldn't install TrustZone S/W on $diskname"
exit 1
fi
fi
#==========================================
# install Arndale SPL & u-boot as raw
#------------------------------------------
if [[ -f "boot/smdk5250-spl.bin" || -f "boot/arndale-spl.bin" ]];then
echo "Installing BL1..."
if ! dd if=boot/arndale-bl1.img of=$diskname seek=1 conv=notrunc; then
echo "Couldn't install BL1 on $diskname"
exit 1
fi
echo "Installing SPL..."
# Get SPL name (depends on u-boot version)
SPL_FILE=$(ls boot/*-spl.bin);
if ! dd if=$SPL_FILE of=$diskname seek=17 conv=notrunc; then
echo "Couldn't install SPL ($SPL_FILE) on $diskname"
exit 1
fi
echo "Installing U-Boot..."
if ! dd if=boot/u-boot.bin of=$diskname seek=49 conv=notrunc; then
echo "Couldn't install u-boot on $diskname"
exit 1
fi
fi
#==========================================
# install Cubieboard/Cubietruck SPL & u-boot as raw
#------------------------------------------
if [[ -f "boot/sunxi-spl.bin" || -f "boot/u-boot-sunxi-with-spl.bin" ]];then
if [ -f "boot/u-boot-sunxi-with-spl.bin" ]; then
echo "Installing All-in-one U-Boot/SPL..."
if ! dd if=boot/u-boot-sunxi-with-spl.bin of=$diskname bs=1024 seek=8 conv=notrunc; then
echo "Couldn't install SPL on $diskname"
exit 1
fi
else
echo "Installing SPL..."
if ! dd if=boot/sunxi-spl.bin of=$diskname bs=1024 seek=8 conv=notrunc; then
echo "Couldn't install SPL on $diskname"
exit 1
fi
echo "Installing U-Boot..."
if ! dd if=boot/u-boot.img of=$diskname bs=1024 seek=40 conv=notrunc; then
echo "Couldn't install u-boot on $diskname"
exit 1
fi
fi
fi
#==========================================
# install Chromebook u-boot as boot kernel
#------------------------------------------
if [ "$flavor" = "chromebook" ]; then
pushd /usr/src/packages/KIWIROOT-oem/
echo "console=tty1 debug verbose" > /tmp/config
./usr/bin/vbutil_kernel --pack /tmp/newkern \
--keyblock ./usr/share/vboot/devkeys/kernel.keyblock \
--version 1 \
--signprivate ./usr/share/vboot/devkeys/kernel_data_key.vbprivk \
--config=/tmp/config --vmlinuz boot/u-boot.img --arch arm
PART=$(kpartx -asv $diskname | cut -d ' ' -f 3 | head -n1)
dd if=/tmp/newkern of=/dev/mapper/$PART
kpartx -dv $diskname
# Enable bootflag on partition 2 (u-boot now looks for bootscripts on bootable partitions only)
parted $diskname set 2 boot on
# CGPT magic
./usr/bin/cgpt add -t kernel -i 1 -S 1 -T 5 -P 10 -l U-BOOT $diskname
popd
fi
#==========================================
# install i.MX u-boot as raw
#------------------------------------------
if [ -f "boot/u-boot.imx" ];then
pushd /usr/src/packages/KIWIROOT-oem/
echo "Installing U-Boot..."
if ! dd if=boot/u-boot.imx of=$diskname bs=512 seek=2 conv=notrunc; then
echo "Couldn't install u-boot on $diskname"
exit 1
fi
popd
fi
#==========================================
# install Cubox-i SPL & u-boot as raw
#------------------------------------------
if [ -f "boot/cuboxi-spl.bin" ];then
echo "Installing SPL..."
if ! dd if=boot/cuboxi-spl.bin of=$diskname bs=1024 seek=1 conv=notrunc; then
echo "Couldn't install SPL on $diskname"
exit 1
fi
echo "Installing U-Boot..."
if ! dd if=boot/u-boot.img of=$diskname bs=1024 seek=69 conv=notrunc; then
echo "Couldn't install u-boot on $diskname"
exit 1
fi
fi
)
if [ -f boot/grub2/*efi/grub.efi -o -f ./EFI/BOOT/boot*.efi ];then
echo "EFI system, installing startup.nsh"
PART=$(kpartx -asv $diskname | cut -d ' ' -f 3 | head -n1)
mkdir ./mnt
mount /dev/mapper/$PART ./mnt
if [ -f boot/grub2/arm-efi/grub.efi ]; then
echo "bootarm" > mnt/startup.nsh
else
echo "bootaa64" > mnt/startup.nsh
fi
umount ./mnt
rmdir ./mnt
kpartx -dv $diskname
fi

View File

@ -1,508 +0,0 @@
#!/bin/bash
set -x
flavor=panda
target=firstboot
kerneladdr=
ramdiskaddr=
bootkernel=default
case $target in
firstboot)
conf=boot/boot.script
binconf=boot/boot.scr
kernel=boot/linux.vmx
initrd=boot/initrd.uboot
# the kernel command line is already prepopulated by KIWI
bootargs=
;;
boot)
hookName=$1 # name of hook script calling this code
mountPrefix=$2 # mount path of the image
destsPrefix=$3 # base dir for the config files
unum=$4 # boot partition ID
rdev=$5 # root partition
ufix=$6 # title postfix
swap=$7 # optional swap partition
conf=$destsPrefix/boot/boot.script
binconf=$destsPrefix/boot/boot.script
#======================================
# make sure conf dir exists
#--------------------------------------
mkdir -p $destsPrefix/boot
#======================================
# check for device by ID
#--------------------------------------
local diskByID=`getDiskID $rdev`
local swapByID=`getDiskID $swap swap`
#======================================
# check for system image .profile
#--------------------------------------
if [ -f $mountPrefix/image/.profile ];then
importFile < $mountPrefix/image/.profile
fi
#======================================
# check for kernel options
#--------------------------------------
if [ ! -z "$kiwi_cmdline" ];then
KIWI_KERNEL_OPTIONS="$KIWI_KERNEL_OPTIONS $kiwi_cmdline"
fi
# /.../
# On other systems which supports a boot menu we add
# the linux kernel and initrd with its file names
# like this:
#
# kernel=`echo $i | cut -f1 -d:`
# initrd=`echo $i | cut -f2 -d:`
#
# But on arm systems there can only be one kernel because
# uboot doesn't support a menu. Thus perl-bootloader also
# doesn't support updating the uboot configuration and
# that's the reason why we use the links created by
# mkinitrd to point to the kernel and initrd in order
# to support kernel updates
# ----
kernel=uImage
initrd=initrd
# gather kernel command line
bootargs="root=$diskByID loader=$loader"
if [ "$imageDiskDevice" ];then
bootargs="$bootargs disk=$(getDiskID $imageDiskDevice)"
fi
if [ "$swap" ];then
bootargs="$bootargs resume=$swapByID"
fi
if [ "$haveLVM" = "yes" ];then
bootargs="$bootargs VGROUP=$VGROUP"
fi
bootargs="$bootargs $KIWI_INITRD_PARAMS"
bootargs="$bootargs $KIWI_KERNEL_OPTIONS"
# start with a fresh config
true > $conf
;;
*)
echo "Unknown target $target" >&2
exit 1
;;
esac
bootdevs=mmc
units="0"
bootparts='${unit}:1'
boottype=bootz
setdev='mmc dev ${unit}'
sizeprefix=0x
fdtfolder=dtb
fs=ext2
initrd_high=0xffffffff
fdt_high=0xffffffff
# To display a splash file, we need a working display, an uncompressed BMP file and 'bmp' commands
should_use_splashfile=0
splashfile=opensuse.bmp
case $flavor in
beaglebone)
units="0 1" # 0: is SD card - 1: is internal eMMC
kerneladdr=0x82000000
ramdiskaddr=0x88080000
fdtaddr=0x88000000
should_use_fdt=1
should_load_fdt=1
fdtfile=call_findfdt
;;
beagle|panda)
kerneladdr=0x82000000
ramdiskaddr=0x88080000
fdtaddr=0x88000000
should_use_fdt=1
should_load_fdt=1
fdtfile=call_findfdt
;;
highbank|midway)
bootdevs=scsi
should_use_fdt=1
setdev=1
# Highbank's u-boot already prepends 0x to the file size
sizeprefix=
# And calls the variable $fdt_addr rather than $fdtaddr
use_fdt_addr=1
;;
cubox)
kerneladdr=0x2000000
ramdiskaddr=0x5000000
;;
cubieboard)
kerneladdr=0x46000000
ramdiskaddr=0x4a000000
should_use_fdt=1
should_load_fdt=1
fdtfile=sun4i-a10-cubieboard.dtb
fdtaddr=0x49000000
;;
cubieboard2)
kerneladdr=0x46000000
ramdiskaddr=0x4a000000
should_use_fdt=1
should_load_fdt=1
fdtfile=sun7i-a20-cubieboard2.dtb
fdtaddr=0x49000000
;;
cubietruck)
kerneladdr=0x46000000
ramdiskaddr=0x4a000000
should_use_fdt=1
should_load_fdt=1
fdtfile=sun7i-a20-cubietruck.dtb
fdtaddr=0x49000000
;;
bananapi)
kerneladdr=0x46000000
ramdiskaddr=0x4a000000
should_use_fdt=1
should_load_fdt=1
fdtfile=sun7i-a20-bananapi.dtb
fdtaddr=0x49000000
;;
loco)
kerneladdr=0x70800000
ramdiskaddr=0x7e000000
fdtaddr=0x7d800000
should_use_fdt=1
should_load_fdt=1
units="0 1"
fdtfile=imx53-qsb.dtb
;;
arndale)
kerneladdr=0x44000000
ramdiskaddr=0x45000000
fdtaddr=0x4c000000
units="0 1" # 0: is internal eMMC or USB stick - 1: is SD card
should_use_fdt=1
should_load_fdt=1
fdtfile=exynos5250-arndale.dtb
;;
chromebook)
fs="" # No ext2load by default on u-boot-snow. Just use 'load' command.
kerneladdr=0x40007000
ramdiskaddr=0x44000000
fdtaddr=0x42000000
bootdevs="mmc usb"
units="0 1" # 0: is internal eMMC or USB stick - 1: is SD card
bootparts='${unit}:2'
should_use_fdt=1
should_load_fdt=1
fdtfile=exynos5250-snow.dtb
;;
sabrelite)
kerneladdr=0x10008000
ramdiskaddr=0x14000000
fdtaddr=0x12000000
bootdevs="mmc usb"
units="0 1" # 0: is SD3 (bottom) slot - 1: is uSD4 (top) slot
should_use_fdt=1
should_load_fdt=1
fdtfile=imx6q-sabrelite.dtb
should_use_splashfile=1
;;
raspberrypi)
fs=""
bootparts='${unit}:2'
should_use_fdt=1
should_load_fdt=1
use_fdt_addr_r=1
#fdtfile is set by u-boot, do not overwrite
# kernel-raspberrypi (downstream kernel) does not use the same DT
if [ $bootkernel = raspberrypi ]; then
fdtfile=bcm2708-rpi-b.dtb # TODO: Support all RPi1 DTB included in Linux kernel, not only RPi 1 B
fi
# bootargs for dracut shouldn't override rootfstype
bootargs=$(echo "$bootargs" | sed 's/ rootfstype=ramfs//')
if [ $bootkernel = raspberrypi ]; then
# Pass Mac address to Linux (works only on downstream kernel). Should be removed with new u-boot which will auto-update device-tree with it.
if [ $target = boot ]; then
# Bootargs is defined upper in this script, so it is available/editable
bootargs=$(echo "$bootargs smsc95xx.macaddr=\${usbethaddr} ")
else # $target = firstboot
# Bootargs is already defined by kiwi but not available/editable here
bootargs=$(echo "\${bootargs} smsc95xx.macaddr=\${usbethaddr} ")
fi
fi
# initrd needs to be relocated as it is too big
initrd_high=
;;
raspberrypi2)
fs=""
bootparts='${unit}:2'
should_use_fdt=1
should_load_fdt=1
use_fdt_addr_r=1
if [ $bootkernel = rpi2 ]; then
fdtfile=bcm2709-rpi-2-b.dtb
fi
# bootargs for dracut shouldn't override rootfstype
bootargs=$(echo "$bootargs" | sed 's/ rootfstype=ramfs//')
if [ $bootkernel = rpi2 ]; then
# Pass Mac address to Linux (works only on downstream kernel) Should be removed with new u-boot which will auto-update device-tree with it.
if [ $target = boot ]; then
# Bootargs is defined upper in this script, so it is available/editable
bootargs=$(echo "$bootargs smsc95xx.macaddr=\${usbethaddr} ")
else # $target = firstboot
# Bootargs is already defined by kiwi but not available/editable here
bootargs=$(echo "\${bootargs} smsc95xx.macaddr=\${usbethaddr} ")
fi
fi
# initrd needs to be relocated as it is too big
initrd_high=
;;
raspberrypi3)
fs=""
bootparts='${unit}:2'
should_use_fdt=1
should_load_fdt=1
use_fdt_addr_r=1
fdtfile=bcm2710-rpi-3-b.dtb
# bootargs for dracut shouldn't override rootfstype
bootargs=$(echo "$bootargs" | sed 's/ rootfstype=ramfs//')
if [ $bootkernel = rpi2 ]; then
# Pass Mac address to Linux (works only on downstream kernel) Should be removed with new u-boot which will auto-update device-tree with it.
if [ $target = boot ]; then
# Bootargs is defined upper in this script, so it is available/editable
bootargs=$(echo "$bootargs smsc95xx.macaddr=\${usbethaddr} ")
else # $target = firstboot
# Bootargs is already defined by kiwi but not available/editable here
bootargs=$(echo "\${bootargs} smsc95xx.macaddr=\${usbethaddr} ")
fi
fi
# initrd needs to be relocated as it is too big
initrd_high=
;;
cuboxi)
kerneladdr=0x10800100
fdtaddr=calculate
ramdiskaddr=calculate
should_load_fdt=1
should_use_fdt=1
fdtfile=call_findfdt
fs="" # u-boot does not know ext2load on cubox-i, 'load' does the job fine
;;
mustang)
boottype=bootm
bootdevs=scsi
setdev="true"
kerneladdr=0x4002000000
fdtaddr=calculate
ramdiskaddr=calculate
use_fdt_addr_r=1
should_load_fdt=1
should_use_fdt=1
remove_fdt_high=1
initrd_high=0x43e0000000
fdtfile=apm-mustang.dtb
[ "$target" = "boot" ] && initrd=uInitrd
fdt_high=
;;
m400)
fs="" # Just use "load" command
boottype=bootm
bootdevs=scsi
setdev="true"
kerneladdr=0x4002000000
fdtaddr=calculate
ramdiskaddr=calculate
use_fdt_addr_r=1
should_load_fdt=1
should_use_fdt=1
remove_fdt_high=1
initrd_high=0x43e0000000
fdtfile=apm/apm-m400.dtb
fdt_high=
;;
paz00)
kerneladdr=0x1000000
ramdiskaddr=0x2200000
fdtaddr=0x2000000
should_use_fdt=1
should_load_fdt=1
units="1 0"
bootdevs="mmc usb"
fdtfile=tegra20-paz00.dtb
;;
olinuxinolime)
kerneladdr=0x41000000
ramdiskaddr=calculate
fdtaddr=calculate
should_load_fdt=1
should_use_fdt=1
remove_fdt_high=1
fdtfile=sun4i-a10-olinuxino-lime.dtb
fdt_high=
initrd_high=
;;
olinuxinolime2)
kerneladdr=0x41000000
ramdiskaddr=calculate
fdtaddr=calculate
should_load_fdt=1
should_use_fdt=1
remove_fdt_high=1
fdtfile=sun7i-a20-olinuxino-lime2.dtb
fdt_high=
initrd_high=
;;
a13olinuxino)
kerneladdr=0x41000000
ramdiskaddr=calculate
fdtaddr=calculate
should_load_fdt=1
should_use_fdt=1
remove_fdt_high=1
fdtfile=sun5i-a13-olinuxino.dtb
fdt_high=
initrd_high=
;;
a20olinuxinolime)
kerneladdr=0x41000000
ramdiskaddr=calculate
fdtaddr=calculate
should_load_fdt=1
should_use_fdt=1
remove_fdt_high=1
fdtfile=sun7i-a20-olinuxino-lime.dtb
fdt_high=
initrd_high=
;;
a20olinuxinomicro)
kerneladdr=0x41000000
ramdiskaddr=calculate
fdtaddr=calculate
should_load_fdt=1
should_use_fdt=1
remove_fdt_high=1
fdtfile=sun7i-a20-olinuxino-micro.dtb
fdt_high=
initrd_high=
;;
odroid|odroidxu3)
fs="" # u-boot does not know ext2load on odroid, only fatload, ext4load and load,
kerneladdr=0x40007FC0
ramdiskaddr=0x42000000
fdtaddr=0x40800000
should_load_fdt=1
should_use_fdt=1
;;
esac
# override zImage file names
if [ $boottype = bootz -a $target = boot ]; then
kernel=zImage
fi
# calculate fdt- and ramdiskaddr from kerneladdr
# kernel needs maximum 63MB
# fdt maximum 1MB
# ramdisk can be placed anywhere after that
if [ "x$fdtaddr" = "xcalculate" ]; then
fdtaddr=$(( $kerneladdr + 0x03F00000 )) # kernel + 63M
fdtaddr=`printf '0x%X' $fdtaddr` # convert back to hexadecimal
fi
if [ "x$ramdiskaddr" = "xcalculate" ]; then
ramdiskaddr=$(( $fdtaddr + 0x00100000 )) # fdt + 1M
ramdiskaddr=`printf '0x%X' $ramdiskaddr` # convert back to hexadecimal
fi
# copy bash variables into boot script (except 'target' which is not used in u-boot and may overlap u-boot variables (e.g. cubox-i))
for variable in kernel initrd fdtfile fdtfolder flavor bootdevs bootparts \
initrd_high fdt_high boottype kerneladdr ramdiskaddr should_use_fdt \
should_load_fdt fdtaddr setdev units sizeprefix use_fdt_addr \
use_fdt_addr_r fs remove_fdt_high should_use_splashfile splashfile; do
value=$(eval "echo $(echo \$$variable)")
# only set variables that contain data, leave the others alone
if [ "$value" ]; then
echo "setenv $variable '$value'" >> $conf
fi
done
# follow KIWI modules/KIWIBoot.pm and append $append variable to the end of bootargs
# this allows user to consistently add extra parameters to kernel as simply as possible:
# > setenv append extraopt
# > boot
if [ "x$bootargs" != "x" ]; then
echo "setenv bootargs \"$bootargs \${append}\"" >> $conf
fi
cat >> $conf <<-"EOF"
test -n "$kerneladdr" || setenv kerneladdr ${kernel_addr_r}
test -n "$ramdiskaddr" || setenv ramdiskaddr ${ramdisk_addr_r}
if test 1${should_use_splashfile} = 11; then
setenv load_splashfile 'if ${fs}load ${bootdev} ${bootpart} ${kerneladdr} ${splashfile}; then; bmp display ${kerneladdr}; fi;'
else
setenv load_splashfile ''
fi
setenv load_kernel '${fs}load ${bootdev} ${bootpart} ${kerneladdr} ${kernel}'
setenv load_initrd '${fs}load ${bootdev} ${bootpart} ${ramdiskaddr} ${initrd}; setenv rd_filesize ${sizeprefix}${filesize}'
if test 1${should_load_fdt} = 11; then
if test 0${fdtfile} = 0call_findfdt; then
run findfdt
fi
if test 0${fdtfile} = 0call_autodetectfdt; then
run autodetectfdt
fi
if test -n "$validatefdt"; then
# Beagleboard xM needs to run validatefdt with latest u-boot, but bootpart is 0:2 by default and prefix file with $bootdir.
setenv bootpart 0:1
setenv bootdir ${fdtfolder}
run validatefdt
fi
setenv loadfdt '${fs}load ${bootdev} ${bootpart} ${fdtaddr} ${fdtfolder}/${fdtfile}'
else
setenv loadfdt ''
fi
if test 1${use_fdt_addr} = 11; then
# Calxeda systems use $fdt_addr rather than $fdtaddr
setenv fdtaddr $fdt_addr
fi
if test 1${use_fdt_addr_r} = 11; then
# At least upstream rpi_b uses $fdt_addr_r rather than $fdtaddr
setenv fdtaddr ${fdt_addr_r}
fi
if test 1${should_use_fdt} = 11; then
setenv boot_kernel '${boottype} ${kerneladdr} ${ramdiskaddr}:${rd_filesize} ${fdtaddr}'
else
setenv boot_kernel '${boottype} ${kerneladdr} ${ramdiskaddr}:${rd_filesize}'
fi
if test 1${remove_fdt_high} = 11; then
setenv fdt_high
fi
setenv doit 'run load_splashfile; if run load_kernel; then; run load_initrd; run loadfdt; run boot_kernel; fi'
setenv bootcmd 'for bootdev in ${bootdevs}; do for unit in ${units}; do setenv bootpart; for bootpart in ${bootparts}; do setenv fix_bootpart "setenv bootpart $bootpart"; run fix_bootpart; run setdev; run doit; done; done; done'
boot
EOF
#==========================================
# Create machine readable uboot format
# (only during image creation)
#------------------------------------------
if [ -x /usr/bin/mkimage -a "$target" = firstboot ];then
mkopts="-A arm -O linux -a 0 -e 0 -T script -C none";
if ! mkimage $mkopts -n 'Boot-Script' -d $conf $binconf;then
echo "Failed to create uboot script image"
exit 1
fi
fi
#==========================================
# create a uImage for one-off x-gene
#------------------------------------------
if [ "$flavor" = "mustang" -o "$flavor" = "m400" ]; then
if [ "$target" = "firstboot" ]; then
mkimage -A arm -O linux -C none -T kernel -a 0x00080000 -e 0x00080000 -n Linux -d $kernel boot/uImage
mv boot/uImage $kernel
fi
fi
set +x

View File

@ -0,0 +1,100 @@
<?xml version="1.0" encoding="utf-8"?>
<image schemaversion="6.9" name="OEM-openSUSE-Tumbleweed">
<description type="system">
<author>Marcus Schäfer</author>
<contact>ms@suse.com</contact>
<specification>oem disk for RaspberryPi test build</specification>
</description>
<preferences>
<version>1.15.0</version>
<packagemanager>zypper</packagemanager>
<bootsplash-theme>openSUSE</bootsplash-theme>
<bootloader-theme>openSUSE</bootloader-theme>
<locale>en_US</locale>
<keytable>us</keytable>
<timezone>Europe/Berlin</timezone>
<rpm-excludedocs>true</rpm-excludedocs>
<type image="oem" initrd_system="dracut" filesystem="btrfs" fsmountoptions="noatime,compress=lzo" bootloader="grub2" firmware="efi" kernelcmdline="plymouth.enable=0 swiotlb=512 cma=64M console=ttyS0,115200n8 console=tty" bootpartition="false" devicepersistency="by-label" btrfs_root_is_snapshot="true" efipartsize="16" editbootinstall="editbootinstall_rpi.sh">
<systemdisk name="RaspberryPi">
<volume name="home"/>
<volume name="root"/>
<volume name="tmp"/>
<volume name="opt"/>
<volume name="srv"/>
<volume name="boot/grub2/arm64-efi" mountpoint="boot/grub2/arm64-efi"/>
<volume name="usr/local"/>
<volume name="var" copy_on_write="false"/>
</systemdisk>
<oemconfig>
<oem-swap>true</oem-swap>
<oem-swapsize>500</oem-swapsize>
<oem-skip-verify>true</oem-skip-verify>
</oemconfig>
</type>
</preferences>
<users>
<user password="$1$wYJUgpM5$RXMMeASDc035eX.NbYWFl0" home="/root" name="root" groups="root"/>
</users>
<repository type="rpm-md">
<source path="obs://Virtualization:Appliances:Staging/openSUSE_Factory_ARM"/>
</repository>
<repository type="rpm-md">
<source path="obs://openSUSE:Factory:ARM/standard"/>
</repository>
<repository type="rpm-md">
<source path="obs://openSUSE:Factory/ports"/>
</repository>
<packages type="image">
<package name="patterns-openSUSE-base"/>
<package name="acl"/>
<package name="btrfsprogs"/>
<package name="btrfsmaintenance"/>
<package name="cron"/>
<package name="dracut"/>
<package name="fipscheck"/>
<package name="group(mail)"/>
<package name="group(wheel)"/>
<package name="grub2-branding-openSUSE"/>
<package name="iputils"/>
<package name="zypper-lifecycle-plugin"/>
<package name="vim"/>
<package name="grub2"/>
<package name="grub2-arm64-efi" arch="aarch64"/>
<package name="haveged"/>
<package name="less"/>
<package name="tar"/>
<package name="parted"/>
<package name="rollback-helper"/>
<package name="snapper"/>
<package name="SUSEConnect"/>
<package name="firewalld"/>
<package name="systemd"/>
<package name="systemd-sysvinit"/>
<package name="timezone"/>
<package name="wicked"/>
<package name="iproute2"/>
<package name="openssh"/>
<package name="rsync"/>
<package name="salt-minion"/>
<package name="dialog"/>
<package name="grub2-snapper-plugin"/>
<package name="snapper-zypp-plugin"/>
<package name="raspberrypi-firmware" arch="aarch64"/>
<package name="raspberrypi-firmware-config" arch="aarch64"/>
<package name="raspberrypi-firmware-dt" arch="aarch64"/>
<package name="u-boot-rpi3" arch="aarch64"/>
<package name="dracut-kiwi-oem-repart"/>
<package name="kernel-default"/>
<package name="ntp"/>
<package name="bcm43xx-firmware"/>
</packages>
<packages type="bootstrap">
<package name="udev"/>
<package name="filesystem"/>
<package name="glibc-locale"/>
<package name="ca-certificates"/>
<package name="openSUSE-release"/>
<package name="openSUSE-release-dvd"/>
</packages>
</image>

View File

@ -0,0 +1,127 @@
#!/bin/bash
#======================================
# Functions...
#--------------------------------------
test -f /.kconfig && . /.kconfig
test -f /.profile && . /.profile
mkdir /var/lib/misc/reconfig_system
#======================================
# Greeting...
#--------------------------------------
echo "Configure image: [$kiwi_iname]-[$kiwi_profiles]..."
#======================================
# Debug
#--------------------------------------
#systemctl enable debug-shell.service
#======================================
# add missing fonts
#--------------------------------------
CONSOLE_FONT="eurlatgr.psfu"
#======================================
# Mount system filesystems
#--------------------------------------
baseMount
#======================================
# Setup baseproduct link
#--------------------------------------
suseSetupProduct
#======================================
# Specify default runlevel
#--------------------------------------
baseSetRunlevel 3
#======================================
# Add missing gpg keys to rpm
#--------------------------------------
suseImportBuildKey
#======================================
# Activate services
#--------------------------------------
suseInsertService sshd
#======================================
# Remove doc files
#--------------------------------------
baseStripDocs
#======================================
# Sysconfig Update
#--------------------------------------
# Systemd controls the console font now
echo FONT="$CONSOLE_FONT" >> /etc/vconsole.conf
#======================================
# SSL Certificates Configuration
#--------------------------------------
echo '** Rehashing SSL Certificates...'
update-ca-certificates
if [ ! -s /var/log/zypper.log ]; then
> /var/log/zypper.log
fi
#======================================
# Import trusted rpm keys
#--------------------------------------
for i in /usr/lib/rpm/gnupg/keys/gpg-pubkey*asc; do
# importing can fail if it already exists
rpm --import $i || true
done
#=====================================
# Configure snapper
#-------------------------------------
if [ "$kiwi_btrfs_root_is_snapshot" = 'true' ]; then
echo "creating initial snapper config ..."
# we can't call snapper here as the .snapshots subvolume
# already exists and snapper create-config doens't like
# that.
cp /etc/snapper/config-templates/default /etc/snapper/configs/root
# Change configuration to match SLES12-SP1 values
sed -i -e '/^TIMELINE_CREATE=/s/yes/no/' /etc/snapper/configs/root
sed -i -e '/^NUMBER_LIMIT=/s/50/10/' /etc/snapper/configs/root
baseUpdateSysConfig /etc/sysconfig/snapper SNAPPER_CONFIGS root
fi
#=====================================
# Enable ntpd if installed
#-------------------------------------
if [ -f /etc/ntp.conf ]; then
suseInsertService ntpd
for i in 0 1 2 3; do
echo "server $i.opensuse.pool.ntp.org iburst" >> /etc/ntp.conf
done
fi
#======================================
# Configure Raspberry Pi specifics
#--------------------------------------
# Add necessary kernel modules to initrd (will disappear with bsc#1084272)
echo 'add_drivers+=" bcm2835_dma dwc2 "' \
> /etc/dracut.conf.d/raspberrypi_modules.conf
# Work around HDMI connector bug and network issues
cat > /etc/modprobe.d/50-rpi3.conf <<-EOF
# No HDMI hotplug available
options drm_kms_helper poll=0
# Prevent too many page allocations (bsc#1012449)
options smsc95xx turbo_mode=N
EOF
cat > /usr/lib/sysctl.d/50-rpi3.conf <<-EOF
# Avoid running out of DMA pages for smsc95xx (bsc#1012449)
vm.min_free_kbytes = 2048
EOF
baseCleanMount
exit 0

View File

@ -0,0 +1,45 @@
#!/bin/bash
set -x
diskname=$1
devname="$2"
loopname="${devname%*p2}"
loopdev=/dev/${loopname#/dev/mapper/*}
#==========================================
# copy Raspberry Pi firmware to EFI partition
#------------------------------------------
echo "RPi EFI system, installing firmware on ESP"
mkdir -p ./mnt-pi
mount ${loopname}p1 ./mnt-pi
( cd boot/vc; tar c . ) | ( cd ./mnt-pi/; tar x )
umount ./mnt-pi
rmdir ./mnt-pi
#==========================================
# Change partition label type to MBR
#------------------------------------------
#
# The target system doesn't support GPT, so let's move it to
# MBR partition layout instead.
#
# Also make sure to set the ESP partition to type 0xc so that
# broken firmware (Rpi) detects it as FAT.
#
# Use tabs, "<<-" strips tabs, but no other whitespace!
cat > gdisk.tmp <<-'EOF'
x
r
g
t
1
c
w
y
EOF
dd if=$loopdev of=mbrid.bin bs=1 skip=440 count=4
gdisk $loopdev < gdisk.tmp
dd of=$loopdev if=mbrid.bin bs=1 seek=440 count=4
rm -f mbrid.bin
rm -f gdisk.tmp

View File

@ -0,0 +1,4 @@
BOOTPROTO='dhcp'
MTU=''
REMOTE_IPADDR=''
STARTMODE='onboot'

View File

@ -0,0 +1 @@
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="?*", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="?*", NAME="lan0"