Skip to content

Instantly share code, notes, and snippets.

View dmuiX's full-sized avatar
🎸

Daniel Ullrich dmuiX

🎸
View GitHub Profile
@dmuiX
dmuiX / chroot-to-pi.sh
Last active December 4, 2022 12:47 — forked from htruong/chroot-to-pi.sh
Chroot to pi sd card
#!/bin/bash
# This script allows you to chroot ("work on")
# the raspbian sd card as if it's the raspberry pi
# on your Ubuntu desktop/laptop
# just much faster and more convenient
# credits: https://gist.github.com/jkullick/9b02c2061fbdf4a6c4e8a78f1312a689
# make sure you have issued
# ----------------------------
# Clean up
# revert /etc/resolv.conf_bak
rm /mnt/raspbian/etc/resolv.conf
mv /mnt/raspbian/etc/resolv.conf_bak /etc/resolv.conf
# revert ld.so.preload fix
sed -i 's/^#CHROOT //g' /mnt/raspbian/etc/ld.so.preload
# unmount everything