Search Results : PiPArted

Apr 242013
 

Another update to PiParted

Fixed up non-appearing SD Cards
Also added a backup option, at the moment it can only backup ~4GB SD Cards as it reads it to ram for now. Your computer will also need at least 4 GB of ram to backup the SD Card.

Grab it here !

SHA1 Hash – 2fa25e4f9e9260a3612129a1b0291fca3e3fd628 PiParted-0.04.iso

Comments / feedback would be very welcome !

Share
Apr 192013
 

Just finished up with PiParted v0.03

Changes –
No longer needs 4 gigs of ram as it will uncompress and image on the fly.
Tested it on a laptop with 1.5 gigs of ram and it worked ok.

Installing from SD Card –
Works with both zip and .gz file, haven’t tested properly with .tar.gz but should still work

Also checks SHA1 hash when downloaded from the Pi site.

Incremental update really.
Download it from here
SHA1 Hash –
f91e53df56aec6cc7d1b27041e0750b0f4763bfd PiParted-0.03.iso

Share
Apr 082013
 

After some tweaking, I have improved PiParted.
Please note this is a very early testing version, so some things may break or not work properly.

Download it here !

New features –
Flash OS from zip file on SD Card:
If the SD card only has one partition, and there is one zip file on that partition, the script will use that to flash an OS on.

Reset SD Card:
This will format an SD Card back to defaults, i.e. one vfat partition.

dd will now show it’s status when it’s flashing a SD card.

I’m looking for testers, so if anyone tries this out, please give me some feedback, either on this post or in the forum thread @ http://www.raspberrypi.org/phpBB3/viewtopic.php?f=63&t=39160

Share
Apr 022013
 

After going through the forums, I recently had an idea that hopefully will make installing distros onto an SD card much easier.

A lot of issues come from people not knowing how to do it right, e.g. just dropping the img file onto an SD card.
So I’ve customised a GParted LiveCD ISO and written up a custom script to *hopefully* install a distro straight onto an SD card.
This is a very early iteration of this idea, but hopefully will develop into something useful.

At the moment, essentially what it will do is

1. Grab the list of Distros from the RPI Download page
2. Let the user select which distro he wants to install
3. Select the Disk device that he wants to install it onto
4. dd the image onto the disk device.

Later on, I’m hoping to add more functionality including –
resizing image files
resizing sd card partitions
wiping SD cards back to a normal usable (by windows) state
Installing distributions from other sites
auto-resizing of the root partition after installing a distribution

Grab the iso from here

Feedback can be left here or on the forum topic

Share
Nov 082013
 

I was adding some new features on PiParted recently and needed a simple file browser for my PiParted script. I couldn’t find anything online for this sort of thing, so I built my own file browser of sorts.

Using whiptail and the output of ls (which isn’t recommended but I’ll get around to posting an updated version of this script sometime), I managed to get a simple file browser to allow a user to pick a file.
I’ll paste bits and pieces of the code to explain it, and then paste the whole function at the end of this post.

This starts off with an if statement to check to see whether a path has been passed to the script. If it hasn’t it will start the listing off at /, Otherwise it will start at the path it had been passed.

function Filebrowser() {
if [ -z $1 ]; then
imgpath=$(ls -lhp / | awk -F ' ' ' { print $9 " " $5 } ')
else
imgpath=$(ls -lhp "/$1" | awk -F ' ' ' { print $9 " " $5 } ')
fi

Next, still checking to see whether it was passed a path, it will show a back button if it was passed a path.

if [ -z $1 ]; then
pathselect=$(whiptail --menu "Select Image File" 40 50 30 --cancel-button Cancel --ok-button Select $imgpath 3>&1 1>&2 2>&3)
else
pathselect=$(whiptail --menu "Select Image File" 40 50 30 --cancel-button Cancel --ok-button Select ../ BACK $imgpath 3>&1 1>&2 2>&3)
fi

Next, it checks the return value to make sure it was 0 to signify the user didn’t press cancel
After that, it checks the path the user selected to see if it was a directory, if it is then it re-runs the function and passes a path
Otherwise it will determine whether the file selected is the file type that is required, and if it is show that it is about to perform an action. If it’s not the type required, present an error to the user.

RET=$?
if [ $RET -eq 0 ]; then
if [[ -d "/$1$pathselect" ]]; then
Filebrowser "/$1$pathselect"
elif [[ -f "/$1$pathselect" ]]; then
fileout=`file "$1$pathselect"
filename=`readlink -m $1$pathselect`
if [[ $fileout =~ x86\ boot\ sector$ ]]; then
whiptail --yesno --title "! WARNING !" "About to try and automatically resize $filename. Are you sure ?" 10 50
### This bit of the code would be what you want to do after the user has selected the right type of file.
if [ $? -ne 0 ]; then
Filebrowser
fi
else
whiptail --msgbox --title "! ERROR ! ERROR ! ERROR ! " "Selected file is not an image file." 8 44
Filebrowser
fi

And lastly, check to make sure the path that was passed to the script is valid. At the moment, I don’t imagine this script would handle spaces well so you may see this error message when processing directories with spaces in their names.

else
echo pathselect $1$pathselect
whiptail --title "! ERROR !" --msgbox "Error setting path to image file." 8 44
unset base
unset imgpath
Filebrowser
fi
exit 0

And, as promised, the whole code in one big block

Filebrowser() {
if [ -z $1 ]; then
imgpath=$(ls -lhp / | awk -F ' ' ' { print $9 " " $5 } ')
else
imgpath=$(ls -lhp "/$1" | awk -F ' ' ' { print $9 " " $5 } ')
fi
if [ -z $1 ]; then
pathselect=$(whiptail --menu "Select Image File" 40 50 30 --cancel-button Cancel --ok-button Select $imgpath 3>&1 1>&2 2>&3)
else
pathselect=$(whiptail --menu "Select Image File" 40 50 30 --cancel-button Cancel --ok-button Select ../ BACK $imgpath 3>&1 1>&2 2>&3)
fi
RET=$?
if [ $RET -eq 1 ]; then
## This is the section where you control what happens when the user hits Cancel
AdvancedMenu
exit 0
elif [ $RET -eq 0 ]; then
if [[ -d "/$1$pathselect" ]]; then
Filebrowser "/$1$pathselect"
elif [[ -f "/$1$pathselect" ]]; then
## Do your thing here, this is just a stub of the code I had to do what I wanted the script to do.
fileout=`file "$1$pathselect"`
filename=`readlink -m $1$pathselect`
if [[ $fileout =~ x86\ boot\ sector$ ]]; then
whiptail --yesno --title "! WARNING !" "About to try and automatically resize $filename. Are you sure ?" 10 50
if [ $? -ne 0 ]; then
Filebrowser
fi
else
whiptail --msgbox --title "! ERROR ! ERROR ! ERROR ! " "Selected file is not an image file." 8 44
Filebrowser
fi
else
echo pathselect $1$pathselect
whiptail --title "! ERROR !" --msgbox "Error setting path to image file." 8 44
unset base
unset imgpath
Filebrowser
fi
exit 0
fi
}

Share