summaryrefslogtreecommitdiff
path: root/packages/openslug-init/openslug-init_0.10.bb
blob: 3b749f0a9b65a26ede650100fb9692f37e7b626e (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
DESCRIPTION = "Openslug initial network config via sysconf"
SECTION = "console/network"
LICENSE = "GPL"
DEPENDS = "base-files"
PR = "r18"

SRC_URI = "file://sysconfsetup \
	   file://turnup \
	   file://modutils.txt \
	   file://modprobe.conf \
	   file://leds_rs_green \
	   file://leds.h \
	   file://leds.c \
	   file://kern_header.c"

inherit autotools update-rc.d

INITSCRIPT_NAME = "sysconfsetup"
INITSCRIPT_PARAMS = "defaults 39"

do_compile() {
	${CC} -o ${S}/../kern_header ${S}/../kern_header.c
	${CC} -o ${S}/../leds ${S}/../leds.c
}

do_install() {
        install -d ${D}/${sysconfdir} \
                   ${D}/${sysconfdir}/init.d \
		   ${D}/${sysconfdir}/modutils \
                   ${D}/${sysconfdir}/rcS.d \
		   ${D}/${sbindir} 
		  
	install -d ${D}/initrd

	install -m 0755 ${D}/../kern_header ${D}${sbindir}/kern_header
	install -m 0755 ${D}/../turnup ${D}${sbindir}/turnup
	install -m 0755 ${D}/../leds ${D}${sbindir}/leds
	install -m 0755 ${D}/../sysconfsetup ${D}${sysconfdir}/init.d/
	install -m 0755 ${D}/../leds_rs_green ${D}${sysconfdir}/init.d/
	install -m 0644 ${D}/../modutils.txt ${D}${sysconfdir}/modutils/
	install -m 0644 ${D}/../modprobe.conf ${D}${sysconfdir}/
	rm -f ${D}${sysconfdir}/rcS.d/S39sysconfsetup
	ln -s ../init.d/sysconfsetup ${D}${sysconfdir}/rcS.d/S39sysconfsetup
	# Put this into the user run levels, after the rmnologin (which is
	# the thing that allows a user log in!)
	for l in 2 3 4 5
	do
		install -d ${D}/${sysconfdir}/rc$l.d
		rm -f ${D}${sysconfdir}/rc$l.d/S99zleds_rs_green
		ln -s ../init.d/leds_rs_green ${D}${sysconfdir}/rc$l.d/S99zleds_rs_green
	done
}

FILES_${PN} = "/"

CONFFILES_${PN} = "${sysconfdir}/modutils/modutils.txt ${sysconfdir}/modprobe.conf"