From 922d5b085eb182e1dcd2ea1ae6e7fc9e7f3faca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?An=C3=ADbal=20Portero=20Hermida?= Date: Tue, 1 Oct 2024 13:38:35 +0000 Subject: [PATCH 1/3] Add new Busybox trim.cfg file to aproximate image to Alchemy The diff between the .config files used in Yocto and Alchemy resulted in two lists, one with the =y items, that has been added to pantavisor.cfg, and another one with the =n, now in trim.cnf. --- recipes-pv/busybox/busybox_1.36~pv.1.bb | 1 + recipes-pv/busybox/files/pantavisor.cfg | 108 ++++++++++++++ recipes-pv/busybox/files/trim.cfg | 191 ++++++++++++++++++++++++ 3 files changed, 300 insertions(+) create mode 100644 recipes-pv/busybox/files/trim.cfg diff --git a/recipes-pv/busybox/busybox_1.36~pv.1.bb b/recipes-pv/busybox/busybox_1.36~pv.1.bb index 9cfcf15..e823274 100644 --- a/recipes-pv/busybox/busybox_1.36~pv.1.bb +++ b/recipes-pv/busybox/busybox_1.36~pv.1.bb @@ -15,6 +15,7 @@ REPENDS:append = "\ SRC_URI = " \ git://gitlab.com/pantacor/busybox.git;protocol=https;branch=pv/1_35_stable \ file://defconfig \ + file://trim.cfg \ file://pantavisor.cfg \ file://debug.patch \ " diff --git a/recipes-pv/busybox/files/pantavisor.cfg b/recipes-pv/busybox/files/pantavisor.cfg index a9d2a95..2fd1983 100644 --- a/recipes-pv/busybox/files/pantavisor.cfg +++ b/recipes-pv/busybox/files/pantavisor.cfg @@ -1,3 +1,4 @@ +# originally added CONFIG_ASH_ECHO=y CONFIG_ASH_PRINTF=y CONFIG_ASH_TEST=y @@ -22,3 +23,110 @@ CONFIG_FEATURE_MDEV_LOAD_FIRMWARE=y CONFIG_FEATURE_FANCY_HEAD=y CONFIG_FEATURE_FIND_TYPE=y CONFIG_TR=y + +# added from alchemy +CONFIG_INSTALL_NO_USR=y +CONFIG_FEATURE_REVERSE_SEARCH=y +CONFIG_FEATURE_EDITING_WINCH=y +CONFIG_ZCAT=y +CONFIG_BZCAT=y +CONFIG_LZCAT=y +CONFIG_XZCAT=y +CONFIG_FEATURE_PRESERVE_HARDLINKS=y +CONFIG_FEATURE_CATN=y +CONFIG_FEATURE_CATV=y +CONFIG_FEATURE_DATE_ISOFMT=y +CONFIG_FEATURE_DATE_COMPAT=y +CONFIG_FEATURE_DD_THIRD_STATUS_LINE=y +CONFIG_FEATURE_DF_FANCY=y +CONFIG_FACTOR=y +CONFIG_NL=y +CONFIG_NOHUP=y +CONFIG_NPROC=y +CONFIG_PASTE=y +CONFIG_PRINTENV=y +CONFIG_SHRED=y +CONFIG_STAT=y +CONFIG_FEATURE_STAT_FORMAT=y +CONFIG_FEATURE_STAT_FILESYSTEM=y +CONFIG_TEST2=y +CONFIG_FEATURE_TEST_64=y +CONFIG_FEATURE_TOUCH_SUSV3=y +CONFIG_BB_ARCH=y +CONFIG_FGCONSOLE=y +CONFIG_SETLOGCONS=y +CONFIG_FEATURE_VI_DOT_CMD=y +CONFIG_FEATURE_VI_READONLY=y +CONFIG_FEATURE_VI_SETOPTS=y +CONFIG_FEATURE_VI_SET=y +CONFIG_FEATURE_VI_ASK_TERMINAL=y +CONFIG_FEATURE_FIND_MTIME=y +CONFIG_FEATURE_FIND_ATIME=y +CONFIG_FEATURE_FIND_CTIME=y +CONFIG_FEATURE_FIND_MMIN=y +CONFIG_FEATURE_FIND_AMIN=y +CONFIG_FEATURE_FIND_CMIN=y +CONFIG_FEATURE_FIND_EXECUTABLE=y +CONFIG_FEATURE_FIND_XDEV=y +CONFIG_FEATURE_FIND_INUM=y +CONFIG_FEATURE_FIND_EXEC_PLUS=y +CONFIG_FEATURE_FIND_GROUP=y +CONFIG_FEATURE_FIND_PAREN=y +CONFIG_FEATURE_FIND_DELETE=y +CONFIG_FEATURE_FIND_EMPTY=y +CONFIG_FEATURE_FIND_REGEX=y +CONFIG_FEATURE_FIND_LINKS=y +CONFIG_HALT=y +CONFIG_DEPMOD=y +CONFIG_MODINFO=y +CONFIG_FEATURE_GPT_LABEL=y +CONFIG_XXD=y +CONFIG_FEATURE_MOUNT_FAKE=y +CONFIG_FEATURE_MOUNT_VERBOSE=y +CONFIG_FEATURE_MOUNT_LABEL=y +CONFIG_FEATURE_MOUNT_CIFS=y +CONFIG_FEATURE_UMOUNT_ALL=y +CONFIG_FEATURE_VOLUMEID_CRAMFS=y +CONFIG_FEATURE_VOLUMEID_HFS=y +CONFIG_FEATURE_VOLUMEID_ISO9660=y +CONFIG_FEATURE_VOLUMEID_JFS=y +CONFIG_FEATURE_VOLUMEID_LINUXRAID=y +CONFIG_FEATURE_VOLUMEID_LINUXSWAP=y +CONFIG_FEATURE_VOLUMEID_LUKS=y +CONFIG_FEATURE_VOLUMEID_NTFS=y +CONFIG_FEATURE_VOLUMEID_OCFS2=y +CONFIG_FEATURE_VOLUMEID_REISERFS=y +CONFIG_FEATURE_VOLUMEID_ROMFS=y +CONFIG_FEATURE_VOLUMEID_SYSV=y +CONFIG_FEATURE_VOLUMEID_UBIFS=y +CONFIG_FEATURE_VOLUMEID_UDF=y +CONFIG_FEATURE_VOLUMEID_XFS=y +CONFIG_BC=y +CONFIG_FEATURE_DC_BIG=y +CONFIG_FEATURE_BC_INTERACTIVE=y +CONFIG_FEATURE_BC_LONG_OPTIONS=y +CONFIG_FEATURE_LESS_REGEXP=y +CONFIG_READAHEAD=y +CONFIG_UBIATTACH=y +CONFIG_UBIDETACH=y +CONFIG_UBIMKVOL=y +CONFIG_UBIRMVOL=y +CONFIG_UBIRSVOL=y +CONFIG_UBIUPDATEVOL=y +CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS=y +CONFIG_TELNETD=y +CONFIG_FEATURE_TELNETD_STANDALONE=y +CONFIG_FEATURE_TELNETD_INETD_WAIT=y +CONFIG_FEATURE_SHOW_THREADS=y +CONFIG_IOSTAT=y +CONFIG_KILLALL5=y +CONFIG_FEATURE_TOP_SMP_CPU=y +CONFIG_FEATURE_TOP_DECIMALS=y +CONFIG_FEATURE_TOP_SMP_PROCESS=y +CONFIG_FEATURE_TOPMEM=y +CONFIG_ASH_RANDOM_SUPPORT=y +CONFIG_ASH_HELP=y +CONFIG_ASH_GETOPTS=y +CONFIG_ASH_CMDCMD=y +CONFIG_FEATURE_SH_MATH_64=y +CONFIG_FEATURE_SH_MATH_BASE=y diff --git a/recipes-pv/busybox/files/trim.cfg b/recipes-pv/busybox/files/trim.cfg new file mode 100644 index 0000000..df85651 --- /dev/null +++ b/recipes-pv/busybox/files/trim.cfg @@ -0,0 +1,191 @@ +# removed from alchemy +CONFIG_SHOW_USAGE=n +CONFIG_FEATURE_COMPRESS_USAGE=n +CONFIG_FEATURE_DEVPTS=n +CONFIG_FEATURE_PIDFILE=n +CONFIG_BUSYBOX=n +CONFIG_FEATURE_SHOW_SCRIPT=n +CONFIG_FEATURE_SUID=n +CONFIG_FEATURE_SUID_CONFIG=n +CONFIG_FEATURE_SUID_CONFIG_QUIET=n +CONFIG_FEATURE_RTMINMAX=n +CONFIG_FEATURE_RTMINMAX_USE_LIBC_DEFINITIONS=n +CONFIG_FEATURE_NON_POSIX_CP=n +CONFIG_FEATURE_USE_SENDFILE=n +CONFIG_MONOTONIC_SYSCALL=n +CONFIG_IOCTL_HEX2STR_ERROR=n +CONFIG_FEATURE_EDITING_SAVEHISTORY=n +CONFIG_FEATURE_EDITING_FANCY_PROMPT=n +CONFIG_UNICODE_SUPPORT=n +CONFIG_FEATURE_CHECK_UNICODE_IN_ENV=n +CONFIG_UNICODE_COMBINING_WCHARS=n +CONFIG_UNICODE_WIDE_WCHARS=n +CONFIG_FEATURE_SEAMLESS_XZ=n +CONFIG_FEATURE_SEAMLESS_BZ2=n +CONFIG_AR=n +CONFIG_GUNZIP=n +CONFIG_BUNZIP2=n +CONFIG_XZ=n +CONFIG_CPIO=n +CONFIG_TAR=n +CONFIG_FEATURE_TAR_CREATE=n +CONFIG_FEATURE_TAR_AUTODETECT=n +CONFIG_UNZIP=n +CONFIG_FEATURE_VERBOSE=n +CONFIG_CHGRP=n +CONFIG_CUT=n +CONFIG_FEATURE_CUT_REGEX=n +CONFIG_FEATURE_SKIP_ROOTFS=n +CONFIG_ECHO=n +CONFIG_ENV=n +CONFIG_EXPR=n +CONFIG_FALSE=n +CONFIG_ID=n +CONFIG_GROUPS=n +CONFIG_LOGNAME=n +CONFIG_FEATURE_LS_COLOR=n +CONFIG_MD5SUM=n +CONFIG_SHA1SUM=n +CONFIG_SHA256SUM=n +CONFIG_SHA3SUM=n +CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=n +CONFIG_PRINTF=n +CONFIG_READLINK=n +CONFIG_FEATURE_READLINK_FOLLOW=n +CONFIG_REALPATH=n +CONFIG_RMDIR=n +CONFIG_FEATURE_SORT_BIG=n +CONFIG_TEE=n +CONFIG_TEST=n +CONFIG_USLEEP=n +CONFIG_WC=n +CONFIG_YES=n +CONFIG_DUMPKMAP=n +CONFIG_LOADFONT=n +CONFIG_LOADKMAP=n +CONFIG_RUN_PARTS=n +CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS=n +CONFIG_START_STOP_DAEMON=n +CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS=n +CONFIG_FEATURE_START_STOP_DAEMON_FANCY=n +CONFIG_NUKE=n +CONFIG_FEATURE_AWK_GNU_EXTENSIONS=n +CONFIG_CMP=n +CONFIG_PATCH=n +CONFIG_FEATURE_VI_8BIT=n +CONFIG_XARGS=n +CONFIG_INIT=n +CONFIG_LINUXRC=n +CONFIG_FEATURE_USE_INITTAB=n +CONFIG_FEATURE_INIT_QUIET=n +CONFIG_FEATURE_INIT_MODIFY_CMDLINE=n +CONFIG_FEATURE_SHADOWPASSWDS=n +CONFIG_USE_BB_CRYPT=n +CONFIG_ADDGROUP=n +CONFIG_ADDUSER=n +CONFIG_MKPASSWD=n +CONFIG_DELUSER=n +CONFIG_DELGROUP=n +CONFIG_LOGIN=n +CONFIG_PASSWD=n +CONFIG_SU=n +CONFIG_SULOGIN=n +CONFIG_VLOCK=n +CONFIG_CHATTR=n +CONFIG_FSCK=n +CONFIG_LSMOD=n +CONFIG_RMMOD=n +CONFIG_FEATURE_CHECK_TAINTED_MODULE=n +CONFIG_FEATURE_MODUTILS_ALIAS=n +CONFIG_FEATURE_MODUTILS_SYMBOLS=n +CONFIG_BLKDISCARD=n +CONFIG_BLKID=n +CONFIG_FEATURE_BLKID_TYPE=n +CONFIG_FATATTR=n +CONFIG_FBSET=n +CONFIG_FEATURE_FBSET_FANCY=n +CONFIG_FEATURE_FBSET_READMODE=n +CONFIG_FLOCK=n +CONFIG_FSCK_MINIX=n +CONFIG_FSTRIM=n +CONFIG_GETOPT=n +CONFIG_FEATURE_GETOPT_LONG=n +CONFIG_HWCLOCK=n +CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS=n +CONFIG_MKFS_EXT2=n +CONFIG_MKFS_MINIX=n +CONFIG_FEATURE_MINIX2=n +CONFIG_RDATE=n +CONFIG_RENICE=n +CONFIG_REV=n +CONFIG_SETSID=n +CONFIG_FEATURE_SWAPON_DISCARD=n +CONFIG_SWITCH_ROOT=n +CONFIG_UNSHARE=n +CONFIG_FEATURE_VOLUMEID_LFS=n +CONFIG_HDPARM=n +CONFIG_I2CGET=n +CONFIG_I2CSET=n +CONFIG_I2CDUMP=n +CONFIG_I2CDETECT=n +CONFIG_FEATURE_LESS_BRACKETS=n +CONFIG_FEATURE_LESS_FLAGS=n +CONFIG_MICROCOM=n +CONFIG_STRINGS=n +CONFIG_TIME=n +CONFIG_FEATURE_HWIB=n +CONFIG_FTPGET=n +CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS=n +CONFIG_HOSTNAME=n +CONFIG_FEATURE_IFUPDOWN_MAPPING=n +CONFIG_IP=n +CONFIG_IPNEIGH=n +CONFIG_FEATURE_IP_ADDRESS=n +CONFIG_FEATURE_IP_LINK=n +CONFIG_FEATURE_IP_ROUTE=n +CONFIG_FEATURE_IP_TUNNEL=n +CONFIG_FEATURE_IP_NEIGH=n +CONFIG_NC=n +CONFIG_NETSTAT=n +CONFIG_NSLOOKUP=n +CONFIG_FEATURE_NSLOOKUP_BIG=n +CONFIG_FEATURE_NSLOOKUP_LONG_OPTIONS=n +CONFIG_PING=n +CONFIG_FEATURE_FANCY_PING=n +CONFIG_ROUTE=n +CONFIG_FEATURE_TELNET_AUTOLOGIN=n +CONFIG_TFTP=n +CONFIG_FEATURE_TFTP_HPA_COMPAT=n +CONFIG_FEATURE_TFTP_GET=n +CONFIG_FEATURE_TFTP_PUT=n +CONFIG_WGET=n +CONFIG_FEATURE_WGET_LONG_OPTIONS=n +CONFIG_FEATURE_WGET_STATUSBAR=n +CONFIG_FEATURE_WGET_FTP=n +CONFIG_FEATURE_WGET_AUTHENTICATION=n +CONFIG_FEATURE_WGET_TIMEOUT=n +CONFIG_FEATURE_WGET_HTTPS=n +CONFIG_FEATURE_WGET_OPENSSL=n +CONFIG_DUMPLEASES=n +CONFIG_UDHCPC=n +CONFIG_FEATURE_UDHCPC_ARPING=n +CONFIG_FEATURE_UDHCPC_SANITIZEOPT=n +CONFIG_FEATURE_FAST_TOP=n +CONFIG_FREE=n +CONFIG_FUSER=n +CONFIG_LSOF=n +CONFIG_BB_SYSCTL=n +CONFIG_UPTIME=n +CONFIG_WATCH=n +CONFIG_KLOGD=n +CONFIG_FEATURE_KLOGD_KLOGCTL=n +CONFIG_LOGGER=n +CONFIG_LOGREAD=n +CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING=n +CONFIG_SYSLOGD=n +CONFIG_FEATURE_ROTATE_LOGFILE=n +CONFIG_FEATURE_REMOTE_LOG=n +CONFIG_FEATURE_SYSLOGD_DUP=n +CONFIG_FEATURE_SYSLOGD_CFG=n +CONFIG_FEATURE_IPC_SYSLOG=n +CONFIG_FEATURE_KMSG_SYSLOG=n From c2f5f8dfd88a687ae2c17f3dfcf78a9ec0a954e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?An=C3=ADbal=20Portero=20Hermida?= Date: Mon, 7 Oct 2024 08:40:46 +0000 Subject: [PATCH 2/3] Remove unnecessary BSP dependencies - Make gptfdisk optional - Remove unused cryptsetup features - Remove unused dropbear binaries - Make kmod optional - Remove opkg update alternatives --- recipes-crypto/cryptsetup/cryptsetup_%.bbappend | 2 +- recipes-pv/dropbear/dropbear-pv_git.bb | 17 ++--------------- recipes-pv/images/pantavisor-initramfs.bb | 9 ++++++++- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/recipes-crypto/cryptsetup/cryptsetup_%.bbappend b/recipes-crypto/cryptsetup/cryptsetup_%.bbappend index 095112b..c806b23 100644 --- a/recipes-crypto/cryptsetup/cryptsetup_%.bbappend +++ b/recipes-crypto/cryptsetup/cryptsetup_%.bbappend @@ -1,2 +1,2 @@ # prevent udev as default dev manager being installed as dependency -PACKAGECONFIG:remove = "udev" \ No newline at end of file +PACKAGECONFIG:remove = "ssh-token udev blkid gcrypt gcrypt-pbkdf2 " diff --git a/recipes-pv/dropbear/dropbear-pv_git.bb b/recipes-pv/dropbear/dropbear-pv_git.bb index 887892d..064e39b 100644 --- a/recipes-pv/dropbear/dropbear-pv_git.bb +++ b/recipes-pv/dropbear/dropbear-pv_git.bb @@ -26,9 +26,8 @@ inherit autotools CVE_PRODUCT = "dropbear_ssh" -SBINCOMMANDS = "dropbear dropbearkey dropbearconvert" -BINCOMMANDS = "dbclient ssh scp" -EXTRA_OEMAKE = 'MULTI=1 SCPPROGRESS=1 PROGRAMS="${SBINCOMMANDS} ${BINCOMMANDS}"' +SBINCOMMANDS = "dropbear" +EXTRA_OEMAKE = 'MULTI=1 SCPPROGRESS=1 PROGRAMS="${SBINCOMMANDS}"' # This option appends to CFLAGS and LDFLAGS from OE # This is causing [textrel] QA warning @@ -40,18 +39,11 @@ EXTRA_OECONF:append:libc-musl = " --disable-wtmp --disable-lastlog" do_install() { install -d ${D}${sysconfdir} \ ${D}${sysconfdir}/dropbear \ - ${D}${bindir} \ ${D}${sbindir} \ ${D}${localstatedir} install -m 0755 dropbearmulti ${D}${sbindir}/ - for i in ${BINCOMMANDS} - do - # ssh and scp symlinks are created by update-alternatives - if [ $i = ssh ] || [ $i = scp ]; then continue; fi - ln -s ${sbindir}/dropbearmulti ${D}${bindir}/$i - done for i in ${SBINCOMMANDS} do ln -s ./dropbearmulti ${D}${sbindir}/$i @@ -61,8 +53,3 @@ do_install() { inherit update-alternatives ALTERNATIVE_PRIORITY = "20" -ALTERNATIVE:${PN} = "${@bb.utils.filter('BINCOMMANDS', 'scp ssh', d)}" - -ALTERNATIVE_TARGET = "${sbindir}/dropbearmulti" - -FILES:${PN} += "${bindir}" diff --git a/recipes-pv/images/pantavisor-initramfs.bb b/recipes-pv/images/pantavisor-initramfs.bb index 16537da..708e6ef 100644 --- a/recipes-pv/images/pantavisor-initramfs.bb +++ b/recipes-pv/images/pantavisor-initramfs.bb @@ -7,7 +7,13 @@ VIRTUAL-RUNTIME_dev_manager ?= "busybox-mdev" VIRTUAL-RUNTIME_init_manager = "pantavisor" VIRTUAL-RUNTIME_pantavisor_config ??= "pantavisor-default-config" -PACKAGE_INSTALL = "pantavisor ${VIRTUAL-RUNTIME_pantavisor_config} dropbear-pv busybox base-passwd kmod ${ROOTFS_BOOTSTRAP_INSTALL}" +PACKAGE_INSTALL = "pantavisor \ + ${VIRTUAL-RUNTIME_pantavisor_config} \ + dropbear-pv \ + busybox \ + base-passwd \ + ${@bb.utils.contains('PANTAVISOR_FEATURES', 'automod', 'kmod', '', d)} \ + ${ROOTFS_BOOTSTRAP_INSTALL}" IMAGE_TYPES_MASKED += " pvbspit pvrexportit" @@ -49,6 +55,7 @@ ROOTFS_POSTINSTALL_COMMAND += "do_finish_rootfs" do_finish_rootfs() { ln -sfr ${IMAGE_ROOTFS}/usr/bin/pantavisor ${IMAGE_ROOTFS}/sbin/init + rm -rf ${IMAGE_ROOTFS}/usr/lib/opkg } unset do_fetch[noexec] From a974738e800136fe2f7a8be59b5c45fac778de58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?An=C3=ADbal=20Portero=20Hermida?= Date: Thu, 17 Oct 2024 14:05:51 +0000 Subject: [PATCH 3/3] Add rng-tools to initramfs --- recipes-pv/images/pantavisor-initramfs.bb | 1 + recipes-pv/rng-tools/rng-tools_%.bbappend | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 recipes-pv/rng-tools/rng-tools_%.bbappend diff --git a/recipes-pv/images/pantavisor-initramfs.bb b/recipes-pv/images/pantavisor-initramfs.bb index 708e6ef..4cb20ba 100644 --- a/recipes-pv/images/pantavisor-initramfs.bb +++ b/recipes-pv/images/pantavisor-initramfs.bb @@ -12,6 +12,7 @@ PACKAGE_INSTALL = "pantavisor \ dropbear-pv \ busybox \ base-passwd \ + rng-tools \ ${@bb.utils.contains('PANTAVISOR_FEATURES', 'automod', 'kmod', '', d)} \ ${ROOTFS_BOOTSTRAP_INSTALL}" diff --git a/recipes-pv/rng-tools/rng-tools_%.bbappend b/recipes-pv/rng-tools/rng-tools_%.bbappend new file mode 100644 index 0000000..91cb6a9 --- /dev/null +++ b/recipes-pv/rng-tools/rng-tools_%.bbappend @@ -0,0 +1,7 @@ +EXTRA_OECONF += " \ + --without-nistbeacon \ + --without-pkcs11 \ + --without-rtlsdr \ + " + +PACKAGECONFIG:remove = "libjitterentropy"