Skip to content

Instantly share code, notes, and snippets.

@sfloess
Last active December 28, 2022 07:52
Show Gist options
  • Save sfloess/b5fafe95ade9c16207836e95e242d1b5 to your computer and use it in GitHub Desktop.
Save sfloess/b5fafe95ade9c16207836e95e242d1b5 to your computer and use it in GitHub Desktop.
Entware Tips and Tricks

Entware

Helpful tips and tricks for Entware

General Stuff

Install

  • ARMv7
cd /opt
wget http://bin.entware.net/armv7sf-k3.2/installer/generic.sh
sh generic.sh
  • MIPS
cd /opt
wget http://bin.entware.net/mipssf-k3.4/installer/generic.sh
sh generic.sh
Packages
  • opkg install coreutils coreutils-chown coreutils-chgrp shadow net-tools
  • opkg install openssh-client-utils openssh-keygen openssh-moduli openssh-sftp-client
  • opkg install rsync screen wget gcc tar
Debian
  • opkg install debootstrap
  • mkdir -p /opt/debian/usr/sbin /opt/debian/etc
  • install-debian

Generate ssh host keys: /opt/bin/ssh-keygen -A

Info
  • shadow: useradd, userdel, usermod, etc
  • net-tools: domainname, etc
  • gcc: building

Create an ipkg Repo

To create an ipkg repo:

  1. git clone https://git.yoctoproject.org/git/opkg-utils
  2. make clean install
  3. Copy all ipkg files to a dir.
  4. Using a shell, cd to the dir containing ipkg files.
  5. Execute: opkg-make-index -a -v -p Packages .

Example

#!/bin/bash

cd /opt/shared/repo/ipkg

opkg-make-index -a -v -p Packages .

Useful Linux-y Things

  • opkg install make gcc
  • Get a copy of util-linux
  • Contains things like rev

Postfix

  • opkg install postfix
  • chgrp postdrop /opt/sbin/postqueue /opt/sbin/postdrop /opt/var/spool/postfix/public /opt/var/spool/postfix/maildrop
  • chown root /opt/var/spool/postfix/ /opt/var/spool/postfix/pid
  • chmod g+s /opt/sbin/postqueue /opt/sbin/postdrop

Postgres

Installing

  • opkg install pgsql-server pgsql-cli pgsql-cli-extra
  • useradd postgres
  • mkdir -p /opt/var/pgsql/data
  • chown -R postgres:postgres /opt/var/pgsql
  • su - postgres -c 'pg_ctl initdb -D /opt/var/pgsql/data'
  • To Configure
    • /opt/var/pgsql/data/postgresql.conf
    • /opt/var/pgsql/data/pg_hba.conf

Maria DB

Installing

  • opkg install mariadb-server mariadb-server-extra mariadb-client mariadb-client-extra
  • useradd mysql
  • mkdir -p /opt/var/lib/mysql /opt/var/log/mysql /opt/var/run/mysqld
  • chown -R mysql:mysql /opt/var/lib/mysql /opt/var/log/mysql /opt/var/run/mysqld
  • mysql_install_db --force
  • To Configure
    • /opt/etc/mysql/conf.d/50-server.cnf

Memory Settings

Minum Memory Settings

Minimum memory settings can be found here.

/opt/etc/mysql/conf.d/50-server.cnf:

innodb_buffer_pool_size    = 5M
innodb_log_buffer_size     = 256K
query_cache_size           = 0
max_connections            = 5
key_buffer_size            = 8k
thread_cache_size          = 0
host_cache_size            = 0
innodb_ft_cache_size       = 1600000
innodb_ft_total_cache_size = 32000000

# per thread or per operation settings
thread_stack            = 192K
max_threads             = 5
sort_buffer_size        = 32K
read_buffer_size        = 8200
read_rnd_buffer_size    = 8200
max_heap_table_size     = 16K
tmp_table_size          = 1K
bulk_insert_buffer_size = 0
join_buffer_size        = 128
net_buffer_length       = 1K
innodb_sort_buffer_size = 64K

#settings that relate to the binary log (if enabled)
binlog_cache_size      = 4K
binlog_stmt_cache_size = 4K
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment