Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #
- # Create minimal ubuntu installation from scratch.
- # Prerequisites: ubuntu precise installation, mounted empty fs at /target
- #
- debootstrap precise /target
- cp /etc/resolv.conf /target/etc/resolv.conf
- cp /etc/apt/sources.list /target/etc/apt/sources.list
- mount --bind /dev /target/dev
- cat > /target/chroot.sh <<EOT
- #!/bin/sh
- mount none -t proc /proc
- mount none -t sysfs /sys
- mount none -t devpts /dev/pts
- export HOME=/root
- export LC_ALL=C
- echo "Please set passwords for root and ubuntu"
- echo "using the passwd command"
- bash -i
- apt-get update
- apt-get install --yes --force-yes linux-image-generic grub2 pump
- apt-get clean
- rm -rf /tmp/*
- rm /etc/resolv.conf
- umount -lf /proc
- umount -lf /sys
- umount -lf /dev/pts
- EOT
- chmod 755 /target/chroot.sh
- chroot /target "/chroot.sh"
- umount -lf /target/dev
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement