Re: [DNG] Odd issue with busybox dc in beowulf

2021-05-07 Thread Brad Campbell via Dng
On 29/4/21 8:14 pm, tito via Dng wrote:

> Hi,
> by looking at the latest git code:
> 
> static const struct op operators[] ALIGN_PTR = {
> #if ENABLE_FEATURE_DC_LIBM
>   {"^",   power},
> //{"exp", power},
> //{"pow", power},
> #endif
>   {"%",   mod},
> //{"mod", mod},
>   // logic ops are not standard, remove?
>   {"and", and},
>   {"or",  or},
>   {"not", not},
>   {"xor", eor},
>   {"+",   add},
> //{"add", add},
>   {"-",   sub},
> //{"sub", sub},
>   {"*",   mul},
> //{"mul", mul},
>   {"/",   divide},
> //{"div", divide},
>   {"p", print_no_pop},
>   {"f", print_stack_no_pop},
>   {"o", set_output_base},
> };
> 
> it seems to me that mod, add, sub, mul, div are disabled
> and only %, +, -, *,  / are supported.
> Cannot say if simply uncommenting  them restores
> the previous functionality, could be worth a try.
> Eventually if it works a patch for making them optional
> (CONFIG_DC_LONG_OPS or the like) could be sent
> to the list.
> 
> Hope this helps, 

It did. Thanks to all that replied.

This bit of code runs in the initramfs and is used to unlock ATA locked drives 
using keys from the network.
If it fails, the machine can't unlock the drives. This prompted me to take the 
time to re-write the arithmetic 
in a POSIX compatible shell to take dc out of the equation altogether. I can't 
risk it breaking again down the track.

I still never got to the bottom of it printing the top of the stack as a 
character rather than a number.

Regards,
Brad
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Odd issue with busybox dc in beowulf

2021-04-30 Thread g4sra via Dng
<--snip-->

> Hi,
> by looking at the latest git code:
> 

> static const struct op operators[] ALIGN_PTR = {
> #if ENABLE_FEATURE_DC_LIBM
> {"^", power},
> // {"exp", power},
> // {"pow", power},
> #endif
> {"%", mod},
> // {"mod", mod},
> // logic ops are not standard, remove?
> {"and", and},
> {"or", or},
> {"not", not},
> {"xor", eor},
> {"+", add},
> // {"add", add},
> {"-", sub},
> // {"sub", sub},
> {"*", mul},
> // {"mul", mul},
> {"/", divide},
> // {"div", divide},
> {"p", print_no_pop},
> {"f", print_stack_no_pop},
> {"o", set_output_base},
> };
> 

> it seems to me that mod, add, sub, mul, div are disabled
> and only %, +, -, *, / are supported.
> Cannot say if simply uncommenting them restores
> the previous functionality, could be worth a try.
> Eventually if it works a patch for making them optional
> (CONFIG_DC_LONG_OPS or the like) could be sent
> to the list.


Perform a 'git blame' and then chase the relevant commit hasha potential 
for 'git revert'.




publickey - g4sra@protonmail.com - 0x42E94623.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Odd issue with busybox dc in beowulf

2021-04-29 Thread tito via Dng
On Thu, 29 Apr 2021 09:59:02 +0800
Brad Campbell via Dng  wrote:

> G'day All,
> 
> I've upgraded a staging server from Jessie to Beowulf and find a
> script in my initramfs is now broken, tracking it down it is a huge
> change in behaviour in the busybox version of dc and I can't find any
> reference to what I'm missing. Has anyone bumped up against this?
> I've tried this on both the arm and x64 versions and the behaviour is
> identical, so it's not an arm thing specifically.
> 
> On jessie :
> brad@srv:~$ busybox dc
> 2
> 2
> add
> p
> 4
> 
> On beowulf :
> root@rpi31:~# busybox dc
> 2
> 2
> add
> p
> 
> 
> What you can't see at the bottom of the last example is the rendering
> of the 0x02 character in the shell.
> 
> The input processor also appears to have changed.
> 
> brad@srv:~$ busybox dc
> 0x127
> p
> 295
> 
> root@rpi31:~# busybox dc
> 0x127
> p
> 127
> 
> Installed packages.
> 
> root@rpi31:~# apt-cache showpkg busybox
> Package: busybox
> Versions:
> 1:1.30.1-4
> (/var/lib/apt/lists/deb.devuan.org_merged_dists_beowulf_main_binary-armhf_Packages)
> (/var/lib/dpkg/status) Description Language:
> File: 
> /var/lib/apt/lists/deb.devuan.org_merged_dists_beowulf_main_binary-armhf_Packages
> MD5: b7707908219c331294f3f9e8d926a9dc Description Language: en
>   File: 
> /var/lib/apt/lists/deb.devuan.org_merged_dists_beowulf_main_i18n_Translation-en
>MD5: b7707908219c331294f3f9e8d926a9dc
> 
> 
> Reverse Depends:
>initramfs-tools-core,busybox 1:1.22.0-17~
>zfs-initramfs,busybox
>udhcpd,busybox 1:1.30.1
>udhcpc,busybox 1:1.30.1
>open-iscsi,busybox
>open-infrastructure-system-boot,busybox
>live-boot-initramfs-tools,busybox
>initramfs-tools-core,busybox 1:1.22.0-17~
>busybox-syslogd,busybox 1:1.30.1
>dropbear-initramfs,busybox
>cryptsetup-initramfs,busybox
>bootcd,busybox
>busybox-static,busybox
>busybox-static,busybox
> Dependencies:
> 1:1.30.1-4 - libc6 (2 2.28) busybox-static (0 (null)) initramfs-tools
> (3 0.99) busybox-static (0 (null)) Provides:
> 1:1.30.1-4 -
> Reverse Provides:
> busybox-static 1:1.30.1-4 (= )
> 
> 
> brad@srv:~$ apt-cache showpkg busybox
> Package: busybox
> Versions:
> 1:1.22.0-9+deb8u4 (/var/lib/dpkg/status)
>   Description Language:
>   File: 
> /var/lib/apt/lists/archive.devuan.org_merged_dists_jessie_main_binary-amd64_Packages
>MD5: b7707908219c331294f3f9e8d926a9dc
>   Description Language: en
>   File: 
> /var/lib/apt/lists/archive.devuan.org_merged_dists_jessie_main_i18n_Translation-en
>MD5: b7707908219c331294f3f9e8d926a9dc
> 
> 1:1.22.0-9+deb8u1
> (/var/lib/apt/lists/archive.devuan.org_merged_dists_jessie_main_binary-amd64_Packages)
> Description Language:
> File: 
> /var/lib/apt/lists/archive.devuan.org_merged_dists_jessie_main_binary-amd64_Packages
> MD5: b7707908219c331294f3f9e8d926a9dc Description Language: en
>   File: 
> /var/lib/apt/lists/archive.devuan.org_merged_dists_jessie_main_i18n_Translation-en
>MD5: b7707908219c331294f3f9e8d926a9dc
> 
> 
> Reverse Depends:
>udhcpd,busybox 1:1.22.0
>udhcpc,busybox 1:1.22.0
>live-boot-initramfs-tools,busybox
>initramfs-tools,busybox 1:1.01-3
>initramfs-tools,busybox 1:1.01-3
>cryptsetup,busybox
>busybox-syslogd,busybox 1:1.22.0
>busybox-static,busybox
>busybox-static,busybox
>bootcd,busybox
> Dependencies:
> 1:1.22.0-9+deb8u4 - libc6 (2 2.16) busybox-static (0 (null))
> initramfs-tools (3 0.99) busybox-static (0 (null)) 1:1.22.0-9+deb8u1
> - libc6 (2 2.16) busybox-static (0 (null)) initramfs-tools (3 0.99)
> busybox-static (0 (null)) Provides: 1:1.22.0-9+deb8u4 -
> 1:1.22.0-9+deb8u1 -
> Reverse Provides:
> busybox-static 1:1.22.0-9+deb8u1
> 
> Am I doing something dumb?
> 
> Regards,
> Brad
> ___
> Dng mailing list
> Dng@lists.dyne.org
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng

Hi,
by looking at the latest git code:

static const struct op operators[] ALIGN_PTR = {
#if ENABLE_FEATURE_DC_LIBM
{"^",   power},
//  {"exp", power},
//  {"pow", power},
#endif
{"%",   mod},
//  {"mod", mod},
// logic ops are not standard, remove?
{"and", and},
{"or",  or},
{"not", not},
{"xor", eor},
{"+",   add},
//  {"add", add},
{"-",   sub},
//  {"sub", sub},
{"*",   mul},
//  {"mul", mul},
{"/",   divide},
//  {"div", divide},
{"p", print_no_pop},
{"f", print_stack_no_pop},
{"o", set_output_base},
};

it seems to me that mod, add, sub, mul, div are disabled
and only %, +, -, *,  / are supported.
Cannot say if simply uncommenting  them restores
the previous functionality, could be worth a try.
Eventually if it works a patch for making them optional
(CONFIG_DC_LONG_OPS or the like) could be sent
to the list.

Hope 

Re: [DNG] Odd issue with busybox dc in beowulf

2021-04-29 Thread g4sra via Dng
‐‐‐ Original Message ‐‐‐
On Thursday, April 29, 2021 2:59 AM, Brad Campbell via Dng  
wrote:

> G'day All,
> 

> I've upgraded a staging server from Jessie to Beowulf and find a script in my 
> initramfs is now broken, tracking it down it is a huge change in behaviour in 
> the busybox version of dc and I can't find any reference to what I'm missing. 
> Has anyone bumped up against this? I've tried this on both the arm and x64 
> versions and the behaviour is identical, so it's not an arm thing 
> specifically.
> 

> On jessie :
> brad@srv:~$ busybox dc
> 2
> 2
> add
> p
> 4
> 

> On beowulf :
> root@rpi31:~# busybox dc
> 2
> 2
> add
> p
> 


In case you did not try it, I observe the following on beowulf :

~$ busybox dc
2
2
+
p
4


<--snip-->

publickey - g4sra@protonmail.com - 0x42E94623.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Odd issue with busybox dc in beowulf

2021-04-28 Thread tito via Dng
On Thu, 29 Apr 2021 09:59:02 +0800
Brad Campbell via Dng  wrote:

> G'day All,
> 
> I've upgraded a staging server from Jessie to Beowulf and find a
> script in my initramfs is now broken, tracking it down it is a huge
> change in behaviour in the busybox version of dc and I can't find any
> reference to what I'm missing. Has anyone bumped up against this?
> I've tried this on both the arm and x64 versions and the behaviour is
> identical, so it's not an arm thing specifically.
> 
> On jessie :
> brad@srv:~$ busybox dc
> 2
> 2
> add
> p
> 4
> 
> On beowulf :
> root@rpi31:~# busybox dc
> 2
> 2
> add
> p
> 
> 
> What you can't see at the bottom of the last example is the rendering
> of the 0x02 character in the shell.
> 
> The input processor also appears to have changed.
> 
> brad@srv:~$ busybox dc
> 0x127
> p
> 295
> 
> root@rpi31:~# busybox dc
> 0x127
> p
> 127
> 
> Installed packages.
> 
> root@rpi31:~# apt-cache showpkg busybox
> Package: busybox
> Versions:
> 1:1.30.1-4
> (/var/lib/apt/lists/deb.devuan.org_merged_dists_beowulf_main_binary-armhf_Packages)
> (/var/lib/dpkg/status) Description Language:
> File: 
> /var/lib/apt/lists/deb.devuan.org_merged_dists_beowulf_main_binary-armhf_Packages
> MD5: b7707908219c331294f3f9e8d926a9dc Description Language: en
>   File: 
> /var/lib/apt/lists/deb.devuan.org_merged_dists_beowulf_main_i18n_Translation-en
>MD5: b7707908219c331294f3f9e8d926a9dc
> 
> 
> Reverse Depends:
>initramfs-tools-core,busybox 1:1.22.0-17~
>zfs-initramfs,busybox
>udhcpd,busybox 1:1.30.1
>udhcpc,busybox 1:1.30.1
>open-iscsi,busybox
>open-infrastructure-system-boot,busybox
>live-boot-initramfs-tools,busybox
>initramfs-tools-core,busybox 1:1.22.0-17~
>busybox-syslogd,busybox 1:1.30.1
>dropbear-initramfs,busybox
>cryptsetup-initramfs,busybox
>bootcd,busybox
>busybox-static,busybox
>busybox-static,busybox
> Dependencies:
> 1:1.30.1-4 - libc6 (2 2.28) busybox-static (0 (null)) initramfs-tools
> (3 0.99) busybox-static (0 (null)) Provides:
> 1:1.30.1-4 -
> Reverse Provides:
> busybox-static 1:1.30.1-4 (= )
> 
> 
> brad@srv:~$ apt-cache showpkg busybox
> Package: busybox
> Versions:
> 1:1.22.0-9+deb8u4 (/var/lib/dpkg/status)
>   Description Language:
>   File: 
> /var/lib/apt/lists/archive.devuan.org_merged_dists_jessie_main_binary-amd64_Packages
>MD5: b7707908219c331294f3f9e8d926a9dc
>   Description Language: en
>   File: 
> /var/lib/apt/lists/archive.devuan.org_merged_dists_jessie_main_i18n_Translation-en
>MD5: b7707908219c331294f3f9e8d926a9dc
> 
> 1:1.22.0-9+deb8u1
> (/var/lib/apt/lists/archive.devuan.org_merged_dists_jessie_main_binary-amd64_Packages)
> Description Language:
> File: 
> /var/lib/apt/lists/archive.devuan.org_merged_dists_jessie_main_binary-amd64_Packages
> MD5: b7707908219c331294f3f9e8d926a9dc Description Language: en
>   File: 
> /var/lib/apt/lists/archive.devuan.org_merged_dists_jessie_main_i18n_Translation-en
>MD5: b7707908219c331294f3f9e8d926a9dc
> 
> 
> Reverse Depends:
>udhcpd,busybox 1:1.22.0
>udhcpc,busybox 1:1.22.0
>live-boot-initramfs-tools,busybox
>initramfs-tools,busybox 1:1.01-3
>initramfs-tools,busybox 1:1.01-3
>cryptsetup,busybox
>busybox-syslogd,busybox 1:1.22.0
>busybox-static,busybox
>busybox-static,busybox
>bootcd,busybox
> Dependencies:
> 1:1.22.0-9+deb8u4 - libc6 (2 2.16) busybox-static (0 (null))
> initramfs-tools (3 0.99) busybox-static (0 (null)) 1:1.22.0-9+deb8u1
> - libc6 (2 2.16) busybox-static (0 (null)) initramfs-tools (3 0.99)
> busybox-static (0 (null)) Provides: 1:1.22.0-9+deb8u4 -
> 1:1.22.0-9+deb8u1 -
> Reverse Provides:
> busybox-static 1:1.22.0-9+deb8u1
> 
> Am I doing something dumb?
> 
> Regards,
> Brad
> ___
> Dng mailing list
> Dng@lists.dyne.org
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng

Hi,
the only changes in the last years in busybox's dc are:

Commit message (Expand) Author  Age Files   Lines
*   timeout,top,watch,ping: parse NN.N fractional duration in locales with 
other ...Gravatar Denys Vlasenko 2021-03-23  1   -0/+1
*   randomconfig fixes  Gravatar Denys Vlasenko 2020-12-29  1   
-1/+1
*   decrease paddign: gcc-9.3.1 slaps 32-byte alignment on arrays 
willy-nilly   Gravatar Denys Vlasenko 2020-11-30  1   -1/+1
*   libbb: reduce the overhead of single parameter bb_error_msg() calls 
Gravatar James Byrne2019-07-02  1   -2/+2
*   dc: make 4 % 0 emit error messgaes and set result to 0  Gravatar Denys 
Vlasenko 2019-05-16  1   -7/+12
*   dc: code shrink Gravatar Denys Vlasenko 2019-05-09  1   -6/+16

Could you take a look at them?

Ciao,
Tito
___
Dng mailing list
Dng@lists.dyne.org

[DNG] Odd issue with busybox dc in beowulf

2021-04-28 Thread Brad Campbell via Dng

G'day All,

I've upgraded a staging server from Jessie to Beowulf and find a script in my 
initramfs is now broken, tracking it down it is a huge change in behaviour in 
the busybox version of dc and I can't find any reference to what I'm missing. 
Has anyone bumped up against this? I've tried this on both the arm and x64 
versions and the behaviour is identical, so it's not an arm thing specifically.

On jessie :
brad@srv:~$ busybox dc
2
2
add
p
4

On beowulf :
root@rpi31:~# busybox dc
2
2
add
p


What you can't see at the bottom of the last example is the rendering of the 
0x02 character in the shell.

The input processor also appears to have changed.

brad@srv:~$ busybox dc
0x127
p
295

root@rpi31:~# busybox dc
0x127
p
127

Installed packages.

root@rpi31:~# apt-cache showpkg busybox
Package: busybox
Versions:
1:1.30.1-4 
(/var/lib/apt/lists/deb.devuan.org_merged_dists_beowulf_main_binary-armhf_Packages)
 (/var/lib/dpkg/status)
 Description Language:
 File: 
/var/lib/apt/lists/deb.devuan.org_merged_dists_beowulf_main_binary-armhf_Packages
  MD5: b7707908219c331294f3f9e8d926a9dc
 Description Language: en
 File: 
/var/lib/apt/lists/deb.devuan.org_merged_dists_beowulf_main_i18n_Translation-en
  MD5: b7707908219c331294f3f9e8d926a9dc


Reverse Depends:
  initramfs-tools-core,busybox 1:1.22.0-17~
  zfs-initramfs,busybox
  udhcpd,busybox 1:1.30.1
  udhcpc,busybox 1:1.30.1
  open-iscsi,busybox
  open-infrastructure-system-boot,busybox
  live-boot-initramfs-tools,busybox
  initramfs-tools-core,busybox 1:1.22.0-17~
  busybox-syslogd,busybox 1:1.30.1
  dropbear-initramfs,busybox
  cryptsetup-initramfs,busybox
  bootcd,busybox
  busybox-static,busybox
  busybox-static,busybox
Dependencies:
1:1.30.1-4 - libc6 (2 2.28) busybox-static (0 (null)) initramfs-tools (3 0.99) 
busybox-static (0 (null))
Provides:
1:1.30.1-4 -
Reverse Provides:
busybox-static 1:1.30.1-4 (= )


brad@srv:~$ apt-cache showpkg busybox
Package: busybox
Versions:
1:1.22.0-9+deb8u4 (/var/lib/dpkg/status)
 Description Language:
 File: 
/var/lib/apt/lists/archive.devuan.org_merged_dists_jessie_main_binary-amd64_Packages
  MD5: b7707908219c331294f3f9e8d926a9dc
 Description Language: en
 File: 
/var/lib/apt/lists/archive.devuan.org_merged_dists_jessie_main_i18n_Translation-en
  MD5: b7707908219c331294f3f9e8d926a9dc

1:1.22.0-9+deb8u1 
(/var/lib/apt/lists/archive.devuan.org_merged_dists_jessie_main_binary-amd64_Packages)
 Description Language:
 File: 
/var/lib/apt/lists/archive.devuan.org_merged_dists_jessie_main_binary-amd64_Packages
  MD5: b7707908219c331294f3f9e8d926a9dc
 Description Language: en
 File: 
/var/lib/apt/lists/archive.devuan.org_merged_dists_jessie_main_i18n_Translation-en
  MD5: b7707908219c331294f3f9e8d926a9dc


Reverse Depends:
  udhcpd,busybox 1:1.22.0
  udhcpc,busybox 1:1.22.0
  live-boot-initramfs-tools,busybox
  initramfs-tools,busybox 1:1.01-3
  initramfs-tools,busybox 1:1.01-3
  cryptsetup,busybox
  busybox-syslogd,busybox 1:1.22.0
  busybox-static,busybox
  busybox-static,busybox
  bootcd,busybox
Dependencies:
1:1.22.0-9+deb8u4 - libc6 (2 2.16) busybox-static (0 (null)) initramfs-tools (3 
0.99) busybox-static (0 (null))
1:1.22.0-9+deb8u1 - libc6 (2 2.16) busybox-static (0 (null)) initramfs-tools (3 
0.99) busybox-static (0 (null))
Provides:
1:1.22.0-9+deb8u4 -
1:1.22.0-9+deb8u1 -
Reverse Provides:
busybox-static 1:1.22.0-9+deb8u1

Am I doing something dumb?

Regards,
Brad
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng