Skip to content

Commit

Permalink
Merge pull request #3610 from HiassofT/le92-noobs-fixes
Browse files Browse the repository at this point in the history
[le92] fix noobs image creation
  • Loading branch information
MilhouseVH committed Jun 27, 2019
2 parents 243ca12 + 92e234c commit e8a8df3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions config/noobs/os.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"description": "@DESCRIPTION@",
"username": "root",
"password": "@ROOT_PASSWORD@",
"supported_models": [@NOOBS_SUPPORTED_MODELS@],
"supported_hex_revisions": "@NOOBS_HEX@"
"supported_hex_revisions": "@NOOBS_HEX@",
"supported_models": [@NOOBS_SUPPORTED_MODELS@]
}
4 changes: 2 additions & 2 deletions projects/RPi/devices/RPi4/options
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# Device defaults
################################################################################

# NOOBS supported hex versions (legacy)
NOOBS_HEX="1040,1041,2082"
# NOOBS supported hex versions (legacy) is not relevant for RPi4
unset NOOBS_HEX

# NOOBS supported model versions
NOOBS_SUPPORTED_MODELS='"Pi 4"'
Expand Down
20 changes: 12 additions & 8 deletions scripts/image
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,14 @@ if [ "${1}" = "release" -o "${1}" = "mkimage" -o "${1}" = "noobs" ]; then
cp ${ROOT}/README* ${RELEASE_DIR}/${NOOBS_DISTRO}
cp ${ROOT}/CHANGELOG ${RELEASE_DIR}/${NOOBS_DISTRO}/release_notes.txt

if [ -n "${NOOBS_HEX}" ]; then
sed -e "s%@NOOBS_HEX@%${NOOBS_HEX}%g" \
-i ${RELEASE_DIR}/${NOOBS_DISTRO}/os.json
else
sed -e "/@NOOBS_HEX@/d" \
-i ${RELEASE_DIR}/${NOOBS_DISTRO}/os.json
fi

sed -e "s%@DISTRONAME@%${DISTRONAME}%g" \
-e "s%@PROJECT@%${DEVICE:-${PROJECT}}%g" \
-e "s%@LIBREELEC_VERSION@%${LIBREELEC_VERSION}%g" \
Expand All @@ -372,7 +380,6 @@ if [ "${1}" = "release" -o "${1}" = "mkimage" -o "${1}" = "noobs" ]; then
-e "s%@DESCRIPTION@%${DESCRIPTION}%g" \
-e "s%@ROOT_PASSWORD@%${ROOT_PASSWORD}%g" \
-e "s%@NOOBS_SUPPORTED_MODELS@%${NOOBS_SUPPORTED_MODELS}%g" \
-e "s%@NOOBS_HEX@%${NOOBS_HEX}%g" \
-i ${RELEASE_DIR}/${NOOBS_DISTRO}/os.json

sed -e "s%@DISTRONAME@%${DISTRONAME}%g" \
Expand All @@ -383,12 +390,9 @@ if [ "${1}" = "release" -o "${1}" = "mkimage" -o "${1}" = "noobs" ]; then
# Create System dir
mkdir -p ${RELEASE_DIR}/${NOOBS_DISTRO}/System

BOOTLOADER_DIR="$(get_pkg_directory "${BOOTLOADER}")"
if [ -d ${BOOTLOADER_DIR}/files/3rdparty/bootloader/ ]; then
cp -PR ${BOOTLOADER_DIR}/files/3rdparty/bootloader/* ${RELEASE_DIR}/${NOOBS_DISTRO}/System
fi

# Copy Bootloader
cp -PR ${INSTALL}/usr/share/bootloader/config.txt ${RELEASE_DIR}/${NOOBS_DISTRO}/System/
cp -PR ${INSTALL}/usr/share/bootloader/distroconfig.txt ${RELEASE_DIR}/${NOOBS_DISTRO}/System/
cp -PR ${INSTALL}/usr/share/bootloader/LICENCE* ${RELEASE_DIR}/${NOOBS_DISTRO}/System/
cp -PR ${INSTALL}/usr/share/bootloader/bootcode.bin ${RELEASE_DIR}/${NOOBS_DISTRO}/System/
cp -PR ${INSTALL}/usr/share/bootloader/fixup.dat ${RELEASE_DIR}/${NOOBS_DISTRO}/System/
Expand Down Expand Up @@ -430,8 +434,8 @@ if [ "${1}" = "release" -o "${1}" = "mkimage" -o "${1}" = "noobs" ]; then
rm -rf ${RELEASE_DIR}/${NOOBS_DISTRO}/Storage.tar.xz

# Create filesystem tarballs
tar cJf ${RELEASE_DIR}/${NOOBS_DISTRO}/System.tar.xz -C ${RELEASE_DIR}/${NOOBS_DISTRO}/System/ .
tar cJf ${RELEASE_DIR}/${NOOBS_DISTRO}/Storage.tar.xz -C ${RELEASE_DIR}/${NOOBS_DISTRO}/Storage/ .
${TOOLCHAIN}/bin/fakeroot tar cJf ${RELEASE_DIR}/${NOOBS_DISTRO}/System.tar.xz -C ${RELEASE_DIR}/${NOOBS_DISTRO}/System/ .
${TOOLCHAIN}/bin/fakeroot tar cJf ${RELEASE_DIR}/${NOOBS_DISTRO}/Storage.tar.xz -C ${RELEASE_DIR}/${NOOBS_DISTRO}/Storage/ .

# Remove filesystem dirs
rm -rf ${RELEASE_DIR}/${NOOBS_DISTRO}/System
Expand Down

0 comments on commit e8a8df3

Please sign in to comment.