From 8054f60a3c798d791be0c6d66fed2b38c2ff59c5 Mon Sep 17 00:00:00 2001 From: Dor Askayo Date: Sat, 25 Dec 2021 20:17:47 +0200 Subject: [PATCH 1/3] Use existing mounts in sysc when available This would be the case when bubblewrap is used for sandboxing the bootstrap. --- sysc/run.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sysc/run.sh b/sysc/run.sh index c8fe16ea..0389a8bb 100755 --- a/sysc/run.sh +++ b/sysc/run.sh @@ -18,11 +18,11 @@ create_fhs() { for d in bin lib sbin; do ln -s "usr/${d}" "/${d}" done - mkdir -p /etc /proc /run /sys /tmp /var - mount -t proc proc /proc - mount -t sysfs sysfs /sys + mkdir -p /etc /run /var + test -d /proc || (mkdir /proc && mount -t proc proc /proc) + test -d /sys || (mkdir /sys && mount -t sysfs sysfs /sys) # Make /tmp a ramdisk (speeds up configure etc significantly) - mount -t tmpfs tmpfs /tmp + test -d /tmp || (mkdir /tmp && mount -t tmpfs tmpfs /tmp) } populate_device_nodes "" From 507f94541982c7449b35af4652cfa55d753043d8 Mon Sep 17 00:00:00 2001 From: Dor Askayo Date: Thu, 12 May 2022 00:03:15 +0300 Subject: [PATCH 2/3] Remove /dev/null only if it's not a character device --- sysa/helpers.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sysa/helpers.sh b/sysa/helpers.sh index 45dc5e4e..d0a193fc 100755 --- a/sysa/helpers.sh +++ b/sysa/helpers.sh @@ -382,8 +382,8 @@ canonicalise_all_files_timestamp() { populate_device_nodes() { # http://www.linuxfromscratch.org/lfs/view/6.1/chapter06/devices.html mkdir -p "${1}/dev" - rm "${1}/dev/null" -f - test -c "${1}/dev/null" || mknod -m 666 "${1}/dev/null" c 1 3 + test -c "${1}/dev/null" || (rm -f "${1}/dev/null" && + mknod -m 666 "${1}/dev/null" c 1 3) test -c "${1}/dev/zero" || mknod -m 666 "${1}/dev/zero" c 1 5 test -c "${1}/dev/random" || mknod -m 444 "${1}/dev/random" c 1 8 test -c "${1}/dev/urandom" || mknod -m 444 "${1}/dev/urandom" c 1 9 From 0a98a6e13d0e623c5d41989c6f47ffb004d14941 Mon Sep 17 00:00:00 2001 From: Dor Askayo Date: Fri, 13 May 2022 12:47:07 +0300 Subject: [PATCH 3/3] Use "rm -f" in libtool to avoid an interactive prompt --- sysa/libtool-2.2.4/libtool-2.2.4.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sysa/libtool-2.2.4/libtool-2.2.4.sh b/sysa/libtool-2.2.4/libtool-2.2.4.sh index 4d3c92f7..e7dc031e 100755 --- a/sysa/libtool-2.2.4/libtool-2.2.4.sh +++ b/sysa/libtool-2.2.4/libtool-2.2.4.sh @@ -6,9 +6,9 @@ src_prepare() { default - rm libltdl/config/ltmain.sh + rm -f libltdl/config/ltmain.sh - rm doc/*.info + rm -f doc/*.info ./bootstrap }