Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #On computer
- apt install debootstrap
- debootstrap --arch=armhf buster /debroot http://ftp.debian.org/debian/
- tar czf /debroot.tgz /debroot/*
- scp /debroot.tgz root@libreelec:/storage/
- ssh root@libreelec
- #On Rpi3
- cd /storage/
- tar xzf debroot.tgz
- mkdir newroot
- mkdir newroot/LibreELEC_root
- cat <<EOF > debroot/etc/shells
- /bin/sh
- /bin/bash
- EOF
- cat <<EOF > debroot/etc/passwd
- root:x:0:0:root:/root:/bin/bash
- _apt:x:105:65534::/nonexistent:/usr/sbin/nologin
- EOF
- echo -n debroot/etc/kernel/postinst.d/apt-auto-removal
- chmod +x debroot/etc/kernel/postinst.d/apt-auto-removal
- cat <<EOF > debroot/etc/group
- root:x:0:
- EOF
- ln -sf /proc/sys/kernel/hostname debroot/etc/hostname
- ln -sf ../LibreELEC_root/run/connman/resolv.conf debroot/etc/resolv.conf
- ln -sf ../LibreELEC_root/run/libreelec/hosts debroot/etc/hosts
- cat <<EOF > launch_debian.sh
- mount --bind /storage/debroot /storage/newroot/
- /storage/debroot/usr/bin/unshare --mount -- /storage/launch_debian_stage2.sh
- umount /storage/newroot
- EOF
- cat <<EOF > launch_debian_stage2.sh
- INIT=/bin/bash #change to /sbin/init later
- cd newroot
- ./usr/sbin/pivot_root . LibreELEC_root/
- mount -t sysfs sysfs /sys
- mount -t proc proc /proc
- mount -t devpts devpts /dev/pts/
- unshare -fp --mount-proc $INIT
- umount /dev/pts
- umount /proc
- umount /sys
- EOF
- chmod +x launch_debian.sh launch_debian_stage2.sh
Add Comment
Please, Sign In to add comment