├── LICENSE ├── README.md └── rmpp_entware.sh /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Hugo Menzaghi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![rmpp](https://img.shields.io/badge/rMPP-supported-green)](https://remarkable.com/store/overview/remarkable-paper-pro) 2 | # RMPP Entware 3 | 4 | **RMPP Entware** allows you to install additional software packages from the [Entware](https://github.com/Entware/Entware) repositories on your reMarkable device. This enhances your device's functionality through a lightweight package manager designed for embedded systems. 5 | 6 | > **Special Thanks:** 7 | > I extend my gratitude to [Evidlo](https://github.com/Evidlo) for his original work on [remarkable_entware](https://github.com/Evidlo/remarkable_entware), which served as the foundation to this script. 8 | 9 | ## Table of Contents 10 | 11 | - [Features](#features) 12 | - [Prerequisites](#prerequisites) 13 | - [Installation](#installation) 14 | - [Step 1: Connect Your reMarkable](#step-1-connect-your-remarkable) 15 | - [Step 2: Access via SSH](#step-2-access-via-ssh) 16 | - [Step 3: Run the Installer](#step-3-run-the-installer) 17 | - [Usage](#usage) 18 | - [Installing Packages](#installing-packages) 19 | - [Searching for Packages](#searching-for-packages) 20 | - [Managing Updates](#managing-updates) 21 | - [After a Firmware Update](#after-a-firmware-update) 22 | - [Cleanup](#cleanup) 23 | - [Additional Information](#additional-information) 24 | - [PATH Configuration](#path-configuration) 25 | - [Toltec Compatibility](#toltec-compatibility) 26 | - [Managing Packages with Opkg](#managing-packages-with-opkg) 27 | - [Final Notes](#final-notes) 28 | - [System Compatibility](#system-compatibility) 29 | - [Safety Precautions](#safety-precautions) 30 | - [Support Disclaimer](#support-disclaimer) 31 | - [Support](#support) 32 | 33 | ## Features 34 | 35 | - **Extended Functionality:** Install a wide range of packages from Entware repositories. 36 | - **RMPP Support:** Tailored for devices running the RMPP firmware. 37 | - **Persistent Installation:** Remains intact even after firmware updates. 38 | 39 | ## Prerequisites 40 | 41 | Before installing reMarkable Entware, ensure you have the following: 42 | 43 | - **reMarkable Device:** Ensure your device is running the RMPP firmware. 44 | - **USB Connection:** A USB cable to connect your reMarkable to your computer. 45 | - **Internet Access:** The device must be connected to the internet. 46 | - **SSH Access:** Ability to access your device via SSH. 47 | 48 | ## Installation 49 | 50 | Follow these steps to install RMPP Entware on your device. 51 | 52 | ### Step 1: Connect Your reMarkable 53 | 54 | 1. **Connect via USB:** Use a USB cable to connect your reMarkable device to your computer. 55 | 2. **Ensure Internet Access:** Verify that your device is connected to the internet to download necessary packages. 56 | 57 | ### Step 2: Access via SSH 58 | 59 | 1. **Enable SSH:** If not already enabled, follow [these instructions](https://remarkable.guide/guide/access/index.html) to enable SSH on your reMarkable (dev mode). 60 | 2. **Connect to SSH:** Use an SSH client to connect to your device. For example: 61 | ```bash 62 | ssh root@ 63 | ``` 64 | 65 | ### Step 3: Run the Installer 66 | 67 | Execute the installation script to set up Entware on your device. 68 | 69 | #### Standard Installation 70 | 71 | ```bash 72 | wget -O - http://raw.githubusercontent.com/hmenzagh/rmpp-entware/main/rmpp_entware.sh | bash 73 | ``` 74 | 75 | #### Force Installation (Bypass Prompts) 76 | 77 | If you prefer a non-interactive installation that automatically answers to prompts: 78 | 79 | ```bash 80 | wget -O - http://raw.githubusercontent.com/hmenzagh/rmpp-entware/main/rmpp_entware.sh | bash -s -- --force 81 | ``` 82 | 83 | #### Cleanup Installation (Remove Existing Entware) 84 | 85 | To remove any partial or existing Entware installation: 86 | 87 | ```bash 88 | wget -O - http://raw.githubusercontent.com/hmenzagh/rmpp-entware/main/rmpp_entware.sh | bash -s -- --cleanup 89 | ``` 90 | 91 | ##### Force Cleanup (No Prompts) 92 | 93 | ```bash 94 | wget -O - http://raw.githubusercontent.com/hmenzagh/rmpp-entware/main/rmpp_entware.sh | bash -s -- --cleanup --force 95 | ``` 96 | 97 | #### Re-enable Entware After Firmware Update 98 | 99 | > **Warning:** This part of the script has not been tested yet & may not work as expected. 100 | After updating your device's firmware, Entware remains safe in `/home/root/.entware`. To remount `/opt` and re-enable Entware: 101 | 102 | ```bash 103 | wget -O - http://raw.githubusercontent.com/hmenzagh/rmpp-entware/main/rmpp_entware.sh | bash -s -- --reenable 104 | ``` 105 | 106 | ##### Force Re-enable (No Prompts) 107 | 108 | ```bash 109 | wget -O - http://raw.githubusercontent.com/hmenzagh/rmpp-entware/main/rmpp_entware.sh | bash -s -- --reenable --force 110 | ``` 111 | 112 | > **Note:** The base installation requires approximately **13MB** of space. All Entware data is stored in `/opt`, which is bind-mounted to `/home/root/.entware` to optimize space usage on the root partition. 113 | 114 | ## Usage 115 | 116 | Once installed, you can manage packages using the `opkg` package manager. 117 | 118 | ### Installing Packages 119 | 120 | To install a package, use the following command: 121 | 122 | ```bash 123 | opkg install 124 | ``` 125 | 126 | **Example: Install Git** 127 | 128 | ```bash 129 | opkg install git 130 | ``` 131 | 132 | ### Searching for Packages 133 | 134 | To search for available packages, use: 135 | 136 | ```bash 137 | opkg find '' 138 | ``` 139 | 140 | **Example: Search for Packages Related to 'top'** 141 | 142 | ```bash 143 | opkg find '*top*' 144 | ``` 145 | 146 | ## Managing Updates 147 | 148 | ### After a Firmware Update 149 | 150 | Firmware updates might overwrite data outside `/home/root`. However, Entware remains safe in `/home/root/.entware`. To ensure Entware remains functional: 151 | 152 | 1. **Remount `/opt`:** 153 | 154 | ```bash 155 | wget -O - http://raw.githubusercontent.com/hmenzagh/rmpp-entware/main/rmpp_entware.sh | bash -s -- --reenable 156 | ``` 157 | 158 | 2. **Force Re-enable (No Prompts):** 159 | 160 | ```bash 161 | wget -O - http://raw.githubusercontent.com/hmenzagh/rmpp-entware/main/rmpp_entware.sh | bash -s -- --reenable --force 162 | ``` 163 | 164 | ## Cleanup 165 | 166 | If you need to remove Entware from your device, follow these steps. 167 | 168 | ### Remove Entware 169 | 170 | ```bash 171 | wget -O - http://raw.githubusercontent.com/hmenzagh/rmpp-entware/main/rmpp_entware.sh | bash -s -- --cleanup 172 | ``` 173 | 174 | #### Force Cleanup (No Prompts) 175 | 176 | ```bash 177 | wget -O - http://raw.githubusercontent.com/hmenzagh/rmpp-entware/main/rmpp_entware.sh | bash -s -- --cleanup --force 178 | ``` 179 | 180 | ### Free Up Disk Space 181 | 182 | To free up space on the root partition by cleaning up system logs: 183 | 184 | ```bash 185 | journalctl --vacuum-size=2M 186 | ``` 187 | 188 | ## Additional Information 189 | 190 | ### PATH Configuration 191 | 192 | During installation, the script can automatically add `/opt/bin` and `/opt/sbin` to your `PATH`. If you skipped this step or used the `--force` option, you can manually update your `PATH`: 193 | 194 | 1. **Add to PATH:** 195 | 196 | ```bash 197 | export PATH=/opt/bin:/opt/sbin:$PATH 198 | ``` 199 | 200 | 2. **Apply Changes:** 201 | 202 | ```bash 203 | source ~/.bashrc 204 | ``` 205 | 206 | ### Toltec Compatibility 207 | 208 | - **Compatibility Limitation:** [Toltec](https://github.com/toltec-dev/toltec) is not supported on firmware versions above **3.3.2.1666** (as of 2024-12-22). 209 | - **RMPP Users:** Toltec is currently not viable for RMPP users. 210 | 211 | ## Managing Packages with Opkg 212 | 213 | Use `opkg` to manage your Entware packages effectively. 214 | 215 | ### Update Package List 216 | 217 | ```bash 218 | opkg update 219 | ``` 220 | 221 | ### Install a Package 222 | 223 | ```bash 224 | opkg install 225 | ``` 226 | 227 | ### Remove a Package 228 | 229 | ```bash 230 | opkg remove 231 | ``` 232 | 233 | ### Upgrade Installed Packages 234 | 235 | ```bash 236 | opkg upgrade 237 | ``` 238 | 239 | ## Final Notes 240 | 241 | ### System Compatibility 242 | 243 | - **Supported Devices:** This installer is specifically designed for **RMPP** devices. 244 | 245 | ### Safety Precautions 246 | 247 | - **Avoid Interruptions:** Do not power off your device during the installation process to prevent potential system corruption. 248 | 249 | ### Support Disclaimer 250 | 251 | - **Use at Your Own Risk:** I am not responsible for any damage or issues arising from the use of this software. 252 | - **No Guaranteed Support:** While I will try to help & update the script, support is limited. 253 | 254 | **Happy hacking!** 255 | 256 | For more detailed information about script usage and available options, run: 257 | 258 | ```bash 259 | wget -O - http://raw.githubusercontent.com/hmenzagh/rmpp-entware/main/rmpp_entware.sh | bash -s -- --help 260 | ``` 261 | 262 | ## Support 263 | 264 | If you encounter issues or have questions, consider the following resources: 265 | - **Documentation:** Refer to the [Entware Wiki](https://github.com/Entware/Entware/wiki) for comprehensive guides. 266 | - **Remarkable.Guide:** [reMarkable.Guide](https://remarkable.guide/) is a great resource to learn more about the reMarkable devices. 267 | 268 | --- 269 | 270 | **Disclaimer:** Always ensure you have backups of important data before making significant changes to your device. Proceed with caution and at your own risk. 271 | -------------------------------------------------------------------------------- /rmpp_entware.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Hugo Menzaghi - 2024-12-22 3 | # Entware Installer & Re-enabler for RMPP Devices 4 | 5 | ################################################################# 6 | ########################### VARIABLES ########################### 7 | ################################################################# 8 | 9 | # Exit on any error 10 | set -e 11 | 12 | FORCE=no 13 | CLEANUP=no 14 | REENABLE=no 15 | HELP=no 16 | 17 | # Variable to capture exit code 18 | EXIT_CODE=0 19 | 20 | ################################################################# 21 | ########################### FUNCTIONS ########################### 22 | ################################################################# 23 | 24 | usage() { 25 | cat </dev/null; then 100 | echo "$PATH_ENTRY" >>"$TARGET_FILE" 101 | echo "Updated PATH in $TARGET_FILE." 102 | else 103 | echo "/opt/bin and /opt/sbin already in PATH for $TARGET_FILE." 104 | fi 105 | } 106 | 107 | # Checksum function 108 | verify_checksum() { 109 | local file="$1" 110 | local expected_hash="$2" 111 | local computed_hash 112 | 113 | if [ ! -f "$file" ]; then 114 | echo "Error: File '$file' not found." 115 | return 1 116 | fi 117 | 118 | if command -v sha256sum >/dev/null 2>&1; then 119 | computed_hash=$(sha256sum "$file" | awk '{print $1}') 120 | else 121 | echo "Error: 'sha256sum' is not available." 122 | return 1 123 | fi 124 | 125 | if [ "$computed_hash" = "$expected_hash" ]; then 126 | echo "Checksum verification passed for $file." 127 | return 0 128 | else 129 | echo "Checksum verification failed for $file." 130 | echo "Expected: $expected_hash" 131 | echo "Computed: $computed_hash" 132 | return 1 133 | fi 134 | } 135 | 136 | # Cleanup function on error or abort 137 | cleanup() { 138 | set +e 139 | trap - ERR 140 | if [ "$CLEANUP" = "yes" ]; then 141 | answer="y" 142 | EXIT_CODE=0 143 | else 144 | echo "An error occurred during installation." 145 | echo "Would you like to clean up the partial installation? (y/N)" 146 | if [ "$FORCE" = "yes" ]; then 147 | echo "Force option enabled. Proceeding with cleanup..." 148 | answer="y" 149 | else 150 | read -r answer /dev/null 2>&1; then 162 | systemctl disable opt.mount 163 | systemctl daemon-reload 164 | fi 165 | 166 | rm -f /etc/systemd/system/opt.mount 167 | systemctl daemon-reload 168 | 169 | # Unmount and remove /opt 170 | if mountpoint -q /opt; then 171 | umount /opt 172 | fi 173 | rm -rf /opt /home/root/.entware 174 | 175 | # Remove symbolic links in /opt/etc 176 | for file in passwd group shells shadow gshadow localtime; do 177 | rm -f "/opt/etc/$file" 178 | done 179 | 180 | # Remove PATH modifications 181 | echo "Removing PATH modifications..." 182 | 183 | # Remove system-wide PATH modification 184 | SYSTEM_PROFILE_D="/etc/profile.d" 185 | ENTWARE_PROFILE="$SYSTEM_PROFILE_D/entware.sh" 186 | if [ -f "$ENTWARE_PROFILE" ]; then 187 | rm -f "$ENTWARE_PROFILE" 188 | echo "Removed $ENTWARE_PROFILE." 189 | fi 190 | 191 | # Remove user-specific PATH modifications 192 | PATH_ENTRY='export PATH=/opt/bin:/opt/sbin:\$PATH' 193 | USER_NAME=${SUDO_USER:-$(whoami)} 194 | USER_HOME=$(eval echo "~$USER_NAME") 195 | USER_PROFILE="$USER_HOME/.profile" 196 | USER_BASHRC="$USER_HOME/.bashrc" 197 | 198 | remove_path_entry() { 199 | TARGET_FILE=$1 200 | if [ -f "$TARGET_FILE" ] && [ -w "$TARGET_FILE" ]; then 201 | sed -i "\|$PATH_ENTRY|d" "$TARGET_FILE" 202 | echo "Removed PATH modification from $TARGET_FILE." 203 | fi 204 | } 205 | 206 | remove_path_entry "$USER_PROFILE" 207 | remove_path_entry "$USER_BASHRC" 208 | 209 | # Restore filesystem mount options 210 | restore_filesystem_state 211 | 212 | echo "Cleanup completed. Exiting..." 213 | exit $EXIT_CODE 214 | fi 215 | 216 | echo "Cleanup canceled. Exiting..." 217 | exit $EXIT_CODE 218 | } 219 | 220 | # Re-enable Entware function 221 | reenable_entware() { 222 | echo "=============================" 223 | echo " ** IMPORTANT **" 224 | echo "This script is intended for RMPP devices only. If you are not using an RMPP device, please exit immediately." 225 | echo "=============================" 226 | echo "Disclaimer:" 227 | echo "- **It is recommended to back up important data before proceeding.**" 228 | echo "- This script has been tested exclusively on firmware version v3.17.0.62." 229 | echo "- Do not power off the device during execution." 230 | echo "- The author is not liable for any potential damage caused by this script." 231 | echo "- Please review the script thoroughly before executing." 232 | echo "- No guaranteed support is provided for issues arising from this script." 233 | echo "=============================" 234 | echo "This script will perform the following actions:" 235 | echo "- Check if Entware is already enabled and exit if it is." 236 | echo "- Recreate the /opt directory if missing." 237 | echo "- Temporarily bind /home/root/.entware to /opt." 238 | echo "- Create a systemd unit file to persist the bind mount across reboots." 239 | echo "- Enable and start the opt.mount systemd service." 240 | echo "=============================" 241 | 242 | if [ "$FORCE" = "yes" ]; then 243 | echo "Force option enabled. Proceeding..." 244 | else 245 | echo "Press Ctrl+C to abort or press Enter to continue." 246 | read -r /dev/null 2>&1; then 254 | echo "Entware is already enabled." 255 | exit 0 256 | fi 257 | 258 | # Create /opt if missing 259 | echo "Creating /opt directory if it doesn't exist..." 260 | mkdir -p /opt 261 | 262 | # Temporarily bind-mount /home/root/.entware to /opt 263 | echo "Mounting /home/root/.entware to /opt..." 264 | mount --bind /home/root/.entware /opt 265 | 266 | # Create the systemd mount unit for /opt 267 | echo "Creating systemd unit for /opt mount..." 268 | cat >/etc/systemd/system/opt.mount </etc/systemd/system/opt.mount <"$ENTWARE_PROFILE" 553 | else 554 | echo "Cannot write to $SYSTEM_PROFILE_D. Skipping system-wide PATH update." 555 | fi 556 | 557 | USER_NAME=${SUDO_USER:-$(whoami)} 558 | USER_HOME=$(eval echo "~$USER_NAME") 559 | USER_PROFILE="$USER_HOME/.profile" 560 | USER_BASHRC="$USER_HOME/.bashrc" 561 | 562 | if [ -w "$USER_PROFILE" ]; then 563 | add_to_path "$USER_PROFILE" 564 | elif [ -w "$USER_BASHRC" ]; then 565 | add_to_path "$USER_BASHRC" 566 | else 567 | echo "Cannot write to $USER_PROFILE or $USER_BASHRC. Skipping user-specific PATH update." 568 | fi 569 | 570 | echo "PATH updated. Please reload your shell or log out and back in for changes to take effect." 571 | else 572 | echo "Skipping PATH update as per user request." 573 | fi 574 | 575 | echo "" 576 | echo "If PATH was not updated automatically, add the following to ~/.bashrc or ~/.profile:" 577 | echo "export PATH=/opt/bin:/opt/sbin:\$PATH" 578 | echo "Then run 'source ~/.bashrc' or 'source ~/.profile' to apply." 579 | echo "" 580 | echo "Manage packages using Opkg:" 581 | echo " opkg update" 582 | echo " opkg install " 583 | echo "" 584 | echo "Installation complete. Thank you for using the RMPP Entware installer." 585 | echo "Happy hacking!" 586 | exit 0 587 | --------------------------------------------------------------------------------