refactor: Create child containers during build as root, not at ai user login
- Renamed init-containers.sh to user-continer.sh - Moved container creation from ai user first login to build.zsh - Removed initialization check from ai user .zshrc - Child containers (workspace, restore-img) now pre-created by root - ai user simply uses pre-existing containers
This commit is contained in:
37
cfg/user-continer.sh
Normal file
37
cfg/user-continer.sh
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
# Create child containers inside aios for ai user
|
||||
# This script runs during build.zsh as root
|
||||
|
||||
ROOTFS="root.x86_64/var/lib/machines/aios"
|
||||
|
||||
echo "=== Creating child containers ==="
|
||||
|
||||
# Create workspace container
|
||||
echo "Creating workspace container..."
|
||||
mkdir -p /tmp/workspace-build
|
||||
pacstrap -c /tmp/workspace-build base
|
||||
|
||||
# Configure workspace
|
||||
arch-chroot /tmp/workspace-build /bin/sh -c 'pacman -Syu --noconfirm vim git zsh openssh nodejs npm sqlite'
|
||||
|
||||
# Add securetty for pts login
|
||||
cat >> /tmp/workspace-build/etc/securetty <<'EOF'
|
||||
pts/0
|
||||
pts/1
|
||||
pts/2
|
||||
pts/3
|
||||
pts/4
|
||||
pts/5
|
||||
EOF
|
||||
|
||||
# Move to aios
|
||||
mkdir -p $ROOTFS/var/lib/machines
|
||||
mv /tmp/workspace-build $ROOTFS/var/lib/machines/workspace
|
||||
|
||||
# Create restore-img as clean backup
|
||||
echo "Creating restore-img (backup)..."
|
||||
cp -a $ROOTFS/var/lib/machines/workspace $ROOTFS/var/lib/machines/restore-img
|
||||
|
||||
echo "✓ Child containers created"
|
||||
echo " - workspace"
|
||||
echo " - restore-img"
|
||||
Reference in New Issue
Block a user