Skip to content

Commit

Permalink
release 1.0 for ruediger offline - only ruediger2_control working
Browse files Browse the repository at this point in the history
  • Loading branch information
flochre committed Dec 18, 2022
1 parent 9e801bd commit 9815ac0
Show file tree
Hide file tree
Showing 10 changed files with 150 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ focal-rt-ros2:
jammy-rt-ros2:
sudo ./ros-rt-img build jammy-rt jammy-rt-humble

jammy-rt-ruediger2:
sudo ./ros-rt-img build jammy-rt-humble-ruediger

clean:
sudo ./ros-rt-img teardown
sudo rm -rf out cache
22 changes: 22 additions & 0 deletions image_builder/data/jammy-rt-humble-ruediger/config.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Overrides the variables in focal-rt/config.ini. See that file for a more
# comprehensive example.
[build]
# The image url to download and customize.
image_url = https://github.com/ros-realtime/ros-realtime-rpi4-image/releases/download/22.04.1_v5.15.39-rt42-raspi_ros2_humble/ubuntu-22.04.1-rt-ros2-arm64+raspi.img.xz

# Mount location for the partitions in the image file downloaded.
image_mounts = /boot/firmware,/

# This is passed to truncate --size=<image_size> when operating against the
# .img file
image_size = 12G

# The filename of the output image
output_filename = ubuntu-22.04.1-rt-ruediger2-arm64+raspi.img

# The host path to the qemu-user-static binary required for the above image
qemu_user_static_path = /usr/bin/qemu-aarch64-static

[env]
ROS_DISTRO = humble

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dwc_otg.lpm_enable=0 console=tty1 root=LABEL=writable rootfstype=ext4 rootwait fixrtc quiet splash
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[all]
kernel=vmlinuz
cmdline=cmdline.txt
initramfs initrd.img followkernel

[pi4]
max_framebuffers=2
arm_boost=1

[all]
# Enable the audio output, I2C and SPI interfaces on the GPIO header. As these
# parameters related to the base device-tree they must appear *before* any
# other dtoverlay= specification
dtparam=audio=on
dtparam=i2c_arm=on,i2c_arm_baudrate=400000
dtparam=spi=on

# Comment out the following line if the edges of the desktop appear outside
# the edges of your display
disable_overscan=1

# If you have issues with audio, you may try uncommenting the following line
# which forces the HDMI output into HDMI mode instead of DVI (which doesn't
# support audio output)
#hdmi_drive=2

# Enable the serial pins
enable_uart=1

# Autoload overlays for any recognized cameras or displays that are attached
# to the CSI/DSI ports. Please note this is for libcamera support, *not* for
# the legacy camera stack
camera_auto_detect=1
display_auto_detect=1

# Config settings specific to arm64
arm_64bit=1
dtoverlay=dwc2

[cm4]
# Enable the USB2 outputs on the IO board (assuming your CM4 is plugged into
# such a board)
dtoverlay=dwc2,dr_mode=host

[pi3]
dtoverlay=pi3-disable-bt

[all]
start_x=1
gpu_mem=256
dtoverlay=disable-bt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#cloud-config

# On first boot, set the (default) ruediger user's password to "ruediger" and
# expire user passwords
chpasswd:
expire: true
list:
- ruediger:ruediger

## Set the system's hostname. Please note that, unless you have a local DNS
## setup where the hostname is derived from DHCP requests (as with dnsmasq),
## setting the hostname here will not make the machine reachable by this name.
## You may also wish to install avahi-daemon (see the "packages:" key below)
## to make your machine reachable by the .local domain
hostname: ruediger2

# Enable password authentication with the SSH daemon
ssh_pwauth: true

users:
- default
- name: ruediger
plain_text_passwd: 'ruediger'
homedir: /home/ruediger
shell: /bin/bash
groups: [ adm, audio, cdrom, dialout, floppy, video, plugdev, dip, netdev, sudo, lxd ]
sudo: ['ALL=(ALL) NOPASSWD:ALL']


## Run arbitrary commands at rc.local like time
runcmd:
- [deluser, --remove-home, ubuntu]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
deb [arch=arm64 signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu jammy main
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if [ -f /opt/ros/humble/setup.bash ]; then
source /opt/ros/humble/setup.bash
fi
11 changes: 11 additions & 0 deletions image_builder/data/jammy-rt-humble-ruediger/scripts/extract-image
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -xe

# This script extract the image downloaded from the image_url specified in
# config.ini. The script should be tailored to the image download.
#
# The script is called with only one argument: the path to the file downloaded.
# The script should output the decompressed output into stdout, so it can be
# redirected into a file by the build system.
exec xzcat --decompress "$1"
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
loop_device=$1

set -xe

# The image should always be using the second partition
e2fsck -y -f "${loop_device}"p2
resize2fs "${loop_device}"p2
18 changes: 18 additions & 0 deletions image_builder/data/jammy-rt-humble-ruediger/scripts/phase1-target
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

apt-get update

apt-get install -y ros-$ROS_DISTRO-xacro ros-$ROS_DISTRO-ros2-control ros-$ROS_DISTRO-ros2-controllers libwiringpi-dev

# reverse the network names to eth0 instead of enx<mac-address>
# this is automatique after a apt-get update
# https://askubuntu.com/a/1025201
ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules

# add library link
ln -s /home/ruediger/deployement/serial_megapi/lib/serial_megapi/libserial_megapi.so /usr/local/lib/libserial_megapi.so
ldconfig

# clean up to reduce image size
apt-get autoremove -y && apt-get clean
rm -rf /var/lib/apt/lists/*

0 comments on commit 9815ac0

Please sign in to comment.