IBM / ibmichroot

A set of scripts to facilitate the use of chroot-based containers for IBM i
MIT License
21 stars 9 forks source link

Need option to only create nodes #64

Closed ThePrez closed 3 years ago

ThePrez commented 5 years ago

This is useful for cloning chroot containers. I've done this in the past my extracting out the mknod parts of the minimal .lst file and running it, but it also requires a deletion of an existing regular file in some cases (because an rsync will copy the device as a zero-byte file).

I think the fix is simply to create a regen_devices.lst that only has the rm commands and the mknod section from minimal.lst (but also with the tty devices as in #63 )

#
# make dev nodes
# (mknod $CHROOT_DIR/dev/tty c 32945 0)
#
:mknod
/dev/tty c 32945 0
/dev/null c 32769 1
/dev/zero c 32769 2
/dev/urandom c 32954 0
/dev/pts/0 c 32947 0
/dev/pts/1 c 32947 1
/dev/pts/2 c 32947 2
/dev/pts/3 c 32947 3
/dev/pts/4 c 32947 4
/dev/pts/5 c 32947 5
/dev/pts/6 c 32947 6
/dev/pts/7 c 32947 7
/dev/pts/8 c 32947 8
/dev/pts/9 c 32947 9
kadler commented 5 years ago

It appears it's not setting up any BSD-style pty pairs, just the AT&T UNIX System V style.

See https://www.ibm.com/support/knowledgecenter/en/ssw_aix_72/filesreference/pty.html and https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_72/rzalf/rzalfpty.htm for more info

kadler commented 4 years ago

We can extract this in to its own file as mentioned and any lst file which uses it can reference the new lst file.

ThePrez commented 4 years ago

cc @earleye2018 as an interested party on this one.