Skip to content

Commit

Permalink
update raspi debian to latest packages
Browse files Browse the repository at this point in the history
  • Loading branch information
b3nn0 committed May 11, 2019
1 parent ebe44cf commit ee7c150
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ nice, full featured Stratux-Flarm image that works well for europe.
* If no pressure sensor is present, report GPS Altitude as pressure altitude to make SkyDemon happy (NOT RECOMENDED!)
* By default, FLARM and DeveloperMode is enabled, UAT is disabled
* Merged Stratux Web-Radar for web-based traffic display by TomBric (https://github.com/TomBric/Radar-Stratux)
* Upgraded the RaspberryPi Debian system to the latest debian packages
* Hide Weather/Towers page if UAT is disabled
* Added a simple Flarm Status page, loading the ogn-rf and ogn-decode web pages as iFrames
5 changes: 5 additions & 0 deletions image/mk_europe_edition.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ sector=$(fdisk -l $IMGNAME | grep Linux | awk -F ' ' '{print $2}')
partoffset=$(( 512*sector ))
bootoffset=$(fdisk -l $IMGNAME | grep W95 | awk -F ' ' '{print $2}')
bootoffset=$(( 512*bootoffset ))
sizelimit=$(fdisk -l $IMGNAME | grep W95 | awk -F ' ' '{print $4}')
sizelimit=$(( 512*sizelimit ))

# Original image partition is too small to hold our stuff.. resize it to 2.5gb
# Append one GB and truncate to size
Expand Down Expand Up @@ -56,11 +58,13 @@ losetup -d /dev/loop0
# Mount image locally, clone our repo, install packages..
mkdir -p mnt
mount -t ext4 -o offset=$partoffset $IMGNAME mnt/
mount -t vfat -o offset=$bootoffset,sizelimit=$sizelimit $IMGNAME mnt/boot
cp $(which qemu-arm-static) mnt/usr/bin

cd mnt/root
wget https://dl.google.com/go/go1.12.4.linux-armv6l.tar.gz
tar xzf go1.12.4.linux-armv6l.tar.gz
rm go1.12.4.linux-armv6l.tar.gz

if [ "$1" == "dev" ]; then
cp -r $SRCDIR .
Expand All @@ -71,6 +75,7 @@ cd ../..

# Now download a specific kernel to run raspbian images in qemu and boot it..
chroot mnt qemu-arm-static /bin/bash -c /root/stratux/image/mk_europe_edition_device_setup.sh
umount mnt/boot
umount mnt

mkdir -p $SRCDIR/image/out
Expand Down
29 changes: 27 additions & 2 deletions image/mk_europe_edition_device_setup.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,40 @@
#!/bin/bash

# DO NOT CALL BE DIRECTLY!
# DO NOT CALL ME DIRECTLY!
# This script is called by mk_europe_edition.sh via qemu

cd /root/stratux
source /root/.bashrc

apt install --yes libjpeg8-dev libconfig9
# Make sure that the upgrade doesn't restart services in the chroot..
mkdir /root/fake
ln -s /bin/true /root/fake/initctl
ln -s /bin/true /root/fake/invoke-rc.d
ln -s /bin/true /root/fake/restart
ln -s /bin/true /root/fake/start
ln -s /bin/true /root/fake/stop
ln -s /bin/true /root/fake/start-stop-daemon
ln -s /bin/true /root/fake/service
ln -s /bin/true /root/fake/deb-systemd-helper

# Fake a proc FS for raspberrypi-sys-mods_20170519_armhf... Extend me as needed
mkdir -p /proc/sys/vm/

apt update
PATH=/root/fake:$PATH apt dist-upgrade --yes
PATH=/root/fake:$PATH apt install --yes libjpeg8-dev libconfig9
apt-get clean

rm -r /proc/*
rm -r /root/fake

# For some reason, qemu build fails unless we use a single compilation thread. Compilation takes quite long...
export GOMAXPROCS=1
go get -u github.com/kidoman/embd/embd
make clean
# Sometimes go build fails for some reason.. we will just try three times and hope for the best
make
make
make
make install
# systemctl daemon-reload doesn't work in qemu because there is no systemd running. Needed?

0 comments on commit ee7c150

Please sign in to comment.