VectorLinux
October 25, 2014, 04:01:36 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
  Print  
Author Topic: mkchroot script  (Read 5107 times)
uelsk8s
Administrator
Vectorian
*****
Posts: 2504



« 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:
#!/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
#
Logged
exeterdad
Packager
Vectorian
****
Posts: 2046



« 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 » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!