Please support VectorLinux!

Author Topic: mkchroot script  (Read 7404 times)

uelsk8s

  • Administrator
  • Vectorian
  • *****
  • Posts: 2504
mkchroot script
« on: December 31, 2007, 03:09:54 pm »
just a small script to make a chroot for building clean packages
it should work on 5.8 and 5.9
If you think of ways to improve it add them below.

Code: [Select]
#!/bin/bash
#mount point
MNT=/mnt/loop
#insert the name of the iso
echo "enter the name of the iso with path"
read ISO
#mount the iso
mount -o loop $ISO $MNT
#enter the name of the new chroot dir
echo "enter a name for the chroot dir"
read CHROOT
#make the chroot dir
mkdir -p $CHROOT
#change to the chroot dir
cd $CHROOT
#extract the bulks
lzma -cd $MNT/veclinux/required/veclinux.tlz |tar xp
lzma -cd $MNT/veclinux/required/vlconfig.tlz |tar xp
lzma -cd $MNT/veclinux/optional/X11.tlz |tar xp
lzma -cd $MNT/veclinux/optional/games.tlz |tar xp
lzma -cd $MNT/veclinux/optional/samba.tlz |tar xp
lzma -cd $MNT/veclinux/optional/dev.tlz |tar xp
lzma -cd $MNT/veclinux/optional/kernel-src.tlz |tar xp
#install the packages
installpkg -R $(pwd) $MNT/packages/*/*t?z
#extract the vlconfig2 bulk last
lzma -cd $MNT/veclinux/required/vlconfig2.tlz |tar xp
#

exeterdad

  • Packager
  • Vectorian
  • ****
  • Posts: 2046
Re: mkchroot script
« Reply #1 on: December 31, 2007, 04:24:23 pm »
You rock!
Added improvements to script: cache the fonts, run ldconfig and set the timezone so you don't get "timezone is not set" message if date it called.

I do some other tweaks also so my terminal will let me know it's a chroot so I don't get confused.  I setup my slaptget-rc, update slapt-get, install requiredbuilder or anything I normally use.  I even plop a couple templates in there. Then I make a lzma out of the whole thing.  So it's a delete and extract...  get to work.
« Last Edit: December 31, 2007, 04:28:08 pm by exeterdad »