From 88c24ab04757d0be379739049063547bf5608f80 Mon Sep 17 00:00:00 2001 From: Geunsik Lim Date: Mon, 27 May 2019 20:20:10 +0900 Subject: [PATCH] Packaging: Added a toybox-full.rpm includes most applets This commit is to provide a sub package that is called toybox-full.rpm as well as toybox.rpm (small package that consists of 7 applets just). The toybox-full.rpm file includes most of the applets including 'init' command. This commit does not affect the execution of the existing toybox.rpm file. As we all know, Busybox has been released with GPL license. Above all, the latest version of Busybox is GPLV3+. We need to provide another full package including 'init' command such as Toybox (BSD) instead of the existing Buxybox package. * Changelog: Ver3: - Declared toybox-full with "Conflicts". - Declared "Requires" with %{name}-full for toyboxy-symlinsks-full Ver2: - Removed unnecessary line (Source44:***) Ver1: - Added toybox-full.rpm package * aarch64: Comparison of the binary size between toybox and toybox-full 1. toybox (dynamic ELF): 84,720 bytes - 7 applets: dhcp dhcpd dumpleases nslookup ping traceroute traceroute6 2. toybox-full(dynamic ELF): 557,008 bytes - 208 applets Change-Id: Ibc5fa77f7d1c7c80296520fe2a55561a9ca188ac Signed-off-by: Geunsik Lim --- packaging/config-full | 322 ++++++++++++++++++++++++++++++++++++++++++++++++ packaging/toybox.spec | 50 +++++++- packaging/usrbin.links | 204 +++++++++++++++++++++++++++++- packaging/usrsbin.links | 1 + 4 files changed, 574 insertions(+), 3 deletions(-) create mode 100644 packaging/config-full diff --git a/packaging/config-full b/packaging/config-full new file mode 100644 index 0000000..f6d2507 --- /dev/null +++ b/packaging/config-full @@ -0,0 +1,322 @@ +# +# Automatically generated make config: don't edit +# ToyBox version: KCONFIG_VERSION +# Fri May 24 11:26:47 2019 +# +CONFIG_TOYBOX_CONTAINER=y +CONFIG_TOYBOX_FIFREEZE=y +CONFIG_TOYBOX_ICONV=y +CONFIG_TOYBOX_FALLOCATE=y +CONFIG_TOYBOX_UTMPX=y +CONFIG_TOYBOX_SHADOW=y +# CONFIG_TOYBOX_ON_ANDROID is not set +CONFIG_TOYBOX_FORK=y + +# +# Samsung developed commands +# +CONFIG_NSLOOKUP=y +CONFIG_PING=y + +# +# Posix commands +# +CONFIG_BASENAME=y +CONFIG_CAL=y +CONFIG_CAT=y +# CONFIG_CAT_V is not set +CONFIG_CATV=y +CONFIG_CHGRP=y +CONFIG_CHOWN=y +CONFIG_CHMOD=y +CONFIG_CKSUM=y +CONFIG_CMP=y +CONFIG_COMM=y +CONFIG_CP=y +CONFIG_CP_MORE=y +CONFIG_CP_PRESERVE=y +CONFIG_MV=y +CONFIG_MV_MORE=y +CONFIG_INSTALL=y +CONFIG_CPIO=y +CONFIG_CUT=y +CONFIG_DATE=y +CONFIG_DF=y +CONFIG_DIRNAME=y +CONFIG_DU=y +CONFIG_ECHO=y +CONFIG_ENV=y +CONFIG_EXPAND=y +CONFIG_FALSE=y +CONFIG_FIND=y +CONFIG_GREP=y +CONFIG_EGREP=y +CONFIG_FGREP=y +CONFIG_HEAD=y +CONFIG_ID=y +# CONFIG_ID_Z is not set +CONFIG_GROUPS=y +CONFIG_LOGNAME=y +CONFIG_WHOAMI=y +CONFIG_KILL=y +CONFIG_KILLALL5=y +CONFIG_LINK=y +CONFIG_LN=y +CONFIG_LS=y +CONFIG_LS_COLOR=y +CONFIG_MKDIR=y +# CONFIG_MKDIR_Z is not set +CONFIG_MKFIFO=y +# CONFIG_MKFIFO_Z is not set +CONFIG_NICE=y +CONFIG_NL=y +CONFIG_NOHUP=y +CONFIG_OD=y +CONFIG_PASTE=y +CONFIG_PATCH=y +CONFIG_PRINTF=y +CONFIG_PWD=y +CONFIG_RENICE=y +CONFIG_RM=y +CONFIG_RMDIR=y +CONFIG_SED=y +CONFIG_SLEEP=y +CONFIG_SLEEP_FLOAT=y +CONFIG_SORT=y +CONFIG_SORT_BIG=y +CONFIG_SORT_FLOAT=y +CONFIG_SPLIT=y +CONFIG_STRINGS=y +CONFIG_TAIL=y +CONFIG_TAIL_SEEK=y +CONFIG_TEE=y +CONFIG_TIME=y +CONFIG_TOUCH=y +CONFIG_TRUE=y +CONFIG_TTY=y +CONFIG_UNAME=y +CONFIG_UNIQ=y +CONFIG_UNLINK=y +CONFIG_UUDECODE=y +CONFIG_UUENCODE=y +CONFIG_WC=y +CONFIG_WHO=y +CONFIG_XARGS=y +# CONFIG_XARGS_PEDANTIC is not set + +# +# pending (see toys/pending/README) +# +# CONFIG_ARP is not set +# CONFIG_ARPING is not set +CONFIG_BOOTCHARTD=y +# CONFIG_BRCTL is not set +CONFIG_COMPRESS=y +CONFIG_GZIP=y +CONFIG_GZIP_D=y +CONFIG_DECOMPRESS=y +CONFIG_ZCAT=y +CONFIG_GUNZIP=y +CONFIG_CROND=y +CONFIG_CRONTAB=y +CONFIG_DD=y +CONFIG_DHCP=y +CONFIG_DHCPD=y +CONFIG_DEBUG_DHCP=y +CONFIG_DIFF=y +CONFIG_DUMPLEASES=y +# CONFIG_EXPR is not set +CONFIG_FDISK=y +# CONFIG_FOLD is not set +CONFIG_FSCK=y +# CONFIG_FTPGET is not set +CONFIG_GETTY=y +# CONFIG_GROUPADD is not set +# CONFIG_GROUPDEL is not set +CONFIG_HOST=y +CONFIG_ICONV=y +CONFIG_INIT=y +CONFIG_IP=y +CONFIG_IPCRM=y +CONFIG_IPCS=y +# CONFIG_KLOGD is not set +# CONFIG_KLOGD_SOURCE_RING_BUFFER is not set +CONFIG_LAST=y +# CONFIG_LOGGER is not set +CONFIG_MDEV=y +CONFIG_MDEV_CONF=y +# CONFIG_MKE2FS is not set +# CONFIG_MKE2FS_JOURNAL is not set +# CONFIG_MKE2FS_GEN is not set +# CONFIG_MKE2FS_LABEL is not set +# CONFIG_MKE2FS_EXTENDED is not set +CONFIG_MODPROBE=y +CONFIG_MORE=y +CONFIG_NETSTAT=y +# CONFIG_OPENVT is not set +# CONFIG_DEALLOCVT is not set +CONFIG_PGREP=y +CONFIG_PS=y +CONFIG_ROUTE=y +CONFIG_SH=y +# CONFIG_EXIT is not set +# CONFIG_CD is not set +CONFIG_SULOGIN=y +# CONFIG_SYSLOGD is not set +CONFIG_TAR=y +# CONFIG_TCPSVD is not set +CONFIG_TELNET=y +CONFIG_TELNETD=y +# CONFIG_TEST is not set +# CONFIG_TFTPD is not set +CONFIG_TOP=y +# CONFIG_TR is not set +CONFIG_TRACEROUTE=y +# CONFIG_USERADD is not set +# CONFIG_USERDEL is not set +CONFIG_WATCH=y +# CONFIG_XZCAT is not set + +# +# Other commands +# +CONFIG_ACPI=y +CONFIG_BASE64=y +CONFIG_BLKID=y +CONFIG_FSTYPE=y +CONFIG_BLOCKDEV=y +CONFIG_BZCAT=y +# CONFIG_CHCON is not set +CONFIG_CHROOT=y +CONFIG_CHVT=y +CONFIG_CLEAR=y +CONFIG_COUNT=y +CONFIG_DOS2UNIX=y +CONFIG_UNIX2DOS=y +CONFIG_EJECT=y +CONFIG_FACTOR=y +CONFIG_FALLOCATE=y +CONFIG_FREE=y +CONFIG_FREERAMDISK=y +CONFIG_FSFREEZE=y +CONFIG_HELP=y +CONFIG_HELP_EXTRAS=y +CONFIG_HEXEDIT=y +CONFIG_HWCLOCK=y +CONFIG_IFCONFIG=y +CONFIG_INOTIFYD=y +CONFIG_INSMOD=y +CONFIG_IONICE=y +CONFIG_IORENICE=y +CONFIG_LOGIN=y +CONFIG_LOSETUP=y +CONFIG_LSATTR=y +CONFIG_CHATTR=y +CONFIG_LSMOD=y +CONFIG_LSPCI=y +CONFIG_LSPCI_TEXT=y +CONFIG_LSUSB=y +CONFIG_MAKEDEVS=y +CONFIG_MIX=y +CONFIG_MKPASSWD=y +CONFIG_MKSWAP=y +CONFIG_MODINFO=y +CONFIG_MOUNTPOINT=y +CONFIG_NBD_CLIENT=y +CONFIG_NETCAT=y +CONFIG_NETCAT_LISTEN=y +CONFIG_UNSHARE=y +CONFIG_NSENTER=y +CONFIG_ONEIT=y +CONFIG_PARTPROBE=y +CONFIG_PIVOT_ROOT=y +CONFIG_PMAP=y +CONFIG_PRINTENV=y +CONFIG_PWDX=y +CONFIG_READAHEAD=y +CONFIG_READLINK=y +CONFIG_REALPATH=y +CONFIG_REBOOT=y +CONFIG_RESET=y +CONFIG_REV=y +CONFIG_RFKILL=y +CONFIG_RMMOD=y +CONFIG_SETSID=y +CONFIG_SHRED=y +CONFIG_STAT=y +CONFIG_SWAPOFF=y +CONFIG_SWAPON=y +CONFIG_SWITCH_ROOT=y +CONFIG_SYSCTL=y +CONFIG_TAC=y +CONFIG_NPROC=y +CONFIG_TASKSET=y +CONFIG_TIMEOUT=y +CONFIG_TRUNCATE=y +CONFIG_UPTIME=y +CONFIG_USLEEP=y +CONFIG_VCONFIG=y +CONFIG_VMSTAT=y +CONFIG_W=y +CONFIG_WHICH=y +CONFIG_XXD=y +CONFIG_YES=y + +# +# Linux Standard Base commands +# +CONFIG_DMESG=y +CONFIG_HOSTNAME=y +CONFIG_KILLALL=y +CONFIG_MD5SUM=y +CONFIG_SHA1SUM=y +CONFIG_MKNOD=y +# CONFIG_MKNOD_Z is not set +CONFIG_MKTEMP=y +CONFIG_MOUNT=y +CONFIG_PASSWD=y +CONFIG_PIDOF=y +CONFIG_SEQ=y +CONFIG_SU=y +CONFIG_SYNC=y +CONFIG_UMOUNT=y + +# +# Example commands +# +# CONFIG_HELLO is not set +# CONFIG_SKELETON is not set +# CONFIG_SKELETON_ALIAS is not set + +# +# Android +# +# CONFIG_GETENFORCE is not set +# CONFIG_GETPROP is not set +# CONFIG_LOAD_POLICY is not set +# CONFIG_RESTORECON is not set +# CONFIG_RUNCON is not set +# CONFIG_SETENFORCE is not set +# CONFIG_SETPROP is not set + +# +# +# + +# +# Toybox global settings +# +CONFIG_TOYBOX=y +CONFIG_TOYBOX_SUID=y +CONFIG_TOYBOX_LSM_NONE=y +# CONFIG_TOYBOX_SELINUX is not set +# CONFIG_TOYBOX_SMACK is not set +CONFIG_TOYBOX_FLOAT=y +CONFIG_TOYBOX_HELP=y +CONFIG_TOYBOX_HELP_DASHDASH=y +CONFIG_TOYBOX_I18N=y +# CONFIG_TOYBOX_FREE is not set +# CONFIG_TOYBOX_NORECURSE is not set +# CONFIG_TOYBOX_DEBUG is not set +CONFIG_TOYBOX_UID_SYS=100 +CONFIG_TOYBOX_UID_USR=500 diff --git a/packaging/toybox.spec b/packaging/toybox.spec index 78a2f24..1906ee5 100644 --- a/packaging/toybox.spec +++ b/packaging/toybox.spec @@ -11,6 +11,7 @@ Source2: bin.links Source3: sbin.links Source4: usrbin.links Source5: usrsbin.links +Source11: config-full Source1001: toybox.manifest BuildRequires : smack-devel @@ -22,6 +23,23 @@ of system commands, including a shell. This package can be very useful for recovering from certain types of system failures, particularly those involving broken shared libraries. +%package full +Group: Base/Utilities +Summary: ToyBox that includes all applets including init. +Conflicts: %{name} + +%description full +Toybox-full is a single binary which includes most of the applets +including 'init' command. + +%package symlinks-full +Group: Base/Utilities +Summary: ToyBox symlinks to provide all applets +Requires: %{name}-full = %{version}-%{release} + +%description symlinks-full +ToyBox symlinks for utilities corresponding to all packages. + %package symlinks-dhcp Group: Base/Utilities Summary: ToyBox symlinks to provide 'dhcp' @@ -67,16 +85,23 @@ ToyBox symlinks for utilities corresponding to 'nslookup' package. %build cp %{SOURCE1001} . -# create dynamic toybox - the executable is toybox + +# create a minimum dynamic toybox (ELF) that consists of 'nslookup', 'ping', and 'dhcpd'. cp %{SOURCE1} .config make -j 4 CC="gcc $RPM_OPT_FLAGS" CFLAGS="$CFLAGS -fPIE" LDOPTIMIZE="-Wl,--gc-sections -pie" cp toybox toybox-dynamic +# create a dynamic toybox-full (ELF) that include most of the applets including 'init'. +cp %{SOURCE11} .config +make -j 4 CC="gcc $RPM_OPT_FLAGS" CFLAGS="$CFLAGS -fPIE" LDOPTIMIZE="-Wl,--gc-sections -pie" +cp toybox toybox-dynamic-full + %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/bin mkdir -p $RPM_BUILD_ROOT/sbin -install -m 755 toybox-dynamic $RPM_BUILD_ROOT/bin/toybox +install -m 755 toybox-dynamic $RPM_BUILD_ROOT/bin/toybox +install -m 755 toybox-dynamic-full $RPM_BUILD_ROOT/bin/toybox-full # debian/toybox.links pushd %{buildroot} @@ -91,12 +116,28 @@ cd ../../usr/sbin for f in `cat %SOURCE5` ; do ln -s ../../bin/toybox $f ; done popd +%post full +ln -s /bin/toybox-full /bin/toybox + %files %manifest toybox.manifest %license LICENSE.BSD %defattr(-,root,root,-) /bin/toybox +%files full +%manifest toybox.manifest +%license LICENSE.BSD +%defattr(-,root,root,-) +/bin/toybox-full + +%files symlinks-full +%manifest toybox.manifest +%license LICENSE.BSD +%defattr(-,root,root,-) +%{_bindir}/* +%{_sbindir}/* + %files symlinks-dhcp %manifest toybox.manifest %license LICENSE.BSD @@ -127,3 +168,8 @@ popd %license LICENSE.BSD %defattr(-,root,root,-) %{_bindir}/nslookup + + +%changelog +* Mon May 27 2019 Geunsik Lim +- Added toybox-full that consists of most applets diff --git a/packaging/usrbin.links b/packaging/usrbin.links index 4df9fd8..5e1069d 100644 --- a/packaging/usrbin.links +++ b/packaging/usrbin.links @@ -1,5 +1,207 @@ -dumpleases +acpi +base64 +basename +blkid +blockdev +bootchartd +bzcat +cal +cat +catv +chattr +chgrp +chmod +chown +chroot +chvt +cksum +clear +cmpcommcompress +count +cp +cpio +crond +crontab +cut +date +dd +df dhcp +diff +dirname +dmesg +dos2unix +du +dumpleases +echo +egrep +eject +env +expand +factor +fallocate +false +fdisk +fgrep +find +free +freeramdisk +fsck +fsfreeze +fstype +getty +grep +groups +gunzip +gzip +halt +head +help +hexedit +host +hostname +hwclock +iconv +id +ifconfig +init +inotifyd +insmod +install +ionice +iorenice +ip +ipaddr +ipcrm +ipcs +iplink +iproute +iprule +iptunnel +kill +killall +killall5 +last +link +ln +login +logname +losetup +ls +lsattr +lsmod +lspci +lsusb +makedevs +md5sum +mdev +mix +mkdir +mkfifo +mknod +mkpasswd +mkswap +mktemp +modinfo +modprobe +more +mount +mountpoint +mv +nbd-client +nc +netcat +netstat +nice +nl +nohup +nproc +nsenter nslookup +od +oneit +partprobe +passwd +paste +patch +pgrep +pidof ping ping6 +pivot_root +pkill +pmap +poweroff +printenv +printf +ps +pwd +pwdx +readahead +readlink +realpath +reboot +renice +reset +rev +rfkill +rm +rmdir +rmmod +route +sed +seq +setsid +sh +sha1sum +shred +sleep +sort +split +stat +strings +su +sulogin +swapoff +swapon +switch_root +sync +sysctl +tac +tail +tar +taskset +tee +telnet +time +timeout +top +touch +toysh +traceroute +traceroute6 +true +truncate +tty +umount +uname +uniq +unix2dos +unlink +unshare +uptime +usleep +uudecode +uuencode +vconfig +vmstat +w +watch +wc +which +who +whoami +xargs +xxd +yes +zcat diff --git a/packaging/usrsbin.links b/packaging/usrsbin.links index d860423..8a71957 100644 --- a/packaging/usrsbin.links +++ b/packaging/usrsbin.links @@ -1 +1,2 @@ dhcpd +telnetd -- 2.7.4