]> www.hackdaworld.org Git - hdw-linux/hdw-linux.git/blob - scripts/adapt_local
several changes to toolchain packages
[hdw-linux/hdw-linux.git] / scripts / adapt_local
1 # 19c3
2 # hdw - linux ; adapt local configs
3 #
4
5 root=""
6 target=""
7
8 while [ "$1" ] ; do
9         case "$1" in
10                 -cfg)   config=$2 ; shift 2 ;;
11                 -from)  root=$2 ; shift 2 ;;
12                 -to)    target=$2 ; shift 2 ;;
13                 *)      echo "usage: $0 -cfg [full|]"
14                         exit 1 ;;
15         esac
16 done
17
18 # read config
19 . ./Config &&
20 [ -z "$target" ] && target=$hdw_build_dir
21 echo "target -> $target <-"
22 [ -z "$target" ] && exit 1
23
24 run_it() {
25         echo "running: $@"
26         $@
27         return $?
28 }
29
30 if [ "$config" = "full" ] ; then
31         # full programm !! ;)
32
33         # kernel config
34         run_it cp $root/usr/src/linux/.config $target/usr/src/linux/.config
35         # x11
36         [ -f $root/etc/X11/XF86Config* ] && \
37         run_it cp $root/etc/X11/XF86Config* $target/etc/X11/
38         [ -f $root/etc/X11/xorg.conf* ] && \
39         run_it cp $root/etc/X11/xorg.conf* $target/etc/X11/
40         # hdw config
41         for i in profile fstab hosts host.conf HOSTNAME resolv.conf conf/ ; do
42                 run_it rm -rf $target/etc/$i
43                 run_it cp -r $root/etc/$i $target/etc
44         done
45 fi
46
47 echo "done"
48