diff options
Diffstat (limited to 'core/scripts/ports.sh')
-rw-r--r-- | core/scripts/ports.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/core/scripts/ports.sh b/core/scripts/ports.sh new file mode 100644 index 0000000..a9cd901 --- /dev/null +++ b/core/scripts/ports.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +ADMIN_USER=c9admin +CHROOT=/mnt + +DIR=$(dirname "$PWD"); +DIR_CONF=$DIR"/conf" + +printf "CHROOT="$CHROOT"\n"; +printf "DIR_CONF="$DIR_CONF"\n"; + +echo "1.3.1. Build as unprivileged user;" + +chroot $CHROOT /bin/bash -c "useradd -U -m -d /usr/ports -s /bin/false pkgmk" +chroot $CHROOT /bin/bash -c "usermod -a -G pkgmk $ADMIN_USER" +chroot $CHROOT /bin/bash -c "chown -R root:pkgmk /usr/ports" +chroot $CHROOT /bin/bash -c "chmod -R 774 /usr/ports" +chroot $CHROOT /bin/bash -c "chmod 775 /usr/ports" + +echo "1.3.2. Ports Layout;" + +chroot --userspec=pkgmk:pkgmk $CHROOT /bin/bash -c "mkdir /usr/ports/packages" +chroot --userspec=pkgmk:pkgmk $CHROOT /bin/bash -c "mkdir /usr/ports/work" +chroot --userspec=pkgmk:pkgmk $CHROOT /bin/bash -c "mkdir /usr/ports/pkgbuild" +chroot --userspec=pkgmk:pkgmk $CHROOT /bin/bash -c "mkdir /usr/ports/distfiles" + +chroot $CHROOT /bin/bash -c "id pkgmk" +read PAUSE +vim $CHROOT/etc/fstab + +echo "1.3.3 Configure pkgmk;" +cp $DIR_CONF/pkgmk.conf $CHROOT/etc/ +#vim $CHROOT/etc/pkgmk.conf + +echo "1.3.4 Configure prt-get;" +mv $CHROOT/etc/ports/contrib.rsync.inactive $CHROOT/etc/ports/contrib.rsync +cp $DIR_CONF/prt-get.conf $CHROOT/etc/ +#vim $CHROOT/etc/prt-get.conf |