Commit d29b933c authored by claes's avatar claes

Package pwrrpi on ubuntu

parent 8d83e440
...@@ -28,7 +28,7 @@ pwra_set_func() ...@@ -28,7 +28,7 @@ pwra_set_func()
baseroot=${baseroot%/} baseroot=${baseroot%/}
if [ ! -e "$baseroot" ]; then if [ ! -e "$baseroot" ]; then
echo "Base $baseroot doesn't exist" echo "Base $baseroot doesn't exist"
elif [ "$3" = "" ]; then elif [ "$3" != "" ]; then
if [ ! -e $baseroot/$3/exp/exe/pwrp_env.sh ]; then if [ ! -e $baseroot/$3/exp/exe/pwrp_env.sh ]; then
echo "Not a base directory: $baseroot" echo "Not a base directory: $baseroot"
return return
......
...@@ -3,15 +3,16 @@ ...@@ -3,15 +3,16 @@
1. Setup toolchain 1. Setup toolchain
Download rpi-tools from https://github.com/rasperrypi/tools 'Download zip' mkdir /usr/local/rpi
cd /usr/local/rpi
Unpack the zip-file under /usr/local/rpi. git clone git://github.com/raspberrypi/tools.git
git checkout 9c3d7b6ac692498dd36fec2872e0b55f910baac1 # There is a bug in the latest commit
2. Define pwre links to the compiler tools 2. Define pwre links to the compiler tools
export pwre_cc=/usr/local/rpi/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc export pwre_cc=/usr/local/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc
export pwre_cxx=/usr/local/rpi/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++ export pwre_cxx=/usr/local/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++
export pwre_ar=/usr/local/rpi/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-ar export pwre_ar=/usr/local/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-ar
3. Define a link to the exe directory of the host release 3. Define a link to the exe directory of the host release
...@@ -41,5 +42,5 @@ ...@@ -41,5 +42,5 @@
Set version in the control file and build with Set version in the control file and build with
pwre build tools/pkg deb rpi pwre build tools/pkg deb src rpi
...@@ -17,26 +17,26 @@ aroot="/usr/pwrp/adm" ...@@ -17,26 +17,26 @@ aroot="/usr/pwrp/adm"
echo "Change owner of files to pwrp" echo "Change owner of files to pwrp"
chown -R pwrp /usr/pwrrpi$ver chown -R pwrp /usr/pwr$ver
chgrp -R pwrp /usr/pwrrpi$ver chgrp -R pwrp /usr/pwr$ver
chmod u+s /usr/pwrrpi$ver/$pwre_target/exp/exe/rt_ini chmod u+s /usr/pwr$ver/$pwre_target/exp/exe/rt_ini
chmod u+s /usr/pwrrpi$ver/$pwre_target/exp/exe/rt_rtt chmod u+s /usr/pwr$ver/$pwre_target/exp/exe/rt_rtt
# Insert base in projectlist # Insert base in projectlist
if [ ! -e $aroot/db/pwr_projectlist.dat ]; then #if [ ! -e $aroot/db/pwr_projectlist.dat ]; then
echo "%base V${ver:0:1}.${ver:1:1}rpi /usr/pwrrpi$ver" > $aroot/db/pwr_projectlist.dat # echo "%base V${ver:0:1}.${ver:1:1}rpi /usr/pwr$ver" > $aroot/db/pwr_projectlist.dat
else #else
set +e # set +e
ptst=`eval grep "^%base" $aroot/db/pwr_projectlist.dat | grep "\bV${ver:0:1}.${ver:1:1}rpi\b"` # ptst=`eval grep "^%base" $aroot/db/pwr_projectlist.dat | grep "\bV${ver:0:1}.${ver:1:1}rpi\b"`
set -e # set -e
if [ "$ptst" = "" ]; then # if [ "$ptst" = "" ]; then
echo "%base V${ver:0:1}.${ver:1:1}rpi /usr/pwrrpi$ver" >> $aroot/db/pwr_projectlist.dat # echo "%base V${ver:0:1}.${ver:1:1}rpi /usr/pwr$ver" >> $aroot/db/pwr_projectlist.dat
fi # fi
fi #fi
# Change group to pwrp # Change group to pwrp
chmod a+w /usr/pwrrpi$ver/$pwre_target/exp/load/*.dbs chmod a+w /usr/pwr$ver/$pwre_target/exp/load/*.dbs
......
...@@ -28,7 +28,7 @@ pwra_set_func() ...@@ -28,7 +28,7 @@ pwra_set_func()
baseroot=${baseroot%/} baseroot=${baseroot%/}
if [ ! -e "$baseroot" ]; then if [ ! -e "$baseroot" ]; then
echo "Base $baseroot doesn't exist" echo "Base $baseroot doesn't exist"
elif [ "$3" = "" ]; then elif [ "$3" != "" ]; then
if [ ! -e $baseroot/$3/exp/exe/pwrp_env.sh ]; then if [ ! -e $baseroot/$3/exp/exe/pwrp_env.sh ]; then
echo "Not a base directory: $baseroot" echo "Not a base directory: $baseroot"
return return
......
...@@ -28,7 +28,7 @@ pwra_set_func() ...@@ -28,7 +28,7 @@ pwra_set_func()
baseroot=${baseroot%/} baseroot=${baseroot%/}
if [ ! -e "$baseroot" ]; then if [ ! -e "$baseroot" ]; then
echo "Base $baseroot doesn't exist" echo "Base $baseroot doesn't exist"
elif [ "$3" = "" ]; then elif [ "$3" != "" ]; then
if [ ! -e $baseroot/$3/exp/exe/pwrp_env.sh ]; then if [ ! -e $baseroot/$3/exp/exe/pwrp_env.sh ]; then
echo "Not a base directory: $baseroot" echo "Not a base directory: $baseroot"
return return
......
Package pwrrpi containing runtime archives compiled with crosscompiler for raspbian on Raspberry PI.
1. Setup toolchain
mkdir /usr/local/rpi
cd /usr/local/rpi
git clone git://github.com/raspberrypi/tools.git
git checkout 9c3d7b6ac692498dd36fec2872e0b55f910baac1 # There is a bug in the latest commit
2. Define pwre links to the compiler tools
export pwre_cc=/usr/local/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc
export pwre_cxx=/usr/local/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++
export pwre_ar=/usr/local/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-ar
3. Define a link to the exe directory of the host release
export pwre_host_exe=/data1/x5-0-0/rls/os_linux/hw_x86/exp/exe
4. Create an pwre environment for the rpi release with hardware arm
pwre add x500rpi
Source root? /data0/x5-0-0/pwr/src
Import root? /data0/x5-0-0/rls/os_linux/hw_x86
Build root? /data0/x5-0-0/rls
Build type?
OS? linux
Hardware? arm
5. Build arm release
pwre init x500rpi
mkdir $pwre_broot
pwre configure --ebuild
pwre create_all_modules
pwre import rt
pwre import java
pwre ebuild rt
6. Build the package
Set version in the control file and build with
pwre build tools/pkg deb src rpi
#!/bin/bash
aroot="/usr/pwrp/adm"
# Get version
if [ -e $pwr_inc/pwr_version.h ]; then
ver=`eval cat $pwr_inc/pwr_version.h | grep "\bpwrv_cWbdbVersionShortStr\b" | awk '{print $3}'`
if [ -z $ver ]; then
echo "Unable to get pwr version"
ver="V00"
fi
ver=${ver:2:2}
fi
if [ "$1" == "-v" ]; then
exit
fi
pkgroot=$pwre_broot/$pwre_target/bld/pkg/pwrrpi$ver
pkgsrc=$pwre_sroot/tools/pkg/ubu/pwrrpi
rpi_target=os_linux/hw_arm
echo "-- Building pwrrpi$ver"
# Create directories
mkdir -p $pkgroot/DEBIAN
mkdir -p $pkgroot/usr/share/doc/pwrrpi$ver
mkdir -p $pkgroot/usr/pwrp
mkdir -p $pkgroot/etc
find $pkgroot -type d | xargs chmod 755
# control
cp $pkgsrc/control $pkgroot/DEBIAN
echo "#!/bin/bash" > $pkgroot/DEBIAN/postinst
echo "ver=\"$ver\"" >> $pkgroot/DEBIAN/postinst
echo "pwre_target=\"$pwre_target\"" >> $pkgroot/DEBIAN/postinst
cat $pkgsrc/postinst >> $pkgroot/DEBIAN/postinst
chmod a+x $pkgroot/DEBIAN/postinst
cp $pkgsrc/prerm $pkgroot/DEBIAN
# copyright
cp $pkgsrc/copyright $pkgroot/usr/share/doc/pwrrpi$ver
# changelog
cp $pkgsrc/changelog $pkgroot/usr/share/doc/pwrrpi$ver
gzip -fq --best $pkgroot/usr/share/doc/pwrrpi$ver/changelog
# changelog.Debian
cp $pkgsrc/changelog.Debian $pkgroot/usr/share/doc/pwrrpi$ver
gzip -fq --best $pkgroot/usr/share/doc/pwrrpi$ver/changelog.Debian
# Copy proview
mkdir $pkgroot/usr/pwr$ver
currentdir="`eval pwd`"
tarfile=$pwre_broot/$pwre_target/bld/pkg/pwrtmp.tar
cd $pwre_broot
echo "-- copy release to package tree"
tar -cf $tarfile $rpi_target/exp
cd $pkgroot/usr/pwr$ver
tar -xf $tarfile
rm $tarfile
cd $currentdir
# Copy adm files to cnf
#echo "pwrp set base V${ver:0:1}.${ver:1:1}" >> $pkgroot/usr/pwr$ver/$pwre_target/exp/cnf/pwr_setup.sh
# Create package
echo "-- Building package"
if which fakeroot > /dev/null; then
fakeroot dpkg -b $pkgroot $pwre_broot/$pwre_target/bld/pkg
else
dpkg -b $pkgroot $pwre_broot/$pwre_target/bld/pkg
fi
rm -r $pkgroot
Proview V5.1.0 (5.1.0-1)
\ No newline at end of file
Proview. See also normal changelog file.
\ No newline at end of file
Package: pwrrpi51
Version: 5.1.0-1
Section: base
Priority: optional
Architecture: i386
Depends: pwr51 (>= 5.1.0-1)
Replaces: pwr51
Maintainer: Proview <postmaster@proview.se>
Description: Proview RPI development package
Proview RPI development environment
5.1.0-1 Base release
Proview
Copyright: SSAB EMEA AB <www.ssab.com>
2014-02-03
The home page of Proview is at:
http://www.proview.se
#!/bin/sh
set -e
# ver=""
# pwre_target=""
echo "Here in postinst..."
# Automatically added by dh_installdocs
if [ "$1" = "configure" ]; then
if [ -d /usr/doc -a ! -e /usr/doc/pwrtest -a -d /usr/share/doc/pwrtest ]; then
ln -sf ../share/doc/pwrtest /usr/doc/pwrtest
fi
fi
# End automatically added section
aroot="/usr/pwrp/adm"
echo "Change owner of files to pwrp"
chown -R pwrp /usr/pwr$ver
chgrp -R pwrp /usr/pwr$ver
chmod u+s /usr/pwr$ver/$pwre_target/exp/exe/rt_ini
chmod u+s /usr/pwr$ver/$pwre_target/exp/exe/rt_rtt
# Insert base in projectlist
#if [ ! -e $aroot/db/pwr_projectlist.dat ]; then
# echo "%base V${ver:0:1}.${ver:1:1}rpi /usr/pwr$ver" > $aroot/db/pwr_projectlist.dat
#else
# set +e
# ptst=`eval grep "^%base" $aroot/db/pwr_projectlist.dat | grep "\bV${ver:0:1}.${ver:1:1}rpi\b"`
# set -e
# if [ "$ptst" = "" ]; then
# echo "%base V${ver:0:1}.${ver:1:1}rpi /usr/pwr$ver" >> $aroot/db/pwr_projectlist.dat
# fi
#fi
# Change group to pwrp
chmod a+w /usr/pwr$ver/$pwre_target/exp/load/*.dbs
#!/bin/sh
set -e
# Automatically added by dh_installdocs
if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/pwrtest ]; then
rm -f /usr/doc/pwrtest
fi
# End automatically added section
...@@ -30,6 +30,7 @@ copy : ...@@ -30,6 +30,7 @@ copy :
lib : lib :
exe : $(bld_dir)/control_pwrrt $(bld_dir)/control_pwr $(bld_dir)/control_pwrsev $(bld_dir)/control_pwrdemo exe : $(bld_dir)/control_pwrrt $(bld_dir)/control_pwr $(bld_dir)/control_pwrsev $(bld_dir)/control_pwrdemo
rpi : $(bld_dir)/control_pwrrpi
clean : clean :
...@@ -60,5 +61,9 @@ $(bld_dir)/control_pwrdemo : ../../../pwrdemo/control ...@@ -60,5 +61,9 @@ $(bld_dir)/control_pwrdemo : ../../../pwrdemo/control
@ ../../../pwrdemo/build.sh @ ../../../pwrdemo/build.sh
@ cp $(source) $(target) @ cp $(source) $(target)
$(bld_dir)/control_pwrrpi : ../../../pwrrpi/control
@ echo "build $(target)"
@ ../../../pwrrpi/build.sh
@ cp $(source) $(target)
...@@ -28,7 +28,7 @@ pwra_set_func() ...@@ -28,7 +28,7 @@ pwra_set_func()
baseroot=${baseroot%/} baseroot=${baseroot%/}
if [ ! -e "$baseroot" ]; then if [ ! -e "$baseroot" ]; then
echo "Base $baseroot doesn't exist" echo "Base $baseroot doesn't exist"
elif [ "$3" = "" ]; then elif [ "$3" != "" ]; then
if [ ! -e $baseroot/$3/exp/exe/pwrp_env.sh ]; then if [ ! -e $baseroot/$3/exp/exe/pwrp_env.sh ]; then
echo "Not a base directory: $baseroot" echo "Not a base directory: $baseroot"
return return
......
...@@ -30,6 +30,7 @@ copy : ...@@ -30,6 +30,7 @@ copy :
lib : lib :
exe : $(bld_dir)/control_pwrrt $(bld_dir)/control_pwr $(bld_dir)/control_pwrsev $(bld_dir)/control_pwrdemo exe : $(bld_dir)/control_pwrrt $(bld_dir)/control_pwr $(bld_dir)/control_pwrsev $(bld_dir)/control_pwrdemo
rpi : $(bld_dir)/control_pwrrpi
clean : clean :
...@@ -60,5 +61,9 @@ $(bld_dir)/control_pwrdemo : ../../../pwrdemo/control ...@@ -60,5 +61,9 @@ $(bld_dir)/control_pwrdemo : ../../../pwrdemo/control
@ ../../../pwrdemo/build.sh @ ../../../pwrdemo/build.sh
@ cp $(source) $(target) @ cp $(source) $(target)
$(bld_dir)/control_pwrrpi : ../../../pwrrpi/control
@ echo "build $(target)"
@ ../../../pwrrpi/build.sh
@ cp $(source) $(target)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment