Merge pull request #390 from Googulator/devtmpfs

Use devtmpfs, and improve finalize_fhs.sh
This commit is contained in:
fosslinux 2024-01-08 10:55:57 +00:00 committed by GitHub
commit 9ec45654cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 9 deletions

View File

@ -6,13 +6,22 @@
#
# Add the rest of the FHS that we will use and is not created pre-boot
rm -rf /sbin /usr/sbin
ln -s /usr/bin /usr/sbin
for d in bin lib sbin; do
ln -s "usr/${d}" "/${d}"
ln -s "/usr/${d}" "/${d}" || true # these might exist if rerunning
done
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)
mkdir -p /etc /run /var/log /var/lock /var/spool /var/tmp /var/cache
# can't use /dev/null before mounting /dev
mount | grep '/dev' &> /junk || (mkdir -p /dev; mount -t devtmpfs none /dev)
rm /junk &> /dev/null || true
mount | grep '/proc' &> /dev/null || (mkdir -p /proc; mount -t proc proc /proc)
mount | grep '/sys' &> /dev/null || (mkdir -p /sys; mount -t sysfs sysfs /sys)
# Make /tmp a ramdisk (speeds up configure etc significantly)
test -d /tmp || (mkdir /tmp && mount -t tmpfs tmpfs /tmp)
mount | grep '/tmp' &> /dev/null || (mkdir -p /tmp; mount -t tmpfs tmpfs /tmp)
# Add /etc/resolv.conf
echo 'nameserver 1.1.1.1' > /etc/resolv.conf
echo 'nameserver 1.1.1.1' > /etc/resolv.conf.head

View File

@ -16,7 +16,6 @@ if [ "${KERNEL_BOOTSTRAP}" = True ]; then
find / -xdev -type d -printf "dir %p %m %U %G\n" >> /initramfs.list
find / -xdev -type f -printf "file %p %p %m %U %G\n" >> /initramfs.list
find / -xdev -type l -printf "slink %p %l %m %U %G\n" >> /initramfs.list
find / -xdev -type c -or -type b -not -name "ram*" -printf "nod %p %m %U %G %y " -exec stat -c '%Hr %Lr' {} \; >> /initramfs.list
kexec-linux "/dev/ram1" "/boot/linux-4.9.10" "!$(command -v gen_init_cpio) /initramfs.list"
else
mkdir /etc

View File

@ -4,7 +4,11 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
set -ex
set -e
# mount might fail if /etc doesn't exist because of fstab and mtab
mkdir -p /dev /etc
mount -t devtmpfs none /dev &> /junk || true # no /dev/null yet
rm /junk &> /dev/null || true
# Create partition if it doesn't exist
if [ $(($(stat -c "%Lr" "/dev/${DISK}") % 8)) -eq 0 ]; then

View File

@ -118,12 +118,11 @@ improve: clean_sources
build: linux-4.9.10 ( BUILD_LINUX == True )
jump: break ( INTERNAL_CI == pass1 )
jump: linux ( CHROOT == False )
jump: move_disk ( KERNEL_BOOTSTRAP == True )
improve: finalize_fhs
improve: swap ( SWAP_SIZE != 0 )
build: musl-1.2.4
build: curl-8.5.0
improve: populate_device_nodes
jump: move_disk ( KERNEL_BOOTSTRAP == True )
improve: get_network ( CHROOT == False )
build: bash-5.2.15
build: xz-5.4.1