debian-galaxy-a20e/ramdisk/init

33 lines
667 B
Plaintext
Raw Permalink Normal View History

2026-08-27 13:48:54 +00:00
#!/bin/sh
# Mount basic filesystems
mount -t proc proc /proc
mount -t sysfs sysfs /sys
mount -t devtmpfs devtmpfs /dev
mount -t tmpfs tmpfs /tmp
mount -t tmpfs tmpfs /run
# Create essential directories
mkdir -p /sys/fs/selinux
mkdir -p /dev/pts
mkdir -p /dev/shm
# Mount pts and shm
mount -t devpts devpts /dev/pts
mount -t tmpfs tmpfs /dev/shm
# Mount debian rootfs from mmcblk0p32
echo "Mounting debian rootfs..."
mount /dev/block/mmcblk0p32 /root
# Check if mount was successful
if [ ! -f /root/etc/fstab ]; then
echo "Failed to mount rootfs!"
/bin/sh
exit 1
fi
# Switch root to debian
echo "Switching to debian rootfs..."
exec chroot /root /sbin/init