|
|
2010-08-02
, 10:38
|
|
Posts: 540 |
Thanked: 387 times |
Joined on May 2009
|
#22
|

$ sudo savedebz
$ sudo savedebz install
$ sudo zsavedebz
$ sudo zsavedebz install
| The Following User Says Thank You to linuxeventually For This Useful Post: | ||
|
|
2010-08-03
, 05:22
|
|
Posts: 222 |
Thanked: 22 times |
Joined on Jul 2010
@ Sydney Australia
|
#23
|
|
|
2010-08-03
, 05:23
|
|
Posts: 222 |
Thanked: 22 times |
Joined on Jul 2010
@ Sydney Australia
|
#24
|
|
|
2010-08-03
, 10:29
|
|
Posts: 540 |
Thanked: 387 times |
Joined on May 2009
|
#25
|
| The Following User Says Thank You to linuxeventually For This Useful Post: | ||
|
|
2010-08-03
, 21:58
|
|
Posts: 222 |
Thanked: 22 times |
Joined on Jul 2010
@ Sydney Australia
|
#26
|
|
|
2010-08-03
, 22:10
|
|
Posts: 540 |
Thanked: 387 times |
Joined on May 2009
|
#27
|
|
|
2010-08-03
, 22:18
|
|
Posts: 222 |
Thanked: 22 times |
Joined on Jul 2010
@ Sydney Australia
|
#28
|
|
|
2010-08-03
, 23:28
|
|
Posts: 540 |
Thanked: 387 times |
Joined on May 2009
|
#29
|
|
|
2010-08-03
, 23:48
|
|
Posts: 173 |
Thanked: 106 times |
Joined on Jun 2010
|
#30
|
Yeah the first line of the script lets you easily change the location of the SD card. Well the physical location of the partitions is usually very handy but in this case you need the mount point. Something like changing sdhc="/media/mmc1" to sdhc="/media/mmc2" would do the trick.
Don't worry finding the mountpoint is easy.
$ partmount() { df -h | grep /dev/$1 | awk '{ print $6}'; } $ partmount mmcblk1p1Or you could just use the modified script (defaults to wherever /dev/mmcblk1p1 is mounted but prompts anyway, you can just hit enter):
#!/bin/bash ########################################## # savedebz by Linux Eventually ver 0.7 ### ########################################## # SD card install location unset sdhc unset partition ##sdhc="/media/mmc1" read -p "Which partition on the SD \ card (default: mmcblk1p1)?: " partition; sdhc=`df -h | grep /dev/$partition | awk '{ print $6 }'`; if [ -z "$partition" ]; then sdhc=`df -h | grep /dev/mmcblk1p1 | awk '{ print $6 }'`; fi sdmount=`echo $sdhc` mountmsg=`echo "Mountpoint:"` sdmsg=`echo $mountmsg $sdmount` echo $sdmsg # Install packages back to Nokia Internet Tablet if [ "$1" = "install" ]; then echo "Install packages from SD card to NXx0?"; read -p "Are you sure? (y/n): " confirminstall fi if [ "$confirminstall" = "y" ]; then echo "Installing ... (this will take awhile)" debzinstall() { alldebz=`cat $sdhc/installdebz`; apt-get -o dir::cache=$sdhc/debz install $alldebz; } debzinstall echo "debz installation complete" exit 0 else if [ "$confirminstall" = "n" ]; then echo "Installation not selected. Exiting."; exit 0 else if [ ! -z "$confirminstall" ]; then echo "Invalid selection"; exit 0 fi fi fi # If invalid parameter then quit if [ ! -z "$1" ]; then echo "ERROR Invalid parameter" echo "Valid options are none or install" exit 0 fi # Ask user to execute script if [ -z "$1" ]; then echo "Download packages to SD card?"; read -p "Are you sure? (y/n): " confirmbackup if [ "$confirmbackup" = "y" ]; then echo "Installing ... (this will take awhile)" else if [ "$confirmbackup" = "n" ]; then echo "Download not selected. Exiting."; exit 0 else echo "Invalid selection"; exit 0 fi fi fi # Create directory on SD card if [ ! -d "$sdhc/debz/archives" ]; then mkdir $sdhc/debz{,/archives} cp -r /var/cache/apt/archives/partial/ $sdhc/debz/archives/ fi # Save list of installed packages dpkg -l | grep ii | awk '{ print $2 }' > $sdhc/alldebz; # Save list of packages on SD ls $sdhc/debz/archives/ | awk 'BEGIN{FS="_"};{print$1}' > $sdhc/debzsd; # Compare files (to save bandwidth) cd $sdhc ########### ## pdiff ## ########### perl <<'EOF' $output = newdebz; chomp($output); open a, "<alldebz"; open b, "<debzsd"; local $/; my @a = split /\n/, <a>; my @b = split /\n/, <b>; my %b = map { $_ => 1 } @b; # Make hash of B my @res = grep { !defined $b{$_} } @a; # Everything in A not in B open myoutput, ">$output"; select myoutput; print join "\n", @res; print "\n"; EOF ########### # Convert line breaks to spaces foobar=`cat $sdhc/newdebz`; echo $foobar > $sdhc/installdebz pkgz=`cat $sdhc/installdebz` # Re-download packages and save them to SD card apt-get -o dir::cache=$sdhc/debz --reinstall -d install $pkgz echo "Finished."{ https://sites.google.com/site/maemo4repo/home }
Last edited by linuxeventually; 2010-08-02 at 06:09.