live-bootstrap/steps/improve/populate_device_nodes.sh

42 lines
1.7 KiB
Bash
Raw Normal View History

Remove the notion of "sys*" - This idea originates from very early in the project and was, at the time, a very easy way to categorise things. - Now, it doesn't really make much sense - it is fairly arbitary, often occuring when there is a change in kernel, but not from builder-hex0 to fiwix, and sysb is in reality completely unnecessary. - In short, the sys* stuff is a bit of a mess that makes the project more difficult to understand. - This puts everything down into one folder and has a manifest file that is used to generate the build scripts on the fly rather than using coded scripts. - This is created in the "seed" stage. stage0-posix -- (calls) --> seed -- (generates) --> main steps Alongside this change there are a variety of other smaller fixups to the general structure of the live-bootstrap rootfs. - Creating a rootfs has become much simpler and is defined as code in go.sh. The new structure, for an about-to-be booted system, is / -- /steps (direct copy of steps/) -- /distfiles (direct copy of distfiles/) -- all files from seed/* -- all files from seed/stage0-posix/* - There is no longer such a thing as /usr/include/musl, this didn't really make any sense, as musl is the final libc used. Rather, to separate musl and mes, we have /usr/include/mes, which is much easier to work with. - This also makes mes easier to blow away later. - A few things that weren't properly in packages have been changed; checksum-transcriber, simple-patch, kexec-fiwix have all been given fully qualified package names. - Highly breaking change, scripts now exist in their package directory but NOT WITH THE packagename.sh. Rather, they use pass1.sh, pass2.sh, etc. This avoids manual definition of passes. - Ditto with patches; default directory is patches, but then any patch series specific to a pass are named patches-passX.
2023-11-06 23:51:23 +00:00
#!/bin/sh
2023-12-07 10:21:03 +00:00
#
# SPDX-FileCopyrightText: 2023 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
Remove the notion of "sys*" - This idea originates from very early in the project and was, at the time, a very easy way to categorise things. - Now, it doesn't really make much sense - it is fairly arbitary, often occuring when there is a change in kernel, but not from builder-hex0 to fiwix, and sysb is in reality completely unnecessary. - In short, the sys* stuff is a bit of a mess that makes the project more difficult to understand. - This puts everything down into one folder and has a manifest file that is used to generate the build scripts on the fly rather than using coded scripts. - This is created in the "seed" stage. stage0-posix -- (calls) --> seed -- (generates) --> main steps Alongside this change there are a variety of other smaller fixups to the general structure of the live-bootstrap rootfs. - Creating a rootfs has become much simpler and is defined as code in go.sh. The new structure, for an about-to-be booted system, is / -- /steps (direct copy of steps/) -- /distfiles (direct copy of distfiles/) -- all files from seed/* -- all files from seed/stage0-posix/* - There is no longer such a thing as /usr/include/musl, this didn't really make any sense, as musl is the final libc used. Rather, to separate musl and mes, we have /usr/include/mes, which is much easier to work with. - This also makes mes easier to blow away later. - A few things that weren't properly in packages have been changed; checksum-transcriber, simple-patch, kexec-fiwix have all been given fully qualified package names. - Highly breaking change, scripts now exist in their package directory but NOT WITH THE packagename.sh. Rather, they use pass1.sh, pass2.sh, etc. This avoids manual definition of passes. - Ditto with patches; default directory is patches, but then any patch series specific to a pass are named patches-passX.
2023-11-06 23:51:23 +00:00
# http://www.linuxfromscratch.org/lfs/view/6.1/chapter06/devices.html
mkdir -p "/dev"
test -c "/dev/null" || (rm -f "/dev/null" &&
mknod -m 666 "/dev/null" c 1 3)
test -c "/dev/zero" || mknod -m 666 "/dev/zero" c 1 5
test -c "/dev/random" || mknod -m 444 "/dev/random" c 1 8
test -c "/dev/urandom" || mknod -m 444 "/dev/urandom" c 1 9
test -c "/dev/ptmx" || mknod -m 666 "/dev/ptmx" c 5 2
test -c "/dev/tty" || mknod -m 666 "/dev/tty" c 5 0
test -e "/dev/stdout" || ln -s "/proc/self/fd/1" "/dev/stdout"
if mount --version >/dev/null 2>&1; then
test -d "/dev/shm" || (mkdir /dev/shm && mount -t tmpfs tmpfs /dev/shm)
test -d "/proc" || (mkdir /proc && mount -t proc proc /proc)
fi
if [ "${CHROOT}" = False ]; then
test -c "/dev/tty1" || mknod -m 666 "/dev/tty1" c 4 1
test -c "/dev/tty2" || mknod -m 666 "/dev/tty2" c 4 2
Remove the notion of "sys*" - This idea originates from very early in the project and was, at the time, a very easy way to categorise things. - Now, it doesn't really make much sense - it is fairly arbitary, often occuring when there is a change in kernel, but not from builder-hex0 to fiwix, and sysb is in reality completely unnecessary. - In short, the sys* stuff is a bit of a mess that makes the project more difficult to understand. - This puts everything down into one folder and has a manifest file that is used to generate the build scripts on the fly rather than using coded scripts. - This is created in the "seed" stage. stage0-posix -- (calls) --> seed -- (generates) --> main steps Alongside this change there are a variety of other smaller fixups to the general structure of the live-bootstrap rootfs. - Creating a rootfs has become much simpler and is defined as code in go.sh. The new structure, for an about-to-be booted system, is / -- /steps (direct copy of steps/) -- /distfiles (direct copy of distfiles/) -- all files from seed/* -- all files from seed/stage0-posix/* - There is no longer such a thing as /usr/include/musl, this didn't really make any sense, as musl is the final libc used. Rather, to separate musl and mes, we have /usr/include/mes, which is much easier to work with. - This also makes mes easier to blow away later. - A few things that weren't properly in packages have been changed; checksum-transcriber, simple-patch, kexec-fiwix have all been given fully qualified package names. - Highly breaking change, scripts now exist in their package directory but NOT WITH THE packagename.sh. Rather, they use pass1.sh, pass2.sh, etc. This avoids manual definition of passes. - Ditto with patches; default directory is patches, but then any patch series specific to a pass are named patches-passX.
2023-11-06 23:51:23 +00:00
test -c "/dev/console" || mknod -m 666 "/dev/console" c 5 1
test -b "/dev/sda" || mknod -m 600 "/dev/sda" b 8 0
test -b "/dev/sda1" || mknod -m 600 "/dev/sda1" b 8 1
test -b "/dev/sda2" || mknod -m 600 "/dev/sda2" b 8 2
test -b "/dev/sda3" || mknod -m 600 "/dev/sda3" b 8 3
test -b "/dev/sdb" || mknod -m 600 "/dev/sdb" b 8 16
test -b "/dev/sdb1" || mknod -m 600 "/dev/sdb1" b 8 17
test -b "/dev/sdb2" || mknod -m 600 "/dev/sdb2" b 8 18
test -b "/dev/sdb2" || mknod -m 600 "/dev/sdb3" b 8 19
test -b "/dev/sdc" || mknod -m 600 "/dev/sdc" b 8 32
test -b "/dev/sdc1" || mknod -m 600 "/dev/sdc1" b 8 33
test -b "/dev/sdc2" || mknod -m 600 "/dev/sdc2" b 8 34
test -b "/dev/sdc3" || mknod -m 600 "/dev/sdc3" b 8 35
Remove the notion of "sys*" - This idea originates from very early in the project and was, at the time, a very easy way to categorise things. - Now, it doesn't really make much sense - it is fairly arbitary, often occuring when there is a change in kernel, but not from builder-hex0 to fiwix, and sysb is in reality completely unnecessary. - In short, the sys* stuff is a bit of a mess that makes the project more difficult to understand. - This puts everything down into one folder and has a manifest file that is used to generate the build scripts on the fly rather than using coded scripts. - This is created in the "seed" stage. stage0-posix -- (calls) --> seed -- (generates) --> main steps Alongside this change there are a variety of other smaller fixups to the general structure of the live-bootstrap rootfs. - Creating a rootfs has become much simpler and is defined as code in go.sh. The new structure, for an about-to-be booted system, is / -- /steps (direct copy of steps/) -- /distfiles (direct copy of distfiles/) -- all files from seed/* -- all files from seed/stage0-posix/* - There is no longer such a thing as /usr/include/musl, this didn't really make any sense, as musl is the final libc used. Rather, to separate musl and mes, we have /usr/include/mes, which is much easier to work with. - This also makes mes easier to blow away later. - A few things that weren't properly in packages have been changed; checksum-transcriber, simple-patch, kexec-fiwix have all been given fully qualified package names. - Highly breaking change, scripts now exist in their package directory but NOT WITH THE packagename.sh. Rather, they use pass1.sh, pass2.sh, etc. This avoids manual definition of passes. - Ditto with patches; default directory is patches, but then any patch series specific to a pass are named patches-passX.
2023-11-06 23:51:23 +00:00
fi