preupgrade has a serious flaw in design.
A long time ago, people writing code to network technology, has created the concept of "resumed download".
It was necessary, because much time and net resources was being consumed by re-downloads of
previously interrupted downloads, by a net error or connection lost.
A lot o tools inside linux, uses this feature to improve users experience. yum is the best example of
that sort of tool. When you start download via yum, and something goes wrong like a power lost, the next time you start yum, all previously downloaded code are just resumed.
Preupgrade developers appears to don't care about it. The second operation of the preupgrade
tool is a lot simple. Download the kernel, the initrd.img and the install.img. To some users, it is a huge download.
In F13, these files sums near 174 Mb. Don't believe the fake "tip" below the dialog. If you quit the preupgrade, this 174M stuff will be RE-downloaded from the beginning.
My connection speed is very slow (about 4 - 12 kbps). And isn't stable. Sometimes the connection just goes off.
Can i preupgrade ? With a lot of lucky, yes. But my first try to preupgrade has gone throght
an full night. In the morning, the connection has gone, and i decided to continue in the next night.
I saw the tip and become happy by clicking quit and shutdown.
But when i returned to the task, preupgrade restarts from the beginning.
I said :
- Huh ?!
Then i did a deep breath and resignate myself with the fact that a full preupgrade was in curse.
TIP : Don't believe in tips.
I have tried to preupgrade by three days, but the connection is so unstable that just some 3 - 32 Mb was really transfered before a connection down. When it happens, i become more and more depressive, because i know that the preupgrade will restart the download of all that is yet downloaded.
There are a lot of DOs and DON'Ts in coding. Re-download unmodified data gets the big :
please-DOOOOOON'T.
Yes, i know that bugs are inside any code. But bugs are accepted things. The use will evicence it and the code will be more and more bug free.
But decision to simple re-download is not what i call bug. It is just bad-coding.
Maybe preupgrade has good code too. Who knows ?
At least, "preupgrade" is a good idea bad coded.
The workaroung against bad code, is inspect what code does. And to do a simple download, coders need to be a bit more smart, than simply assume that none will be wrong with the download itself.
If your connection is unstable too, i suggest you make the download of the three files by hand using a tool that supports resuming, like wget or kget.
Download vmlinuz and initrd.img from (mirror)/releases/13/Fedora/x86_64/os/images/pxeboot
Download install.img from (mirror)/releases/13/Fedora/x86_64/os/images
Where (mirror) is your preferred mirror. In my case, i have downloaded (using kget) the following files :
http://ftp.unicamp.br/pub/fedora/rel...xeboot/vmlinuz
http://ftp.unicamp.br/pub/fedora/rel...oot/initrd.img
http://ftp.unicamp.br/pub/fedora/rel...es/install.img
Then, copy all three files to /boot/upgrade/
I don't know if it matter, but remember to change owner of these files to root.
Now comes the harder part.
We must comment the bad-coded part of preupgraded-gtk.py file, to assure that it will not
(bad) re-download all 174 Mb stuff again.
Open (as root) /usr/share/preupgrade/preupgrade-gtk.py and search by the following block of code
Code:
:
:
# Step 2: Get installer images
self.progress.next_step()
self.dnlProgress.reset(4) # treeinfo, kernel, initrd, stage2
done = False
while not done:
try:
self.progress.details(_("Getting installer metadata..."))
update_interface()
self.pu.retrieve_treeinfo()
self.progress.details(_("Getting installer images..."))
self.pu.retrieve_critical_boot_files()
done = True
except (URLGrabError, PUError), e:
print str(e)
:
:
the line :
self.pu.retrieve_critical_boot_files()
downloads the vmlinuz and initrd.img files. Put a # sign in front of it (# is the comment mark in python).
The code will be :
Code:
:
:
# Step 2: Get installer images
self.progress.next_step()
self.dnlProgress.reset(4) # treeinfo, kernel, initrd, stage2
done = False
while not done:
try:
self.progress.details(_("Getting installer metadata..."))
update_interface()
self.pu.retrieve_treeinfo()
self.progress.details(_("Getting installer images..."))
# self.pu.retrieve_critical_boot_files()
done = True
except (URLGrabError, PUError), e:
print str(e)
:
:
Now, go a bit down in the file until you see this code :
Code:
:
:
# Try to download stage2.img and write kickstart to /boot
extra_args = ""
try:
# TODO: make generate_kickstart cram the kickstart into initrd, so
# /boot-less upgrades can still be automated
# generate a kickstart file to automate the installation
extra_args += " ks=%s" % self.pu.generate_kickstart()
# download stage2.img
stage2file = self.pu.retrieve_non_critical_files()
stage2_abs = self.pu.bootpath+"/"+stage2file
bootdevpath = bootpath_to_anacondapath(stage2_abs, UUID=True)
extra_args += " stage2=%s" % bootdevpath
except PUError, e:
:
:
Our target is the line :
stage2file = self.pu.retrieve_non_critical_files()
It will download the install.img file.
Comment it out, and write the followng line :
stage2file = "install.img"
The block of code will be :
Code:
:
:
# Try to download stage2.img and write kickstart to /boot
extra_args = ""
try:
# TODO: make generate_kickstart cram the kickstart into initrd, so
# /boot-less upgrades can still be automated
# generate a kickstart file to automate the installation
extra_args += " ks=%s" % self.pu.generate_kickstart()
# download stage2.img
# stage2file = self.pu.retrieve_non_critical_files()
stage2file = "install.img"
stage2_abs = self.pu.bootpath+"/"+stage2file
bootdevpath = bootpath_to_anacondapath(stage2_abs, UUID=True)
extra_args += " stage2=%s" % bootdevpath
except PUError, e:
:
:
Save the file and run preupgrade.
If you are familiar with python programing (what i'm not) , you can write code to
ask the user if he wants re-download this stuff or not. And correct things to assure that the download
can be made in the "resumed download" way.
Good (not so bad)-preupgrade.
Fer.