WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: "version" command download location  (Read 5609 times)

Offline netnomad

  • Hero Member
  • *****
  • Posts: 1026
Re: "version" command download location
« Reply #15 on: February 24, 2016, 01:14:40 AM »
hi jason,

how do you want to use the *.latest-information...?
i guess you want to give the backup-files the timestamp?
the downloaded files should be functional without any additional action.
a timestamp-backup-file is copied at every new download, so the core file is overwritten and a backup-timestamp-file created?

thank you for your help.
« Last Edit: February 24, 2016, 01:17:59 AM by netnomad »

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: "version" command download location
« Reply #16 on: February 24, 2016, 01:51:08 AM »
The date in the *.latest can be used to name backups, while the current is dCore-trusty.gz, or whichever port.

Offline nitram

  • Hero Member
  • *****
  • Posts: 1054
Re: "version" command download location
« Reply #17 on: February 24, 2016, 04:20:55 AM »
This is what i have so far, will probably submit tomorrow,  version -c  example:
Code: [Select]
tc@box:/usr/bin$ version -c
Warning:
You are running:          dCore-jessie:2016.02.22.12.22
The latest release is:    dCore-jessie:2016.02.19.16.43
 
Preferred dCore*.gz download path from /etc/sysconfig/boot_path:
 
/etc/sysconfig/tcedir/boot
 
Press Enter to download the most recent stable release, existing dCore*.gz
and *.md5.txt files will automatically be backed up, (q)uit to exit.
 
Connecting to repo.tinycorelinux.net (89.22.99.37:80)
dCore-jessie.gz.md5. 100% |*******************************|    50   0:00:00 ETA
 
Connecting to repo.tinycorelinux.net (89.22.99.37:80)
dCore-jessie.gz      100% |*******************************| 11656k  0:00:00 ETA
 
Downloaded:   /etc/sysconfig/tcedir/boot/dCore-jessie.gz.md5.txt
              /etc/sysconfig/tcedir/boot/dCore-jessie.gz
 
Ensure correct boot path, reboot to complete update.


I run RC to obviously  version -c  sees a different version above. Like before if you are already running the latest you see below, no download prompt.
Code: [Select]
tc@box:/usr/bin$ version -r
You are running dCore-jessie:2016.02.22.12.22, the latest release candidate.


Before downloading an updated version the specified boot partition is auto-mounted if necessary, provided the config file is properly modified and the partition is found in /etc/fstab. The existing dCore*gz and .md5.txt files will be moved/renamed like below, appended with the current running version. Unlimited backups can be kept based on partition space. There is currently no 'clean-up' functionality, so for now user will need to periodically clean out the old stuff when ready to delete.
Code: [Select]
tc@box:/usr/bin$ ll /etc/sysconfig/tcedir/boot/
total 23M
-rw-r--r-- 1 root root 12M Feb 24 02:04 dCore-jessie.gz
-rw-r--r-- 1 root root 12M Feb 24 02:00 dCore-jessie.gz.2016.02.22.12.22
-rw-r--r-- 1 root root  50 Feb 24 02:03 dCore-jessie.gz.md5.txt
-rw-r--r-- 1 root root  50 Feb 24 01:59 dCore-jessie.gz.md5.txt.2016.02.22.12.22


The config file is /etc/sysconfig/boot_path and the default download pathway is /etc/sysconfig/tcedir/boot/. Hopefully this will be acceptable, good for testing anyway. Further modifications can still be made and Jason's assistance might be required for anything fancier.

Offline nitram

  • Hero Member
  • *****
  • Posts: 1054
Re: "version" command download location
« Reply #18 on: February 24, 2016, 09:29:06 AM »
Draft done, will submit to Jason for review, appears to function well on one system :)

Added simple file check to confirm successful dCore*.gz and *.md5.txt download.

Successful dCore*.gz download creates a root owned /tmp/dCoreUpdateDownloadedReboot! file. It's presence prevents inadvertently re-downloading an update more than once during a session without reboot. Reboot to apply system update or simply delete this file from /tmp to play around and test.
Code: [Select]
tc@box:/tmp$ version -r
Warning:
You are running:                    dCore-jessie:2016.02.22.12.22
The latest release candidate is:    dCore-jessie:2016.02.19.16.43
 
Update already downloaded to /etc/sysconfig/tcedir/boot,
confirm correct boot path, reboot system to complete update.

Only downloading once also prevents appending a backup file with the wrong version number. For example, downloading once correctly backs up the currently used dCore*.gz file with the current running version number. Downloading a second dCore*.gz file without reboot then incorrectly backs up a newer version dCore*.gz file with the current (now older) version number.

Jason knows cpio stuff to retrieve this information direct from the *.gz file but that's beyond me at present. Feel free to modify as desired. Hopefully this proposed system is adequate. If it tests okay great or it can be ammended, thanks.

Offline nitram

  • Hero Member
  • *****
  • Posts: 1054
Re: "version" command download location
« Reply #19 on: February 27, 2016, 04:09:36 AM »
Hopefully new version downloads are working okay, no news is good news.

Made some revisions and will submit to Jason for review shortly. Simple file check after download will either indicate download success or download fail for both the *.gz and md5 files. Also now an automated md5sum check, which ouputs the *gz.md5.txt for comparison to the actual md5sum.
Code: [Select]
tc@box:/mnt/sdb4/tce$ version -r
Warning:
You are running:                    dCore-jessie:2016.02.26.09.00
The latest release candidate is:    dCore-jessie:2016.02.27.00.41
 
Preferred dCore*.gz download path from /etc/sysconfig/boot_path:
/mnt/sdb1/dCore/boot
 
Press Enter to download the most recent release candidate, existing dCore*.gz
and *.md5.txt files will automatically be backed up, (q)uit to exit.
 
Connecting to repo.tinycorelinux.net (89.22.99.37:80)
dCore-jessie.gz.md5. 100% |*******************************|    50   0:00:00 ETA
 
Connecting to repo.tinycorelinux.net (89.22.99.37:80)
dCore-jessie.gz      100% |*******************************| 11697k  0:00:00 ETA
 
Download success: /mnt/sdb1/dCore/boot/dCore-jessie.gz.md5.txt
Download success: /mnt/sdb1/dCore/boot/dCore-jessie.gz
Reported md5sum:  9b3e05e63b67eac0d88e17627be216fa
Actual md5sum:    9b3e05e63b67eac0d88e17627be216fa
 
Correct any errors, confirm boot path, reboot to complete update.

Offline netnomad

  • Hero Member
  • *****
  • Posts: 1026
Re: "version" command download location
« Reply #20 on: February 28, 2016, 05:59:10 AM »
hi friends,

i have seen in nitrams post that there is a checksum-test in his routine.

###
Download success: /mnt/sdb1/dCore/boot/dCore-jessie.gz.md5.txt
Download success: /mnt/sdb1/dCore/boot/dCore-jessie.gz
Reported md5sum:  9b3e05e63b67eac0d88e17627be216fa
Actual md5sum:    9b3e05e63b67eac0d88e17627be216fa
Correct any errors, confirm boot path, reboot to complete update.
###

that feature would be really great for the core :-)

thank you for all your contributions.

Offline nitram

  • Hero Member
  • *****
  • Posts: 1054
Re: "version" command download location
« Reply #21 on: February 29, 2016, 01:16:05 AM »
netnomad the md5 check is already in the latest RCs.

Updated version script and /etc/sysconfig/boot_path config sent to Jason for review, hopefully will be released for testing. Now allows user to specify how many dCore*.gz and *.md5.txt backups to keep, any more are auto-purged during the update process once the new version was successfully downloaded. Default is 3 backups, change as desired. Without the updated boot_path config file the download directory will not display and you'll get the error below. Note the output now also displays the MAXBACKUPS setting.
Code: [Select]
dCore*.gz download path from /etc/sysconfig/boot_path (MAXBACKUPS = 3):
Not specified, create /etc/sysconfig/boot_path entry, exiting..


Then either remove boot_path from /opt/.filetool.lst and reboot to get the new config file or just cut/paste from below and re-configure:

boot_path config:
Code: [Select]
# Specify download directory for  version -c  or  version -r  dCore updates. The full dCore boot
# pathway must be specified (contains the dCore-*.gz and vmlinuz-* files). The version command
# automatically backs up the old dCore-*.gz and *.md5.txt file before downloading the update.
# Specify the maximum number of backups to store below. Reboot to complete the update.

# If this file is modified, add an /opt/.filetool.lst entry to save changes:
#      etc/sysconfig/boot_path

# NO SPACES, ONLY ONE ENTRY FOR EACH OPTION
# BOOTPATH ENTRY MUST START WITH A SLASH
# BOOTPATH ENTRY MUST CONTAIN /mnt/* IF DOWNLOAD DIRECTORY IS NOT MOUNTED AFTER BOOT

# Note dCore uses the symlink 'tcedir' to point to the /tce directory. The dCore installer by default
# uses /etc/sysconfig/tcedir/boot, on the actual system this may be something like /mnt/sdb4/tce/boot.

# Use BOOTPATH=/* to specify dCore boot path directory:
#BOOTPATH=/etc/sysconfig/tcedir/boot
#BOOTPATH=/mnt/sdb4/tce/boot
BOOTPATH=/etc/sysconfig/tcedir/boot

# USE MAXBACKUPS=* to specify number of backups to keep:
#MAXBACKUPS=3
MAXBACKUPS=3


Note RCs 2016.02.28.23.36 and older don't need this yet, updating to the next RC won't need it yet, updating after that will require the new boot_path config.

Sorry for the hassles, learning as i go, should have provided a better config file at the start, thanks.