Guest User

debian inside libreelec

a guest
May 22nd, 2020
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. #On computer
  2. apt install debootstrap
  3. debootstrap --arch=armhf buster /debroot http://ftp.debian.org/debian/
  4. tar czf /debroot.tgz /debroot/*
  5. scp /debroot.tgz root@libreelec:/storage/
  6. ssh root@libreelec
  7.  
  8. #On Rpi3
  9. cd /storage/
  10. tar xzf debroot.tgz
  11. mkdir newroot
  12. mkdir newroot/LibreELEC_root
  13.  
  14. cat <<EOF > debroot/etc/shells
  15. /bin/sh
  16. /bin/bash
  17. EOF
  18.  
  19. cat <<EOF > debroot/etc/passwd
  20. root:x:0:0:root:/root:/bin/bash
  21. _apt:x:105:65534::/nonexistent:/usr/sbin/nologin
  22. EOF
  23.  
  24. echo -n debroot/etc/kernel/postinst.d/apt-auto-removal
  25. chmod +x debroot/etc/kernel/postinst.d/apt-auto-removal
  26.  
  27. cat <<EOF > debroot/etc/group
  28. root:x:0:
  29. EOF
  30.  
  31. ln -sf /proc/sys/kernel/hostname debroot/etc/hostname
  32. ln -sf ../LibreELEC_root/run/connman/resolv.conf debroot/etc/resolv.conf
  33. ln -sf ../LibreELEC_root/run/libreelec/hosts debroot/etc/hosts
  34.  
  35. cat <<EOF > launch_debian.sh
  36. mount --bind /storage/debroot /storage/newroot/
  37. /storage/debroot/usr/bin/unshare --mount -- /storage/launch_debian_stage2.sh
  38. umount /storage/newroot
  39. EOF
  40.  
  41. cat <<EOF > launch_debian_stage2.sh
  42. INIT=/bin/bash #change to /sbin/init later
  43.  
  44. cd newroot
  45. ./usr/sbin/pivot_root . LibreELEC_root/
  46. mount -t sysfs sysfs /sys
  47. mount -t proc proc /proc
  48. mount -t devpts devpts /dev/pts/
  49. unshare -fp --mount-proc $INIT
  50. umount /dev/pts
  51. umount /proc
  52. umount /sys
  53. EOF
  54.  
  55. chmod +x launch_debian.sh launch_debian_stage2.sh
Add Comment
Please, Sign In to add comment