refactor: Remove unnecessary backup step in container creation
Simplified user-continer.sh by removing temp backup. Directly copy aios to workspace and restore-img.
This commit is contained in:
@@ -6,24 +6,15 @@ ROOTFS="root.x86_64/var/lib/machines/aios"
|
|||||||
|
|
||||||
echo "=== Creating child containers ==="
|
echo "=== Creating child containers ==="
|
||||||
|
|
||||||
# Backup current aios to temp location
|
|
||||||
echo "Backing up aios..."
|
|
||||||
cp -a $ROOTFS /tmp/aios-backup-$$
|
|
||||||
|
|
||||||
# Create directory for child containers
|
# Create directory for child containers
|
||||||
mkdir -p $ROOTFS/var/lib/machines
|
mkdir -p $ROOTFS/var/lib/machines
|
||||||
|
|
||||||
# Copy backup as workspace
|
# Copy aios as workspace
|
||||||
echo "Creating workspace container (copy of aios)..."
|
echo "Creating workspace container..."
|
||||||
cp -a /tmp/aios-backup-$$ $ROOTFS/var/lib/machines/workspace
|
cp -a $ROOTFS $ROOTFS/var/lib/machines/workspace
|
||||||
|
|
||||||
# Copy backup as restore-img (clean backup)
|
# Copy aios as restore-img
|
||||||
echo "Creating restore-img container (copy of aios)..."
|
echo "Creating restore-img container..."
|
||||||
cp -a /tmp/aios-backup-$$ $ROOTFS/var/lib/machines/restore-img
|
cp -a $ROOTFS $ROOTFS/var/lib/machines/restore-img
|
||||||
|
|
||||||
# Cleanup temp backup
|
|
||||||
rm -rf /tmp/aios-backup-$$
|
|
||||||
|
|
||||||
echo "✓ Child containers created"
|
echo "✓ Child containers created"
|
||||||
echo " - workspace (copy of aios)"
|
|
||||||
echo " - restore-img (copy of aios)"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user