galeb

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

чување 8b20e4c5522c548313b1fe0c7a5b7b7263ca1aac
родитељ 0122785adc4d88cb82cc791c7994c20d150ed608
Аутор: Страхиња Радић <contact@strahinja.org>
Датум:   Mon, 25 Jul 2022 22:14:46 +0200

Changed some mounts; gpg and pass are now static

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

Diffstat:
M02-chroot.sh | 7++++---
M03-packages.sh | 8+++++---
MFAQ | 4++++
Mfil/man/man8/galeb.8 | 9++++++---
Mfil/rc.d/rc.init | 10++++++----
Mlib/createlinks | 2+-
Mlib/dirs.tsv | 1-
Mlib/symlinks.tsv | 2++
измењених датотека: 8, додавања: 28(+), брисања: 15(-)

diff --git a/02-chroot.sh b/02-chroot.sh @@ -47,11 +47,11 @@ check_mknod ${GR}/dev/null c 1 3 -m 666 mount_or_fail -B /dev ${GR}/dev mount_or_fail -t devpts devpts ${GR}/dev/pts -o gid=5,mode=620 mount_or_fail -t proc proc ${GR}/proc -mount_or_fail -t sysfs sysfs ${GR}/sys +mount_or_fail -t sysfs sys ${GR}/sys check_dir ${GR}/sys/firmware/efi/efivars mount_or_fail -t efivarfs efivarfs ${GR}/sys/firmware/efi/efivars -mount_or_fail -t tmpfs tmpfs ${GR}/run -mount_or_fail -t tmpfs tmpfs ${GR}/tmp +mount_or_fail -t tmpfs -o nodev,nosuid,noatime,mode=0755 run ${GR}/run +mount_or_fail -t tmpfs -o nodev,nosuid,noatime,mode=1777 tmp ${GR}/tmp rm -f ${GR}/dev/random ${GR}/dev/urandom mknod -m 444 ${GR}/dev/random c 1 8 @@ -136,6 +136,7 @@ cp_or_fail ${WD}/lib/rmlist.tsv ${GR}/lib/rmlist.tsv #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}/src/gettyc ${GR}/bin/gettyc +cp_or_fail -r ${WD}/${FLD}/man/* ${GR}/share/man/ cp_or_fail ${WD}/${FLD}/rc.d/profile ${GR}/etc/profile.final cp_or_fail ${WD}/${FLD}/rc.d/mkshrc ${GR}/etc/mkshrc diff --git a/03-packages.sh b/03-packages.sh @@ -4963,6 +4963,7 @@ mkpk_install() mkdir -p /local/include ./configure --prefix=/sucks \\ + --enable-static \\ --disable-nls || exit 1 make ${JN} || exit 1 @@ -5000,7 +5001,7 @@ mkpk_install() DESTDIR=/build export CFLAGS LDFLAGS DESTDIR - ./configure --prefix=/sucks || exit 1 + ./configure --prefix=/sucks --enable-static || exit 1 make ${JN} || exit 1 make install @@ -5246,6 +5247,7 @@ mkpk_install() export CFLAGS LDFLAGS DESTDIR ./configure --prefix=/sucks \\ + --enable-static \\ --disable-gpg-test \\ --enable-languages=cl,cpp || exit 1 @@ -5323,8 +5325,8 @@ mkpk_name() mkpk_install() { - CFLAGS='-Os -pipe' - LDFLAGS='-s' + CFLAGS='-Os -pipe -static --static -fcommon' + LDFLAGS='-static --static -fcommon -s' DESTDIR=/build export CFLAGS LDFLAGS DESTDIR diff --git a/FAQ b/FAQ @@ -101,6 +101,10 @@ A: Galeb doesn't follow FHS. Instead, it builds on https://sta.li/filesystem/ * There is also /local serving the purpose of /usr/local. + * /var/run is a symlink to /run tmpfs. + + * There is also user-writeable /tmp tmpfs. + * Package sources and related files are in /src. * Compiled packages are in /pkg. diff --git a/fil/man/man8/galeb.8 b/fil/man/man8/galeb.8 @@ -30,7 +30,7 @@ Static linking, as much as possible. Simplicity. Prefer simple solutions and programs which conform to the Unix philosophy of .Do -programs which do one thing well, work with other programs and handle text +programs that do one thing well, work with other programs and handle text streams .Dc . .It @@ -52,14 +52,17 @@ adopts and extends the filesystem hierarchy of stali: .It Li /local Ta programs specific to the local system .It Li /mnt Ta mount points .It Li /pkg Ta compiled packages -.It Li /proc Ta procfs files +.It Li /proc Ta procfs +.It Li /run Ta 0755 tmpfs .It Li /sbin -> /bin Ta symlink pointing to /bin .It Li /share Ta man pages, locales, dependencies .It Li /src Ta source code .It Li /sucks Ta stuff that sucks, dynamic programs/libraries -.It Li /sys Ta sysfs files +.It Li /sys Ta sysfs +.It Li /tmp Ta user-writeable (1777) tmpfs .It Li /usr -> / Ta symlink pointing to / .It Li /var Ta spool, run, log, cache +.It Li /var/run -> /run Ta symlink pointing to /run tmpfs .El .Sh SEE ALSO .Xr service 8 , Xr svc 8 diff --git a/fil/rc.d/rc.init b/fil/rc.d/rc.init @@ -15,14 +15,14 @@ printf "${green}===( ${bold}${white}%s${norm}${green} )=== booting${norm}\n" \ 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 -mkdir -p /dev/shm +mount -n -t proc -o nosuid,noexec,nodev proc /proc +mount -n -t sysfs -o nosuid,noexec,nodev sysfs /sys mount -n -t tmpfs -o nosuid,nodev,noatime,mode=1777 tmp /tmp +mkdir -p /dev/shm 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 +mount -n -t tmpfs -o nosuid,nodev,noatime,mode=0755 run /var/run printf "%s: /tmp/boot.log created on %s\n" $0 "$(date)" >/tmp/boot.log G_LOGFILE=/tmp/boot.log @@ -181,6 +181,8 @@ if [ -x /bin/rc.local ]; then fi :>/var/run/utmp +chmod 0600 /var/run/utmp 2>>${G_LOGFILE} +chown root:utmp /var/run/utmp 2>>${G_LOGFILE} unset PATH G_LOGFILE diff --git a/lib/createlinks b/lib/createlinks @@ -36,7 +36,7 @@ do fi if [ -L "${GR}${dest}" ]; then - rm "${GR}${dest}" + remove_file "${GR}${dest}" || continue fi msg info "ln -sf %s %s" "${src}" "${GR}${dest}" ln -sf "${src}" "${GR}${dest}" #|| exit 1 diff --git a/lib/dirs.tsv b/lib/dirs.tsv @@ -31,7 +31,6 @@ Path Mode Owner Group Step /var 0755 root root 01-cross.sh,02-chroot.sh-start /var/cache 0755 root root 01-cross.sh,02-chroot.sh-start /var/log 0755 root root 01-cross.sh,02-chroot.sh-start -/var/run 0755 root root 01-cross.sh,02-chroot.sh-start /var/spool 0755 root root 01-cross.sh,02-chroot.sh-start /var/spool/cron/crontabs 0755 root root 01-cross.sh,02-chroot.sh-start /var/spool/cron/cronstamps 0755 root root 01-cross.sh,02-chroot.sh-start diff --git a/lib/symlinks.tsv b/lib/symlinks.tsv @@ -3,6 +3,7 @@ bin /sbin 01-cross.sh bin /local/sbin 01-cross.sh bin /sucks/sbin 01-cross.sh . /usr 01-cross.sh +../run /var/ 01-cross.sh ../../share/locale /sucks/share/locale 03-packages.sh lksh /bin/sh 03-packages.sh /proc/self/mounts /etc/mtab 03-packages.sh @@ -11,3 +12,4 @@ lksh /bin/sh 03-packages.sh /bin/rc.shutdown /bin/poweroff 02-chroot.sh-end /bin/rc.shutdown /bin/reboot 02-chroot.sh-end / /usr 02-chroot.sh-end +/run /var/run 02-chroot.sh-end