Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:13.2:Ports
JeOS-cubieboard
pre_checkin.sh
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File pre_checkin.sh of Package JeOS-cubieboard
#!/bin/bash set -e CPP=cpp if [ -e /usr/bin/cpp-4.6 ]; then # SLES11 has cpp4.3 as default which generates spurious blank lines CPP=cpp-4.6 fi armv6_gfx_images="rootfs raspberrypi" armv6_jeos_images="$armv6_gfx_images" armv7_gfx_images="rootfs arndale beagle beaglebone chromebook panda sabrelite vexpress cuboxi paz00" armv7_jeos_images="$armv7_gfx_images cubieboard cubieboard2 cubietruck cubox highbank midway efikamx loco cuboxi paz00" aarch64_gfx_images="rootfs mustang efi seattle thunder" aarch64_jeos_images="$aarch64_gfx_images vexpress64" for arch in armv6 armv7 aarch64; do image_list="" if [[ $arch == armv6 ]]; then jeos_images=$armv6_jeos_images gfx_images=$armv6_gfx_images elif [[ $arch == armv7 ]]; then jeos_images=$armv7_jeos_images gfx_images=$armv7_gfx_images else jeos_images=$aarch64_jeos_images gfx_images=$aarch64_gfx_images fi for machinetype in $jeos_images; do image_list="$image_list JeOS-$machinetype" done for machinetype in $gfx_images; do image_list="$image_list E17-$machinetype" image_list="$image_list XFCE-$machinetype" done echo "Arch: $arch - image_list: $image_list" for i in $image_list; do if [[ $i == XFCE-* ]]; then image_type=TYPE_XFCE image_type_string="XFCE" flavor="${i/XFCE-/}" elif [[ $i == E17-* ]]; then image_type=TYPE_E17 image_type_string="E17" flavor="${i/E17-/}" elif [[ $i == JeOS-* ]]; then image_type=TYPE_JEOS image_type_string="JeOS" flavor="${i/JeOS-/}" else echo "Unknown image type: $i" exit 1 fi; # special cases: JeOS-rootfs is called "JeOS" as package and add .armv6 to armv6 rootfs if [ "$arch" = "armv6" ]; then suffix=".armv6" elif [ "$arch" = "aarch64" ]; then suffix=".aarch64" else suffix="" # No suffix for armv7 fi if [ "$i" = "JeOS-rootfs" ]; then i="JeOS"$suffix elif [[ "$i" == *"-rootfs" ]]; then i=$i$suffix elif [[ "$i" == *"-efi" ]]; then i=$i$suffix fi # create kiwi description image_type_info="-DIMAGE_TYPE=$image_type -DIMAGE_TYPE_STRING=$image_type_string -DIS_ARCH_$arch=1" t=$(mktemp) echo "Formatting $i" $CPP $image_type_info -DIS_FLAVOR_$flavor=1 -DFLAVOR_TYPE=$flavor -P Images.kiwi.in -o $t # replace defines that cpp would ignore sed -i "s/FLAVOR_TYPE/$flavor/g;s/IMAGE_TYPE/$image_type/g;s/IMAGE_TYPE_STRING/$image_type_string/g;s/ARCH/$arch/g" $t # this will abort if there's an error (see set -e) xmllint --format $t --output $i.kiwi || break rm -f $t if [ "$flavor" != "rootfs" ]; then # create uboot scripts for i in install setup; do sed "s/FLAVOR/$flavor/g;s/TARGET/firstboot/g" uboot-image-$i.in > uboot-image-$flavor-$i done rm -rf x y mkdir -p x/kiwi-hooks cat > x/kiwi-hooks/installUBoot.sh <<-"EOF" #========================================== # Recreate boot.script after first boot #------------------------------------------ if [ -x /usr/bin/mkimage ]; then mkimage -A arm -O linux -a 0 -e 0 -T script -C none \ -n 'Boot-Script' -d /boot/boot.script /boot/boot.scr if [ ! $? = 0 ]; then Echo "Failed to create boot script image" fi fi EOF [ "$flavor" = "mustang" ] && cat >> x/kiwi-hooks/installUBoot.sh <<-"EOF" #========================================== # create uImage and uInitrd for mustang #------------------------------------------ /usr/bin/mkimage -A arm -O linux -C none -T kernel -a 0x00080000 \ -e 0x00080000 -n Linux -d /boot/Image /boot/uImage /usr/bin/mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n initramfs \ -d /boot/initrd /boot/uInitrd EOF [ "$flavor" = "raspberrypi" ] && cat >> x/kiwi-hooks/installUBoot.sh <<-"EOF" #========================================== # convert GPT to hybrid GPT again #------------------------------------------ echo "r h 1 2 3 n c y 83 n 83 n w y" > /gdisk.tmp /usr/sbin/gdisk /dev/mmcblk0 < /gdisk.tmp rm -f /gdisk.tmp EOF sed "s/FLAVOR/$flavor/g;s/TARGET/boot/g" uboot-image-setup.in > x/kiwi-hooks/setupUBoot.sh chmod +x x/kiwi-hooks/* # compare to the old tar ball TGZ=uboot-setup-$flavor.tgz if [ -f $TGZ ]; then mkdir -p y ( cd y; tar xzf ../$TGZ ) if ! diff -br x y > /dev/null; then ( cd x; tar czf ../$TGZ kiwi-hooks ) fi rm -rf x y else ( cd x; tar czf ../$TGZ kiwi-hooks ) rm -rf x fi fi done done
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor