Howto: Update the system from binaries The NetBSD Project
Status: Closed Time to complete: 72 hrs Mentors: Aleksej Saushev, Julian Coleman, Julian Fagir Tags: howto, research

There is the new tool written in shell named sysupgrade (to be found in pkgsrc/sysutils/sysupgrade), which updates the system in binaries for you. Though it is nice, you may have reasons to not use it for an update (e.g. non-standard systems, or some components may not change).


This is why you should document the single tasks sysupgrade does (and why) and fill it with examples, in the end creating an howto which resembles the work done by sysupgrade.

Guide chapter how to use sysupgade: http://www.netbsd.org/docs/guide/en/chap-upgrading.html#id1168229274341 

Our preferred format for the submission is some form of plain text, as that is most portable and can be read anywhere.  If you want to use a word processor, please export the file as text.  You could also add something like markdown or latex to add structure (these are both plain text based), but that is not a requirement.

Uploaded Work
File name/URL File size Date submitted
upgrade.txt 2.2 KB January 11 2013 12:33 UTC
upgrade2.txt 2.7 KB January 11 2013 21:28 UTC
upgrade3.txt 2.9 KB January 11 2013 21:32 UTC
upgrade4.txt 3.0 KB January 11 2013 22:43 UTC
upgrade5.txt 4.2 KB January 11 2013 23:10 UTC
upgrade6.txt 5.0 KB January 12 2013 17:13 UTC
upgrade7.txt 5.1 KB January 12 2013 17:31 UTC
upgrade8.txt 5.1 KB January 12 2013 19:50 UTC
upgrade9.txt 5.1 KB January 12 2013 20:13 UTC
Comments
Rohit on December 28 2012 05:07 UTC Task Claimed

I would like to work on this task.

Rohit on December 28 2012 05:10 UTC Help !!

Does it work on NetBsd 5.0 or do i need NetBSd 6.0 to run this ?

Thanks
Rohit 

Aleksej Saushev on December 28 2012 11:00 UTC Re: Help !!

Neither of the two. You should use the most recent stable release.


(Or the version we provide for GCI.)

Aleksej Saushev on December 28 2012 11:02 UTC Task Assigned

This task has been assigned to Rohit . You have 72 hours to complete this task, good luck!

Rohit on December 28 2012 11:21 UTC Further question

Hello Sir !!


With all respect !!


i am done downloading the version you provided 

it asks for password !!

since its totally new to me can you explain how to bypass that ...

PS- don't make the explanination that Technical because its totally new to me , moreover i am not a programmer or coder

Thanks
Rohit  

Julian Fagir on December 28 2012 14:27 UTC Singleuser mode

Hi,


 


you can always use the single user mode (you have to choose that when the system boots.


If not, the password and the user is both 'root'.


Your main task is to disect the tool sysupgrade and then do these steps by hand. You don't have to use current; you can also do that with the images we provided. If you have furtehr questions, feel free to come into the IRC (described on http://komkon2.de/nbwiki ) and ask us questions directly, but be a bit patient with replies.


Regards, Julian


 


 

Rohit on December 29 2012 19:00 UTC Request

Hello Sir 

With all the respect

i will try me level best to complete my Task on time , but since its totally new to me its kind of taking me sometime to getting things in correct manner 

As a request , i won't be at home for a day or so , so if possible kindly give me an extra time of a day

Thanks
Rohit  

Julian Fagir on December 29 2012 19:26 UTC Deadline extended

The deadline of the task has been extended with 2 days and 0 hours.

Rohit on December 30 2012 08:40 UTC Help !!

Hey there
 

What exactly is my Task , is it how to operate sysupgade ? 

if yes i do believe you have already given a explanation about it 

or is it about usefulness and explaing what sysupgrade does i.e cons & Pros
with examples ?


Thanks

Rohit
 

Julian Fagir on December 30 2012 21:32 UTC You have to write down what the script does, not how to use it

No, your task is different. You have to review the script sysupgrade.sh which you find here:


http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/sysutils/sysupgrade/files/sysupgrade.sh?only_with_tag=MAIN


The script contains many wrappers and questions and so on. Your task is to extract the important parts of the script and describe what they do, such that a user who does not want to use sysupgrade (for whatever reason) has the possibility to fulfil these steps by hand.


One example: There's this function in the text:


167 extract_set() {
168 local set_name="${1}"; shift
169
170 require_cached_file "${set_name}.tgz"
171
172 local destdir="$(shtk_config_get_default DESTDIR "")"
173 local set_tgz="$(get_cached_file "${set_name}.tgz")"
174
175 shtk_cli_info "Extracting ${set_name} into ${destdir}/"
176 [ -z "${destdir}" ] || shtk_process_run mkdir -p "${destdir}"
177 progress -zf "${set_tgz}" tar -xp -C "${destdir}/" -f -
178 }


 


Though all it does is in line 177. You have to collect these commands, say what they do and provide a step-by-step tutorial what people have to do to execute these commands themselves (i.e. which arguments they have to provide).


 


 

Rohit on January 2 2013 11:00 UTC Claim Removed

The claim on this task has been removed, someone else can claim it now.

Matthew on January 11 2013 12:11 UTC Task Claimed

I would like to work on this task.

Julian Fagir on January 11 2013 12:14 UTC Task Assigned

This task has been assigned to Matthew. You have 72 hours to complete this task, good luck!

Matthew on January 11 2013 12:33 UTC Ready for review

The work on this task is ready to be reviewed.

Aleksej Saushev on January 11 2013 16:29 UTC Review

Hi!


1. Please, avoid using and referencing FTP. Use HTTP to fetch files instead.


2. Your commands won't work. Try following your instructions with typing your commands as is.


3. Consider something goes wrong, and the new kernel doesn't boot. Following your instructions, a user has new userland already. Thus a user can't boot into working system.


4. Using etcupdate is not described.

Aleksej Saushev on January 11 2013 16:29 UTC Task Needs More Work

One of the mentors has sent this task back for more work. Talk to the mentor(s) assigned to this task to satisfy the requirements needed to complete this task, submit your work again and mark the task as complete once you re-submit your work.

Aleksej Saushev on January 11 2013 16:32 UTC Review (additionally)

Ideally, it would be nice if you test such an upgrade between the two most recent releases.

Matthew on January 11 2013 21:32 UTC Ready for review

The work on this task is ready to be reviewed.

Aleksej Saushev on January 11 2013 22:32 UTC Review

Hi!


1.1. "Fetches files from NetBSD's ftp."


I think, this should be "file server" or "web server" rather than "ftp".


1.2. Also, it would be nice to have example rather than just "$(uname -m)" and "$(uname -r)" in URL.


1.3. It is better to provide direct URL or even a command (or commands) to fetch all sets needed.


2.1. "tar zxf modules.tgz -C /" is definitly a bad way to talk about sets comprising userland since it is kernel modules rather.


2.2. It is better to list all sets, they are not numerous enough. In addition, you talk about finding out installed sets. Try to compose a shell command ("for") that installs necessary sets.


2.3. The command you propose brings system into non-functional state, since you lose some access permissions and file ownership information (some files lose setuid flags, e.g.).


3.1. <<It will allow us to extract the "">> - ? Stray text? Incomplete text?


3.2. Could you provide example of etcupdate invocation?


3.3. What about postinstall(8)? How does it compare to etcupdate?

Aleksej Saushev on January 11 2013 22:32 UTC Task Needs More Work

One of the mentors has sent this task back for more work. Talk to the mentor(s) assigned to this task to satisfy the requirements needed to complete this task, submit your work again and mark the task as complete once you re-submit your work.

Matthew on January 11 2013 22:43 UTC Ready for review

The work on this task is ready to be reviewed.

Aleksej Saushev on January 12 2013 09:52 UTC Review

Hi!


1. NetBSD doesn't have sudo.


2. NEVER ever recommend sudo.


3. /tmp may not survive reboot, see hier(7), you might have wanted to use /var/tmp instead


4. Why do you export "sets" variable? Is it needed in subprocesses?


5. Perhaps a note that "etc" and "xetc" need special handling would be nice.


6. Examples in postinstall part are about etcupdate. Incomplete text?


 

Aleksej Saushev on January 12 2013 09:52 UTC Task Needs More Work

One of the mentors has sent this task back for more work. Talk to the mentor(s) assigned to this task to satisfy the requirements needed to complete this task, submit your work again and mark the task as complete once you re-submit your work.

Matthew on January 12 2013 17:32 UTC Ready for review

The work on this task is ready to be reviewed.

Aleksej Saushev on January 12 2013 18:34 UTC Task Needs More Work

One of the mentors has sent this task back for more work. Talk to the mentor(s) assigned to this task to satisfy the requirements needed to complete this task, submit your work again and mark the task as complete once you re-submit your work.

Aleksej Saushev on January 12 2013 19:33 UTC Review


The following issue from previous review is not addressed (and it is critical):


2.3. The command you propose brings system into non-functional state, since you lose some access permissions and file ownership information (some files lose setuid flags, e.g.).


To make it clear, the problematic command is this one:


tar zxf $set.tgz -C /


 


The following issue from previous review is not addressed:


6. Examples in postinstall part are about etcupdate. Incomplete text?


If you mean "rm" you shouldn't write "ls", right?

Matthew on January 12 2013 19:50 UTC Ready for review

The work on this task is ready to be reviewed.

Aleksej Saushev on January 12 2013 20:21 UTC Task Closed

Congratulations, this task has been completed successfully.