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

Install RaspberryPi specific packages #152

Merged
merged 2 commits into from
Apr 30, 2024
Merged
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
23 changes: 16 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ The following environment variables are supported:
Configure the board the Kuiper image will boot on. Together with the variable `ADI_EVAL_BOARD` it can be used to prepare \
the boot partition during build time with the required ADI project and carrier.

* `INSTALL_RPI_PACKAGES` (Default: n)

Install the following RaspberryPi specific packages: raspi-config, GPIO related (pigpio, python3-gpio, raspi-gpio,\
python3-rpi.gpio), VideoCore debugging related (vcdbg), sense-hat, sense-emu.

* `EXTRA_SCRIPT` (Default empty)

Customize the Kuiper image by running an extra script. The variable should be the path to the script.
Expand Down Expand Up @@ -337,8 +342,8 @@ maintenance and customization.
- **06.boot-partition** - this stage adds the Intel, Xilinx and Raspberry Pi boot binaries that will be in the
BOOT partition. It also configures files so that the image is bootable on RPI by default.

- **07.extra-scripts** - this stage is used to customize Kuiper image with extra scripts. It contains a script that runs
the extra script inside chroot. Extra script path is retrieved from EXTRA_SCRIPT variable.
- **07.extra-tweaks** - this stage is used to customize Kuiper image with extra scripts. It contains a script that runs
the extra script inside chroot. Extra script path is retrieved from EXTRA_SCRIPT variable from config file. In this stage the RaspberryPi specific packages are also installed if INSTALL_RPI_PACKAGES is set to 'y'.

- **08.export-stage** - this stage downloads sources for the ADI tools, debootstrap command
and all packages installed in Kuiper. The sources can be found in `kuiper-volume/sources` inside the cloned repository on your machine.
Expand Down Expand Up @@ -378,18 +383,22 @@ maintenance and customization.

* `Kuiper with custom script:`

- **07.extra-scripts**
- **07.extra-tweaks** - substage **01.extra-scripts**

* `Kuiper with specific RaspberryPi packages:`

- **07.extra-tweaks** - substage **02.install-rpi-packages**

# Kuiper with custom extra scripts

Kuiper has an option to run extra scripts at build time in order to customize the resulted image.
Below are steps to add this option by using the example script provided in stage `07.extra-scripts` or a custom script.
Below are steps to add this option by using the example script provided in stage `07.extra-tweaks` or a custom script.

Steps to prepare Kuiper customization with the example script:
- in the `config` file, set 'EXTRA_SCRIPT' variable to `stages/07.extra-scripts/examples/extra-script-example.sh`
- in the `config` file, set 'EXTRA_SCRIPT' variable to `stages/07.extra-tweaks/01.extra-scripts/examples/extra-script-example.sh`
- if you need to pass `config` file parameters to the script, uncomment the line where it sources the config file in
`stages/07.extra-scripts/examples/extra-script-example.sh`, otherwise skip this step
- write your commands in `stages/07.extra-scripts/examples/extra-script-example.sh`
`stages/07.extra-tweaks/01.extra-scripts/examples/extra-script-example.sh`, otherwise skip this step
- write your commands in `stages/07.extra-tweaks/01.extra-scripts/examples/extra-script-example.sh`

Steps to prepare Kuiper customization with custom script:
- place the custom script inside `adi-kuiper-gen` directory
Expand Down
10 changes: 9 additions & 1 deletion config
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,20 @@ CARRIER=
#
#
#
# [RASPBERRY PI SPECIFIC PACKAGES]*
# Install the following RaspberryPi specific packages: raspi-config, GPIO related (pigpio, python3-gpio, raspi-gpio, python3-rpi.gpio),
# VideoCore debugging related (vcdbg), sense-hat, sense-emu.
# *partially depends on DESKTOP ENVIRONMENT (only sense-hat and sense-emu packages)
INSTALL_RPI_PACKAGES=n
#
#
#
# [EXTRA SCRIPT]
# Customize you Kuiper image by running an extra bash script.
# The 'EXTRA_SCRIPT' variable should have the path to the script you want to run.
# After cloning the repository, the script should be added inside 'adi-kuiper-gen' folder.
# The path should be relative to 'adi-kuiper-gen' folder.
# Example: EXTRA_SCRIPT=stages/07.extra-scripts/examples/extra-script-example.sh
# Example: EXTRA_SCRIPT=stages/07.extra-tweaks/01.extra-scripts/examples/extra-script-example.sh
EXTRA_SCRIPT=
#
#
Expand Down
1 change: 1 addition & 0 deletions kuiper-stages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export USE_ADI_REPO_CARRIERS_BOOT=${USE_ADI_REPO_CARRIERS_BOOT:-n}
export ADI_EVAL_BOARD=${ADI_EVAL_BOARD:-""}
export CARRIER=${CARRIER:-""}
export EXTRA_SCRIPT=${EXTRA_SCRIPT:-""}
export INSTALL_RPI_PACKAGES=${INSTALL_RPI_PACKAGES:-n}

# Check if architecture is supported
if [[ ! ${TARGET_ARCHITECTURE} = armhf && ! ${TARGET_ARCHITECTURE} = arm64 ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

# Variable EXTRA_SCRIPT should contain the path to the extra script.
# The script must be placed inside 'adi-kuiper-gen' directory and the path should be relative to that directory.
# Example: EXTRA_SCRIPT=stages/07.extra-scripts/examples/extra-script-example.sh and file 'extra-script-example.sh' is placed in stages/07.extra-scripts/examples directory.
# Example: EXTRA_SCRIPT=stages/07.extra-tweaks/01.extra-scripts/examples/extra-script-example.sh and file 'extra-script-example.sh' is placed in stages/07.extra-tweaks/01.extra-scripts/examples directory.

if [ ! -z "${EXTRA_SCRIPT}" ]; then
# Check if file exists
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Desktop Entry]
Name=Sense HAT Emulator
Comment=GUI for controlling the emulated Sense HAT
Exec=sense_emu_gui
Icon=/usr/local/share/sense/sense_emu_gui.svg
Terminal=false
Type=Application
Categories=Development
StartupNotify=true
Loading
Loading