From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) by mx.groups.io with SMTP id smtpd.web10.23656.1625326414344806118 for ; Sat, 03 Jul 2021 08:33:34 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QJGKEElp; spf=pass (domain: gmail.com, ip: 209.85.167.51, mailfrom: tolvupostur@gmail.com) Received: by mail-lf1-f51.google.com with SMTP id f30so23963010lfj.1 for ; Sat, 03 Jul 2021 08:33:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zlb0zCmoBI2Ch4ksC5hJKSULZoq+Pi5UNDME4/YsPpY=; b=QJGKEElp1+BoYG72LHx5FnpfEL8dfJgZmiL0L2ROnwkInJdne0bV5lIf6WqBDqHx8/ FnjCU212vD2RDUH+aiEn/dEslfgH697tsT44/o/qd7kUG452W3lmVXaRRJyU3jUyohYX TTCGAtnCe5u84TT3bXR2K/7cwEBre79oAa3fC+3bHdHkCKqkRBmvpJSnvrjISKCWt9Nd 25BfsyHxoabS09qtld+RGB22Qi8X0LcHxGf34RDWEfs7b3+t/cPMgFsZWQgVqtHbqWDn 8yep+uCBM0xXFF85bF8rqEeLfI2qOn/JqsZr+YMPLMeLMXV/07yWdpGpjgP7U7jQ1TiU 5+GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zlb0zCmoBI2Ch4ksC5hJKSULZoq+Pi5UNDME4/YsPpY=; b=skMV+7uZqtIcN+zUxaMW39W9rFRV5sv7E7XMP/th+oemN8HN8pRoUH0waKzZXBZij6 /ybH+WqEICGzLC4ph/WL2zlFLZ9an5NKL92OPfxlx2IbosJ3BIWo93vcLLopYAC7zCjR J2sWc/yEORCD/SFrZbTYAw56Q8HqWMqhmIOWGOM/mSRlX25XJNsrC3X46jm1nSPZ0pjR waMK+JjSxba8jo/hKkVMB2Cc6DwG5iycCt0QLQJRbnXfmVjL59FPAHhdokqUjGifXEal wteAp3enh7fbJ6LBSabmFWy7JTZ7Qtv1eH+XGuatZvYhHXKxO39Z1rwKCf7ct0QYg7Qy YHTg== X-Gm-Message-State: AOAM5314aiR1kU7oKQKHh7liZjdZVdd0ifZavalfxAmw2W4xQJPq762T SaimqTJ5VerzTpkAOCD2xtb79gWmp6JaboKFnjs= X-Google-Smtp-Source: ABdhPJx5ujZ4PgWM6aBtOuq+v7fwiXb8dRnYhfe5ZWIQxC0WnmTeuBjQUDb2T2bjMwJfouuVoFtol1trMCpfuq7O2vs= X-Received: by 2002:a05:6512:3da0:: with SMTP id k32mr3822756lfv.568.1625326412474; Sat, 03 Jul 2021 08:33:32 -0700 (PDT) MIME-Version: 1.0 References: <168DFB55CCAE8B91.30759@lists.openembedded.org> In-Reply-To: From: "Einar Gunnarsson" Date: Sat, 3 Jul 2021 17:33:21 +0200 Message-ID: Subject: Re: [OE-core] [update-rc.d][PATCH] update-rc.d: Fix enable/disable command To: Alexandre Belloni Cc: openembedded-core@lists.openembedded.org Content-Type: multipart/alternative; boundary="00000000000075ab6705c639cb6a" --00000000000075ab6705c639cb6a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ok. I messed up the prefix, so the mail is separate... https://lists.openembedded.org/g/openembedded-core/message/153509 On Fri, 2 Jul 2021 at 23:46, Alexandre Belloni < alexandre.belloni@bootlin.com> wrote: > On 02/07/2021 15:57:03+0200, Einar Gunnarsson wrote: > > I forgot the third error in this line: > > Links numbered 91 or higher will create a single digit link. > > > > # update-rc.d -v -n smack disable > > rename /etc/rc2.d/S91smack -> /etc/rc2.d/K9smack > > > > I guess this fixes all three: > > > > printf -v newnn "%02d" $((100-${oldnn#0})) > > > > How do I resubmit a patch? > > > > Simply send the new patch with [PATCH v2] instead of [PATCH]. > > > > > On Fri, 2 Jul 2021 at 15:10, Einar Gunnarsson via lists.openembedded.o= rg > > wrote: > > > > > $[] is a bashism and does not work on POSIX shells > > > > > > enable/disable on links numbered 08 and 09 gives the error: > > > 'bash: 100-08: value too great for base (error token is "08")' > > > > > > Signed-off-by: Einar Gunnarsson > > > --- > > > update-rc.d | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/update-rc.d b/update-rc.d > > > index c9355d7..24ac752 100644 > > > --- a/update-rc.d > > > +++ b/update-rc.d > > > @@ -114,7 +114,7 @@ renamelink() > > > # or stop link to start link with a sequence number equal t= o > the > > > difference of 100 minus the original sequence number. > > > if ls ${etcd}${lev}.d/${oldstartstop}*${bn} >/dev/null 2>&1; > then > > > oldnn=3D`basename > ${etcd}${lev}.d/${oldstartstop}*${bn}|cut > > > -c2-3` > > > - newnn=3D$[100-$oldnn] > > > + newnn=3D$((100-${oldnn#0})) > > > [ $verbose -eq 1 ] && echo "rename > > > ${etcd}${lev}.d/${oldstartstop}${oldnn}${bn} -> > > > ${etcd}${lev}.d/${newstartstop}${newnn}${bn}" > > > if [ $notreally -eq 0 ];then > > > mv ${etcd}${lev}.d/${oldstartstop}${oldnn}${= bn} > > > ${etcd}${lev}.d/${newstartstop}${newnn}${bn} > > > -- > > > 2.17.1 > > > > > > > > > > > > > > > > > > > -- > > Regards > > Einar J=C3=B3n > > +31 610 957234 > > > > >=20 > > > > > -- > Alexandre Belloni, co-owner and COO, Bootlin > Embedded Linux and Kernel engineering > https://bootlin.com > --=20 Regards Einar J=C3=B3n +31 610 957234 --00000000000075ab6705c639cb6a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Ok.=C2=A0
I messed up the prefix, so the mail is separa= te...
https://lists.openembedded.org/g/openembedded-core/message/1535= 09

On Fri, 2 Jul 2021 at 23:46, Alexandre Belloni <alexandre.belloni@bootlin.com> wr= ote:
On 02/07/20= 21 15:57:03+0200, Einar Gunnarsson wrote:
> I forgot the third error in this line:
> Links numbered 91 or higher will create a single digit link.
>
> # update-rc.d -v=C2=A0 -n smack disable
> rename /etc/rc2.d/S91smack -> /etc/rc2.d/K9smack
>
> I guess this fixes all three:
>
> printf -v newnn "%02d" $((100-${oldnn#0}))
>
> How do I resubmit a patch?
>

Simply send the new patch with [PATCH v2] instead of [PATCH].

>
> On Fri, 2 Jul 2021 at 15:10, Einar Gunnarsson via lists.openembed= ded.org
> <tolvupostur=3Dgmail.com@lists.openembedded.org> wrote:
>
> > $[] is a bashism and does not work on POSIX shells
> >
> > enable/disable on links numbered 08 and 09 gives the error:
> > 'bash: 100-08: value too great for base (error token is &quo= t;08")'
> >
> > Signed-off-by: Einar Gunnarsson <tolvupostur@gmail.com>
> > ---
> >=C2=A0 update-rc.d | 2 +-
> >=C2=A0 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/update-rc.d b/update-rc.d
> > index c9355d7..24ac752 100644
> > --- a/update-rc.d
> > +++ b/update-rc.d
> > @@ -114,7 +114,7 @@ renamelink()
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # or stop link to start link w= ith a sequence number equal to the
> > difference of 100 minus the original sequence number.
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if ls ${etcd}${lev}.d/${oldstar= tstop}*${bn} >/dev/null 2>&1; then
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0old= nn=3D`basename ${etcd}${lev}.d/${oldstartstop}*${bn}|cut
> > -c2-3`
> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0newnn=3D= $[100-$oldnn]
> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0newnn=3D= $((100-${oldnn#0}))
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[ $= verbose -eq 1 ] && echo "rename
> > ${etcd}${lev}.d/${oldstartstop}${oldnn}${bn} ->
> > ${etcd}${lev}.d/${newstartstop}${newnn}${bn}"
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if = [ $notreally -eq 0 ];then
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0mv ${etcd}${lev}.d/${oldstartstop}${oldnn}${bn}=
> > ${etcd}${lev}.d/${newstartstop}${newnn}${bn}
> > --
> > 2.17.1
> >
> >
> >
> >
> >
>
> --
> Regards
> Einar J=C3=B3n
> +31 610 957234

>
>
>


--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https= ://bootlin.com


--
Regards
Einar J=C3=B3n
+31 610 957234 --00000000000075ab6705c639cb6a--