Fixing up few issues, adding resolv.conf linking to chroot script
This commit is contained in:
@ -31,6 +31,12 @@ error() {
|
||||
####################
|
||||
## util functions ##
|
||||
####################
|
||||
linkresolv(){
|
||||
if [ ! -f "$TARGET/etc/resolv.conf" ]; then
|
||||
ln -sf /run/systemd/resolve/resolv.conf "$TARGET/etc/resolv.conf"
|
||||
fi
|
||||
}
|
||||
|
||||
chrt() {
|
||||
mount -t proc proc "$TARGET/proc"
|
||||
mount -t sysfs sysfs "$TARGET/sys"
|
||||
@ -40,13 +46,15 @@ chrt() {
|
||||
|
||||
mount -o bind /dev "$TARGET/dev"
|
||||
mount -t devpts none "$TARGET/dev/pts"
|
||||
mount -t tmpfs tmpfs "$TARGET/run"
|
||||
mount --bind /run "$TARGET/run"
|
||||
linkresolv
|
||||
|
||||
if [ -h $TARGET/dev/shm ]; then
|
||||
mkdir -p $TARGET/$(readlink $TARGET/dev/shm)
|
||||
else
|
||||
mount -t tmpfs -o nosuid,nodev tmpfs "$TARGET/dev/shm"
|
||||
fi
|
||||
|
||||
|
||||
local prompt='\['$BOLD'\['$RED'(chroot)\['$RESET'\['$BOLD' \u@\h:\w#\['$RESET' '
|
||||
chroot "$TARGET" /usr/bin/env -i \
|
||||
|
Reference in New Issue
Block a user