:: Re: [DNG] Odd issue with busybox dc…
Página Principal
Delete this message
Reply to this message
Autor: tito
Data:  
Para: dng
Assunto: Re: [DNG] Odd issue with busybox dc in beowulf
On Thu, 29 Apr 2021 09:59:02 +0800
Brad Campbell via Dng <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@???
> 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 this helps,

Ciao,
Tito