galeb

Једноставна статичка дистрибуција заснована на musl-у
Дневник | Датотеке | Референце | ПРОЧИТАЈМЕ | ЛИЦЕНЦА

чување d6bbb028e9a85f4d3bb20dcd93e3c6cf8ba04636
родитељ f1325024bfb3bdb364b805ee5e790ca57f5cf35b
Аутор: Страхиња Радић <contact@strahinja.org>
Датум:   Sat, 23 Jul 2022 22:52:28 +0200

Add gnupg, pass, tree

Signed-off-by: Страхиња Радић <contact@strahinja.org>

Diffstat:
M02-chroot.sh | 5-----
M03-packages.sh | 613+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
M04-finale.sh | 5+++++
MFAQ | 5+++++
MTODO | 61+++++++++++++++++++++++++++++++------------------------------
Mfil/rc.d/rc.conf | 2+-
Mfil/rc.d/rc.init | 111+++++++++++++++++++++++++++++++++++++++++++++++++------------------------------
Mlib/fun.sh | 26++++++++++++--------------
Mlib/pkgs.tsv | 19++++++++++++++++++-
Apat/gnupg-alpine/0001-Include-sys-select.h-for-FD_SETSIZE.patch | 31+++++++++++++++++++++++++++++++
измењених датотека: 10, додавања: 785(+), брисања: 93(-)

diff --git a/02-chroot.sh b/02-chroot.sh @@ -144,11 +144,6 @@ case "${run_as_root}" in *) chroot ${GR} /${TLD}/bin/mksh -l +h;; esac -msg info "makewhatis /share/man" -makewhatis /share/man -msg info "makewhatis /sucks/share/man" -makewhatis /sucks/share/man - umount ${GR}/tmp umount ${GR}/run umount ${GR}/sys/firmware/efi/efivars diff --git a/03-packages.sh b/03-packages.sh @@ -4620,6 +4620,536 @@ mkpk_install() fi end_substep +# Needed fpr gnupg +begin_substep libtasn1-4.18.0 +if [ -e /sucks/lib/libtasn1.so.6.6.2 ]; then + msg info "%s exists, skipping %s" /sucks/lib/libtasn1.so.6.6.2 ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.gz + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CFLAGS='-Os -pipe' + LDFLAGS='-s' + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + ./configure --prefix=/sucks || exit 1 + + make ${JN} || exit 1 + make install +} +! + mkpk ${pkg} + remove_dir ${G_SRC}/${pkg} + unpack_pkg ${pkg} / + ) || exit 1 +fi +end_substep + +# Needed fpr gnupg +begin_substep nettle-3.8 +if [ -e /sucks/bin/nettle-hash ]; then + msg info "%s exists, skipping %s" /sucks/bin/nettle-hash ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.gz + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CFLAGS='-Os -pipe' + LDFLAGS='-s' + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + ./configure --prefix=/sucks || exit 1 + + make ${JN} || exit 1 + make install +} +! + mkpk ${pkg} + remove_dir ${G_SRC}/${pkg} + unpack_pkg ${pkg} / + ) || exit 1 +fi +end_substep + +# Needed fpr gnupg +begin_substep libunistring-1.0 +if [ -e /sucks/lib/libunistring.so.2.2.0 ]; then + msg info "%s exists, skipping %s" /sucks/lib/libunistring.so.2.2.0 \ + ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.xz + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CFLAGS='-Os -pipe' + LDFLAGS='-s' + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + ./configure --prefix=/sucks \\ + --docdir=/share/doc/${pkg} || exit 1 + + make ${JN} || exit 1 + make install +} +! + mkpk ${pkg} + remove_dir ${G_SRC}/${pkg} + unpack_pkg ${pkg} / + ) || exit 1 +fi +end_substep + +# Needed fpr gnupg +begin_substep p11-kit-0.24.1 +if [ -x /sucks/bin/p11-kit ]; then + msg info "%s exists, skipping %s" /sucks/bin/p11-kit ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.xz + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CFLAGS='-Os -pipe' + LDFLAGS='-s' + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + # Supress warning about missing include dir + mkdir -p /local/include + + NOCONFIGURE=1 autoreconf -vif || exit 1 + + ./configure --prefix=/sucks \\ + --sysconfdir=/etc \\ + --with-trust-paths=/etc/pki/anchors || exit 1 + + make ${JN} || exit 1 + make install +} +! + mkpk ${pkg} + remove_dir ${G_SRC}/${pkg} + unpack_pkg ${pkg} / + ) || exit 1 +fi +end_substep + +# Needed fpr gnupg +begin_substep gnutls-3.7.2 +if [ -x /sucks/bin/gnutls-cli ]; then + msg info "%s exists, skipping %s" /sucks/bin/gnutls-cli ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.xz + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CFLAGS='-Os -pipe' + CXXFLAGS=\${CFLAGS} + LDFLAGS='-s' + DESTDIR=/build + export CFLAGS CXXFLAGS LDFLAGS DESTDIR + + # Supress warning about missing include dir + mkdir -p /local/include + + ./configure --prefix=/sucks \\ + --with-default-trust-store-pkcs11="pkcs11:" \\ + --enable-openssl-compatibility \\ + --with-zlib \\ + --disable-guile \\ + --disable-valgrind-tests \\ + --disable-rpath || exit 1 + + make ${JN} || exit 1 + make install +} +! + mkpk ${pkg} + remove_dir ${G_SRC}/${pkg} + unpack_pkg ${pkg} / + ) || exit 1 +fi +end_substep + +# Needed fpr gnupg +begin_substep libgpg-error-1.45 +if [ -x /sucks/bin/gpg-error ]; then + msg info "%s exists, skipping %s" /sucks/bin/gpg-error ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.bz2 + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CFLAGS='-Os -pipe' + CXXFLAGS=\${CFLAGS} + LDFLAGS='-s' + DESTDIR=/build + export CFLAGS CXXFLAGS LDFLAGS DESTDIR + + # Supress warning about missing include dir + mkdir -p /local/include + + ./configure --prefix=/sucks \\ + --disable-nls || exit 1 + + make ${JN} || exit 1 + make install +} +! + mkpk ${pkg} + remove_dir ${G_SRC}/${pkg} + unpack_pkg ${pkg} / + ) || exit 1 +fi +end_substep + +# Needed fpr gnupg +begin_substep libassuan-2.5.5 +if [ -e /sucks/lib/libassuan.so.0.8.5 ]; then + msg info "%s exists, skipping %s" /sucks/lib/libassuan.so.0.8.5 ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.bz2 + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CFLAGS='-Os -pipe' + LDFLAGS='-s' + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + ./configure --prefix=/sucks || exit 1 + + make ${JN} || exit 1 + make install +} +! + mkpk ${pkg} + remove_dir ${G_SRC}/${pkg} + unpack_pkg ${pkg} / + ) || exit 1 +fi +end_substep + +# Needed fpr gnupg +begin_substep libgcrypt-1.10.1 +if [ -e /sucks/lib/libgcrypt.so.20.4.1 ]; then + msg info "%s exists, skipping %s" /sucks/lib/libgcrypt.so.20.4.1 ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.bz2 + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CFLAGS='-Os -pipe' + LDFLAGS='-s' + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + ./configure --prefix=/sucks \\ + --enable-padlock-support || exit 1 + + make ${JN} || exit 1 + make install +} +! + mkpk ${pkg} + remove_dir ${G_SRC}/${pkg} + unpack_pkg ${pkg} / + ) || exit 1 +fi +end_substep + +# Needed fpr gnupg +begin_substep libksba-1.6.0 +if [ -e /sucks/lib/libksba.so.8.14.0 ]; then + msg info "%s exists, skipping %s" /sucks/lib/libksba.so.8.14.0 ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.bz2 + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CFLAGS='-Os -pipe' + LDFLAGS='-s' + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + ./configure --prefix=/sucks || exit 1 + + make ${JN} || exit 1 + make install +} +! + mkpk ${pkg} + remove_dir ${G_SRC}/${pkg} + unpack_pkg ${pkg} / + ) || exit 1 +fi +end_substep + +# Needed fpr gnupg +begin_substep npth-1.6 +if [ -e /sucks/lib/libnpth.so.0.1.2 ]; then + msg info "%s exists, skipping %s" /sucks/lib/libnpth.so.0.1.2 ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.bz2 + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CFLAGS='-Os -pipe' + LDFLAGS='-s' + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + ./configure --prefix=/sucks || exit 1 + + make ${JN} || exit 1 + make install +} +! + mkpk ${pkg} + remove_dir ${G_SRC}/${pkg} + unpack_pkg ${pkg} / + ) || exit 1 +fi +end_substep + +# Needed fpr gnupg +begin_substep pinentry-1.2.0 +if [ -x /sucks/bin/pinentry-tty ]; then + msg info "%s exists, skipping %s" /sucks/bin/pinentry-tty ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.bz2 + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CFLAGS='-Os -pipe' + LDFLAGS='-s' + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + ./configure --prefix=/sucks \\ + --enable-pinentry-tty \\ + --enable-pinentry-qt=no \\ + --enable-pinentry-gtk2=no \\ + --enable-pinentry-gnome3=no \\ + --enable-pinentry-curses \\ + --enable-libsecret \\ + --enable-pinentry-fltk=no || exit 1 + + make ${JN} || exit 1 + make install + + ln -sf pinentry-tty ../build/sucks/bin/pinentry +} +! + mkpk ${pkg} + remove_dir ${G_SRC}/${pkg} + unpack_pkg ${pkg} / + ) || exit 1 +fi +end_substep + +begin_substep gnupg-2.3.7 +if [ -x /sucks/bin/gpg ]; then + msg info "%s exists, skipping %s" /sucks/bin/gpg ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.bz2 + ( + cd_or_fail ${G_SRC}/${pkg} + + apply_patch final -Np1 -i \ + ${G_PAT}/gnupg-alpine/0001-Include-sys-select.h-for-\ +FD_SETSIZE.patch + #apply_patch final -Np1 -i \ + # ${G_PAT}/gnupg-alpine/fix-i18n.patch + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CFLAGS='-Os -pipe' + LDFLAGS='-s' + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + /${TLD}/bin/sed -e '/noinst_SCRIPTS = gpg-zip/c '\\ +'sbin_SCRIPTS += gpg-zip' -i tools/Makefile.in + + ./configure --prefix=/sucks \\ + --enable-symcryptrun \\ + --sysconfdir=/etc \\ + --localstatedir=/var \\ + --docdir=/share/doc/${pkg} \\ + --disable-nls \\ + --enable-bzip2 || exit 1 + + make ${JN} || exit 1 + make install-strip +} +! + mkpk ${pkg} + remove_dir ${G_SRC}/${pkg} + unpack_pkg ${pkg} / + ) || exit 1 +fi +end_substep + +begin_substep gpgme-1.17.1 +if [ -x /sucks/bin/gpgme-config ]; then + msg info "%s exists, skipping %s" /sucks/bin/gpgme-config ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.bz2 + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CFLAGS='-Os -pipe' + LDFLAGS='-s' + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + ./configure --prefix=/sucks \\ + --disable-gpg-test \\ + --enable-languages=cl,cpp || exit 1 + + make ${JN} || exit 1 + make install-strip +} +! + mkpk ${pkg} + remove_dir ${G_SRC}/${pkg} + unpack_pkg ${pkg} / + ) || exit 1 +fi +end_substep + begin_substep opendoas-6.8.2 if [ -x /bin/doas ]; then msg info "%s exists, skipping %s" /bin/doas ${pkg} @@ -4666,6 +5196,50 @@ permit nopass :wheel fi end_substep +begin_substep pass-20220723 +if [ -x /bin/pass ]; then + msg info "%s exists, skipping %s" /bin/pass ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CFLAGS='-Os -pipe' + LDFLAGS='-s' + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + /${TLD}/bin/sed -i -e 's,\\<encrypt\\>,pass_encrypt,g' pass.c + + cat <<@ >config.mk +PREFIX= +MANPREFIX=/share/man + +CFLAGS=\${CFLAGS} -DVERSION=\\"\\\${VERSION}\\" +LDFLAGS=\${LDFLAGS} + +LIBS += -lgpgme -lassuan -lgpg-error +@ + make ${JN} || exit 1 + make install +} +! + mkpk ${pkg} + #remove_dir ${G_SRC}/${pkg} + unpack_pkg ${pkg} / + ) || exit 1 +fi +end_substep + # Don't need this if we are going for exclusively root-usable script # begin_substep galeb-utils-20220717 # if [ ! -x /bin/umountall ]; then @@ -4759,6 +5333,45 @@ mkpk_install() fi end_substep +begin_substep tree-2.0.2 +if [ -x /bin/tree ]; then + msg info "%s exists, skipping %s" /bin/tree ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + extract_pkg ${G_SRC} ${pkg} ${pkg}.tgz + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CFLAGS='-Os -pipe -static --static -fcommon' + LDFLAGS='-static --static -fcommon -s' + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + /${TLD}/bin/sed -i -e 's,/usr/local,/build,' \\ + -e '/^MANDIR/s,/man,/share&,' \\ + -e "/^CFLAGS/s,\\(CFLAGS=\\).*,\\1\${CFLAGS}," \\ + -e "/^LDFLAGS/s,\\(LDFLAGS=\\).*,\\1\${LDFLAGS}," \\ + Makefile + make ${JN} || exit 1 + make install +} +! + mkpk ${pkg} + remove_dir ${G_SRC}/${pkg} + unpack_pkg ${pkg} / + ) || exit 1 +fi +end_substep + # Only needed for wpa_supplicant below # begin_substep libnl-3.5.0 # if [ -e /sucks/lib/libnl-3.so.200.26.0 ]; then diff --git a/04-finale.sh b/04-finale.sh @@ -257,6 +257,11 @@ mkpk_install() fi end_substep +msg info "makewhatis /share/man" +makewhatis /share/man +msg info "makewhatis /sucks/share/man" +makewhatis /sucks/share/man + msg info "Generating /etc/galeb-release" cat <<! >/etc/galeb-release Galeb musl/Linux ${G_VER} diff --git a/FAQ b/FAQ @@ -114,6 +114,11 @@ A: Python doesn't support it yet (apparently?): Q: Why not use scron (simple cron) instead of dcron? A: Because it doesn't support per-user crontabs. +Q: Can you add FOO as a package? +A: When I created Galeb, I made my own choice of initial packages. You are free + to add whatever you like. Some of my choices regarding packages not being + included are deliberate. + [1]: https://www.gnu.org/licenses/gpl-faq.html#LGPLStaticVsDynamic [2]: https://www.gnu.org/licenses/license-list.html#Expat diff --git a/TODO b/TODO @@ -1,40 +1,15 @@ TODO ==== -[~] Fix init scripts - [ ] git://r-36.net/stali-init - [ ] Add multiple ways to set hostname, TZ, etc. - [x] http://r-36.net/scm/ - [x] https://codemadness.org/git/ - [x] https://git.2f30.org/ - [x] https://git.suckless.org/ - [x] Investigate crond showing message for 1 on (re)start - - Was a bug in bare.sh - [x] figure out how to bring down all services cleanly as a regular user - (svc group?) - - Regular user shutting down? Should be handled either by suid - (therefore: not script) calling other things or doas/sup. - Scripts/programs to do specific things like remounting - ro/umounting should just expect root or error out, shouldn't - be suid - - Conclusion (for now): call /bin/rc.shutdown as root with - doas/sup, otherwise error out. Alternative would be to create - dedicated shutdown suid executable (TODO) - - This alternative is the ultimate solution; consider calling - poweroff from within tmux (fails when done by script) - [x] shutdown, poweroff, reboot - [x] Add sdhcp as ~oneshot~ longrun - [x] hwclock on shutdown - [x] shutdown as regular user (remount / ro) - [~] Add packages - [ ] https://git.2f30.org/pass/files.html - [ ] https://git.2f30.org/ports/files.html - [ ] git://r-36.net/nldev - [ ] git://r-36.net/nlmon [ ] git://r-36.net/rfkilld [ ] Add X [ ] Add ssh(d) + [x] https://git.2f30.org/ports/files.html + [x] https://git.2f30.org/pass/files.html + [x] Add GnuPG + [/] git://r-36.net/nldev - requires busybox mdev? + [/] git://r-36.net/nlmon - requires busybox mdev? [x] Add wpa_supplicant (DBus stripped - untested! Commented out by default) [x] Add opendoas @@ -64,6 +39,32 @@ Low priority Done ---- +[x] Fix init scripts + [x] git://r-36.net/stali-init + [x] Add multiple ways to set hostname, TZ, etc. + [x] http://r-36.net/scm/ + [x] https://codemadness.org/git/ + [x] https://git.2f30.org/ + [x] https://git.suckless.org/ + [x] Investigate crond showing message for 1 on (re)start + - Was a bug in bare.sh + [x] figure out how to bring down all services cleanly as a regular user + (svc group?) + - Regular user shutting down? Should be handled either by suid + (therefore: not script) calling other things or doas/sup. + Scripts/programs to do specific things like remounting + ro/umounting should just expect root or error out, shouldn't + be suid + - Conclusion (for now): call /bin/rc.shutdown as root with + doas/sup, otherwise error out. Alternative would be to create + dedicated shutdown suid executable (TODO) + - This alternative is the ultimate solution; consider calling + poweroff from within tmux (fails when done by script) + [x] shutdown, poweroff, reboot + [x] Add sdhcp as ~oneshot~ longrun + [x] hwclock on shutdown + [x] shutdown as regular user (remount / ro) + [x] Linux [x] Random number generator? - Fixed by recreating /dev/u?random, which for some reason were created as block special files instead of diff --git a/fil/rc.d/rc.conf b/fil/rc.d/rc.conf @@ -3,7 +3,7 @@ FONT_MAP= FONT_UNIMAP= KEYMAP=us INTERFACE=eth0 -KILLDELAY=3 +KILLDELAY=3 # Delay before sending TERM and KILL on shutdown LANG=en_US.UTF-8 HARDWARECLOCK=UTC HOSTNAME=galeb diff --git a/fil/rc.d/rc.init b/fil/rc.d/rc.init @@ -17,42 +17,47 @@ ctrlaltdel -s msg info "Mounting essential filesystems" mount -n -t proc -o nosuid,noexec,nodev proc /proc mount -n -t sysfs -o nosuid,noexec,nodev sysfs /sys -mount -n -t devtmpfs -o nosuid,mode=0755 dev /dev +#mount -n -t devtmpfs -o nosuid,mode=0755 dev /dev mkdir -p /dev/shm +mount -n -t tmpfs -o nosuid,nodev,noatime,mode=1777 tmp /tmp mount -n -t tmpfs -o nosuid,nodev,noatime,mode=1777 shm /dev/shm mkdir -p /dev/pts mount -n -t devpts -o gid=5,mode=0020 devpts /dev/pts -if grep -q verbose /proc/cmdline >/dev/null 2>&1; then - dmesg -n 8 +printf "%s: /tmp/boot.log created on %s\n" $0 "$(date)" >/tmp/boot.log +G_LOGFILE=/tmp/boot.log +export G_LOGFILE + +if grep -q verbose /proc/cmdline >/dev/null 2>>${G_LOGFILE}; then + dmesg -n 8 2>>${G_LOGFILE} else - dmesg -n 3 + dmesg -n 3 2>>${G_LOGFILE} fi -mount -o ro,remount / +mount -o ro,remount / 2>>${G_LOGFILE} msg info "Running smdev" -smdev -s +smdev -s 2>>${G_LOGFILE} # Doesn't work (because of newer Linux?) #echo /bin/smdev >/proc/sys/kernel/hotplug cd /dev -ln -sf /proc/self/fd/0 stdin -ln -sf /proc/self/fd/1 stdout -ln -sf /proc/self/fd/2 stderr -ln -sf /proc/self/fd fd +ln -sf /proc/self/fd/0 stdin 2>>${G_LOGFILE} +ln -sf /proc/self/fd/1 stdout 2>>${G_LOGFILE} +ln -sf /proc/self/fd/2 stderr 2>>${G_LOGFILE} +ln -sf /proc/self/fd fd 2>>${G_LOGFILE} cd - >/dev/null -if echo ${LANG} | grep -i utf >/dev/null; then +if echo ${LANG} | grep -i utf >/dev/null 2>>${G_LOGFILE}; then msg info "Setting kbd_mode -u and font" - kbd_mode -u >/dev/null 2>&1 + kbd_mode -u >/dev/null 2>>${G_LOGFILE} if [ -n "${KEYMAP}" ]; then - loadkeys -q ${KEYMAP} + loadkeys -q ${KEYMAP} 2>>${G_LOGFILE} fi for tty in /dev/tty[0-9]*; do - kbd_mode -u -C ${tty} >/dev/null 2>&1 - printf "\e%%G" >${tty} >/dev/null 2>&1 + kbd_mode -u -C ${tty} >/dev/null 2>>${G_LOGFILE} + printf "\e%%G" >${tty} >/dev/null 2>>${G_LOGFILE} if [ -n "${FONT}" ]; then SETFONT_ARGS= if [ -n "${FONT_MAP}" ]; then @@ -61,19 +66,19 @@ if echo ${LANG} | grep -i utf >/dev/null; then if [ -n "${FONT_UNIMAP}" ]; then SETFONT_ARGS+=" -u${FONT_UNIMAP}" fi - setfont ${FONT} ${SETFONT_ARGS} -C ${tty} + setfont ${FONT} ${SETFONT_ARGS} -C ${tty} 2>>${G_LOGFILE} fi done - echo 1 >| /sys/module/vt/parameters/default_utf8 + echo 1 >| /sys/module/vt/parameters/default_utf8 2>>${G_LOGFILE} else msg info "Setting kbd_mode -a and font" - kbd_mode -a >/dev/null 2>&1 + kbd_mode -a >/dev/null 2>>${G_LOGFILE} if [ -n "${KEYMAP}" ]; then - loadkeys -q -a ${KEYMAP} + loadkeys -q -a ${KEYMAP} 2>>${G_LOGFILE} fi for tty in /dev/tty[0-9]*; do - kbd_mode -a -C ${tty} >/dev/null 2>&1 - printf "\e%%@" >${tty} >/dev/null 2>&1 + kbd_mode -a -C ${tty} >/dev/null 2>>${G_LOGFILE} + printf "\e%%@" >${tty} >/dev/null 2>>${G_LOGFILE} if [ -n "${FONT}" ]; then SETFONT_ARGS= if [ -n "${FONT_MAP}" ]; then @@ -82,15 +87,19 @@ else if [ -n "${FONT_UNIMAP}" ]; then SETFONT_ARGS+=" -u${FONT_UNIMAP}" fi - setfont ${FONT} ${SETFONT_ARGS} -C ${tty} + setfont ${FONT} ${SETFONT_ARGS} -C ${tty} 2>>${G_LOGFILE} fi done - echo 0 >| /sys/module/vt/parameters/default_utf8 + echo 0 >| /sys/module/vt/parameters/default_utf8 2>>${G_LOGFILE} fi +msg info "Setting hostname" if [ -n "${HOSTNAME}" ]; then - msg info "Setting hostname" - hostname ${HOSTNAME} + hostname ${HOSTNAME} 2>>${G_LOGFILE} +elif [ -e /etc/hostname ]; then + hostname $(sed 1q /etc/hostname) 2>>${G_LOGFILE} +else + hostname galeb 2>>${G_LOGFILE} fi msg info "Checking filesystems" @@ -104,37 +113,50 @@ if [ $? -eq 1 ]; then fi msg info "Remounting / read-write" -mount -o rw,remount / +mount -o rw,remount / 2>>${G_LOGFILE} +ln -sf /proc/mounts /etc/mtab 2>>${G_LOGFILE} msg info "Mounting filesystems" -mount -a - -ln -sf /proc/mounts /etc/mtab - +mount -a 2>>${G_LOGFILE} msg info "Activating swap" -swapon -a +swapon -a 2>>${G_LOGFILE} + +msg info "Setting timezone" +if [ -n "${TIMEZONE}" ]; then + TZ=:${TIMEZONE} + export TZ + ln -sf /share/zoneinfo/${TIMEZONE} /etc/localtime 2>>${G_LOGFILE} +else + if [ ! -L /etc/localtime ]; then + TIMEZONE=GMT + TZ=:${TIMEZONE} + export TZ + ln -sf /share/zoneinfo/${TIMEZONE} /etc/localtime \ + 2>>${G_LOGFILE} + fi +fi msg info "Configure svc" -svc -c +svc -c 2>>${G_LOGFILE} -service start metalog +service start metalog 2>>${G_LOGFILE} msg info "Setting random seed" if [ -f /etc/random-seed ]; then - cat /etc/random-seed >/dev/urandom + cat /etc/random-seed >/dev/urandom 2>>${G_LOGFILE} fi -dd if=/dev/urandom of=/etc/random-seed count=1 bs=512 2>/dev/null +dd if=/dev/urandom of=/etc/random-seed count=1 bs=512 2>/dev/null 2>>${G_LOGFILE} msg info "Storing dmesg output to /var/log/dmesg.log" -dmesg >/var/log/dmesg.log +dmesg >/var/log/dmesg.log 2>>${G_LOGFILE} if [ -e /proc/sys/kernel/dmesg_restrict ] && \ [ "$(cat /proc/sys/kernel/dmesg_restrict)" = "1" ] then - chmod 0600 /var/log/dmesg.log + chmod 0600 /var/log/dmesg.log 2>>${G_LOGFILE} else - chmod 0644 /var/log/dmesg.log + chmod 0644 /var/log/dmesg.log 2>>${G_LOGFILE} fi if [ -x /bin/rc.modules ]; then @@ -143,12 +165,12 @@ if [ -x /bin/rc.modules ]; then fi msg info "Bringing up lo interface" -ip addr add 127.0.0.1/8 dev lo broadcast + scope host -ip link set lo up +ip addr add 127.0.0.1/8 dev lo broadcast + scope host 2>>${G_LOGFILE} +ip link set lo up 2>>${G_LOGFILE} if [ -n "${INTERFACE}" ]; then msg info "Bringing up %s" ${INTERFACE} - ip link set "${INTERFACE}" up + ip link set "${INTERFACE}" up 2>>${G_LOGFILE} fi service start all @@ -160,7 +182,12 @@ fi :>/var/run/utmp -unset PATH +unset PATH G_LOGFILE + +printf "%s: Boot finished at %s, spawning gettys.\n" $0 "$(date)" \ + >>/tmp/boot.log +mv /tmp/boot.log /var/log/ +chmod 0600 /var/log/boot.log echo for n in 1 2 3 4; do diff --git a/lib/fun.sh b/lib/fun.sh @@ -371,20 +371,18 @@ mkpk() sh else legalfiles= - [ -e LEGAL* ] && legalfiles=LEGAL - [ -e LICENSE* ] && legalfiles+=' LICENSE' - [ -e License* ] && legalfiles+=' License' - [ -e Artistic* ] && legalfiles+=' Artistic' - [ -e COPYING* ] && legalfiles+=' COPYING' - [ -e Copying* ] && legalfiles+=' Copying' - [ -e COPYRIGHT* ] && legalfiles+=' COPYRIGHT' - [ -e doc/LEGAL* ] && legalfiles+=' doc/LEGAL' - [ -e doc/LICENSE* ] && legalfiles+=' doc/LICENSE' - [ -e doc/License* ] && legalfiles+=' doc/License' - [ -e doc/Artistic* ] && legalfiles+=' doc/Artistic' - [ -e doc/COPYING* ] && legalfiles+=' doc/COPYING' - [ -e doc/Copying* ] && legalfiles+=' doc/Copying' - [ -e doc/COPYRIGHT* ] && legalfiles+=' doc/COPYRIGHT' + for path in \ + LEGAL LICENSE License Artistic \ + COPYING Copying COPYRIGHT \ + doc/LEGAL doc/LICENSE doc/License doc/Artistic \ + doc/COPYING doc/Copying doc/COPYRIGHT + do + if [ $(find . -path "./${path}*" 2>/dev/null | \ + wc -l) -gt 0 ] + then + legalfiles+=" ${path}" + fi + done if [ -n "${legalfiles}" ]; then check_dir ../build/${G_LGL}/${pkg} diff --git a/lib/pkgs.tsv b/lib/pkgs.tsv @@ -5,16 +5,20 @@ git+https://git.sr.ht/~strahinja/svc svc-20220720 git+https://github.com/cpeuvrel/usleep-aur usleep-20220718 git+https://github.com/mirbsd/mksh mksh-20220709 git+https://github.com/onetrueawk/awk awk-20220709 +git://git.2f30.org/pass pass-20220723 git://git.2f30.org/sdhcp sdhcp-20220716 git://git.suckless.org/9base 9base-20220706 -git://git.suckless.org/sbase sbase-20220709 git://git.suckless.org/farbfeld farbfeld-20220722 +git://git.suckless.org/sbase sbase-20220709 git://git.suckless.org/sinit sinit-20220713 git://git.suckless.org/smdev smdev-20220715 git://git.suckless.org/ubase ubase-20220709 git://oldgit.suckless.org/sup sup-20220718 +git://r-36.net/nldev nldev-20220723 +git://r-36.net/nlmon nlmon-20220723 git://r-36.net/rfkilld rfkilld-20220722 git://repo.or.cz/tinycc.git tinycc-20220708 +http://mama.indstate.edu/users/ice/tree/src/tree-2.0.2.tgz bc4b2e2c8726c6156d52a00b52de6b1d http://www.jimpryor.net/linux/releases/dcron-4.5.tar.gz 078833f3281f96944fc30392b1888326 http://www.nasm.us/pub/nasm/releasebuilds/2.15.05/nasm-2.15.05.tar.xz 1c9802446d7341c41c21eb98c7859064 https://astron.com/pub/file/file-5.41.tar.gz 18233bb0a0089dfdc7dfbc93b96f231b @@ -50,11 +54,14 @@ https://ftp.gnu.org/gnu/groff/groff-1.22.4.tar.gz 08fb04335e2f5e73f23ea4c3adbf0 https://ftp.gnu.org/gnu/gzip/gzip-1.12.tar.xz 9608e4ac5f061b2a6479dc44e917a5db https://ftp.gnu.org/gnu/help2man/help2man-1.49.2.tar.xz 0372898fbf054140d62385a79c5855f4 https://ftp.gnu.org/gnu/inetutils/inetutils-2.1.tar.xz 4e7676d1980e57c7df665e5c5c3c1047 +https://ftp.gnu.org/gnu/libtasn1/libtasn1-4.18.0.tar.gz 8203e72a2c0390515410b2ea2c032f04 https://ftp.gnu.org/gnu/libtool/libtool-2.4.6.tar.xz 1bfb9b923f2c1339b4d2ce1807064aa5 +https://ftp.gnu.org/gnu/libunistring/libunistring-1.0.tar.xz 88752c7859212f9c7a0f6cbf7a273535 https://ftp.gnu.org/gnu/m4/m4-1.4.19.tar.xz 0d90823e1426f1da2fd872df0311298d https://ftp.gnu.org/gnu/make/make-4.3.tar.gz fc7a67ea86ace13195b0bce683fd4469 https://ftp.gnu.org/gnu/mpc/mpc-1.2.1.tar.gz libmpc-1.2.1.tar.gz 9f16c976c25bb0f76b50be749cd7a3a8 https://ftp.gnu.org/gnu/mpfr/mpfr-4.1.0.tar.xz libmpfr-4.1.0.tar.xz bdd3d5efba9c17da8d83a35ec552baef +https://ftp.gnu.org/gnu/nettle/nettle-3.8.tar.gz 77eca50d6bb7c6ed34275466f669f62e https://ftp.gnu.org/gnu/patch/patch-2.7.6.tar.xz 78ad9937e4caadcba1526ef1853730d5 https://ftp.gnu.org/gnu/readline/readline-8.1.tar.gz e9557dd5b1409f5d7b37ef717c64518e https://ftp.gnu.org/gnu/sed/sed-4.8.tar.xz 6d906edfdb3202304059233f51f9a71d @@ -80,6 +87,7 @@ https://github.com/libffi/libffi/releases/download/v3.4.2/libffi-3.4.2.tar.gz 2 https://github.com/martanne/vis/releases/download/v0.7/vis-0.7.tar.gz a45ba03d1fa4785ee5693f9619f22e85 https://github.com/mesonbuild/meson/releases/download/0.61.3/meson-0.61.3.tar.gz 8998d77313d753a0c474d9bdf1738b2e https://github.com/michaelforney/samurai/releases/download/1.2/samurai-1.2.tar.gz 3ad6771de19a93660fdb36dc67687727 +https://github.com/p11-glue/p11-kit/releases/download/0.24.1/p11-kit-0.24.1.tar.xz 67b2539bdca6b4bedaeecc12864d2796 https://github.com/pullmoll/musl-fts/archive/v1.2.7.tar.gz musl-fts-1.2.7.tar.gz bce0b5de0cf2519a74fbfacead60369d https://github.com/pullmoll/musl-obstack/archive/v1.1.tar.gz musl-obstack-1.1.tar.gz 185975cc117dba8e6158cce847ba44d5 https://github.com/rhboot/efibootmgr/archive/17.tar.gz efibootmgr-17.tar.gz 6ae315936d9bc8613b3a4cb8a4064128 @@ -91,6 +99,14 @@ https://github.com/tmux/tmux/releases/download/3.3a/tmux-3.3a.tar.gz 8eee5883b9 https://github.com/util-linux/util-linux/archive/refs/tags/v2.38.tar.gz util-linux-2.38.tar.gz d6f945e504db53c9cdea43a38c226d94 https://github.com/westes/flex/releases/download/v2.6.4/flex-2.6.4.tar.gz 2882e3179748cc9f9c23ec593d6adc8d https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.0.6.tar.gz zlib-ng-2.0.6.tar.gz 4ba0da231291632799948c5568906ce4 +https://gnupg.org/ftp/gcrypt/gnupg/gnupg-2.3.7.tar.bz2 1c6a6722b9cececcf10ca4e24106e34b +https://gnupg.org/ftp/gcrypt/gpgme/gpgme-1.17.1.tar.bz2 4d3c7699e1cdd4095d103f7a6833ae3a +https://gnupg.org/ftp/gcrypt/libassuan/libassuan-2.5.5.tar.bz2 7194453152bb67e3d45da698762b5d6f +https://gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.10.1.tar.bz2 8fadbe1fddafa341dce5ef3869f70e25 +https://gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.45.tar.bz2 3bb15e0c29d3a680db7cef15143615e1 +https://gnupg.org/ftp/gcrypt/libksba/libksba-1.6.0.tar.bz2 d333b2e1381068d4f9a328240f062f0f +https://gnupg.org/ftp/gcrypt/npth/npth-1.6.tar.bz2 375d1a15ad969f32d25f1a7630929854 +https://gnupg.org/ftp/gcrypt/pinentry/pinentry-1.2.0.tar.bz2 32e09a982711d6e705f9d89020424c2d https://invisible-island.net/archives/byacc/byacc-20220128.tgz c861b313fb59857a5ca3475ce9d62c4e https://invisible-island.net/archives/reflex/reflex-20210808.tgz 31ed4340e8b636cb2c1de2ad378a14e9 https://launchpad.net/intltool/trunk/0.51.0/+download/intltool-0.51.0.tar.gz 12e517cac2b57a0121cda351570f1e63 @@ -109,6 +125,7 @@ https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz 67e051268d0c475ea773822f750 https://tukaani.org/xz/xz-5.2.5.tar.xz aa1621ec7013a19abab52a8aff04fe5b https://www.cairographics.org/releases/pixman-0.40.0.tar.gz 73858c0862dd9896fb5f62ae267084a4 https://www.cpan.org/src/5.0/perl-5.32.1.tar.xz 7f104064b906ad8c7329ca5e409a32d7 +https://www.gnupg.org/ftp/gcrypt/gnutls/v3.7/gnutls-3.7.2.tar.xz 95c32a1af583ecfcb280648874c0fbd9 https://www.greenwoodsoftware.com/less/less-590.tar.gz f029087448357812fba450091a1172ab https://www.iana.org/time-zones/repository/releases/tzcode2022a.tar.gz fdc790effd7b01d29837fb27b3e81672 https://www.iana.org/time-zones/repository/releases/tzdata2022a.tar.gz 081662184f3b902f8e5d96816568432e diff --git a/pat/gnupg-alpine/0001-Include-sys-select.h-for-FD_SETSIZE.patch b/pat/gnupg-alpine/0001-Include-sys-select.h-for-FD_SETSIZE.patch @@ -0,0 +1,31 @@ +From d2f3053e156a8dfc3e2e7f8fa814f671d851b26f Mon Sep 17 00:00:00 2001 +From: Natanael Copa <ncopa@alpinelinux.org> +Date: Fri, 4 Jul 2014 08:15:21 +0000 +Subject: [PATCH] Include sys/select.h for FD_SETSIZE + +This fixes the following compile error with musl libc: +watchgnupg.c:225:18: error: 'FD_SETSIZE' undeclared (first use in this +function) + else if (fd >= FD_SETSIZE) + ^ + +Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> +--- + tools/watchgnupg.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/tools/watchgnupg.c b/tools/watchgnupg.c +index 4f4d54d..7aede22 100644 +--- a/tools/watchgnupg.c ++++ b/tools/watchgnupg.c +@@ -28,6 +28,7 @@ + #include <stdarg.h> + #include <assert.h> + #include <unistd.h> ++#include <sys/select.h> + #include <sys/socket.h> + #include <sys/un.h> + #include <netinet/in.h> +-- +2.0.1 +