-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Created utils/random-numgen package, an alternative to $RANDOM #20728
Conversation
Just saw the "Formalities" test failing, I am going to fix it ASAP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure... You should rather active BUSYBOX_CONFIG_ASH_RANDOM_SUPPORT
in your build instead of adding your own custom package for it.
And no, this will not be backported to OpenWrt 22.03.
utils/random-numgen/Makefile
Outdated
PKG_NAME:=random-numgen | ||
PKG_VERSION:=0.1 | ||
PKG_RELEASE:=1 | ||
PKG_LICENSE:=GPL-2.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Outdated LICENSE SPDX License Identifier.
utils/random-numgen/Makefile
Outdated
|
||
include $(INCLUDE_DIR)/package.mk | ||
|
||
define Package/$(PKG_NAME) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why you are trying to add something here back, when it was removed?
define Package/$(PKG_NAME) | |
define Package/random-numgen |
utils/random-numgen/Makefile
Outdated
SECTION:=utils | ||
CATEGORY:=Utilities | ||
TITLE:=Generates a random number 0-65535 | ||
MAINTAINER:=Ilario Gelmetti <ilario@sindominio.net> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be elsewhere, please look how Makefiles are done in this repository. Also, this section should have 2 spaces as indentation not tab.
utils/random-numgen/Makefile
Outdated
|
||
define Package/$(PKG_NAME)/install | ||
$(INSTALL_DIR) $(1)/ | ||
$(CP) ./files/* $(1)/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Use INSTALL_BIN
- Move only specific files not everything
since this is a very simple wrapper, imo it should go to somewhere like |
Thanks @BKPepe for the corrections!
That is what we were doing in LibreMesh, but that implies that we are not compatible with pristine OpenWrt's ImageBuilder.
Ok |
@ilario what is the size increase of enabling |
Signed-off-by: Ilario Gelmetti <iochesonome@gmail.com>
The same was asked by @aparcar here: openwrt/openwrt#12291 (comment) :) Is there a proper way to measure that? I compiled and then run binwalk on the
So in total, it increases by only 188 bytes, if I measured it correctly. |
Closing as fixed in openwrt/openwrt#12465 and openwrt/openwrt@8f427f1 |
Maintainer: me / @ilario
Compile tested: OpenWrt 22.03 and OpenWrt 19.07, YouHua WR1200JS
Run tested: OpenWrt 22.03 and OpenWrt 19.07, YouHua WR1200JS
Description:
By default, the
$RANDOM
shell variable is not available as Busybox does not have theBUSYBOX_CONFIG_ASH_RANDOM_SUPPORT
option activated.This command gives an equivalent output, an integer from 0 to 65535.
Originally, we decided we needed such a command in LibreMesh to replace the usage of
$RANDOM
, as discussed here libremesh/lime-packages#800 and here libremesh/lime-packages#980.I would be nice to have this also in the openwrt-22.03 branch.