summaryrefslogtreecommitdiff
blob: fc194841551a70555205b8744cfb75ade34cd7e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-apps/baselayout-lite/baselayout-lite-1.0_pre2.ebuild,v 1.3 2005/05/30 03:40:13 solar Exp $

IUSE="build bootstrap"

DESCRIPTION="Baselayout for embedded systems"
HOMEPAGE="http://www.gentoo.org/proj/en/base/embedded/"
SRC_URI="mirror://gentoo/${P}.tar.bz2
	http://dev.gentoo.org/~iggy/${P}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="-*"

PROVIDE="virtual/baselayout"
RDEPEND="!virtual/baselayout"
DEPEND=""

S="${WORKDIR}/${PN}"

src_install() {
	# the new tarball has the layout we want, just copy it straight to the 
	# output dir
	cp -a ${S}/image/* ${D}
	find ${D} -name CVS -exec rm -rf {} \;

	[ -f $ROOT/proc/cpuinfo ] && rm -f ${D}/proc/.keep
	use elibc_uclibc && rm -f ${D}/etc/nsswitch.conf
	chmod 755 ${D}/etc/init.d/*

	# compile the few things that need to be
	cd ${S}/src
	make || die "failed to compile the bits and pieces"
	into /
	dosbin rc runscript

	# device node creation stuff
	cd ${D}/dev || die
	einfo "Making device nodes (this could take a minute or so...)"

	MAKEDEV std
	mknod -m 0600 console c 5 1

	for i in 0 1 2 3 4; do
		mknod -m 0660 hda${i/0} b 3 ${i}
		mknod -m 0660 sda${i/0} b 8 ${i}
		chown root:disk hda${i/0} sda${i/0}
		mknod -m 0600 tty${i} c 4 ${i}
		chown root:tty tty${i}
	done

	MAKEDEV ttyS0
}

pkg_postinst() {
	# Touching /etc/passwd and /etc/shadow after install can be fatal, as many
	# new users do not update them properly.  thus remove all ._cfg files if
	# we are not busy with a build.
	if ! ( use build || use bootstrap )
	then
		ewarn "Removing invalid backup copies of critical config files..."
		rm -f ${ROOT}/etc/._cfg????_{passwd,shadow}
	fi

	# Doing device node creation here, since portage doesnt record
	# device nodes in CONTENTS

	# (Jul 23 2004 -solar)
	# Moved device node creation to src_install() so that we can get
	# the device nods into a binary package which can then be
	# installed on a host which does not have python/portage etc.
}