galeb

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

чување ad58fe504ceec846c125970b652a2055bb5dfd92
родитељ 192617f4dc9abeaa3c556a52b15ae030f711baf6
Аутор: Страхиња Радић <contact@strahinja.org>
Датум:   Tue, 19 Jul 2022 12:59:00 +0200

Add table; fixes related to svc and initscripts

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

Diffstat:
M02-chroot.sh | 3+++
M03-packages.sh | 129+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------
MBUGS | 4++--
MFAQ | 12++++++++----
MTODO | 25++++++++++++++-----------
Mfil/rc.d/g_fun.sh | 2+-
Afil/rc.d/logout | 3+++
Mfil/rc.d/profile | 9++++++---
Mfil/rc.d/rc.init | 9+++++----
Mfil/rc.d/rc.shutdown | 2+-
Mfil/svc.d/avail/crond | 0
Afil/svc.d/avail/metalog | 86+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afil/svc.d/avail/sdhcp | 86+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afil/svc.d/default/metalog | 2++
Afil/svc.d/default/sdhcp | 2++
Mlib/createlinks | 3+++
Mlib/dirs.tsv | 4++--
Mlib/pkgs.tsv | 3++-
Mlib/symlinks.tsv | 1+
Msrc/remountroot.c | 10++++++++--
измењених датотека: 20, додавања: 339(+), брисања: 56(-)

diff --git a/02-chroot.sh b/02-chroot.sh @@ -122,6 +122,7 @@ cp_or_fail ${WD}/src/remountroot.c ${G_SRC}/galeb-utils-20220717/remountroot.c cp_or_fail ${WD}/src/umountall.c ${G_SRC}/galeb-utils-20220717/umountall.c cp_or_fail ${WD}/${FLD}/rc.d/profile ${GR}/etc/profile.final +cp_or_fail ${WD}/${FLD}/rc.d/logout ${GR}/etc/logout cp_or_fail ${WD}/${FLD}/rc.d/mkshrc ${GR}/etc/mkshrc cp_or_fail ${WD}/${FLD}/rc.d/rc.conf ${GR}/etc/rc.conf cp_or_fail ${WD}/${FLD}/rc.d/rc.init ${GR}/bin/rc.init @@ -158,6 +159,8 @@ msg info "Creating symlinks" msg info "Setting permissions" ./lib/setperms +chmod 755 ${GR}/bin/svc.d/avail/* + msg info "Cleaning up" ./lib/rmfiles 02-chroot.sh-end diff --git a/03-packages.sh b/03-packages.sh @@ -25,8 +25,6 @@ fi export JN=-j1 -cat /etc/issue - totalsteps=1 step=1 @@ -1896,8 +1894,9 @@ fi end_substep begin_substep autoconf-archive-2022.02.11 -if [ -x /share/aclocal/ax_zoneinfo.m4 ]; then - msg info "%s exists, skipping %s" /share/aclocal/ax_zoneinfo.m4 ${pkg} +if [ -e /sucks/share/aclocal/ax_absolute_header.m4 ]; then + msg info "%s exists, skipping %s" \ + /sucks/share/aclocal/ax_absolute_header.m4 ${pkg} elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then unpack_pkg ${pkg} / else @@ -2352,8 +2351,8 @@ fi end_substep begin_substep ca-certificates-20211016 -if [ -e /bin/ca-certificates ]; then - msg info "%s exists, skipping %s" /bin/ca-certificates ${pkg} +if [ -e /bin/update-ca-certificates ]; then + msg info "%s exists, skipping %s" /bin/update-ca-certificates ${pkg} elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then unpack_pkg ${pkg} / mkdir -p /etc/ssl/certs @@ -2398,6 +2397,7 @@ mkpk_install() make ${JN} || exit 1 make install + /${TLD}/bin/install -Dm644 -v sbin/update-ca-certificates.8 \\ ../build/share/man/man8/update-ca-certificates.8 /${TLD}/bin/mv -v ../build/share/ca-certificates/mozilla/* \\ @@ -2406,7 +2406,8 @@ mkpk_install() /${TLD}/bin/find . -name '*.crt' | sort | cut -b3- > \\ /build/etc/ca-certificates.conf /${TLD}/bin/sed -i -e 's,openssl rehash,openssl certhash,g' \\ - /build/bin/update-ca-certificates + -e 's,--tmpdir,-p /tmp,g' \\ + /build/bin/update-ca-certificates /${TLD}/bin/ln -sv /etc/ssl/certs/ca-certificates.crt \\ /build/etc/ssl/certs.pem @@ -2422,8 +2423,8 @@ fi end_substep begin_substep curl-7.84.0 -if [ -e /bin/curl ]; then - msg info "%s exists, skipping %s" /bin/curl ${pkg} +if [ -e /sucks/bin/curl ]; then + msg info "%s exists, skipping %s" /sucks/bin/curl ${pkg} elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then unpack_pkg ${pkg} / else @@ -3177,8 +3178,6 @@ mkpk_install() FALLBACKVER=${pkg##*-} PREFIX=/build export SLED_CC FALLBACKVER PREFIX - printf "SLED_CC=[%s] FALLBACKVER=[%s] PREFIX=[%s]\n" "\${SLED_CC}" \ - "\${FALLBACKVER}" "\${PREFIX}" if [ ! -e do.orig ]; then cp do do.orig @@ -3195,8 +3194,8 @@ fi end_substep begin_substep dcron-4.5 -if [ -x /bin/cron ]; then - msg info "%s exists, skipping %s" /bin/cron ${pkg} +if [ -x /bin/crond ]; then + msg info "%s exists, skipping %s" /bin/crond ${pkg} elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then unpack_pkg ${pkg} / else @@ -3236,9 +3235,48 @@ mkpk_install() fi end_substep +begin_substep dosfstools-4.2 +if [ -x /bin/fsck.vfat ]; then + msg info "%s exists, skipping %s" /bin/fsck.vfat ${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 -static --static -fcommon' + LDFLAGS='-static --static -fcommon -s' + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + ./configure --prefix=/ \\ + --enable-compat-symlinks \\ + --mandir=/share/man \\ + --docdir=/share/doc/${pkg} || exit 1 + + make ${JN} || exit 1 + make install || exit 1 +} +! + mkpk ${pkg} + remove_dir ${G_SRC}/${pkg} + unpack_pkg ${pkg} / + ) || exit 1 +fi +end_substep + begin_substep git-2.37.1 -if [ -x /bin/git ]; then - msg info "%s exists, skipping %s" /bin/git ${pkg} +if [ -x /sucks/bin/git ]; then + msg info "%s exists, skipping %s" /sucks/bin/git ${pkg} elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then unpack_pkg ${pkg} / else @@ -3514,8 +3552,9 @@ fi end_substep begin_substep pcre2-10.39 -if [ -x /sucks/lib/libpcre2.so ]; then - msg info "%s exists, skipping %s" /sucks/lib/libpcre2.so ${pkg} +if [ -x /sucks/lib/libpcre2-32.so.0.10.4 ]; then + msg info "%s exists, skipping %s" /sucks/lib/libpcre2-32.so.0.10.4 \ + ${pkg} elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then unpack_pkg ${pkg} / else @@ -3559,8 +3598,8 @@ fi end_substep begin_substep metalog-20220214 -if [ -x /bin/metalog ]; then - msg info "%s exists, skipping %s" /bin/metalog ${pkg} +if [ -x /sucks/sbin/metalog ]; then + msg info "%s exists, skipping %s" /sucks/sbin/metalog ${pkg} elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then unpack_pkg ${pkg} / else @@ -3633,6 +3672,45 @@ mkpk_install() fi end_substep +begin_substep table-0.6.3 +if [ -x /bin/table ]; then + msg info "%s exists, skipping %s" /bin/table ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + remove_dir ${G_SRC}/${pkg} + extract_pkg ${G_SRC} table-v0.6.3 ${pkg}.tar.gz ${pkg} + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + TABLE_CC='tcc -Os -static -fcommon' + FALLBACKVER=${pkg##*-} + PREFIX=/build + export TABLE_CC FALLBACKVER PREFIX + + if [ ! -e do.orig ]; then + cp do do.orig + /${TLD}/bin/sed -i -e "s,\\<xargs\\>,/${TLD}/bin/xargs,g" do + fi + patch -Np1 -i tcc-unicode-string-literals.patch + ./do -c install +} +! + mkpk ${pkg} + remove_dir ${G_SRC}/${pkg} + unpack_pkg ${pkg} / + ) || exit 1 +fi +end_substep + begin_substep texinfo-6.8 if [ -x /sucks/bin/texi2dvi ]; then msg info "%s exists, skipping %s" /sucks/bin/texi2dvi ${pkg} @@ -3726,7 +3804,7 @@ mkpk_install() PREFIX=/build/bin export CFLAGS LDFLAGS DESTDIR - make ${JN} || exit 1 + make ${JN} CFLAGS="\${CFLAGS}" LDFLAGS="\${LDFLAGS}" || exit 1 make install } ! @@ -4128,12 +4206,10 @@ mkpk_name() mkpk_install() { - AR=ar - CC=tcc - CFLAGS='-static -fcommon' + CFLAGS='-Os -static -fcommon' LDFLAGS='-static -fcommon' LDLIBS=-lc - export AR CC CFLAGS LDFLAGS LDLIBS + export CFLAGS LDFLAGS LDLIBS if [ ! -e config.mk.orig ]; then cp config.mk config.mk.orig @@ -4143,7 +4219,7 @@ mkpk_install() fi make clean - make ${JN} || exit 1 + make ${JN} CFLAGS="\${CFLAGS}" LDFLAGS="\${LDFLAGS}" || exit 1 make DESTDIR=/build install } ! @@ -4379,6 +4455,9 @@ if [ ! -x /bin/umountall ]; then ( cd_or_fail ${G_SRC}/${pkg} + remove_file remountroot + remove_file umountall + cc -Os -pipe -static --static -fcommon -o remountroot \ remountroot.c || exit 1 cc -Os -pipe -static --static -fcommon -o umountall \ diff --git a/BUGS b/BUGS @@ -7,8 +7,8 @@ Known bugs/Errata - mandoc See lib/impostors for a current report when building (needs table(1)). -* utmp is nonfunctional as I have been reluctant to include skalibs. That might - change in a future version of Galeb. +* utmp/wtmp is nonfunctional as I have been reluctant to include skalibs. That + might change in a future version of Galeb. * Once you finish compiling and installing everything, the build scripts won't be fully functional from that point on, due to sbase/ubase/9base utilities diff --git a/FAQ b/FAQ @@ -9,7 +9,7 @@ A: [gɑ:leb]. Q: Is this Linux? GNU/Linux? Something else? A: Kernel = Linux. libc = musl-libc. coreutils = suckless core. Init system - = suckless init. Process supervisor = suckless svc, with modifications by + = suckless init. Process supervisor = suckless svc, heavily modified by me.The rest are GNU or other utilities which weren't covered by the above. Thus, "suckless/musl/Linux", or "musl/Linux". It is not wrong to throw GNU in the name as well, but this system is definitely different than something like @@ -22,11 +22,11 @@ Q: What if I don't want to read and/or type commands? A: Go back to "ricing" Ubuntu. Nothing to see here. Q: Halp! This doesn't work! How to fix? -A: RTFM/search the Web. Apply logic. Otherwise, see above. +A: RTFM. Search the Web. Apply logic. Otherwise, see above. Q: No thanks, I will instead go back to another distro or Windoze. But won't that hurt your business? -A: What business? Use whatever software you like, or don't. Either way works. +A: What business? Use whatever software you like, or don't, it's up to you. Q: How do I install a package? A: cd / && xz -dc /pkg/some_pkg.tar.xz | tar -xf - @@ -35,6 +35,10 @@ Q: How do I uninstall a package? A: cd / && xz -dc /pkg/some_pkg.tar.xz | tar -tf - | xargs rm Remove unwanted empty directories manually. +Q: How do I find a package the $file belongs to? +A: for pkg in /pkg/*.tar.xz; do if xz -dc $pkg | tar -tf - | \ + grep $file >/dev/null; then echo $pkg; fi; done + Q: What license applies here? A: License for each individual program is its own. License for files in this repository is GPLv3, unless otherwise noted. @@ -44,7 +48,7 @@ A: License for each individual program is its own. License for files in this In contrast, glibc (not used here) is mainly licensed under the LGPL v2.1+, which requires software using it to provide means for it to be potentially - combined with modified versions of glibc (eg. have *.o files and Makefiles or + combined with modified versions of glibc (eg. have *.o files and makefiles or just full source code available[1]). Scripts used to build the binary form of Galeb are publicly available, and diff --git a/TODO b/TODO @@ -2,41 +2,44 @@ TODO ==== [~] Fix init scripts - [x] shutdown, poweroff, reboot + [ ] figure out how to bring down all services cleanly as a regular user + (svc group?) [ ] git://r-36.net/stali-init [ ] http://r-36.net/scm/ [ ] https://codemadness.org/git/ [ ] https://git.2f30.org/ [ ] https://git.suckless.org/ - [ ] Add sdhcp as oneshot + [x] shutdown, poweroff, reboot + [x] Add sdhcp as ~oneshot~ longrun [x] hwclock on shutdown [x] shutdown as regular user (remount / ro) +[ ] Add -h to free + [~] Add packages - [x] Add curl (needed for git?) - needed - [ ] git://git.suckless.org/utmp [ ] git://r-36.net/nldev [ ] git://r-36.net/nlmon [ ] git://r-36.net/rfkilld - [ ] fsck.vfat [ ] Add ssh(d) - [ ] Add sup + [x] fsck.vfat + [x] Add curl (needed for git?) - needed + [/] git://git.suckless.org/utmp - n/a here + [/] Add sup - this should be customized by the user [x] Add ~syslog-ng~ metalog [x] Add git - [~] Add table, text-utils + [x] Add table, ~text-utils~ [x] Add sdhcp [x] Test sdhcp [/] ~Add snarf~ - doesn't support HTTPS [/] Replace with axel if not installing curl [x] Add svc -[ ] Add -h to free - -[~] Fix dcron - [ ] crontab -e doesn't respect EDITOR? +[x] Fix dcron + [x] crontab -e doesn't respect EDITOR? [x] Linux [x] /proc/sys/kernel/hotplug/create - Add hotplugging to Linux + - Still doesn't make available the required pseudofile [x] Remove ram disks from Linux [x] Fix filesystem diff --git a/fil/rc.d/g_fun.sh b/fil/rc.d/g_fun.sh @@ -43,7 +43,7 @@ msg() log=0 newline=0;; warn) icon_plain="=W=" - icon="${bgyellow}${bold}${faint}${black}${icon_plain}";; + icon="${bgyellow}${black}${icon_plain}";; *) ;; esac printf "%s %s " "${icon}" ${tstamp} diff --git a/fil/rc.d/logout b/fil/rc.d/logout @@ -0,0 +1,3 @@ +#!/bin/sh + +clear diff --git a/fil/rc.d/profile b/fil/rc.d/profile @@ -4,7 +4,7 @@ EDITOR=/bin/sledv LC_ALL= LANG=C.UTF-8 PATH=/local/bin:/bin:/sucks/bin:/plan9/bin -export LC_ALL LANG PATH +export EDITOR LC_ALL LANG PATH for script in /etc/profile.d/*; do [ -x ${script} ] && . ${script} @@ -18,4 +18,8 @@ lc() if [ -e /etc/mkshrc ]; then . /etc/mkshrc -fi -\ No newline at end of file +fi + +trap '[ -e ${HOME}/.mksh_logout ] && . ${HOME}/.mksh_logout;'\ +' [ -e /etc/logout ] && . /etc/logout; exit' \ + HUP INT QUIT TERM EXIT KILL diff --git a/fil/rc.d/rc.init b/fil/rc.d/rc.init @@ -32,7 +32,8 @@ mount -o ro,remount / msg info "Running smdev" smdev -s -echo /bin/smdev >/proc/sys/kernel/hotplug +# Doesn't work (because of newer Linux?) +#echo /bin/smdev >/proc/sys/kernel/hotplug cd /dev ln -sf /proc/self/fd/0 stdin @@ -42,8 +43,9 @@ ln -sf /proc/self/fd fd cd - >/dev/null msg info "Checking filesystems" -fsck -ATa +fsckout=$(fsck -ATa 2>&1) if [ $? -eq 1 ]; then + echo "${fsckout}" msg err "Filesystem errors, fix manually" sh msg warn "Rebooting" @@ -58,8 +60,7 @@ mount -a ln -sf /proc/mounts /etc/mtab -msg info "Starting metalog" -/sucks/bin/metalog -B -g metalog +service start metalog if [ -n "${FONT}" ]; then msg info "Setting font" diff --git a/fil/rc.d/rc.shutdown b/fil/rc.d/rc.shutdown @@ -57,7 +57,7 @@ msg info "Sending processes the KILL signal..." killall5 -s KILL msg info "Remounting / as read-only" -remountroot +remountroot -q msg info "Unmounting filesystems" umountall -q diff --git a/fil/svc.d/avail/crond b/fil/svc.d/avail/crond diff --git a/fil/svc.d/avail/metalog b/fil/svc.d/avail/metalog @@ -0,0 +1,86 @@ +#!/bin/sh + +svc=metalog +svcbin=/sucks/bin/metalog + +. /bin/svc.d/default/${svc} + +if [ -z "${PIDFILE}" ]; then + exit 2 +fi + +case $1 in + -e) if [ ! -e "${PIDFILE}" ]; then + exit 2 + elif [ -z "$(ps -ef | awk '{print $2}' | \ + grep $(<"${PIDFILE}"))" ]; then + exit 2 + fi;; + -s) ${svcbin} ${PARAMS} >/dev/null 2>&1 & + tries=4 + childpid=$(ps -ef | \ + awk '{if ($3 = "1" && match($8, "'\ +${svcbin//\//\\\/}'")) print $2}') + while [ -z "${childpid}" ] + do + /bin/usleep 100000 + tries=$((tries-1)) + if [ "${tries}" -eq 0 ]; then + exit 2 + fi + childpid=$(ps -ef | \ + awk '{if ($3 = "1" && match($8, "'\ +${svcbin//\//\\\/}'")) print $2}') + done + echo "${childpid}" > "${PIDFILE}";; + -k) if [ ! -e "${PIDFILE}" ]; then + exit 1 + elif [ -z "$(ps -ef | awk '{print $2}' | \ + grep $(<"${PIDFILE}"))" ] + then + rm "${PIDFILE}" + exit 1 + else + kill $(<"${PIDFILE}") >/dev/null 2>&1 + if [ -n "$(ps -ef | awk '{print $2}' | \ + grep $(<"${PIDFILE}"))" ] + then + pkill -9 $(<"${PIDFILE}") >/dev/null 2>&1 \ + || exit 2 + fi + rm "${PIDFILE}" + fi;; + -r) if [ -e "${PIDFILE}" ]; then + if [ -z "$(ps -ef | awk '{print $2}' | \ + grep $(<"${PIDFILE}"))" ] + then + rm "${PIDFILE}" + else + kill $(<"${PIDFILE}") >/dev/null 2>&1 + if [ -n "$(ps -ef | awk '{print $2}' | \ + grep $(<"${PIDFILE}"))" ] + then + kill -9 $(<"${PIDFILE}") \ + >/dev/null 2>&1 || exit 2 + fi + rm "${PIDFILE}" + fi + fi + ${svcbin} ${PARAMS} >/dev/null 2>&1 & + tries=4 + childpid=$(ps -ef | \ + awk '{if ($3 = "1" && match($8, "'\ +${svcbin//\//\\\/}'")) print $2}') + while [ -z "${childpid}" ] + do + /bin/usleep 100000 + tries=$((tries-1)) + if [ "${tries}" -eq 0 ]; then + exit 2 + fi + childpid=$(ps -ef | \ + awk '{if ($3 = "1" && match($8, "'\ +${svcbin//\//\\\/}'")) print $2}') + done + echo "${childpid}" > "${PIDFILE}";; +esac diff --git a/fil/svc.d/avail/sdhcp b/fil/svc.d/avail/sdhcp @@ -0,0 +1,86 @@ +#!/bin/sh + +svc=sdhcp +svcbin=/bin/sdhcp + +. /bin/svc.d/default/${svc} + +if [ -z "${PIDFILE}" ]; then + exit 2 +fi + +case $1 in + -e) if [ ! -e "${PIDFILE}" ]; then + exit 2 + elif [ -z "$(ps -ef | awk '{print $2}' | \ + grep $(<"${PIDFILE}"))" ]; then + exit 2 + fi;; + -s) ${svcbin} ${PARAMS} >/dev/null 2>&1 & + tries=4 + childpid=$(ps -ef | \ + awk '{if ($3 = "1" && match($8, "'\ +${svcbin//\//\\\/}'")) print $2}') + while [ -z "${childpid}" ] + do + /bin/usleep 100000 + tries=$((tries-1)) + if [ "${tries}" -eq 0 ]; then + exit 2 + fi + childpid=$(ps -ef | \ + awk '{if ($3 = "1" && match($8, "'\ +${svcbin//\//\\\/}'")) print $2}') + done + echo "${childpid}" > "${PIDFILE}";; + -k) if [ ! -e "${PIDFILE}" ]; then + exit 1 + elif [ -z "$(ps -ef | awk '{print $2}' | \ + grep $(<"${PIDFILE}"))" ] + then + rm "${PIDFILE}" + exit 1 + else + kill $(<"${PIDFILE}") >/dev/null 2>&1 + if [ -n "$(ps -ef | awk '{print $2}' | \ + grep $(<"${PIDFILE}"))" ] + then + pkill -9 $(<"${PIDFILE}") >/dev/null 2>&1 \ + || exit 2 + fi + rm "${PIDFILE}" + fi;; + -r) if [ -e "${PIDFILE}" ]; then + if [ -z "$(ps -ef | awk '{print $2}' | \ + grep $(<"${PIDFILE}"))" ] + then + rm "${PIDFILE}" + else + kill $(<"${PIDFILE}") >/dev/null 2>&1 + if [ -n "$(ps -ef | awk '{print $2}' | \ + grep $(<"${PIDFILE}"))" ] + then + kill -9 $(<"${PIDFILE}") \ + >/dev/null 2>&1 || exit 2 + fi + rm "${PIDFILE}" + fi + fi + ${svcbin} ${PARAMS} >/dev/null 2>&1 & + tries=4 + childpid=$(ps -ef | \ + awk '{if ($3 = "1" && match($8, "'\ +${svcbin//\//\\\/}'")) print $2}') + while [ -z "${childpid}" ] + do + /bin/usleep 100000 + tries=$((tries-1)) + if [ "${tries}" -eq 0 ]; then + exit 2 + fi + childpid=$(ps -ef | \ + awk '{if ($3 = "1" && match($8, "'\ +${svcbin//\//\\\/}'")) print $2}') + done + echo "${childpid}" > "${PIDFILE}";; +esac diff --git a/fil/svc.d/default/metalog b/fil/svc.d/default/metalog @@ -0,0 +1,2 @@ +PARAMS="-B -g metalog" +PIDFILE=/var/run/metalog.pid diff --git a/fil/svc.d/default/sdhcp b/fil/svc.d/default/sdhcp @@ -0,0 +1,2 @@ +PARAMS="eth0" +PIDFILE=/var/run/sdhcp.pid diff --git a/lib/createlinks b/lib/createlinks @@ -35,6 +35,9 @@ do continue fi + if [ -L "${GR}${dest}" ]; then + rm "${GR}${dest}" + fi msg info "ln -sf %s %s" "${src}" "${GR}${dest}" ln -sf "${src}" "${GR}${dest}" #|| exit 1 done <${symlinkdb} diff --git a/lib/dirs.tsv b/lib/dirs.tsv @@ -1,7 +1,7 @@ Path Mode Owner Group Step /bin 0755 root root 01-cross.sh,02-chroot.sh-start -/bin/svc.d 0755 root root 02-chroot.sh-start -/bin/svc.d/run 0755 root root 02-chroot.sh-start +/bin/svc.d 0755 root root 02-chroot.sh-start +/bin/svc.d/run 0755 root root 02-chroot.sh-start /boot 0755 root root 01-cross.sh,02-chroot.sh-start /dev 0755 root root 01-cross.sh,02-chroot.sh-start /etc 0755 root root 01-cross.sh,02-chroot.sh-start diff --git a/lib/pkgs.tsv b/lib/pkgs.tsv @@ -59,10 +59,11 @@ https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.4.2.tar.gz 18aa728e7947 https://ftpmirror.gnu.org/autoconf-archive/autoconf-archive-2022.02.11.tar.xz d140e95be64f0aa7369f82e3caae4730 https://gcc.gnu.org/pub/gcc/snapshots/11-20220101/gcc-11-20220101.tar.xz 2d984314c9ad01d941358bcf3ec6b29e https://git.sr.ht/~strahinja/sled/archive/v0.10.8.tar.gz sled-0.10.8.tar.gz 2a12c7eb0e6cb4f671299acb76753986 -https://git.sr.ht/~strahinja/table/archive/v0.6.2.tar.gz table-0.6.2.tar.gz d77b956284878bb68c07d96e7efbc161 +https://git.sr.ht/~strahinja/table/archive/v0.6.3.tar.gz table-0.6.3.tar.gz 77caad9d100083dc4f975b50ff803ec4 https://github.com/Mic92/iana-etc/releases/download/20210611/iana-etc-20210611.tar.gz f2854be57fe281e3ffc7364984467d2f https://github.com/PhilipHazel/pcre2/releases/download/pcre2-10.39/pcre2-10.39.tar.bz2 4a765b1419c2e7a01263c3260abca87a https://github.com/arsv/perl-cross/releases/download/1.4/perl-cross-1.4.tar.gz 73c246c20766d027c3dc9f606418c22c +https://github.com/dosfstools/dosfstools/releases/download/v4.2/dosfstools-4.2.tar.gz 49c8e457327dc61efab5b115a27b087a https://github.com/ericonr/argp-standalone/archive/refs/tags/1.4.1.tar.gz argp-standalone-1.4.1.tar.gz 7f391d52161e7fe8e8d3df4f850bc7ee https://github.com/facebook/zstd/releases/download/v1.5.0/zstd-1.5.0.tar.gz a6eb7fb1f2c21fa80030a47993853e92 https://github.com/gavinhoward/bc/releases/download/5.0.0/bc-5.0.0.tar.xz 8345bb81c576ddfc8c27e0842370603c diff --git a/lib/symlinks.tsv b/lib/symlinks.tsv @@ -10,3 +10,4 @@ lksh /bin/sh 03-packages.sh /bin/rc.shutdown /bin/shutdown 02-chroot.sh-end /bin/rc.shutdown /bin/poweroff 02-chroot.sh-end /bin/rc.shutdown /bin/reboot 02-chroot.sh-end +/ /usr 02-chroot.sh-end diff --git a/src/remountroot.c b/src/remountroot.c @@ -1,14 +1,20 @@ #include <stdio.h> +#include <string.h> #include <sys/mount.h> static const char roottype[] = "ext4"; +static int quiet = 0; int -main() +main(int argc, char** argv) { + if (*argv[1] && !strcmp(argv[1], "-q")) + quiet = 1; + if (mount(NULL, "/", roottype, MS_REMOUNT | MS_RDONLY, NULL)) { - perror("remountroot"); + if (!quiet) + perror("remountroot"); return 1; } return 0;