Skip to content
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
19 changes: 19 additions & 0 deletions export-image/04-set-partuuid/00-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,22 @@ sed -i "s/BOOTDEV/PARTUUID=${BOOT_PARTUUID}/" "${ROOTFS_DIR}/etc/fstab"
sed -i "s/ROOTDEV/PARTUUID=${ROOT_PARTUUID}/" "${ROOTFS_DIR}/etc/fstab"

sed -i "s/ROOTDEV/PARTUUID=${ROOT_PARTUUID}/" "${ROOTFS_DIR}/boot/firmware/cmdline.txt"

# Normalize CardputerZero cmdline for this image and keep console/splash/plymouth out.
if grep -q "dtoverlay=cardputerzero" "${ROOTFS_DIR}/boot/firmware/config.txt" 2>/dev/null; then
awk '
{
out = ""
for (i = 1; i <= NF; i++) {
if ($i != "console=serial0,115200" && $i != "splash" && $i != "plymouth.ignore-serial-consoles") {
out = out (out == "" ? "" : " ") $i
}
}
print out
}
' "${ROOTFS_DIR}/boot/firmware/cmdline.txt" > "${ROOTFS_DIR}/boot/firmware/cmdline.txt.tmp"
mv "${ROOTFS_DIR}/boot/firmware/cmdline.txt.tmp" "${ROOTFS_DIR}/boot/firmware/cmdline.txt"

# Keep boot/cmdline.txt aligned with the file actually mounted in verify.
cp "${ROOTFS_DIR}/boot/firmware/cmdline.txt" "${ROOTFS_DIR}/boot/cmdline.txt"
fi
21 changes: 19 additions & 2 deletions stage2/05-cardputerzero/02-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,27 @@ sed -i '1i kernel=u-boot.bin' ${ROOTFS_DIR}/boot/firmware/config.txt



# Append cmdline.txt parameters
sed -i 's/$/ quiet splash plymouth.ignore-serial-consoles fbcon=map:off cfg80211.ieee80211_regdom=AE/' \
# Append custom cmdline parameters for CardputerZero.
sed -i 's/$/ quiet fbcon=map:off cfg80211.ieee80211_regdom=AE/' \
"${ROOTFS_DIR}/boot/firmware/cmdline.txt"

# Clean up CardputerZero cmdline tokens.
for cmd in "${ROOTFS_DIR}/boot/firmware/cmdline.txt" "${ROOTFS_DIR}/boot/cmdline.txt"; do
[ -f "$cmd" ] || continue
awk '
{
out = ""
for (i = 1; i <= NF; i++) {
if ($i != "console=serial0,115200" && $i != "splash" && $i != "plymouth.ignore-serial-consoles") {
out = out (out == "" ? "" : " ") $i
}
}
print out
}
' "$cmd" > "${cmd}.tmp"
mv "${cmd}.tmp" "$cmd"
done

# Module load config
cat > "${ROOTFS_DIR}/etc/modules-load.d/cardputerzero.conf" << 'EOF'
i2c-dev
Expand Down
48 changes: 45 additions & 3 deletions tools/verify-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,52 @@ else
fi

# Check cmdline.txt
if grep -q "quiet splash" "$TMPDIR/boot/cmdline.txt" 2>/dev/null; then
pass "cmdline.txt: quiet splash"
if awk '
{
for (i = 1; i <= NF; i++) {
if ($i == "quiet") {
ok = 1
break
}
}
}
END {
exit (ok ? 0 : 1)
}
' "$TMPDIR/boot/cmdline.txt" 2>/dev/null; then
pass "cmdline.txt: quiet present"
else
fail "cmdline.txt: missing quiet splash"
fail "cmdline.txt: quiet missing"
fi

if awk '
{
for (i = 1; i <= NF; i++) {
if ($i == "splash") {
ok = 1
break
}
}
}
END {
exit (ok ? 0 : 1)
}
' "$TMPDIR/boot/cmdline.txt" >/dev/null 2>&1; then
fail "cmdline.txt: splash should be removed for CardputerZero"
else
pass "cmdline.txt: splash removed"
fi

if grep -q "plymouth.ignore-serial-consoles" "$TMPDIR/boot/cmdline.txt" 2>/dev/null; then
fail "cmdline.txt: plymouth.ignore-serial-consoles should be removed for CardputerZero"
else
pass "cmdline.txt: plymouth.ignore-serial-consoles removed"
fi

if grep -q "console=serial0,115200" "$TMPDIR/boot/cmdline.txt" 2>/dev/null; then
fail "cmdline.txt: console=serial0,115200 should be removed for CardputerZero"
else
pass "cmdline.txt: console=serial0,115200 removed"
fi

umount "$TMPDIR/boot" 2>/dev/null || true
Expand Down
Loading