Skip to content

Commit

Permalink
🐛 Fix bootargs matcher for rpi
Browse files Browse the repository at this point in the history
It was matching before on ubuntu flavours and copying the debian one all
the time in rpi stuff

Also adds a check to copy it only if its not there already so we dont
touch it on other artifacts

Signed-off-by: Itxaka <[email protected]>
  • Loading branch information
Itxaka committed Sep 12, 2023
1 parent 2f32f60 commit e0ddc6d
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -273,20 +273,22 @@ framework:
COPY +luet/luet /framework/usr/bin/luet
COPY framework-profile.yaml /framework/etc/luet/luet.yaml

# Copy bootargs.cfg into the final framework as its needed to boot
IF [[ "$FLAVOR" =~ ^alpine* ]]
COPY ./images/alpine/bootargs.cfg /framework/etc/cos/bootargs.cfg
ELSE IF [[ "$FLAVOR" = "ubuntu-20-lts-arm-nvidia-jetson-agx-orin" ]]
COPY ./images/nvidia/bootargs.cfg /framework/etc/cos/bootargs.cfg
ELSE IF [[ "$FLAVOR" =~ "ubuntu" ]]
COPY ./images/debian/bootargs.cfg /framework/etc/cos/bootargs.cfg
ELSE IF [[ "$FLAVOR" =~ ^opensuse-leap$ ]] || [[ "$FLAVOR" =~ ^opensuse-tumbleweed$ ]] # Be specific so it doesnt match the arm-rpi flavors
COPY ./images/opensuse/bootargs.cfg /framework/etc/cos/bootargs.cfg
ELSE IF [[ "$FLAVOR" =~ ^rockylinux* ]] || [[ "$FLAVOR" =~ ^fedora* ]] || [[ "$FLAVOR" =~ ^almalinux* ]]
COPY ./images/redhat/bootargs.cfg /framework/etc/cos/bootargs.cfg
ELSE IF [[ "$FLAVOR" =~ -rpi$ ]]
COPY ./images/rpi/bootargs.cfg /framework/etc/cos/bootargs.cfg
COPY ./images/rpi/config.txt /framework/boot/config.txt
# Copy bootargs.cfg into the final framework as its needed to boot if its not there
IF [ ! -f /framework/etc/cos/bootargs.cfg ]
IF [[ "$FLAVOR" =~ ^alpine* ]]
COPY ./images/alpine/bootargs.cfg /framework/etc/cos/bootargs.cfg
ELSE IF [[ "$FLAVOR" = "ubuntu-20-lts-arm-nvidia-jetson-agx-orin" ]]
COPY ./images/nvidia/bootargs.cfg /framework/etc/cos/bootargs.cfg
ELSE IF [[ "$FLAVOR" =~ "ubuntu" ]] && [[ ! "$FLAVOR" =~ -rpi$ ]]
COPY ./images/debian/bootargs.cfg /framework/etc/cos/bootargs.cfg
ELSE IF [[ "$FLAVOR" =~ ^opensuse-leap$ ]] || [[ "$FLAVOR" =~ ^opensuse-tumbleweed$ ]] # Be specific so it doesnt match the arm-rpi flavors
COPY ./images/opensuse/bootargs.cfg /framework/etc/cos/bootargs.cfg
ELSE IF [[ "$FLAVOR" =~ ^rockylinux* ]] || [[ "$FLAVOR" =~ ^fedora* ]] || [[ "$FLAVOR" =~ ^almalinux* ]]
COPY ./images/redhat/bootargs.cfg /framework/etc/cos/bootargs.cfg
ELSE IF [[ "$FLAVOR" =~ -rpi$ ]]
COPY ./images/rpi/bootargs.cfg /framework/etc/cos/bootargs.cfg
COPY ./images/rpi/config.txt /framework/boot/config.txt
END
END

SAVE ARTIFACT --keep-own /framework/ framework
Expand Down

0 comments on commit e0ddc6d

Please sign in to comment.