fickit: Use rootfs directory instead of lower

This commit is contained in:
nemunaire 2024-03-24 12:57:04 +01:00
commit e3e55c579a
3 changed files with 12 additions and 12 deletions

View file

@ -1,9 +1,9 @@
#!/bin/sh
if [ -d /containers/onboot/004-synchro-ip-setup ]; then
LOWER=/containers/onboot/004-synchro-ip-setup/lower
elif [ -d /containers/onboot/004-nginx-ip-setup ]; then
LOWER=/containers/onboot/004-nginx-ip-setup/lower
if [ -d /containers/onboot/006-synchro-ip-setup ]; then
LOWER=/containers/onboot/006-synchro-ip-setup/lower
elif [ -d /containers/onboot/006-nginx-ip-setup ]; then
LOWER=/containers/onboot/006-nginx-ip-setup/lower
else
nsenter -t 1 -m -u -i -p -- "$0" $@
exit $?

View file

@ -4,13 +4,13 @@
mkdir -p /var/lib/fic/ssh/
cp /containers/services/sshd/lower/etc/ssh/* /var/lib/fic/ssh/
cp /containers/services/sshd/rootfs/etc/ssh/* /var/lib/fic/ssh/
mount -o bind /dev /containers/services/sshd/lower/dev
mount -o bind /proc /containers/services/sshd/lower/proc
mount -o bind /sys /containers/services/sshd/lower/sys
mount -o bind /var/lib/fic/ssh/ /containers/services/sshd/lower/etc/ssh
mount -o bind /dev /containers/services/sshd/rootfs/dev
mount -o bind /proc /containers/services/sshd/rootfs/proc
mount -o bind /sys /containers/services/sshd/rootfs/sys
mount -o bind /var/lib/fic/ssh/ /containers/services/sshd/rootfs/etc/ssh
chroot /containers/services/sshd/lower/ ssh-keygen -A
chroot /containers/services/sshd/rootfs/ ssh-keygen -A
umount /containers/services/sshd/lower/dev /containers/services/sshd/lower/proc /containers/services/sshd/lower/sys /containers/services/sshd/lower/etc/ssh
umount /containers/services/sshd/rootfs/dev /containers/services/sshd/rootfs/proc /containers/services/sshd/rootfs/sys /containers/services/sshd/rootfs/etc/ssh