]> CyberLeo.Net >> Repos - CDN/j.git/blob - seeds/gentoo.sh
j: add seed support for scripted chroot creation
[CDN/j.git] / seeds / gentoo.sh
1 # Initialize a debian chroot using debootstrap into the provided directory
2
3 # Parameters that I want on the command line:
4 # <arch>
5
6 case "${jarch}" in
7 x86|i386) arch=i686 ;;
8 amd64|x86_64|x64) arch=amd64 ;;
9 *) pebkac "Unsupported arch '${jarch}'" ;;
10 esac
11
12 mkdir -p "${jroot}"
13
14 seed="${jseed}/gentoo/stage3-${arch}"-*.tar.bz2
15 [ -f "${seed}" ] || pebkac "Seed ${seed} not found"
16 tar jxvCf "${jroot}" "${seed}"
17
18 # Make sure locales are generated on first start
19 mkdir -p "${jroot}/etc/rcJ.d"
20 cat > "${jroot}/etc/rcJ.d/S00localegen" <<"EOF"
21 #!/bin/sh
22 /bin/sed -i '/en_US/s/^# //' /etc/locale.gen
23 /usr/sbin/locale-gen
24 /bin/rm -f "${0}"
25 EOF
26 chmod 755 "${jroot}/etc/rcJ.d/S00localegen"