main/postmarketos-mkinitfs: move dev node creation to initfs (MR 2407)

There should be no reason that this has to be done by mkinitfs, and
moving it to initfs simplifies mkinitfs (and the creation of a
replacement)
This commit is contained in:
Clayton Craft 2021-08-05 14:02:21 -07:00 committed by Bart Ribbers
parent a97aca7e3a
commit 2283190a93
No known key found for this signature in database
GPG key ID: 0BF4C1B5988C50D8
5 changed files with 12 additions and 13 deletions

View file

@ -1,6 +1,6 @@
# Maintainer: Oliver Smith <ollieparanoid@postmarketos.org>
pkgname=postmarketos-mkinitfs
pkgver=0.29
pkgver=0.30
pkgrel=0
pkgdesc="Tool to generate initramfs images for postmarketOS"
url="https://postmarketos.org"
@ -53,9 +53,9 @@ check() {
}
sha512sums="
4717bf24bd13fd4d90f3ab000ab43f7d61529515de224ebc86458ae709ebe0b5065655457e34f5952126bac6ab45143a91cddb09a8ad2d0a55c5cecd564a0135 00-default.modules
1a267dd958609263a4f24657f602ac0e4e0c724bf1284adec85e82d05c9b07553085edea5a56f7fa09d1652af232c72d4d39a06858c2a580ff830577b5f37d67 init.sh.in
daf8bbc02e0dc18dda653d1b25cac985c5ff66568eec7a379857b606843b94f03855d47ded2aff801015ec3c9e2cf90f646dc7deaaef23d373c2ff2b9bbfa435 init_functions.sh
54c8ea6c4b5313c0ca82bbc40498a35d4b5cbcdbf950dc01b5025238ea6b8caa2f9a9ee57a269fb78673fbcac186c33243188458ecda45deb3354d5d8a77fdfe mkinitfs.sh
b653f5cfe3ef2616b7335f53204fd79f3859be24f40c7a76e1c3b4f9692b9dfe82106a0aeb3b3fb82a8edff3c11795251197287a73817d4ec31321a558cb8613 mkinitfs_functions.sh
4d718fca3b6a8c2d362003e7d57f9fa29510c05c27b372d21b8278fe76b2096ae098aa9f9a266a029f82956d165fd764e406ddaf36cec2e4f3bd30c6022d07a7 init.sh.in
6b6c2aa88ad41fde29783042addcf2fb6309791d9c92636a20ca01a56ae16fb86c94ef4bb0371105cf4ed1f306f85d3cd825b1d2094b29bf496975edfad1f8d1 init_functions.sh
5590087d67cf8cae0e4f2b9a0d3f055a01282ace53abe586a0117a9701287cf60a88230ba5817e77886b9496098139c025c6221c4b7404e36faac7df63adc1ee mkinitfs.sh
879223b6b608f3b26993c3536b4e6b37728f774d6e4da891ae87ef26e38603a15b09918b69963c4f65aa4551b721815fd3578a1ec598b7b9d418aa677520d55f mkinitfs_functions.sh
c7a3c33daeb12b33ac72207191941c4d634f15c22958273b52af381a70ebaba1d3a9299483f0c447d9e66c560151fe7b9588bb4bbef2c8914f83185984ee4622 mkinitfs_test.sh
"

View file

@ -12,6 +12,7 @@ export PATH=/usr/bin:/bin:/usr/sbin:/sbin
# Mount everything, set up logging, modules, mdev
mount_proc_sys_dev
create_device_nodes
setup_log
setup_firmware_path
# shellcheck disable=SC2154,SC2086

View file

@ -38,6 +38,12 @@ mount_proc_sys_dev() {
mkdir /run
}
create_device_nodes() {
mknod -m 666 /dev/null c 1 3
mknod -m 644 /dev/random c 1 8
mknod -m 644 /dev/urandom c 1 9
}
setup_firmware_path() {
# Add the postmarketOS-specific path to the firmware search paths.
# This should be sufficient on kernel 3.10+, before that we need

View file

@ -20,7 +20,6 @@ copy_files "$(get_binaries)" "$tmpdir"
copy_files "/etc/deviceinfo" "$tmpdir"
copy_files "/etc/postmarketos-mkinitfs/hooks/*.sh" "$tmpdir"
cp /usr/share/postmarketos-splashes/*.ppm.gz "$tmpdir"
create_device_nodes
ln -s "/bin/busybox" "$tmpdir/bin/sh"
install -Dm755 "/usr/share/postmarketos-mkinitfs/init.sh.in" \
"$tmpdir/init"

View file

@ -266,13 +266,6 @@ copy_files()
done
}
create_device_nodes()
{
mknod -m 666 "$tmpdir/dev/null" c 1 3
mknod -m 644 "$tmpdir/dev/random" c 1 8
mknod -m 644 "$tmpdir/dev/urandom" c 1 9
}
replace_init_variables()
{
sed -i "s:@INITRAMFS_EXTRA@:${outfile_extra}:g" "$tmpdir/init"