summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Fankhauser hiddenalpha.ch2023-10-04 21:46:26 +0200
committerAndreas Fankhauser hiddenalpha.ch2023-10-04 21:46:26 +0200
commit17359a2f719f4f5b6268560d4f273c018f71a2f4 (patch)
tree6588f9defa63ca1d4d3bcc2b9277cfe03d540ff8
parent7a27a057a6ae162b74d379e868fd0b2fc8247b85 (diff)
parentabaaf383172cdc3c861f1c867d3522a1e7c04476 (diff)
downloadUnspecifiedGarbage-17359a2f719f4f5b6268560d4f273c018f71a2f4.zip
UnspecifiedGarbage-17359a2f719f4f5b6268560d4f273c018f71a2f4.tar.gz
Merge remote-tracking branch 'gh-hiddenalpha/master'
-rw-r--r--doc/note/firefox/firefox.txt9
-rw-r--r--doc/note/qemu/build-cJSON.txt76
-rw-r--r--doc/note/qemu/build-libarchive.txt72
-rw-r--r--doc/note/qemu/build-libcurl.txt99
-rw-r--r--doc/note/qemu/build-libpcre1.txt70
-rw-r--r--doc/note/qemu/build-lua.txt86
-rw-r--r--doc/note/qemu/build-sqlite.txt77
-rw-r--r--doc/note/qemu/build-zlib.txt73
-rw-r--r--doc/note/qemu/qemu.txt34
9 files changed, 589 insertions, 7 deletions
diff --git a/doc/note/firefox/firefox.txt b/doc/note/firefox/firefox.txt
index e1e2999..9c48e29 100644
--- a/doc/note/firefox/firefox.txt
+++ b/doc/note/firefox/firefox.txt
@@ -2,6 +2,7 @@
Firefox
================
+
## Install plugin quickNdirty until restart
- Visit "about:debugging"
@@ -12,6 +13,7 @@ Firefox
For refresh, there is a button on the same page to reload the plugin.
+
## Create an XPI file (eg for distribution)
"manifest.json" MUST be in top level dir inside ZIP.
@@ -19,6 +21,7 @@ For refresh, there is a button on the same page to reload the plugin.
zip my.xpi manifest.json main.js
+
## Distribute via self-hosting
Package MUST be signed by "addons.mozilla.org" (Except for ESR or dev
@@ -27,3 +30,9 @@ firefox builds)
XPI file can be drag-n-drop to FF to trigger install dialog. Or via gear
icon "install from file".
+
+
+## Install native manifest (linux)
+
+"~/.mozilla/native-messaging-hosts/<name>.json"
+
diff --git a/doc/note/qemu/build-cJSON.txt b/doc/note/qemu/build-cJSON.txt
new file mode 100644
index 0000000..93d9496
--- /dev/null
+++ b/doc/note/qemu/build-cJSON.txt
@@ -0,0 +1,76 @@
+
+### Debian native
+true \
+ && PKGS_TO_ADD="ca-certificates gcc libc6-dev" \
+ && SUDO=sudo \
+ && PKGINIT="$SUDO apt update" \
+ && PKGADD="$SUDO apt install -y --no-install-recommends" \
+ && PKGCLEAN="$SUDO apt clean" \
+ && HOST= \
+ && true
+
+
+### Alpine mingw cross
+true \
+ && PKGS_TO_ADD="curl mingw-w64-gcc tar" \
+ && SUDO="/home/$USER/.local/bin/sudo" \
+ && PKGINIT=true \
+ && PKGADD="$SUDO apk add" \
+ && PKGCLEAN="$SUDO apk clean" \
+ && HOST=x86_64-w64-mingw32 \
+ && true
+
+
+# Generic
+true \
+ && CJSON_VERSION="1.7.15" \
+ && CACHE_DIR="/var/tmp" \
+ && true
+
+
+## Make
+true \
+ && CJSON_URL="https://github.com/DaveGamble/cJSON/archive/refs/tags/v${CJSON_VERSION:?}.tar.gz" \
+ && CJSON_SRCTGZ="${CACHE_DIR:?}/cJSON-${CJSON_VERSION:?}.tgz" \
+ && CJSON_BINTGZ="${CJSON_SRCTGZ%.*}-bin.tgz" \
+ && ${PKGINIT:?} && ${PKGADD:?} ${PKGS_TO_ADD} \
+ && if test -n "$HOST"; then HOST_="${HOST:?}-" ;fi \
+ && if test ! -e "${CJSON_SRCTGZ:?}"; then (true \
+ && echo "Download \"${CJSON_URL:?}\"" \
+ && curl -sSLo "${CJSON_SRCTGZ:?}" "${CJSON_URL:?}" \
+ );fi \
+ && if test ! -e "${CJSON_BINTGZ:?}"; then (true \
+ && printf '\n Build cJSON\n\n' \
+ && tar xzf "${CJSON_SRCTGZ:?}" \
+ && cd "cJSON-${CJSON_VERSION:?}" \
+ && mkdir build build/obj build/lib build/include \
+ && CFLAGS="-Wall -pedantic -fPIC" \
+ && ${HOST_}cc $CFLAGS -c -o build/obj/cJSON.o cJSON.c \
+ && ${HOST_}cc $CFLAGS -shared -o build/lib/libcJSON.so.${CJSON_VERSION:?} build/obj/cJSON.o \
+ && unset CFLAGS \
+ && (cd build/lib \
+ && MIN=${CJSON_VERSION%.*} && MAJ=${MIN%.*} \
+ && ln -s libcJSON.so.${CJSON_VERSION:?} libcJSON.so.${MIN:?} \
+ && ln -s libcJSON.so.${MIN:?} libcJSON.so.${MAJ} \
+ ) \
+ && ${HOST_}ar rcs build/lib/libcJSON.a build/obj/cJSON.o \
+ && cp -t build/. LICENSE README.md \
+ && cp -t build/include/. cJSON.h \
+ && rm build/obj -rf \
+ && (cd build \
+ && find -type f -not -name MD5SUM -exec md5sum -b {} + > MD5SUM \
+ && tar --owner=0 --group=0 -czf "${CJSON_BINTGZ:?}" * \
+ && md5sum -b "${CJSON_BINTGZ:?}" > "${CJSON_BINTGZ:?}.md5" \
+ ) \
+ && cd .. && rm -rf "cJSON-${CJSON_VERSION:?}" \
+ );fi \
+ && printf '\n DONE\n\n'
+
+
+## Install
+true \
+ && $SUDO tar -C "${INSTALL_ROOT:?}" -xzf "${CJSON_BINTGZ:?}" \
+ && true
+
+
+
diff --git a/doc/note/qemu/build-libarchive.txt b/doc/note/qemu/build-libarchive.txt
new file mode 100644
index 0000000..96f95d6
--- /dev/null
+++ b/doc/note/qemu/build-libarchive.txt
@@ -0,0 +1,72 @@
+
+### Debian native
+### TODO: test this
+true \
+ && PKGS_TO_ADD="make gcc curl ca-certificates libc6-dev" \
+ && SUDO=sudo \
+ && PKGINIT="$SUDO apt update" \
+ && PKGADD="$SUDO apt install -y --no-install-recommends" \
+ && PKGCLEAN="$SUDO apt clean" \
+ && HOST= \
+ && true
+
+
+### Alpine mingw cross
+true \
+ && PKGS_TO_ADD="make mingw-w64-gcc curl tar" \
+ && SUDO="/home/$USER/.local/bin/sudo" \
+ && PKGINIT=true \
+ && PKGADD="$SUDO apk add" \
+ && PKGCLEAN="$SUDO apk cache clean 2>&1| grep -v 'ERROR: Package cache is not enabled'" \
+ && HOST=x86_64-w64-mingw32 \
+ && true
+
+
+### General
+true \
+ && LIBARCHIVE_VERSION="3.6.2" \
+ && CACHE_DIR="/var/tmp" \
+ && true
+
+
+### Make
+true \
+ && if test -n "$(ls -A)"; then true \
+ && printf '\n It is recommended to run this script in an empty dir.\n\n' \
+ && false \
+ ;fi \
+ && LIBARCHIVE_URL="https://github.com/libarchive/libarchive/releases/download/v${LIBARCHIVE_VERSION:?}/libarchive-${LIBARCHIVE_VERSION:?}.tar.gz" \
+ && LIBARCHIVE_SRCTGZ="${CACHE_DIR:?}/libarchive-${LIBARCHIVE_VERSION:?}.tgz" \
+ && LIBARCHIVE_BINTGZ="${LIBARCHIVE_SRCTGZ%.*}-bin.tgz" \
+ && if test -n "$HOST"; then HOST_="${HOST:?}-" ;fi \
+ && ${PKGINIT:?} && ${PKGADD:?} $PKGS_TO_ADD \
+ && if test ! -e "${LIBARCHIVE_SRCTGZ:?}"; then true \
+ && echo "Download ${LIBARCHIVE_URL:?}" \
+ && curl -sSLo "${LIBARCHIVE_SRCTGZ:?}" "${LIBARCHIVE_URL:?}" \
+ ;fi \
+ && if test ! -e "${LIBARCHIVE_BINTGZ}"; then (true \
+ && printf '\n Build libarchive\n\n' \
+ && tar xf "${LIBARCHIVE_SRCTGZ:?}" \
+ && cd "libarchive-${LIBARCHIVE_VERSION:?}" \
+ && ./configure --prefix="${PWD:?}/build/usr_local" --host=${HOST} \
+ --enable-bsdtar=static --enable-bsdcat=static --enable-bsdcpio=static \
+ --disable-rpath --enable-posix-regex-lib \
+ --with-libiconv-prefix="${PWD%/*}/libiconv-1.16-mingw64" \
+ CC=${HOST_}gcc CPP=${HOST_}cpp \
+ && make clean && make -j$(nproc) && make install \
+ && (cd build/usr_local \
+ && rm -rf lib/pkgconfig lib/libarchive.la \
+ && find -type f -not -wholename MD5SUM -exec md5sum {} + > MD5SUM \
+ && tar --owner=0 --group=0 -czf "${LIBARCHIVE_BINTGZ:?}" * \
+ && md5sum -b "${LIBARCHIVE_BINTGZ:?}" > "${LIBARCHIVE_BINTGZ:?}.md5" \
+ ) \
+ && cd .. && rm -rf "libarchive-${LIBARCHIVE_VERSION:?}" \
+ );fi \
+ && printf '\n DONE\n\n'
+
+
+## Install
+true \
+ && $SUDO tar -C "${INSTALL_ROOT:?}" -xzf "${LIBARCHIVE_BINTGZ:?}" \
+ && true
+
diff --git a/doc/note/qemu/build-libcurl.txt b/doc/note/qemu/build-libcurl.txt
new file mode 100644
index 0000000..eea83ec
--- /dev/null
+++ b/doc/note/qemu/build-libcurl.txt
@@ -0,0 +1,99 @@
+
+
+### Debian native
+true \
+ && PKGS_TO_ADD="autoconf automake ca-certificates make" \
+ && SUDO=sudo \
+ && PKGINIT="$SUDO apt update" \
+ && PKGADD="$SUDO apt install -y --no-install-recommends" \
+ && PKGCLEAN="$SUDO apt clean" \
+ && HOST= \
+ && true
+
+
+### Alpine mingw cross
+true \
+ && PKGS_TO_ADD="git make mingw-w64-gcc curl tar cmake autoconf automake libtool m4" \
+ && SUDO="/home/$USER/.local/bin/sudo" \
+ && PKGINIT=true \
+ && PKGADD="$SUDO apk add" \
+ && PKGCLEAN="$SUDO apk clean" \
+ && HOST=x86_64-w64-mingw32 \
+ && true
+
+
+## Generic
+true \
+ && CURL_VERSION="8.3.0" \
+ && CACHE_DIR="/var/tmp" \
+ && true
+
+
+## Make
+true \
+ && if test -n "$(ls -A)"; then true \
+ && printf '\n It is recommended to run this script in an empty dir.\n\n' \
+ && false \
+ ;fi \
+ && if test -n "$HOST"; then HOST_="${HOST:?}-" ;fi \
+ && CURL_VERSION_UGLY="$(echo "$CURL_VERSION"|sed 's;\.;_;g')" \
+ && CURL_URL="https://github.com/curl/curl/archive/refs/tags/curl-${CURL_VERSION_UGLY:?}.tar.gz" \
+ && CURL_SRCTGZ="${CACHE_DIR:?}/curl-${CURL_VERSION:?}.tgz" \
+ && CURL_BINTGZ="${CURL_SRCTGZ%.*}-bin.tgz" \
+ \
+ && ${PKGINIT:?} && ${PKGADD:?} $PKGS_TO_ADD \
+ && printf '\n Download Sources\n\n' \
+ && if test ! -e "${CURL_SRCTGZ:?}"; then true \
+ && echo "Download ${CURL_URL:?}" \
+ && curl -sSLo "${CURL_SRCTGZ:?}" "${CURL_URL:?}" \
+ ;fi \
+ && if test ! -e "${CURL_BINTGZ:?}"; then (true \
+ && printf '\n Build curl\n\n' \
+ && tar xf "${CURL_SRCTGZ:?}" \
+ && cd "curl-curl-${CURL_VERSION_UGLY:?}" \
+ && autoreconf -fi \
+ && if test -n "$HOST"; then HORSCHT="--host=${HOST:?}";fi \
+ && ./configure --prefix="$PWD/build/usr_local" --enable-http --with-nghttp2 --with-nghttp3 \
+ --disable-alt-svc --disable-ares --disable-aws --disable-basic-auth \
+ --disable-bearer-auth --disable-bindlocal --disable-cookies --disable-curldebug \
+ --disable-dateparse --disable-debug --disable-dependency-tracking --disable-dict \
+ --disable-digest-auth --disable-dnsshuffle --disable-doh --disable-ech --disable-file \
+ --disable-form-api --disable-ftp --disable-get-easy-options --disable-gopher \
+ --disable-headers-api --disable-hsts --disable-http-auth --disable-imap --enable-ipv6 \
+ --disable-kerberos-auth --disable-largefile --disable-ldap --disable-ldaps \
+ --disable-libcurl-option --disable-libtool-lock --enable-manual --disable-mime \
+ --disable-mqtt --disable-negotiate-auth --disable-netrc --enable-ntlm --enable-ntlm-wb \
+ --disable-openssl-auto-load-config --disable-optimize --disable-pop3 \
+ --disable-progress-meter --enable-proxy --disable-pthreads --disable-rt --disable-rtsp \
+ --disable-smb --enable-smtp --disable-socketpair --disable-sspi --disable-symbol-hiding \
+ --disable-telnet --disable-tftp --disable-threaded-resolver --disable-tls-srp \
+ --disable-unix-sockets --disable-verbose --disable-versioned-symbols --disable-warnings \
+ --disable-websockets --disable-werror --without-schannel --without-secure-transport \
+ --without-amissl --without-ssl --without-openssl --without-gnutls --without-mbedtls \
+ --without-wolfssl --without-bearssl --without-rustls --without-test-nghttpx \
+ --without-test-caddy --without-test-httpd --without-pic --without-aix-soname \
+ --without-gnu-ld --without-sysroot --without-mingw1-deprecated --without-hyper \
+ --without-zlib --without-brotli --without-zstd --without-ldap-lib --without-lber-lib \
+ --without-gssapi-includes --without-gssapi-libs --without-gssapi \
+ --without-default-ssl-backend --without-random --without-ca-bundle --without-ca-path \
+ --without-ca-fallback --without-libpsl --without-libgsasl --without-librtmp \
+ --without-winidn --without-libidn2 --without-ngtcp2 --without-quiche --without-msh3 \
+ --without-zsh-functions-dir --without-fish-functions-dir \
+ CFLAGS=-fPIC $HORSCHT \
+ && make clean && make -j$(nproc) && make install \
+ && (cd build/usr_local \
+ && rm -rf share/aclocal bin/curl-config lib/libcurl.la lib/pkgconfig \
+ && tar --owner=0 --group=0 -czf "${CURL_BINTGZ:?}" * \
+ && md5sum -b "${CURL_BINTGZ:?}" > "${CURL_BINTGZ:?}.md5" \
+ ) \
+ && cd .. && rm -rf "curl-curl-${CURL_VERSION_UGLY:?}" \
+ );fi \
+ && printf '\n DONE\n\n'
+
+
+### Install
+true \
+ && $SUDO tar -C "${INSTALL_ROOT:?}" -xzf "${CURL_BINTGZ:?}" \
+ && true
+
+
diff --git a/doc/note/qemu/build-libpcre1.txt b/doc/note/qemu/build-libpcre1.txt
new file mode 100644
index 0000000..affbd3e
--- /dev/null
+++ b/doc/note/qemu/build-libpcre1.txt
@@ -0,0 +1,70 @@
+
+
+### Debian native
+true \
+ && PKGS_TO_ADD="git make gcc ca-certificates libc6-dev cmake autoconf automake libtool m4" \
+ && SUDO=sudo \
+ && PKGINIT="$SUDO apt update" \
+ && PKGADD="$SUDO apt install -y --no-install-recommends" \
+ && PKGCLEAN="$SUDO apt clean" \
+ && HOST= \
+ && true
+
+
+### Alpine mingw cross
+true \
+ && PKGS_TO_ADD="git make mingw-w64-gcc curl tar cmake autoconf automake libtool m4" \
+ && SUDO="/home/$USER/.local/bin/sudo" \
+ && PKGINIT=true \
+ && PKGADD="$SUDO apk add" \
+ && PKGCLEAN="$SUDO apk clean" \
+ && HOST=x86_64-w64-mingw32 \
+ && true
+
+
+## Generic
+true \
+ && PCRE_VERSION="8.45" \
+ && CACHE_DIR="/var/tmp" \
+ && true
+
+
+## Make
+true \
+ && if test -n "$(ls -A)"; then true \
+ && printf '\n It is recommended to run this script in an empty dir.\n\n' \
+ && false \
+ ;fi \
+ && PCRE_URL="https://sourceforge.net/projects/pcre/files/pcre/${PCRE_VERSION:?}/pcre-${PCRE_VERSION:?}.tar.gz/download" \
+ && PCRE_SRCTGZ="${CACHE_DIR:?}/pcre-${PCRE_VERSION:?}.tgz" \
+ && PCRE_BINTGZ="${PCRE_SRCTGZ%.*}-bin.tgz" \
+ && if test -n "$HOST"; then HOST_="${HOST:?}-" ;fi \
+ && ${PKGINIT:?} && ${PKGADD:?} $PKGS_TO_ADD \
+ && printf '\n Download Dependency Sources\n\n' \
+ && if test ! -e "${PCRE_SRCTGZ:?}"; then true \
+ && echo "Download ${PCRE_URL:?}" \
+ && curl -sSLo "${PCRE_SRCTGZ:?}" "${PCRE_URL:?}" \
+ ;fi \
+ && if test ! -e "${PCRE_BINTGZ:?}"; then (true \
+ && printf '\n Build curl\n\n' \
+ && tar xf "${PCRE_SRCTGZ:?}" \
+ && cd "pcre-${PCRE_VERSION:?}" \
+ && ./configure --prefix="$PWD/build/usr_local" --host=$HOST --disable-cpp --enable-utf \
+ && make clean && make -j$(nproc) && make install \
+ && (cd build/usr_local \
+ && rm -rf lib/libpcre.la lib/pkgconfig lib/libpcreposix.la bin/pcre-config \
+ && tar --owner=0 --group=0 -czf "${PCRE_BINTGZ:?}" * \
+ && md5sum -b "${PCRE_BINTGZ:?}" > "${PCRE_BINTGZ:?}.md5" \
+ ) \
+ && cd .. && rm -rf "pcre-${PCRE_VERSION:?}" \
+ );fi \
+ && printf '\n DONE\n\n'
+
+
+## Install
+true \
+ && $SUDO tar -C "${INSTALL_ROOT:?}" -xzf "${PCRE_BINTGZ:?}" \
+ && true
+
+
+
diff --git a/doc/note/qemu/build-lua.txt b/doc/note/qemu/build-lua.txt
new file mode 100644
index 0000000..59c0838
--- /dev/null
+++ b/doc/note/qemu/build-lua.txt
@@ -0,0 +1,86 @@
+
+### Debian native
+true \
+ && PKGS_TO_ADD="ca-certificates gcc make libc6-dev" \
+ && SUDO=sudo \
+ && PKGINIT="$SUDO apt update" \
+ && PKGADD="$SUDO apt install -y --no-install-recommends" \
+ && PKGCLEAN="$SUDO apt clean" \
+ && HOST= \
+ && true
+
+
+### Alpine mingw cross
+true \
+ && PKGS_TO_ADD="binutils curl mingw-w64-gcc make tar" \
+ && SUDO="/home/$USER/.local/bin/sudo" \
+ && PKGINIT=true \
+ && PKGADD="$SUDO apk add" \
+ && PKGCLEAN="$SUDO apk clean" \
+ && HOST=x86_64-w64-mingw32 \
+ && true
+
+
+## Generic
+true \
+ && LUA_VERSION="5.4.3" \
+ && CACHE_DIR="/var/tmp" \
+ && true
+
+
+## Make
+true \
+ && if test -n "$(ls -A)"; then true \
+ && printf '\n It is recommended to run this script in an empty dir.\n\n' \
+ && false \
+ ;fi \
+ && if test -n "$HOST"; then HOST_="${HOST:?}-" ;fi \
+ && ${PKGINIT:?} && ${PKGADD:?} $PKGS_TO_ADD \
+ && LUA_URL="https://www.lua.org/ftp/lua-${LUA_VERSION:?}.tar.gz" \
+ && LUA_SRCTGZ="${CACHE_DIR:?}/lua-${LUA_VERSION:?}.tgz" \
+ && LUA_BINTGZ="${LUA_SRCTGZ%.*}-bin.tgz" \
+ && printf '\n Download Dependency Sources\n\n' \
+ && if test ! -e "${LUA_SRCTGZ:?}"; then true \
+ && echo "Download ${LUA_URL:?}" \
+ && curl -sSLo "${LUA_SRCTGZ:?}" "${LUA_URL:?}" \
+ ;fi \
+ && if test ! -e "${LUA_BINTGZ:?}"; then (true \
+ && printf '\n Build lua\n\n' \
+ && tar xf "${LUA_SRCTGZ:?}" \
+ && cd "lua-${LUA_VERSION:?}" \
+ && mkdir -p build/bin build/include build/lib build/man/man1 \
+ && export CFLAGS="-ggdb -Wall -Wextra" \
+ && `# Uncomment this line for debugging` \
+ && export CFLAGS="$CFLAGS -DLUAI_ASSERT -DLUA_USE_APICHECK" \
+ && `# endOf Uncomment` \
+ && make clean \
+ && if echo "$HOST"|grep -q '\-mingw'; then true \
+ && make -j$(nproc) PLAT=mingw \
+ CC="${HOST_}gcc -std=gnu99" AR="${HOST_}ar rcu" RANLIB="${HOST_}ranlib" \
+ && cp -t build/. README \
+ && cp -t build/bin/. src/lua.exe src/luac.exe \
+ ;else true \
+ && export CFLAGS="$CFLAGS -DLUA_USE_POSIX" \
+ && make -j$(nproc) \
+ && cp -t build/. README \
+ && cp -t build/bin/. src/lua src/luac \
+ ;fi \
+ && cp -t build/include/. src/lua.h src/luaconf.h src/lualib.h src/lauxlib.h src/lua.hpp \
+ && cp -t build/lib/. src/liblua.a \
+ && cp -t build/man/man1/. doc/lua.1 doc/luac.1 \
+ && (cd build \
+ && rm -rf include/lua.hpp \
+ && tar --owner=0 --group=0 -czf "${LUA_BINTGZ:?}" * \
+ && md5sum -b "${LUA_BINTGZ:?}" > "${LUA_BINTGZ:?}.md5" \
+ ) \
+ && cd .. && rm -rf "lua-${LUA_VERSION:?}" \
+ );fi \
+ && printf '\n DONE\n\n'
+
+
+## Install
+true \
+ && $SUDO tar -C "${INSTALL_ROOT:?}" -xzf "${LUA_BINTGZ:?}" \
+ && true
+
+
diff --git a/doc/note/qemu/build-sqlite.txt b/doc/note/qemu/build-sqlite.txt
new file mode 100644
index 0000000..b7b31bd
--- /dev/null
+++ b/doc/note/qemu/build-sqlite.txt
@@ -0,0 +1,77 @@
+
+### Debian native
+true \
+ && PKGS_TO_ADD="ca-certificates gcc libc6-dev make tcl" \
+ && SUDO=sudo \
+ && PKGINIT="$SUDO apt update" \
+ && PKGADD="$SUDO apt install -y --no-install-recommends" \
+ && PKGCLEAN="$SUDO apt clean" \
+ && HOST= \
+ && true
+
+
+### Alpine mingw cross
+true \
+ && PKGS_TO_ADD="curl gcc musl-dev make mingw-w64-gcc tar tcl" \
+ && SUDO="/home/$USER/.local/bin/sudo" \
+ && PKGINIT=true \
+ && PKGADD="$SUDO apk add" \
+ && PKGCLEAN="$SUDO apk clean" \
+ && HOST=x86_64-w64-mingw32 \
+ && true
+
+
+## Generic
+true \
+ && SQLITE_VERSION="3.33.0" \
+ && CACHE_DIR="/var/tmp" \
+ && true
+
+
+## Make
+true \
+ && SQLITE_URL="https://github.com/sqlite/sqlite/archive/refs/tags/version-${SQLITE_VERSION:?}.tar.gz" \
+ && SQLITE_SRCTGZ="${CACHE_DIR:?}/sqlite-${SQLITE_VERSION:?}.tgz" \
+ && SQLITE_BINTGZ="${SQLITE_SRCTGZ%.*}-bin.tgz" \
+ && ${PKGINIT:?} && ${PKGADD:?} ${PKGS_TO_ADD} \
+ && if test -n "$HOST"; then HOST_="${HOST:?}-" ;fi \
+ && if test ! -e "${SQLITE_SRCTGZ:?}"; then (true \
+ && echo "Download \"${SQLITE_URL:?}\"" \
+ && curl -sSLo "${SQLITE_SRCTGZ:?}" "${SQLITE_URL:?}" \
+ );fi \
+ && if test ! -e "${SQLITE_BINTGZ:?}"; then (true \
+ && printf '\n Build SqLite\n\n' \
+ && tar xzf "${SQLITE_SRCTGZ:?}" \
+ && cd sqlite-*${SQLITE_VERSION:?} \
+ && mkdir build \
+ && if echo $HOST|grep -q 'mingw'; then true \
+ && ./configure --prefix=${PWD:?}/build --host=${HOST:?} \
+ CC=${HOST_}cc CPP=$CPP CXX=$CXX BCC=gcc BEXE=.exe config_TARGET_EXEEXT=.exe \
+ && ln -s mksourceid.exe mksourceid \
+ && make clean && make -j$(nproc) && make install \
+ && (cd build \
+ && rm -rf lemon* mksourceid lib/pkgconfig lib/*.la \
+ ) \
+ ;else true \
+ && ./configure --prefix=${PWD:?}/build \
+ && make clean && make -j$(nproc) && make install \
+ ;fi \
+ && cp README.md LICENSE.md VERSION build/. \
+ && (cd build \
+ && rm -rf lib/libsqlite3.la lib/pkgconfig \
+ && find -not -name MD5SUM -type f -exec md5sum -b {} + > MD5SUM \
+ && tar --owner=0 --group=0 -czf "${SQLITE_BINTGZ:?}" * \
+ && md5sum -b "${SQLITE_BINTGZ:?}" > "${SQLITE_BINTGZ:?}.md5" \
+ ) \
+ && cd .. && rm -rf sqlite-*${SQLITE_VERSION:?} \
+ );fi \
+ && printf '\n DONE\n\n'
+
+
+## Install
+true \
+ && $SUDO tar -C "${INSTALL_ROOT:?}" -xzf "${SQLITE_BINTGZ:?}" \
+ && true
+
+
+
diff --git a/doc/note/qemu/build-zlib.txt b/doc/note/qemu/build-zlib.txt
new file mode 100644
index 0000000..1b6fc26
--- /dev/null
+++ b/doc/note/qemu/build-zlib.txt
@@ -0,0 +1,73 @@
+
+### Debian native
+true \
+ && PKGS_TO_ADD="ca-certificates gcc libc6-dev make" \
+ && SUDO=sudo \
+ && PKGINIT="$SUDO apt update" \
+ && PKGADD="$SUDO apt install -y --no-install-recommends" \
+ && PKGCLEAN="$SUDO apt clean" \
+ && HOST= \
+ && true
+
+
+### Alpine mingw cross
+true \
+ && PKGS_TO_ADD="curl make mingw-w64-gcc tar" \
+ && SUDO="/home/$USER/.local/bin/sudo" \
+ && PKGINIT=true \
+ && PKGADD="$SUDO apk add" \
+ && PKGCLEAN="$SUDO apk clean" \
+ && HOST=x86_64-w64-mingw32 \
+ && true
+
+
+## Generic
+true \
+ && ZLIB_VERSION="1.2.11" \
+ && CACHE_DIR="/var/tmp" \
+ && true
+
+
+## Make
+true \
+ && ZLIB_URL="https://downloads.sourceforge.net/project/libpng/zlib/${ZLIB_VERSION:?}/zlib-${ZLIB_VERSION:?}.tar.gz" \
+ && ZLIB_SRCTGZ="${CACHE_DIR:?}/zlib-${ZLIB_VERSION:?}.tgz" \
+ && ZLIB_BINTGZ="${ZLIB_SRCTGZ%.*}-bin.tgz" \
+ && if test -n "$HOST"; then HOST_="${HOST:?}-" ;fi \
+ && if test ! -e "${ZLIB_SRCTGZ:?}"; then (true \
+ && echo "Download \"${ZLIB_URL:?}\"" \
+ && curl -sSLo "${ZLIB_SRCTGZ:?}" "${ZLIB_URL:?}" \
+ );fi \
+ && if test ! -e "${ZLIB_BINTGZ:?}"; then (true \
+ && printf '\n Build zlib\n\n' \
+ && tar xzf "${ZLIB_SRCTGZ:?}" \
+ && cd "zlib-${ZLIB_VERSION:?}" \
+ && mkdir build \
+ && if echo $HOST|grep -q '\-mingw'; then true \
+ && export DESTDIR=./build BINARY_PATH=/bin INCLUDE_PATH=/include LIBRARY_PATH=/lib \
+ && sed -i "s;^PREFIX =.\*\$;;" win32/Makefile.gcc \
+ && make -j$(nproc) -fwin32/Makefile.gcc PREFIX=${HOST_:?} \
+ && make -fwin32/Makefile.gcc install PREFIX=${HOST_:?} \
+ && unset DESTDIR BINARY_PATH INCLUDE_PATH LIBRARY_PATH \
+ ;else true \
+ && ./configure --prefix=$PWD/build \
+ && make -j$(nproc) && make install \
+ ;fi \
+ && cp README build/. \
+ && (cd build \
+ && rm -rf lib/pkgconfig \
+ && tar --owner=0 --group=0 -czf "${ZLIB_BINTGZ:?}" * \
+ && md5sum -b "${ZLIB_BINTGZ:?}" > "${ZLIB_BINTGZ:?}.md5" \
+ ) \
+ && cd .. && rm -rf "zlib-${ZLIB_VERSION:?}" \
+ );fi \
+ && printf '\n DONE\n\n'
+
+
+## Install
+true \
+ && $SUDO tar -C "${INSTALL_ROOT:?}" -xzf "${ZLIB_BINTGZ:?}" \
+ && true
+
+
+
diff --git a/doc/note/qemu/qemu.txt b/doc/note/qemu/qemu.txt
index 2c7eaba..53159d9 100644
--- a/doc/note/qemu/qemu.txt
+++ b/doc/note/qemu/qemu.txt
@@ -54,26 +54,46 @@ Regular boot
## aarch64 (not working yet)
- apt install -y --no-install-recommends qemu-uefi-aarch64
- curl -sSLO https://github.com/dhruvvyas90/qemu-rpi-kernel/raw/master/kernel-qemu-4.4.34-jessie
+ #apt install -y --no-install-recommends qemu-uefi-aarch64
+ curl -sSLO https://github.com/dhruvvyas90/qemu-rpi-kernel/blob/master/kernel-qemu-5.10.63-bullseye
+ curl -sSLO https://github.com/dhruvvyas90/qemu-rpi-kernel/blob/master/versatile-pb-bullseye-5.10.63.dtb
+ curl -sSLO https://github.com/dhruvvyas90/qemu-rpi-kernel/blob/master/native-emulation/dtbs/bcm2711-rpi-4-b.dtb
+ curl -sSLO https://github.com/dhruvvyas90/qemu-rpi-kernel/blob/master/kernel-qemu-5.4.51-buster
+ curl -sSLO https://github.com/dhruvvyas90/qemu-rpi-kernel/blob/master/versatile-pb-buster-5.4.51.dtb
curl -sSLO https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2023-05-03/2023-05-03-raspios-bullseye-arm64-lite.img.xz
xz -d 2023-05-03-raspios-bullseye-arm64-lite.img.xz
+ echo p | /sbin/fdisk 2023-05-03-raspios-bullseye-arm64-lite.img | egrep 'Linux$' | sed -E 's:^\S+\s+([0-9]+) .*$:\nmount -o offset=$(expr \1 \\* 512) ./2023-05-03-raspios-bullseye-arm64-lite.img /mnt/foo:'
qemu-img convert -f raw -O qcow2 2023-05-03-raspios-bullseye-arm64-lite.img raspbian-bullseye-lite.qcow2
qemu-img resize raspbian-bullseye-lite.qcow2 16G
mv raspbian-bullseye-lite.qcow2 hda.qcow2
qemu-system-aarch64 \
- -bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd \
- -hda hda.qcow2 \
- -cpu cortex-a72 -m 256 \
+ -m 256 -cpu arm1176 \
-M versatilepb \
-no-reboot \
-serial stdio \
-net nic -net user \
+ -drive file=2023-05-03-raspios-bullseye-arm64-lite.img,format=raw \
+ -boot 'dtb=versatile-pb-bullseye-5.10.63.dtb,kernel=kernel-qemu-5.10.63-bullseye,kernel_args=root=/dev/vda2 panic=1' \
+ qemu-system-aarch64 \
+ -dtb ./bcm2711-rpi-4-b.dtb \
+ -m 256 -cpu arm1176 -M versatilepb \
+ -kernel kernel-qemu-5.10.63-bullseye -append "root=/dev/sda2 rootfstype=ext4 rw" \
+ -serial stdio \
+ -drive file=2023-05-03-raspios-bullseye-arm64-lite.img,format=raw \
+ -net nic -net user \
+ -no-reboot \
+
+ qemu-system-arm \
+ -M versatilepb \
-cpu arm1176 -m 256 \
- -net tap,ifname=vnet0,script=no,downscript=no \
- -bios /usr/share/ovmf/OVMF.fd \
+ -drive "file=2023-05-03-raspios-bullseye-arm64-lite.img,if=none,index=0,media=disk,format=raw,id=disk0" \
+ -device "virtio-blk-pci,drive=disk0,disable-modern=on,disable-legacy=off" \
+ -net "user,hostfwd=tcp::5022-:2222" \
+ -dtb "./versatile-pb-buster-5.4.51.dtb" \
+ -kernel "./kernel-qemu-5.4.51-buster" -append 'root=/dev/vda2 panic=1' \
+ -no-reboot
## Shared host directory via CIFS/SMB