From 9de6015afbbf7b60b183b222c5f2a4bfc9b7cf87 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Tue, 2 Apr 2019 20:53:34 +0200 Subject: [PATCH] Create and mount the system for debootstrap --- debian/chroot.install | 48 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/debian/chroot.install b/debian/chroot.install index a8cadf7..aa71296 100755 --- a/debian/chroot.install +++ b/debian/chroot.install @@ -57,3 +57,51 @@ done mkswap /dev/mapper/"${vgname}"-swap ## }}} # }}} +# Debootstrap {{{ +## Create and mount the system {{{ +### Root +mkdir -p -- /target +mountpoint -q /target || mount -- /dev/mapper/"${vgname}"-root /target + +### boot - grub +mkdir -p -- /target/boot +mountpoint -q /target/boot || mount -- ${hdd}1 /target/boot + +### home LV +mkdir -p -- /target/home +mountpoint -q /target/home || mount -- /dev/mapper/"${vgname}"-home /target/home +### opt LV +mkdir -p -- /target/opt +mountpoint -q /target/opt || mount -- /dev/mapper/"${vgname}"-opt /target/opt +### srv LV +mkdir -p -- /target/srv +mountpoint -q /target/srv || mount -- /dev/mapper/"${vgname}"-srv /target/srv +#### bkp LV +mkdir -p -- /target/srv/backup +mountpoint -q /target/srv/backup || mount -- /dev/mapper/"${vgname}"-bkp /target/srv/backup +### tmp LV +mkdir -p -- /target/tmp +mountpoint -q /target/tmp || mount -- /dev/mapper/"${vgname}"-tmp /target/tmp +### usr LV +mkdir -p -- /target/usr +mountpoint -q /target/usr || mount -- /dev/mapper/"${vgname}"-usr /target/usr +### var LV +mkdir -p -- /target/var +mountpoint -q /target/var || mount -- /dev/mapper/"${vgname}"-var /target/var +#### vz LV +mkdir -p -- /target/var/lib/vz +mountpoint -q /target/var/lib/vz || mount -- /dev/mapper/"${vgname}"-vz /target/var/lib/vz + +### Swap +swapon -- /dev/mapper/"${vgname}"-swap + +### System +mkdir -p -- /target/dev/pts +mountpoint -q /target/dev/pts || mount -o bind -- /dev/pts /target/dev/pts +mkdir -p -- /target/proc +mountpoint -q /target/proc || mount -t proc -- proc /target/proc +mkdir -p -- /target/sys +mountpoint -q /target/sys || mount -o bind -- /sys /target/sys +## }}} + +# }}}