sysupgrade: select sets to install

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

sysupgrade: select sets to install

Denis Fondras
Hello,

Here is a diff to allow selection of packages to install.
My routers do not need X or games to be installed.

$ doas sysupgrade -s -CGMX
SHA256.sig   100% |***************************************************************************| 2141       00:00    
Signature Verified
INSTALL.amd64 100% |**************************************************************************| 43535       00:00    
base65.tgz   100% |***************************************************************************| 202 MB    00:05    
bsd          100% |***************************************************************************| 15662 KB    00:00    
bsd.mp       100% |***************************************************************************| 15753 KB    00:00    
bsd.rd       100% |***************************************************************************| 10016 KB    00:00    
Verifying sets.

There is probably a better way to do this though.

Index: sysupgrade.8
===================================================================
RCS file: /cvs/src/usr.sbin/sysupgrade/sysupgrade.8,v
retrieving revision 1.8
diff -u -p -r1.8 sysupgrade.8
--- sysupgrade.8 9 May 2019 21:09:37 -0000 1.8
+++ sysupgrade.8 9 Jul 2019 14:49:14 -0000
@@ -24,6 +24,7 @@
 .Nm
 .Op Fl fkn
 .Op Fl r | s
+.Op Fl CGMX
 .Op Ar installurl
 .Sh DESCRIPTION
 .Nm
@@ -72,6 +73,14 @@ The default is to find out if the system
 In case of release
 .Nm
 downloads the next release.
+.It Fl C
+Do not install comp*.tgz set.
+.It Fl G
+Do not install game*.tgz set.
+.It Fl M
+Do not install man*.tgz set.
+.It Fl X
+Do not install x*.tgz sets.
 .El
 .Sh FILES
 .Bl -tag -width "/home/_sysupgrade" -compact
Index: sysupgrade.sh
===================================================================
RCS file: /cvs/src/usr.sbin/sysupgrade/sysupgrade.sh,v
retrieving revision 1.22
diff -u -p -r1.22 sysupgrade.sh
--- sysupgrade.sh 21 Jun 2019 16:50:26 -0000 1.22
+++ sysupgrade.sh 9 Jul 2019 14:49:14 -0000
@@ -33,7 +33,7 @@ ug_err()
 
 usage()
 {
- ug_err "usage: ${0##*/} [-fkn] [-r | -s] [installurl]"
+ ug_err "usage: ${0##*/} [-fkn] [-r | -s] [-CGMX] [installurl]"
 }
 
 unpriv()
@@ -75,13 +75,22 @@ FORCE=false
 KEEP=false
 REBOOT=true
 
-while getopts fknrs arg; do
+NOCOMP=
+NOGAME=
+NOMAN=
+NOX=
+
+while getopts fknrsCGMX arg; do
  case ${arg} in
  f) FORCE=true;;
  k) KEEP=true;;
  n) REBOOT=false;;
  r) RELEASE=true;;
  s) SNAP=true;;
+ C) NOCOMP='-e /^comp/d';;
+ G) NOGAME='-e /^game/d';;
+ M) NOMAN='-e /^man/d';;
+ X) NOX='-e /^x/d';;
  *) usage;;
  esac
 done
@@ -154,8 +163,9 @@ if cmp -s /var/db/installed.SHA256 SHA25
  exit 0
 fi
 
-# INSTALL.*, bsd*, *.tgz
+# INSTALL.*, bsd*, and selected *.tgz
 SETS=$(sed -n -e 's/^SHA256 (\(.*\)) .*/\1/' \
+    $NOCOMP $NOGAME $NOMAN $NOX \
     -e '/^INSTALL\./p;/^bsd/p;/\.tgz$/p' SHA256)
 
 OLD_FILES=$(ls)

Reply | Threaded
Open this post in threaded view
|

Re: sysupgrade: select sets to install

Klemens Nanni-2
I think sysupgrade should, if at all, use the same semantics as the
installer.  That is, something like `sysugprade -S '-* b*'" to upgrade
nothing but kernels and base.

Such options offer great potential for users to shoot themselves in the
foot by doing partial upgrades;  I am not really sold on the idea, yet.

Reply | Threaded
Open this post in threaded view
|

Re: sysupgrade: select sets to install

Theo de Raadt-2
Klemens Nanni <[hidden email]> wrote:

> I think sysupgrade should, if at all, use the same semantics as the
> installer.  That is, something like `sysugprade -S '-* b*'" to upgrade
> nothing but kernels and base.
>
> Such options offer great potential for users to shoot themselves in the
> foot by doing partial upgrades;  I am not really sold on the idea, yet.

From time to time I consider merging all the sets into baseXX.tgz.

Reply | Threaded
Open this post in threaded view
|

Re: sysupgrade: select sets to install

Evan Silberman
In reply to this post by Klemens Nanni-2
Klemens Nanni <[hidden email]> wrote:
> I think sysupgrade should, if at all, use the same semantics as the
> installer.  That is, something like `sysugprade -S '-* b*'" to upgrade
> nothing but kernels and base.
>
> Such options offer great potential for users to shoot themselves in the
> foot by doing partial upgrades;  I am not really sold on the idea, yet.

I think the most predictable thing for sysupgrade to do by default would
be to upgrade only those sets I installed originally/installed the last
time I upgraded through the installer program. Thus I could make the
decision about sets once and not have to think about it every six months
(every few days if following snaps!). I don't know whether this design
would require the installer to leave additional state behind that it
doesn't already, e.g. a list in /var/db/sets.

Evan Silberman

Reply | Threaded
Open this post in threaded view
|

Re: sysupgrade: select sets to install

Ingo Schwarze
In reply to this post by Theo de Raadt-2
Hi Theo,

Theo de Raadt wrote on Tue, Jul 09, 2019 at 09:23:25AM -0600:
> Klemens Nanni <[hidden email]> wrote:

>> I think sysupgrade should, if at all, use the same semantics as the
>> installer.  That is, something like `sysugprade -S '-* b*'" to upgrade
>> nothing but kernels and base.
>>
>> Such options offer great potential for users to shoot themselves in the
>> foot by doing partial upgrades;  I am not really sold on the idea, yet.

> From time to time I consider merging all the sets into baseXX.tgz.

That sounds reasonable to me.  Having separate sets was probably
useful in the 1980ies, but nowadays, it provides little benefit in
a general-purpose operating system, and getting rid of it would
reduce maintenance effort and recurring confusion when people shoot
themselves in the foot by not installings parts of the operating
system they actually want to use, then asking questions why their
system isn't working as expected.

By the way, on amd64, merging in game65 would make base65 1.3% larger,
man65 3.5%, and even comp65 only 35%.

It seems similar to avoiding flavours in ports if those flavours
provide little benefit: KISS.

Then again, merging the sets causes some work and churn and certainly
isn't an urgent task, but eventually and at a convenient time, i
expect that it should and will happen.

Yours,
  Ingo

Reply | Threaded
Open this post in threaded view
|

Re: sysupgrade: select sets to install

Stuart Henderson
On 2019/07/10 17:02, Ingo Schwarze wrote:

> Hi Theo,
>
> Theo de Raadt wrote on Tue, Jul 09, 2019 at 09:23:25AM -0600:
> > Klemens Nanni <[hidden email]> wrote:
>
> >> I think sysupgrade should, if at all, use the same semantics as the
> >> installer.  That is, something like `sysugprade -S '-* b*'" to upgrade
> >> nothing but kernels and base.
> >>
> >> Such options offer great potential for users to shoot themselves in the
> >> foot by doing partial upgrades;  I am not really sold on the idea, yet.
>
> > From time to time I consider merging all the sets into baseXX.tgz.
>
> That sounds reasonable to me.  Having separate sets was probably
> useful in the 1980ies, but nowadays, it provides little benefit in
> a general-purpose operating system, and getting rid of it would
> reduce maintenance effort and recurring confusion when people shoot
> themselves in the foot by not installings parts of the operating
> system they actually want to use, then asking questions why their
> system isn't working as expected.
>
> By the way, on amd64, merging in game65 would make base65 1.3% larger,
> man65 3.5%, and even comp65 only 35%.
>
> It seems similar to avoiding flavours in ports if those flavours
> provide little benefit: KISS.
>
> Then again, merging the sets causes some work and churn and certainly
> isn't an urgent task, but eventually and at a convenient time, i
> expect that it should and will happen.
>
> Yours,
>   Ingo
>

Having them split does at least give us some reasonably simple
way to get around the far too small /usr partition that disklabel
autopartitioning used to use.

Reply | Threaded
Open this post in threaded view
|

Re: sysupgrade: select sets to install

Theo de Raadt-2
Stuart Henderson <[hidden email]> wrote:

> On 2019/07/10 17:02, Ingo Schwarze wrote:
> > Hi Theo,
> >
> > Theo de Raadt wrote on Tue, Jul 09, 2019 at 09:23:25AM -0600:
> > > Klemens Nanni <[hidden email]> wrote:
> >
> > >> I think sysupgrade should, if at all, use the same semantics as the
> > >> installer.  That is, something like `sysugprade -S '-* b*'" to upgrade
> > >> nothing but kernels and base.
> > >>
> > >> Such options offer great potential for users to shoot themselves in the
> > >> foot by doing partial upgrades;  I am not really sold on the idea, yet.
> >
> > > From time to time I consider merging all the sets into baseXX.tgz.
> >
> > That sounds reasonable to me.  Having separate sets was probably
> > useful in the 1980ies, but nowadays, it provides little benefit in
> > a general-purpose operating system, and getting rid of it would
> > reduce maintenance effort and recurring confusion when people shoot
> > themselves in the foot by not installings parts of the operating
> > system they actually want to use, then asking questions why their
> > system isn't working as expected.
> >
> > By the way, on amd64, merging in game65 would make base65 1.3% larger,
> > man65 3.5%, and even comp65 only 35%.
> >
> > It seems similar to avoiding flavours in ports if those flavours
> > provide little benefit: KISS.
> >
> > Then again, merging the sets causes some work and churn and certainly
> > isn't an urgent task, but eventually and at a convenient time, i
> > expect that it should and will happen.
> >
> > Yours,
> >   Ingo
> >
>
> Having them split does at least give us some reasonably simple
> way to get around the far too small /usr partition that disklabel
> autopartitioning used to use.

However time moves on, and systems should eventually be reinstalled
since too much has changed.

The problem with the many-sets approach is the large number of people
who believe they should push that button because it they see it as
an invitation.

Reply | Threaded
Open this post in threaded view
|

Re: sysupgrade: select sets to install

Hiltjo Posthuma
In reply to this post by Klemens Nanni-2
On Tue, Jul 09, 2019 at 05:09:12PM +0200, Klemens Nanni wrote:
> I think sysupgrade should, if at all, use the same semantics as the
> installer.  That is, something like `sysugprade -S '-* b*'" to upgrade
> nothing but kernels and base.
>
> Such options offer great potential for users to shoot themselves in the
> foot by doing partial upgrades;  I am not really sold on the idea, yet.
>

Ofcourse there are also custom sets, like site${VERSION}-*.tgz . Which is
something to keep in mind.

--
Kind regards,
Hiltjo

Reply | Threaded
Open this post in threaded view
|

Re: sysupgrade: select sets to install

Theo de Raadt-2
Hiltjo Posthuma <[hidden email]> wrote:

> On Tue, Jul 09, 2019 at 05:09:12PM +0200, Klemens Nanni wrote:
> > I think sysupgrade should, if at all, use the same semantics as the
> > installer.  That is, something like `sysugprade -S '-* b*'" to upgrade
> > nothing but kernels and base.
> >
> > Such options offer great potential for users to shoot themselves in the
> > foot by doing partial upgrades;  I am not really sold on the idea, yet.
> >
>
> Ofcourse there are also custom sets, like site${VERSION}-*.tgz . Which is
> something to keep in mind.

Yeah, we could delete support for that entirely

Those of you so used to pushing buttons and requiring special features
used by a limited subset of the community really don't know what hole
you are starting to dig

Reply | Threaded
Open this post in threaded view
|

Re: sysupgrade: select sets to install

Alexander Bluhm
On Wed, Jul 10, 2019 at 12:18:33PM -0600, Theo de Raadt wrote:
> > Ofcourse there are also custom sets, like site${VERSION}-*.tgz . Which is
> > something to keep in mind.
>
> Yeah, we could delete support for that entirely

I use site.tgz to configure my regression test machines.  This is
a useful feature.

bluhm

Reply | Threaded
Open this post in threaded view
|

Re: sysupgrade: select sets to install

Philipp Buehler
In reply to this post by Theo de Raadt-2
Am 10.07.2019 20:18 schrieb Theo de Raadt:
>> Ofcourse there are also custom sets, like site${VERSION}-*.tgz . Which
>> is
>> something to keep in mind.
>
> Yeah, we could delete support for that entirely
>
> Those of you so used to pushing buttons and requiring special features
> used by a limited subset of the community really don't know what hole
> you are starting to dig

Please do not for the install-installer. I think those who are really
using site*.tgz
know that automation is obliteration and don't need site (or selected
sets
back then) "awareness" in the update tools.

While I think sys{upgrade,patch,merge} are useful, who installs such
machines (e.g. laptops) in a "site.tgz" way anyway?

--
pb