]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - lfs/stage2
Merge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into next
[people/teissler/ipfire-2.x.git] / lfs / stage2
CommitLineData
cd1a2927 1###############################################################################
cd1a2927 2# #
70df8302
MT
3# IPFire.org - A linux based firewall #
4# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
5# #
6# This program is free software: you can redistribute it and/or modify #
cd1a2927 7# it under the terms of the GNU General Public License as published by #
70df8302 8# the Free Software Foundation, either version 3 of the License, or #
cd1a2927
MT
9# (at your option) any later version. #
10# #
70df8302 11# This program is distributed in the hope that it will be useful, #
cd1a2927
MT
12# but WITHOUT ANY WARRANTY; without even the implied warranty of #
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14# GNU General Public License for more details. #
15# #
16# You should have received a copy of the GNU General Public License #
70df8302 17# along with this program. If not, see <http://www.gnu.org/licenses/>. #
cd1a2927 18# #
cd1a2927
MT
19###############################################################################
20
21###############################################################################
22# Definitions
23###############################################################################
24
25include Config
26
15679d9f
MT
27VER = ipfire
28
cd1a2927
MT
29THISAPP = stage2
30TARGET = $(DIR_INFO)/$(THISAPP)
31
32###############################################################################
33# Top-level Rules
34###############################################################################
35
36install : $(TARGET)
37
38check :
39
40download :
41
42md5 :
43
44###############################################################################
45# Installation Details
46###############################################################################
47
48$(TARGET) :
49 @$(PREBUILD)
50
51 # Create directories
c3db995c 52 -mkdir -pv /{bin,boot,etc/opt,etc/modprobe.d,home,lib,mnt,opt}
59de0b00 53 -mkdir -pv /{media/{floppy,cdrom,usbkey},sbin,srv,var}
9b0ff0a0
MT
54 -install -dv -m 0750 /root
55 -install -dv -m 1777 /tmp /var/tmp
56 -mkdir -pv /usr/{,local/}{bin,include,lib,sbin,src}
57 -mkdir -pv /usr/{,local/}share/{doc,info,locale,man}
58 -mkdir -v /usr/{,local/}share/{misc,terminfo,zoneinfo}
59 -mkdir -pv /usr/{,local/}share/man/man{1..8}
90d372c4
MT
60 #-for dir in /usr /usr/local; do \
61 # ln -sv share/{man,doc,info} $$dir; \
62 #done
cd1a2927
MT
63
64 # Symlinks
65 # for this reason, stage2 rebuild will broke the iso:perl, grubbatch
4a337852 66 -ln -sv /tools/bin/{bash,cat,echo,pwd,stty} /bin
9b0ff0a0
MT
67 -ln -sv /tools/bin/perl /usr/bin
68 -ln -sv /tools/lib/libgcc_s.so{,.1} /usr/lib
4a337852
MT
69 -ln -sv /tools/lib/libstdc++.so{,.6} /usr/lib
70 sed 's/tools/usr/' /tools/lib/libstdc++.la > /usr/lib/libstdc++.la
9b0ff0a0 71 -ln -sv bash /bin/sh
cd1a2927
MT
72
73 # Config files
fb617ff5 74 cp -rvf $(DIR_SRC)/config/etc/* /etc;
9b0ff0a0 75 touch /etc/mtab
0b59f25c
MT
76 echo "$(NAME) v$(VERSION) - $(SLOGAN)" > /etc/issue
77 echo "===============================" >> /etc/issue
78 echo "\n running on \s \r \m" >> /etc/issue
79
71e32384
MT
80 # Bash startup files
81 install --directory --mode=0755 --owner=root --group=root /etc/profile.d
82 for i in $(DIR_SRC)/config/profile.d/*; do \
83 [ -f $$i ] && cp $$i /etc/profile.d; \
84 done
05402246 85 chmod 755 /etc/bashrc
b21b0df6
MT
86
87 # Install root's bash files.
88 for i in $(DIR_SRC)/config/bash/dot_*; do \
89 [ -f $$i ] && cp $$i /root/$$(basename $${i/dot_/\.}); \
90 done
cd1a2927
MT
91
92 # Scripts
93 for i in `find $(DIR_SRC)/src/scripts -maxdepth 1 -type f`; do \
94 sed "s+CONFIG_ROOT+$(CONFIG_ROOT)+g" $$i > /usr/local/bin/`basename $$i`; \
95 chmod 755 /usr/local/bin/`basename $$i`; \
96 done
97
07cdb8f6
SS
98 # Move script to correct place.
99 mv -vf /usr/local/bin/ovpn-ccd-convert /usr/sbin/
100
cd1a2927
MT
101 # Nobody user
102 -mkdir -p /home/nobody
103 chown -R nobody:nobody /home/nobody
104
9b0ff0a0
MT
105 # Create /var dirs and files
106 -mkdir -v /var/{lock,log,mail,run,spool,empty}
107 -mkdir -pv /var/{opt,cache,lib/{misc,locate},local}
069ae085
MT
108 -mkdir -pv /var/log/{counter,calamaris}
109 chown nobody.nobody /var/log/calamaris
83843a1c 110 touch /var/run/utmp /var/log/{btmp,lastlog,wtmp,net-traffic.log}
9b0ff0a0
MT
111 chgrp -v utmp /var/run/utmp /var/log/lastlog
112 chmod -v 664 /var/run/utmp /var/log/lastlog
6d4147d2 113
90d372c4
MT
114 # Permissions
115 chmod 0711 /var/empty
99f3c72f
MT
116
117 # A small hack to include /root to the iso but not all of it's files.
118 touch /root/ipfire
90d372c4 119
7274a673
JPT
120 # License agreement
121 -mkdir -pv /usr/share/doc/licenses/
122 cp -vf $(DIR_SRC)/doc/COPYING /usr/share/doc/licenses/GPLv3
123
cd1a2927 124 @$(POSTBUILD)