Pi Power Tools

2025-12-11 0 211

Pi Power Tools

General Purpose Raspbian Image & SD Card Manager

Want to build your own custom Raspbian SD card image? Like enabling ssh, modifying /boot/config.txt, doing an apt update, enabling VNC, or installing something?
Have a pile of sd cards and curious what\’s on them? (and don\’t want to boot them, one at a time, in a Pi?)
Want to run two versions of Raspbian at once?
Or, how about running Raspbian Stretch on a Pi 4?

No other tool can do any of these:

  • Boot – Powered by Vdesktop. Runs the Raspbian image in a virtual machine. It even shows the desktop!
  • Flash – Flashes Raspbian directly from the Internet to the selected device. Tuned for maximum speed, proven by benchmarks.
  • Mount – Full control to manage loop devices and mountpoints.
  • Edit – Auto-creates a loop device, then lets you mess up its partitions with Gparted.
  • Resize – Add or remove free space from a disk image with a single click. <– This also repairs the image!

Sneak peek:

Want to give it a spin? Great!

To download & install

Run this command in a terminal in the desktop session, not from the console:

wget -O - https://raw.gi*th*ubuserconten*t.com/Botspot/Pi-Power-Tools/master/update | bash

This clones the repository to /home/pi/Pi-Power-Tools, adds a menu button, clones my vdesktop repo, and asks permission before installing YAD. Nothing is modified outside of your home directory.

System requirements:

  • Raspberry Pi 3B, 3B+, or 4B (untested on older models)
  • Running Raspbian Buster or Stretch
  • Passwordless sudo ability for pi user
  • Internet connection (recommended for update checking & img downloading)

After installing, Pi Power Tools can be launched from the Menu:

To uninstall:

If it\’s not working for you, please open an issue.

sudo apt purge gparted yad systemd-container xserver-xephyr expect
rm -rf ${HOME}/Pi-Power-Tools ${HOME}/Pi-Power-Tools.old
rm ${HOME}/Desktop/ppt.desktop ${HOME}/.local/share/applications/ppt.desktop

Instructions

Table of Contents

  • Home
    • Settings
  • IMG Mode
  • USB Mode
  • Flash
  • Button explanations
    • Boot
    • View
    • Edit
    • Advanced Mount
  • Under the hood
    • Directory Tree
  • Q&A

Home

The menu button opens this window by default. Enter IMG Mode or USB Mode from here. The Update button will appear if an update is available.

Settings

Currently, you can change what the menu button opens by default – (Flash, IMG Mode, USB Mode, and Home), if the Boot Button launches the Desktop, whether or not to run zerofree when the Shrink Button is clicked, and how much free space to add when the \’X GB free\’ button is clicked.

IMG Mode

Customize Raspbian Images.

Before you can see that above page, you first have to select an img.

4 ways to select a Raspbian Image:

  1. Click the arrow on the right to see any previously used disk images:
  2. Drag-n-drop a Raspbian image from File Manager to the text box:
  3. Click Download New to download & unzip a new Raspbian image:

    Download mode has been tuned for maximum speed.

  4. Or create an img from your running Pi by clicking SD to IMG.

After a disk image has been selected, this main page appears:

Buttons:

  • Back: Back to the image selection window.
  • Flash: Copy everything from the selected img to a device. Details
  • Boot: Attempt to \”boot\” the selected device using a virtual desktop. Details
  • View: Mounts the image to /media/pi/pi-power-tools so you can modify the filesystem. Details
  • Edit: Modify the partitions using Gparted. Details
  • Reset PT: This button attempts to fix the partitions if you messed them up somehow. It replaces the partition table with the one from Raspbian Buster Full. Your Mileage May Vary.
  • Advmount: Control exactly where to mount each partition. In theory this will work for any kind of disk image, but has only been tested on Raspbian images. YMMV. Details
  • Shrink: Removes all free space from the selected image. If enabled in Settings, zerofree will run afterwards to remove unused blocks from the disk image.

    • Though similar in function, the script used to do this is entirely different in design and does not utilize RonR\’s image-utils in any way.
  • 1 GB Free: Adds one gigabyte of free space to the root partition. Customize how much free space in Settings.

    • It is not accumulative, so clicking it multiple times won\’t result in multiple gigabytes of free space.

USB Mode

Manage storage devices connected to your Pi.

Select a drive in the list, then click an action button on the bottom.
Your Pi\’s internal SD Card (/dev/mmcblk0) cannot be flashed or booted.
Buttons:

  • Home: Back to the home window.
  • Refresh: Check for any newly inserted storage devices.
  • Flash: Copy everything from an img to the selected device. Details
  • Boot: Attempt to \”boot\” the selected device using a virtual desktop. Details
  • View: Mounts the device to /media/pi/pi-power-tools. Details
    Intended for Raspbian devices only, as this button assumes there are 2 partitions. (and mounts partition 1 to /media/pi/pi-power-tools/boot)
  • Edit: Modify the partitions using Gparted. Details

Flash

Select an input disk image and an output usb drive. The filesystem root device (/dev/mmcblk0) cannot be flashed and so is not listed.
In addition to any previously used img and zip files, there are three download options:

If Download is selected, this window will appear next asking which download mode you want.

The first mode is much faster than the second one.
Breakdown of the pros and cons:

Faster mode Slower mode
For Pies that don\’t have sufficient free space to hold a large disk image You keep the downloaded image for later.
Better for a single flash Better for flashing multiple SD cards

Concerning speed, here are benchmarks made on a 4GB Pi 4:

Faster Mode: Slower mode:
Raspbian Full 387 seconds 816 seconds
Raspbian 205 393
Raspbian Lite 102 184

Explanations for some buttons:

Boot

With this handy button, you can \”test drive\” your img/usb without needing to power down, switch sd cards, etc. Any changes made inside (apt install, change preferences, etc) will be preserved in the img/usb.

Instead of a Virtual Machine, this technique runs at 100% native speed (no emulation), because the guest runs the same kernel as the host device. Therefore, only booting Raspbian is supported, as other OSes require other kernels.
That means this method will still work just fine, even if the whole boot partition is corrupted!

First, the VM\’s Console will appear and display the boot text.
After the boot process has completed, and if \”Boot to Desktop\” is enabled in Settings, a window similar to VNC will open and display the desktop.

It is a known issue that the browser crashes with the Aw, Snap! error.

View

Mounts the selected device/img to /media/pi/pi-power-tools.

When you close the Viewing /dev/sdX dialog window, the selected device will be unmounted (ejected).

Edit

Lets you edit the partitions of the selected device using gparted.

Advanced Mount

Fine-tune control over loop devices and mountpoints for disk images.
If there are multiple loop devices associated with it, you will be prompted to select one and delete the others.
Which one to delete? Usually you want to keep the top one on the list. (in this example, that\’s /dev/loop0)

Now you can mount each partition where you want to:

When you\’re finished, be sure to click Delete to detach the loop device.


Under the hood

Pro tip: There are many comments in the shell scripts. Not only does this assist debugging, it also makes most of it self-explanatory.

Directory Tree:

Pi-Power-Tools/ – This is the main folder that stores everything.

During an update, the old folder is renamed to Pi-Power-Tools.old/

  • Scripts:
    • installgui – This prompts for packages to be installed
    • flash – This is the Flash tool\’s script.
    • update – This script is what installs/updates Pi Power Tools.
    • home – This is Home\’s script.
    • img-mode – This script is IMG Mode.
    • usb-mode – This script is USB Mode.
  • Other files:
    • installedpackages – Keeps a record of what the update script installed.
    • README.md – You are reading this right now.
  • Folders:
  • functions/ – Stores sub-scripts that do certain things.

    • advmount – The Advanced Mount tool.
    • buffer – The secret sauce behind the fast download speeds. This ARMHF executable ships with Pi Power Tools, to prevent adding a dependency for installing buffer.
    • edit – A short bash script that opens a Raspbian image in gparted. It handles creating a loop device and deleting it when done.
    • imglist-parser – Bash script that parses imglist, deletes entries that don\’t exist on the filesystem, removes duplicate entries, and echo\’s the resulting output.
    • milliways-image-backup – Fork of a fork of RonR\’s image-backup. I have made substancial changes to most of the script.
    • restore-pt – Short bash script to overwrite the specified disk image\’s partition table with part-table.img.
    • terminal-run – This simple script is used to run bash scripts in a terminal. It\’s a standardized workaround originally developed for Pi-Apps.
    • image-shrink – Botspot\’s version of image-shrink. Added a couple bug fixes and removed the interactive elements for better scripting usage.
    • zerofree – Another ARMHF executable for recognizing unused blocks and overwriting them with zeros. Shrinks a disk image even more. Only used if enabled in Settings.
    • zerofree_runner – Wrapper bash script to interface with zerofree. Creates a loop device for the specified img, runs zerofree, runs shrinkimage, then removes the loop device.
  • data/ – Stores configuration files

    • home.conf – Stores the configuration from the Settings window.
    • imglist – Keeps track of what disk images have been used.
    • mirrors – URLs, sizes, and names of download sites. Feel free to add your own.
    • mountpoint – Change where to mount to. Default is /media/pi/pi-power-tools.
    • part-table.img – The default partition table extracted from Raspbian Buster Full. Used by the Reset PT button in IMG Mode.
    • vdesktop.conf – Stores the boot mode for vdesktop. Possible values are gui, cli, and cli-login.
    • version – The new location for the version file. Compared against the online version to check for updates.
    • ziplist – Exactly the same as imglist, but stores entries for previously used ZIP files instead. Currently only used by the Flash tool.
  • icons/ – Stores all the icons for the user interface.
  • vdesktop/ – Ships empty, but installgui populates this folder with all files from the Vdesktop repo.

Basic script design:

  • The scripts all use YAD to handle the user interface.* I found that Zenity was way too limited. (and didn\’t allow for multiple buttons, button icons, customized tooltips, or much else)
    * Okay, installgui and update do use zenity because Raspbian does not include YAD by default.

Q&A

  • Q: Unique logo.What inspired you?

It\’s a combination of BB-8, the RPi logo, and a saw blade. Also I think it looks a bit like like a pineapple, which is my favorite fruit.

  • What made you develop this tool?

I while back, I wanted to download Raspbian, uninstall all programming tools from it, do an apt update & upgrade, add a chrome extension to the browser, then flash it to a SD card. It took several days to fumble around with terminal commands. The action was so simple, but the process so hard that I realized a tool to do it was sorely needed.

  • Q: How long did it take to program this?

Several months. But it saved me enough time to be worth it. And I had a blast programming it all.

下载源码

通过命令行克隆项目:

git clone https://github.com/Botspot/Pi-Power-Tools.git

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

申明:本文由第三方发布,内容仅代表作者观点,与本网站无关。对本文以及其中全部或者部分内容的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。本网发布或转载文章出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,也不代表本网对其真实性负责。

左子网 建站资源 Pi Power Tools https://www.zuozi.net/34814.html

zpix pixel font
上一篇: zpix pixel font
Aura.Session
下一篇: Aura.Session
常见问题
  • 1、自动:拍下后,点击(下载)链接即可下载;2、手动:拍下后,联系卖家发放即可或者联系官方找开发者发货。
查看详情
  • 1、源码默认交易周期:手动发货商品为1-3天,并且用户付款金额将会进入平台担保直到交易完成或者3-7天即可发放,如遇纠纷无限期延长收款金额直至纠纷解决或者退款!;
查看详情
  • 1、描述:源码描述(含标题)与实际源码不一致的(例:货不对板); 2、演示:有演示站时,与实际源码小于95%一致的(但描述中有”不保证完全一样、有变化的可能性”类似显著声明的除外); 3、发货:不发货可无理由退款; 4、安装:免费提供安装服务的源码但卖家不履行的; 5、收费:价格虚标,额外收取其他费用的(但描述中有显著声明或双方交易前有商定的除外); 6、其他:如质量方面的硬性常规问题BUG等。 注:经核实符合上述任一,均支持退款,但卖家予以积极解决问题则除外。
查看详情
  • 1、左子会对双方交易的过程及交易商品的快照进行永久存档,以确保交易的真实、有效、安全! 2、左子无法对如“永久包更新”、“永久技术支持”等类似交易之后的商家承诺做担保,请买家自行鉴别; 3、在源码同时有网站演示与图片演示,且站演与图演不一致时,默认按图演作为纠纷评判依据(特别声明或有商定除外); 4、在没有”无任何正当退款依据”的前提下,商品写有”一旦售出,概不支持退款”等类似的声明,视为无效声明; 5、在未拍下前,双方在QQ上所商定的交易内容,亦可成为纠纷评判依据(商定与描述冲突时,商定为准); 6、因聊天记录可作为纠纷评判依据,故双方联系时,只与对方在左子上所留的QQ、手机号沟通,以防对方不承认自我承诺。 7、虽然交易产生纠纷的几率很小,但一定要保留如聊天记录、手机短信等这样的重要信息,以防产生纠纷时便于左子介入快速处理。
查看详情

相关文章

猜你喜欢
发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务