Last active
November 7, 2018 21:01
-
-
Save foursixnine/e376e6ea76b40ac1f2c2e6be7b8e7f5e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/foursixnine/systeminstaller/blob/master/bootstrap-os.sh | |
# you could run all of this in a shell script | |
BOOTSTRAP_ROOTFS=/tmp/rootfs | |
mkdir ${BOOTSTRAP_ROOTFS} | |
mount -t ext3 -o noatime /dev/your/device ${BOOTSTRAP_ROOTFS} | |
mount -t proc proc ${BOOTSTRAP_ROOTFS}/proc/ | |
mount -t sysfs sys ${BOOTSTRAP_ROOTFS}/sys/ | |
mount -o bind /dev ${BOOTSTRAP_ROOTFS}/dev/ | |
#Make sure that apt installs what we really need instead of what it thinks | |
tee ${BOOTSTRAP_ROOTFS}/resolv.conf <<_EOF_ | |
nameserver 1.1.1.1 | |
_EOF_ | |
# this can run in a different shell, make sure you export your variables :) | |
export BOOTSTRAP_ROOTFS=/tmp/rootfs | |
LC_ALL=C chroot ${BOOTSTRAP_ROOTFS} /bin/bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment