some improvements

This commit is contained in:
illiliti 2020-03-08 06:29:14 +03:00
parent 15457b48be
commit 0c976787c7
2 changed files with 22 additions and 14 deletions

View File

@ -95,7 +95,7 @@ prepare_environment() {
elif [ -d /usr/share/tinyramfs ]; then elif [ -d /usr/share/tinyramfs ]; then
filesdir="/usr/share/tinyramfs" filesdir="/usr/share/tinyramfs"
elif [ -d ./usr/share/tinyramfs ]; then elif [ -d ./usr/share/tinyramfs ]; then
filesdir="./usr/share/initramfs" filesdir="./usr/share/tinyramfs"
else else
msg panic "failed to find required files" msg panic "failed to find required files"
fi fi
@ -236,11 +236,8 @@ install_luks() {
install_driver "$_driver" install_driver "$_driver"
done done
# avoid "locking directory missing" warning # avoid libgcc_s.so.1 missing error
# message and libgcc_s.so.1 missing error
# see https://bugs.archlinux.org/task/56771 # see https://bugs.archlinux.org/task/56771
mkdir -p "${workdir}/run/cryptsetup"
[ -e /usr/lib/libgcc_s.so.1 ] && [ -e /usr/lib/libgcc_s.so.1 ] &&
install_library /usr/lib/libgcc_s.so.1 install_library /usr/lib/libgcc_s.so.1

View File

@ -40,10 +40,25 @@ parse_cmdline() {
done done
} }
mount_pseudofs() { prepare_environment() {
mount -t proc none /proc /sbin/busybox --install -s
mount -t sysfs none /sys
mount -t devtmpfs none /dev . /config || panic "failed to source config"
mount -t proc -o nosuid,noexec,nodev proc /proc
mount -t sysfs -o nosuid,noexec,nodev sys /sys
mount -t tmpfs -o mode=0755,nosuid,nodev run /run
mount -t devtmpfs -o mode=0755,noexec,nosuid dev /dev
mkdir -pm 0755 /run/cryptsetup /run/lvm /dev/pts /dev/shm
mount -t devpts -o gid=5,mode=620,noexec,nosuid devpts /dev/pts
mount -t tmpfs -o mode=1777,noexec,nosuid,nodev shm /dev/shm
ln -s /proc/self/fd /dev/fd
ln -s /proc/self/fd/0 /dev/stdin
ln -s /proc/self/fd/1 /dev/stdout
ln -s /proc/self/fd/2 /dev/stderr
} }
setup_devmgr() { setup_devmgr() {
@ -135,11 +150,7 @@ boot_system() {
panic "failed to boot system" panic "failed to boot system"
} }
/sbin/busybox --install -s prepare_environment
. /config || panic "failed to source config"
mount_pseudofs
parse_cmdline parse_cmdline
[ "$debug" = 1 ] && set -x [ "$debug" = 1 ] && set -x
setup_devmgr setup_devmgr