Porteus Migration Tool

New features which should be implemented in Porteus; suggestions are welcome. All questions or problems with testing releases (alpha, beta, or rc) should go in their relevant thread here, rather than the Bug Reports section.
Post Reply
User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Porteus Migration Tool

Post#1 by Hamza » 22 Apr 2011, 11:24

I writing a tool for upgrade from older version of Porteus to latest.

But , I must have the choose of the community.

If you want this tool , please post a message in this thread.

If you won't this tool , please post a message in this thread.

All votes out of this thread are not valid.
NjVFQzY2Rg==

User avatar
fanthom
Site Admin
Site Admin
Posts: 4566
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Re: Porteus Migration Tool

Post#2 by fanthom » 22 Apr 2011, 20:34

dont ask for votes - just do the job and show it to the community. will be included in the distro, if people find it useful.
few ideas:
- cron job which checks periodically for new version (user could decide how often)
- support for stable and unstable, 32/64 bit
- autostart in KDE/LXDE
Please add [Solved] to your thread title if the solution was found.

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Porteus Migration Tool

Post#3 by Hamza » 22 Apr 2011, 20:37

Thanks for ideas!

Will see if I can make these functions.
NjVFQzY2Rg==

User avatar
82issa
DOC Team
DOC Team
Posts: 127
Joined: 13 Apr 2011, 17:24
Location: USA, NC

Re: Porteus Migration Tool

Post#4 by 82issa » 22 Apr 2011, 20:46

I like this idea.
Suggestion md5sum the xzm's to identify version number. If != to current stable,verify they want to upgrade
then download and replace. You would need to make an exemption list. So that people can add their custom
xzm's to that without having to worry about them getting replaced. But first md5 itself and update the updater.
Sorry guys... I got to go. My girlfriend just casted "get your dirty ass into the shower" on me.
Oh and here is some naked grandpa pictures too.

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Porteus Migration Tool

Post#5 by Hamza » 22 Apr 2011, 20:51

I have already added this function to my tool.
NjVFQzY2Rg==

User avatar
82issa
DOC Team
DOC Team
Posts: 127
Joined: 13 Apr 2011, 17:24
Location: USA, NC

Re: Porteus Migration Tool

Post#6 by 82issa » 22 Apr 2011, 20:55

even exemption list?
Sorry guys... I got to go. My girlfriend just casted "get your dirty ass into the shower" on me.
Oh and here is some naked grandpa pictures too.

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Porteus Migration Tool

Post#7 by Hamza » 22 Apr 2011, 20:56

My tool will check the md5sum of the ISO file only , that's more fast ,and more easy.
NjVFQzY2Rg==

User avatar
82issa
DOC Team
DOC Team
Posts: 127
Joined: 13 Apr 2011, 17:24
Location: USA, NC

Re: Porteus Migration Tool

Post#8 by 82issa » 22 Apr 2011, 21:02

Well I will just go ahead and punch myself in the face a couple times for you :wall:
Sorry guys... I got to go. My girlfriend just casted "get your dirty ass into the shower" on me.
Oh and here is some naked grandpa pictures too.

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Porteus Migration Tool

Post#9 by Hamza » 22 Apr 2011, 21:04

Well I will just go ahead and punch myself in the face a couple times for you
I think , I haven't understand perfectly your last answer.
NjVFQzY2Rg==

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Porteus Migration Tool

Post#10 by Hamza » 28 Apr 2011, 22:00

This is a part of the code , I can't finish and test it , the official repo is not ready yet.

Code: Select all

#!/bin/bash

cpu=`uname -m`
HOST=http://ponce.cc/porteus
rm -Rf /tmp/version*.*
echo "Checking of latest version available.."

cd /tmp && wget -q http://porteus.olympe-network.com/current/version.txt
if [ -e /tmp/version.txt ]; then
CVER=`cat /tmp/version.txt | head -n1`
else
clear
echo "An error is occured when Porteus Migration Tool trying to check the latest version available"
echo "You must have an internet connection"
exit
fi

progressbar () {
# Set wget for display the progress bar only

    local flag=false c count cr=$'\r' nl=$'\n'
    while IFS='' read -d '' -rn 1 c
    do
        if $flag
        then
            printf '%c' "$c"
        else
            if [[ $c != $cr && $c != $nl ]]
            then
                count=0
            else
                ((count++))
                if ((count > 1))
                then
                    flag=true
                fi
            fi
        fi
    done
}

download () {
# Download with progressbar function

wget --progress=bar:force $1 2>&1 | progressbar

}


chk_ver () {
if [ -e /etc/porteus-version ]; then
CURRENT=`cat /etc/porteus-version`
echo "You using $CURRENT"
else
clear
echo "You don't using Porteus OS"
echo "You cannot upgrade from another OS to Porteus"
echo "You must install Porteus OS before."
exit
fi
}


if [ "$cpu" = "x86_64" ]; then
ARCH=x86_64
else
ARCH=i486
fi


mount_iso () {
mount -o loop -t iso9660 $1 $2
}

mkfold () {
if [ -e $1 ]; then
rm -Rf $1
else
mkdir $1
fi
}


clear

echo "==========> Porteus <=========="
echo " "
echo "Welcome to Porteus Upgrade Tool"
echo "With this tool , you'll be able"
echo "to upgrade to latest version"
echo "of Porteus.This Tool will see"
echo "your architecture before to begin"
echo "all operations.If you won't make"
echo "problems with this script."
echo "Could you close all others apps"
echo " "
echo "Are you ready?"
read

echo "Checking of your current OS.."
chk_ver
echo "Checking of your architecture.."
TMP=/tmp/porteus_mig
[ -d $TMP ] && rm -Rf $TMP
mkdir $TMP
EXT=iso
ISO=porteus-$CVER-$ARCH.$EXT
#LATEST=$HOST/$ARCH/current/porteus-$C_VER-$ARCH.$EXT
LATEST=$HOST/$ARCH/current/$ISO
echo "Downloading of the latest ISO..."
cd $TMP
download $LATEST
if [ -e $TMP/$ISO ]; then
LC_ISO=$TMP/$ISO
echo "Porteus downloaded!"
echo "Checking of ISO..."
wget -q $HOST/$ARCH/current/porteus-$CVER-$ARCH.txt
MD5_LC=`md5sum $LC_ISO`
MD5_RM=`cat $TMP/porteus-$CVER-$ARCH.txt | head -n1`
if [ "$MD5_LC" = "$MD5_RM" ]; then
echo "Well, Your Porteus ISO is checked and it correct!"
else
echo "Your Porteus ISO is corrupted , you must download it again."
echo "Exiting..."
exit
fi
else
echo "Check your internet connection."
echo "The Porteus ISO was not found !"
echo "Exiting..."
exit
fi

[ -d /mnt/iso ] && rm -Rf /mnt/iso
mkdir /mnt/iso 
mount_iso $LC_ISO /mnt/iso
echo "Is it a frugual install?"
echo "Answer available 'y' and 'n'"
read ans
if [ "$ans" = "y" ]; then
echo "Backing up of old installation..."
else
clear
echo "If it is not a frugal installation"
echo "I can't upgrade your current installation"
echo "For save your disk space , I cleanning the system"
rm -Rf
if [ -e /mnt/live/mnt/*/boot ]; then
cd /mnt/live/mnt/*/boot && cd ../ && mv ./boot ./boot.bak
fi
if [ -e /mnt/live/mnt/*/porteus ]; then
cd /mnt/live/mnt/*/porteus && cd ../ && mv ./porteus ./porteus.bak
fi
echo "Copying of files...."
C_BOOT=`ls /mnt/live/mnt/`
BOOT_DIR=/mnt/live/mnt/$C_BOOT/boot
PRTS_DIR=/mnt/live/mnt/$C_BOOT/porteus
if [ -e $BOOT_DIR ]; then
cd /mnt/live/mnt/$C_BOOT/boot && cp -r . /mnt/iso/boot
cd /mnt/live/mnt/$C_BOOT/porteus && cp -r . /mnt/iso/porteus

echo "Starting of Boot Installer..."
sh /mnt/live/mnt/*/boot/bootinst.sh
Any suggestions are welcome.
NjVFQzY2Rg==

User avatar
fanthom
Site Admin
Site Admin
Posts: 4566
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Re: Porteus Migration Tool

Post#11 by fanthom » 29 Apr 2011, 08:15

i would add a warning that porteus can crash (for sure user wont be able to start any new application) after:
"cd /mnt/live/mnt/*/porteus && cd ../ && mv ./porteus ./porteus.bak"
so immediate reboot is required.
Please add [Solved] to your thread title if the solution was found.

User avatar
Blaze
Moderator
Moderator
Posts: 1386
Joined: 28 Dec 2010, 11:31
Distribution: ⟰ Porteus 3.2 Cinnamon x86_64
Location: ☭ Russian Federation, Lipetsk region, Dankov
Contact:

Re: Porteus Migration Tool

Post#12 by Blaze » 29 Apr 2011, 08:41

Hamza, great job!
Linux porteus 4.12.7-porteus #1 SMP PREEMPT Sun Aug 13 17:38:30 x86_64 Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz GenuineIntel GNU/Linux
MS-7A12 » [AMD/ATI] Tobago PRO [Radeon R7 360 / R9 360 OEM] (rev 81) » Vengeance LPX 16GB DDR4 K2 3200MHz C16

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Porteus Migration Tool

Post#13 by Hamza » 29 Apr 2011, 09:31

i would add a warning that porteus can crash (for sure user wont be able to start any new application) after:
"cd /mnt/live/mnt/*/porteus && cd ../ && mv ./porteus ./porteus.bak"
so immediate reboot is required.
This is good idea. But I won't use any dialog box. Because , It will be compatible with any versions (KDE/LXDE/...) of Porteus.

I'll try to insert a red warning with a red message.
NjVFQzY2Rg==

User avatar
brokenman
Site Admin
Site Admin
Posts: 5456
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: Porteus Migration Tool

Post#14 by brokenman » 02 May 2011, 13:13

I have a text file sitting on the server that has a number in it ... for example 110102. The number is the date of the last release in yymmdd. There is also a file in the boot folder with the same number.

When a new release comes out users will be able to check (via main menu) if there is an update available. If the number they have locally is lower than the number checked on the server then an update is available. I havn't got as far as writing anything for an automatic update because this will be a long and winding road and will most probably have differences from release to release (just check ponces latest lxde for an example).

Eventually ... once official release is out and most bugs are ironed out ... i would like to work on an svn script to update Porteus. The ISO will still be offered but for those that prefer to 'roll their own' the svn may be a better choice.
How do i become super user?
Wear your underpants on the outside and put on a cape.

Post Reply