Skip to content

Commit

Permalink
Merge branch 'qml' into add-usb-ether-gadget-toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
paulober authored Sep 27, 2024
2 parents d99a508 + 2ec36ed commit cb733d3
Show file tree
Hide file tree
Showing 14 changed files with 101 additions and 58 deletions.
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ Raspberry Pi Imaging Utility
- To install on Raspberry Pi OS, use `sudo apt update && sudo apt install rpi-imager`.
- Download the latest version for Windows, macOS and Ubuntu from the [Raspberry Pi downloads page](https://www.raspberrypi.com/software/).

# How to use Raspberry Pi Imager
## How to use Raspberry Pi Imager

Please see our [official documentation](https://www.raspberrypi.com/documentation/computers/getting-started.html#raspberry-pi-imager).



## Contributing

### Linux
Expand All @@ -36,13 +34,15 @@ git clone --depth 1 https://github.com/raspberrypi/rpi-imager

Modify appimagecraft.yml:

- First, you _must_ set Qt6_ROOT (as a extra_variables item under build/cmake) to the root of your Qt6 installation
- Second, you _must_ set QMAKE (as a raw_environment variable of the linuxdeploy plugin) to the full path of qmake inside that Qt6 installation.
- First, you _must_ set Qt6_ROOT (as a extra_variables item under build/cmake) to the root of your Qt6 installation. eg: `/opt/Qt/6.7.2/gcc_arm64/`
- Second, you _must_ set QMAKE (as a raw_environment variable of the linuxdeploy plugin) to the full path of qmake inside that Qt6 installation. eg: `/opt/Qt/6.7.2./gcc_arm64/bin/qmake`

Now, use AppImageCraft to build your AppImage:

```sh
cd rpi-imager
export LD_LIBRARY_PATH=${your_Qt6_install_path}/lib
./${your_platform_appimagecraft_AppImage_name}
./${your_platform_appimagecraft}.AppImage
```

Now mark the AppImage as executable, and run it:
Expand All @@ -69,6 +69,7 @@ Building Raspberry Pi Imager on Windows is best done with the Qt Creator GUI.

- Download source .zip from github and extract it to a folder on disk
- Open src/CMakeLists.txt in Qt Creator.
- Use Qt Creator to set the MINGW64_ROOT CMake variable to your MingGW64 installation path, eg `C:\Qt\Tools\mingw64`
- For builds you distribute to others, make sure you choose "Release" in the toolchain settings and not the Debug configuration.
- Menu "Build" -> "Build all"
- Result will be in build_rpi-imager_someversion
Expand All @@ -86,13 +87,14 @@ During installation, choose Qt 6.7, CMake and Qt Creator.

- Download source .zip from github and extract it to a folder on disk
- Start Qt Creator and open src/CMakeLists.txt
- Use Qt Creator to set the Qt6_ROOT CMake variable to your Qt6 installation path, eg `/opt/Qt6/6.7.2/gcc_arm64`
- Menu "Build" -> "Build all"
- Result will be in build_rpi-imager_someversion
- For distribution to others:
- Use the IMAGER_SIGNED_APP flag to enable Application signing
- Use the IMAGER_SIGNING_IDENTITY string to specify the Developer ID certificate Common Name
- Use the IMAGER_NOTARIZE_APP flag to enable notarization as part of the build
- Use the IMAGER_NOTARIZE_KEYCHAIN_PROFILE string to specify the name of the keychain item containing your Apple ID credentials for notarizing.
- Use the IMAGER_SIGNED_APP flag to enable Application signing
- Use the IMAGER_SIGNING_IDENTITY string to specify the Developer ID certificate Common Name
- Use the IMAGER_NOTARIZE_APP flag to enable notarization as part of the build
- Use the IMAGER_NOTARIZE_KEYCHAIN_PROFILE string to specify the name of the keychain item containing your Apple ID credentials for notarizing.

### Linux embedded (netboot) build

Expand Down
2 changes: 1 addition & 1 deletion appimagecraft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 1

project:
name: org.raspberrypi.rpi-imager
version: 1.9.0
version: 1.9.1

build:
cmake:
Expand Down
12 changes: 12 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
rpi-imager (1.9.1) unstable; urgency=medium

* i18n: German, Taiwanese, Catalan, Spanish, Slovak
translations updated
* i18n: Added Hebrew translation
* qml: OS Customisation: Allow mouse selection in
comboboxes
* qml: MessagePopup: Constrain text, align to the center
* packaging: debian: Ignore AppImages and ci scripts

-- Tom Dewey <[email protected]> Wed, 18 Sep 2024 18:57:00 +0000

rpi-imager (1.9.0) unstable; urgency=medium

* ui: Upgrade to Qt6.7, bringing new controls to everything
Expand Down
4 changes: 2 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Standards-Version: 4.1.2
Homepage: https://www.raspberrypi.com/software

Package: rpi-imager
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, dosfstools, fdisk, fuse
Architecture: arm64
Depends: ${shlibs:Depends}, ${misc:Depends}, dosfstools, fdisk, fuse, libfuse2
Recommends: udisks2
Description: Raspberry Pi Imaging utility
A user-friendly tool for creating bootable media for Raspberry Pi Devices.
2 changes: 1 addition & 1 deletion debian/org.raspberrypi.rpi-imager.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ Name[zh_CN]=树莓派启动盘制作工具
Comment=Raspberry Pi Imager
Comment[zh_CN]=树莓派启动盘制作工具
Icon=rpi-imager
Exec=/usr/bin/rpi-imager.AppImage %F
Exec=/usr/bin/rpi-imager %F
Categories=Utility
StartupNotify=false
4 changes: 2 additions & 2 deletions debian/postinst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh

if [ ! -x /usr/bin/rpi-imager.AppImage ]; then
chmod +x /usr/bin/rpi-imager.AppImage
if [ ! -x /usr/bin/rpi-imager ]; then
chmod +x /usr/bin/rpi-imager
fi
4 changes: 3 additions & 1 deletion debian/install → debian/rpi-imager.install
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
rpi-imager.AppImage /usr/bin/
#!/usr/bin/dh-exec

rpi-imager.AppImage => /usr/bin/rpi-imager

debian/rpi-imager.png /usr/share/icons/hicolor/128x128/apps/

Expand Down
2 changes: 1 addition & 1 deletion debian/rpi-imager.metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</screenshots>
<url type="homepage">https://github.com/raspberrypi/rpi-imager</url>
<provides>
<binary>rpi-imager.AppImage</binary>
<binary>rpi-imager</binary>
</provides>
<releases>
<release version="1.9.0" />
Expand Down
3 changes: 3 additions & 0 deletions debian/source/options
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tar-ignore = "release.appimagecraft.yml"
tar-ignore = "*.AppImage"
tar-ignore = "ci"
5 changes: 4 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ endif(APPLE)

# Bundled code will occasionally use identical options - eg, BUILD_TESTING.
set(BUILD_TESTING OFF)
set(BUILD_STATIC_LIBS ON)
set(BUILD_SHARED_LIBS OFF)

# Bundled liblzma
set(XZ_MICROLZMA_DECODER OFF)
Expand Down Expand Up @@ -79,6 +81,7 @@ set(ZSTD_LIBRARIES libzstd_static)

# Bundled zlib
set(ZLIB_BUILD_EXAMPLES OFF)
set(SKIP_INSTALL_ALL ON)
add_subdirectory(dependencies/zlib-1.3.1)
set(ZLIB_FOUND TRUE)
set(ZLIB_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/dependencies/zlib-1.3.1 CACHE PATH "zlib include dir")
Expand Down Expand Up @@ -114,7 +117,6 @@ set(LibArchive_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/dependencies/libarchive-3.7

# Bundled libcurl
set(CMAKE_CURL_INCLUDES)
set(BUILD_STATIC_CURL true)
set(BUILD_CURL_EXE OFF CACHE BOOL "" FORCE)
set(BUILD_LIBCURL_DOCS OFF CACHE BOOL "" FORCE)
set(ENABLE_CURL_MANUAL OFF CACHE BOOL "" FORCE)
Expand All @@ -136,6 +138,7 @@ set(CURL_DISABLE_TELNET ON)
set(CURL_DISABLE_TFTP ON)
set(CURL_ZSTD ON)
set(CURL_ENABLE_EXPORT_TARGET OFF CACHE BOOL "" FORCE)
set(CURL_DISABLE_INSTALL ON)
if (APPLE)
# TODO: SecureTransport is a deprecated API in macOS, supporting
# only up to TLS v1.2. cURL has not implemented the replacement,
Expand Down
10 changes: 6 additions & 4 deletions src/MsgPopup.qml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ Popup {

MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
msgpopup.close()
}
Expand Down Expand Up @@ -90,10 +89,13 @@ Popup {
textFormat: Text.StyledText
font.family: roboto.name
Layout.fillHeight: true
Layout.leftMargin: 25
Layout.rightMargin: 25
Layout.topMargin: 25
Layout.fillWidth: true
Layout.leftMargin: 10
Layout.rightMargin: 10
Layout.topMargin: 10
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
Accessible.name: text.replace(/<\/?[^>]+(>|$)/g, "")
}

Expand Down
3 changes: 3 additions & 0 deletions src/OptionsPopup.qml
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ Window {
}
ComboBox {
id: fieldWifiCountry
selectTextByMouse: true
enabled: chkWifi.checked
editable: true
}
Expand All @@ -329,6 +330,7 @@ Window {
}
ComboBox {
enabled: chkLocale.checked
selectTextByMouse: true
id: fieldTimezone
editable: true
Layout.minimumWidth: 200
Expand All @@ -347,6 +349,7 @@ Window {
}
ComboBox {
enabled: chkLocale.checked
selectTextByMouse: true
id: fieldKeyboardLayout
editable: true
Layout.minimumWidth: 200
Expand Down
80 changes: 48 additions & 32 deletions src/dependencies/xz-5.6.2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ if(NOT MSVC)
endif()
endif()

OPTION(XZ_INSTALL OFF "Enable xz Install directives")

# On Apple OSes, don't build executables as bundles:
set(CMAKE_MACOSX_BUNDLE OFF)

Expand Down Expand Up @@ -1378,6 +1380,7 @@ configure_file(src/liblzma/liblzma.pc.in liblzma.pc

# Install the library binary. The INCLUDES specifies the include path that
# is exported for other projects to use but it doesn't install any files.
if (XZ_INSTALL)
install(TARGETS liblzma EXPORT liblzmaTargets
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
COMPONENT liblzma_Runtime
Expand Down Expand Up @@ -1416,7 +1419,7 @@ if(NOT MSVC)
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
COMPONENT liblzma_Development)
endif()

endif(XZ_INSTALL)

#############################################################################
# Helper functions for installing files
Expand All @@ -1427,13 +1430,15 @@ endif()
# The target file should exist because on Cygwin and MSYS2 symlink creation
# can fail under certain conditions if the target doesn't exist.
function(my_install_symlinks COMPONENT DIR TARGET_NAME LINK_SUFFIX LINK_NAMES)
install(CODE "set(D \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${DIR}\")
foreach(L ${LINK_NAMES})
file(CREATE_LINK \"${TARGET_NAME}\"
\"\${D}/\${L}${LINK_SUFFIX}\"
SYMBOLIC)
endforeach()"
COMPONENT "${COMPONENT}")
if (XZ_INSTALL)
install(CODE "set(D \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${DIR}\")
foreach(L ${LINK_NAMES})
file(CREATE_LINK \"${TARGET_NAME}\"
\"\${D}/\${L}${LINK_SUFFIX}\"
SYMBOLIC)
endforeach()"
COMPONENT "${COMPONENT}")
endif(XZ_INSTALL)
endfunction()

# Installs a man page file of a given language ("" for the untranslated file)
Expand All @@ -1451,10 +1456,11 @@ function(my_install_man_lang COMPONENT SRC_FILE MAN_LANG LINK_NAMES)

# Installing the file must be done before creating the symlinks
# due to Cygwin and MSYS2.
install(FILES "${SRC_FILE}"
DESTINATION "${CMAKE_INSTALL_MANDIR}/${MAN_LANG}/man${MAN_SECTION}"
COMPONENT "${COMPONENT}")

if(XZ_INSTALL)
install(FILES "${SRC_FILE}"
DESTINATION "${CMAKE_INSTALL_MANDIR}/${MAN_LANG}/man${MAN_SECTION}"
COMPONENT "${COMPONENT}")
endif(XZ_INSTALL)
# Get the basename of the file to be used as the symlink target.
get_filename_component(BASENAME "${SRC_FILE}" NAME)

Expand Down Expand Up @@ -1593,10 +1599,11 @@ if(XZ_HAVE_DECODERS AND (NOT MSVC OR MSVC_VERSION GREATER_EQUAL 1900))
endif()

tuklib_progname("${XZDEC}")

install(TARGETS "${XZDEC}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
COMPONENT "${XZDEC}_Runtime")
if (XZ_INSTALL)
install(TARGETS "${XZDEC}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
COMPONENT "${XZDEC}_Runtime")
endif(XZ_INSTALL)
endforeach()

# This is the only build-time difference with lzmadec.
Expand Down Expand Up @@ -1657,10 +1664,11 @@ if(XZ_HAVE_DECODERS AND (NOT MSVC OR MSVC_VERSION GREATER_EQUAL 1900))
# )
# endif()

install(TARGETS lzmainfo
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
COMPONENT lzmainfo_Runtime)

if (XZ_INSTALL)
install(TARGETS lzmainfo
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
COMPONENT lzmainfo_Runtime)
endif(XZ_INSTALL)
if(UNIX)
my_install_man(lzmainfo_Documentation src/lzmainfo/lzmainfo.1 "")
endif()
Expand Down Expand Up @@ -1866,9 +1874,11 @@ if(NOT MSVC OR MSVC_VERSION GREATER_EQUAL 1900)
# Our installation order must be such that when a symbolic link is created
# its target must already exists. There is no race condition for parallel
# builds because the generated cmake_install.cmake executes serially.
install(TARGETS xz
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
COMPONENT xz_Runtime)
if (XZ_INSTALL)
install(TARGETS xz
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
COMPONENT xz_Runtime)
endif(XZ_INSTALL)

if(UNIX)
option(CREATE_XZ_SYMLINKS "Create unxz and xzcat symlinks" ON)
Expand Down Expand Up @@ -1949,9 +1959,11 @@ if(UNIX)
@ONLY
NEWLINE_STYLE LF)

install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/${S}"
DESTINATION "${CMAKE_INSTALL_BINDIR}"
COMPONENT scripts_Runtime)
if (XZ_INSTALL)
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/${S}"
DESTINATION "${CMAKE_INSTALL_BINDIR}"
COMPONENT scripts_Runtime)
endif(XZ_INSTALL)
endforeach()

# file(CHMOD ...) would need CMake 3.19 so use execute_process instead.
Expand Down Expand Up @@ -2010,15 +2022,19 @@ if(UNIX)
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/doc/api/index.html"
)

install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/doc/api"
DESTINATION "${CMAKE_INSTALL_DOCDIR}"
COMPONENT liblzma_Documentation)
if (XZ_INSTALL)
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/doc/api"
DESTINATION "${CMAKE_INSTALL_DOCDIR}"
COMPONENT liblzma_Documentation)
endif(XZ_INSTALL)
endif()
endif()

install(DIRECTORY doc/examples
DESTINATION "${CMAKE_INSTALL_DOCDIR}"
COMPONENT liblzma_Documentation)
if (XZ_INSTALL)
install(DIRECTORY doc/examples
DESTINATION "${CMAKE_INSTALL_DOCDIR}"
COMPONENT liblzma_Documentation)
endif(XZ_INSTALL)

# GPLv2 applies to the scripts. If GNU getopt_long is used then
# LGPLv2.1 applies to the command line tools but, using the
Expand Down
6 changes: 3 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,13 @@ int main(int argc, char *argv[])
}
else if (args[i] == "--help")
{
cerr << args[0] << " [--debug] [--version] [--repo <repository URL>] [--qm <custom qm translation file>] [--disable-telemetry] [<image file to write>]" << endl;
cerr << "-OR- " << args[0] << " --cli [--disable-verify] [--sha256 <expected hash>] [--debug] [--quiet] <image file to write> <destination drive device>" << endl;
cerr << "rpi-imager [--debug] [--version] [--repo <repository URL>] [--qm <custom qm translation file>] [--disable-telemetry] [<image file to write>]" << endl;
cerr << "-OR- rpi-imager --cli [--disable-verify] [--sha256 <expected hash>] [--debug] [--quiet] <image file to write> <destination drive device>" << endl;
return 0;
}
else if (args[i] == "--version")
{
cerr << args[0] << " version " << imageWriter.constantVersion() << endl;
cerr << "rpi-imager version " << imageWriter.constantVersion() << endl;
cerr << "Repository: " << imageWriter.constantOsListUrl().toString() << endl;
return 0;
}
Expand Down

0 comments on commit cb733d3

Please sign in to comment.