Skip to content

Commit

Permalink
Remove manual setup of /dev contents
Browse files Browse the repository at this point in the history
debootstrap already creates the minimally needed set of device nodes,
and everything else will come from udev. Booting systems without udev
is not supported in Debian TTBOMK, so we also do not need to try
supporting that.

Here is the contents of /dev with this patch applied, for a bookworm install:

/dev:
total 4
drwxr-xr-x  4 root root  182 Nov 13 22:50 ./
drwxr-xr-x 17 root root 4096 Nov 13 22:51 ../
crw-rw-rw-  1 root root 5, 1 Nov 13 22:50 console
lrwxrwxrwx  1 root root   13 Nov 13 22:50 fd -> /proc/self/fd/
crw-rw-rw-  1 root root 1, 7 Nov 13 22:50 full
crw-rw-rw-  1 root root 1, 3 Nov 13 22:50 null
crw-rw-rw-  1 root root 5, 2 Nov 13 22:50 ptmx
drwxr-xr-x  2 root root    6 Nov 13 22:50 pts/
crw-rw-rw-  1 root root 1, 8 Nov 13 22:50 random
drwxr-xr-x  2 root root    6 Nov 13 22:50 shm/
lrwxrwxrwx  1 root root   15 Nov 13 22:50 stderr -> /proc/self/fd/2
lrwxrwxrwx  1 root root   15 Nov 13 22:50 stdin -> /proc/self/fd/0
lrwxrwxrwx  1 root root   15 Nov 13 22:50 stdout -> /proc/self/fd/1
crw-rw-rw-  1 root root 5, 0 Nov 13 22:50 tty
crw-rw-rw-  1 root root 1, 9 Nov 13 22:50 urandom
crw-rw-rw-  1 root root 1, 5 Nov 13 22:50 zero

/dev/pts:
total 0
drwxr-xr-x 2 root root   6 Nov 13 22:50 ./
drwxr-xr-x 4 root root 182 Nov 13 22:50 ../

/dev/shm:
total 0
drwxr-xr-x 2 root root   6 Nov 13 22:50 ./
drwxr-xr-x 4 root root 182 Nov 13 22:50 ../
  • Loading branch information
zeha committed Nov 17, 2023
1 parent 89f05ac commit 8671b4a
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 4 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ install:
mkdir -p $(DESTDIR)/usr/sbin/
mkdir -p $(DESTDIR)/usr/share/zsh/vendor-completions
install -m 644 config $(DESTDIR)/etc/debootstrap/
install -m 644 devices.tar.gz $(DESTDIR)/etc/debootstrap/
install -m 644 locale.gen $(DESTDIR)/etc/debootstrap/
install -m 644 packages $(DESTDIR)/etc/debootstrap/
install -m 644 packages-arm64 $(DESTDIR)/etc/debootstrap/
Expand Down
1 change: 1 addition & 0 deletions debian/grml-debootstrap.maintscript
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
rm_conffile /etc/debootstrap/devices.tar.gz 0.105~
rm_conffile /etc/zsh/completion.d/_grml-debootstrap 0.86~
Binary file removed devices.tar.gz
Binary file not shown.
3 changes: 0 additions & 3 deletions grml-debootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -1908,9 +1908,6 @@ preparechroot() {
# setup default locales
[ -n "$LOCALES" ] && cp $VERBOSE "${CONFFILES}"/locale.gen "${MNTPOINT}"/etc/locale.gen

# MAKEDEV is just a forking bomb crap, let's do it on our own instead :)
( cd "${MNTPOINT}"/dev && tar zxf /etc/debootstrap/devices.tar.gz )

# copy any existing files to chroot
[ -d "${CONFFILES}"/bin ] && cp $VERBOSE -a -L "${CONFFILES}"/bin/* "${MNTPOINT}"/bin/
[ -d "${CONFFILES}"/boot ] && cp $VERBOSE -a -L "${CONFFILES}"/boot/* "${MNTPOINT}"/boot/
Expand Down

0 comments on commit 8671b4a

Please sign in to comment.