Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu focal 20.04 lts #22

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@

## Requirements

The scripts require qemu-arm-static and binfmt being set up properly.
- The scripts require qemu-arm-static and binfmt being set up properly.
- Only works on Ubuntu 20.04(tested) and Ubuntu based Linux distribution

```sh
sudo apt-get update
sudo apt-get install qemu binfmt-support qemu binfmt-support qemu-user-static
sudo apt-get install flex bison zerofree u-boot-tools
sudo apt install debootstrap
```

## Flow
Expand Down
5 changes: 3 additions & 2 deletions packages.basic.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ opencl-headers
libelf1
#libelf-dev -- conflict
'libconfig++9v5' 'libconfig++-dev' libconfig-dev libconfig9
libevent-2.1.6 libevent-dev
#libevent-2.1.* will be installed by libevent-dev depends.
libevent-dev

# Needed for parallella-utils xtemp
libx11-6
Expand All @@ -87,6 +88,6 @@ i2c-tools

# OpenMPI
libopenmpi-dev
libopenmpi2
libopenmpi3
openmpi-bin
openmpi-common
18 changes: 12 additions & 6 deletions rootfs-arm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,24 @@ cd $top
export LC_ALL=C
export DEBIAN_FRONTEND=noninteractive

echo add 'universe' to sources.list
#add-apt-repository "deb http://deb.torproject.org/torproject.org $(lsb_release -s -c) universe"
echo "deb http://ports.ubuntu.com/ubuntu-ports $(lsb_release -s -c) universe" >> /etc/apt/sources.list

echo Updating packages
apt-get update -yy || true

echo Installing local deb packages
apt-get install -yy multiarch-support
apt-get install -yy wget
wget -P /tmp/ http://ftp.us.debian.org/debian/pool/main/g/glibc/multiarch-support_2.28-10_armhf.deb
#apt-get install -yy multiarch-support
dpkg -i /tmp/multiarch-support*.deb
dpkg -i /tmp/deb-pkgs/*.deb

echo fixing libelf symlink for coprthr
#HACK HACK HACK
(cd /usr/lib/arm-linux-gnueabihf/ && ln -sf libelf.so.0.8.13 libelf.so)
(cd /usr/lib/arm-linux-gnueabihf/ && ln -sf libelf.so.1 libelf.so)

echo Updating packages
apt-get update -yy || true

echo Fixing zoneinfo
# Set Zonedata so the interactive prompt won't pop up while installing packages
Expand All @@ -40,8 +48,6 @@ touch /etc/dhcp/dhclient.conf
apt-get install -o Dpkg::Options::="--force-confold" -o Dpkg::Options::="--force-confdef" --force-yes -yy \
isc-dhcp-client isc-dhcp-common

echo Unminimize Ubuntu install
yes | unminimize || true # Will fail in restart hook

echo Upgrading packages
apt-get dist-upgrade -yy
Expand Down
31 changes: 18 additions & 13 deletions rootfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,6 @@ unset LC_ALL
unset LC_TIME
export LC_ALL=C

if ! [ -e ${ubuntu_tarball} ]; then
echo Downloading Ubuntu Base tarball
wget ${UBUNTU_URL} -O ${ubuntu_tarball}
fi

echo Checking md5sums
if ! md5sum -c md5sum.txt; then
echo md5sum fail
exit 1
fi

echo Removing old rootfs image
rm -rf ${root_image} ${root_image}.gz

Expand All @@ -78,8 +67,8 @@ echo Mounting root filesystem
mkdir -p ${root_mnt}
mount ${root_dev} ${root_mnt}

echo Unpacking Ubuntu tarball
tar xfzp ${ubuntu_tarball} -C ${root_mnt} --strip-components 0
echo fetching Ubuntu focal
sudo debootstrap --arch=armhf focal ${root_mnt}

echo Applying overlays
#TODO: Use tarballs (for owner/group)?
Expand Down Expand Up @@ -168,6 +157,22 @@ cp -r tests ${root_mnt}/home/parallella/
echo Copying debian packages
cp -rv ${top}/deb-pkgs ${root_mnt}/tmp/

# Ubuntu 20.04 uses symlinks to /usr for /bin, /sbin and /lib
# after applying overlays, it change bin lib to a regular folder
fixSymbLink () {
if [[ -e "${root_mnt}/$1" && ! -L "${root_mnt}/$1" ]]
then
echo Fixing symbolic link $1
pushd ${root_mnt}
rsync -ap --no-owner --no-group $1/ usr/$1
rm -rf $1
ln -sf usr/$1
popd
fi
}
fixSymbLink bin
fixSymbLink lib

echo Starting ARM chroot
chroot ${root_mnt} ./tmp/rootfs-arm.sh
#chroot ${root_mnt}
Expand Down
4 changes: 0 additions & 4 deletions settings.inc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@ set -u

mkdir -p ${top}/out

UBUNTU_URL="http://cdimage.ubuntu.com/ubuntu-base/releases/bionic/release/ubuntu-base-18.04.2-base-armhf.tar.gz"
UBUNTU_TARBALL_NAME=ubuntu_base.tgz

root_mnt=${top}/mnt/rootfs
boot_mnt=${top}/mnt/boot
root_image=${top}/out/root.image
boot_image=${top}/out/boot.image
ubuntu_tarball=${top}/${UBUNTU_TARBALL_NAME}
image_file=${top}/out/image
# Offsets and sizes hardcoded. See sfdisk-script.txt
image_size=7200
Expand Down