° Kernel-spezifische rcS, Großteil der (Developer?) Kommentare in dnl-Makros konvertiert
° Das mounten der /var wird nur bei Flash-Images im rcS ausgeführt
° Korrektur der default HDD-Partition bei 2.6er Kernel (/dev/hda2)
Index: cdk/make/etc.mk
Code: Alles auswählen
RCS file: /cvs/tuxbox/cdk/make/etc.mk,v
retrieving revision 1.2
diff -u -u -r1.2 etc.mk
--- a/cdk/make/etc.mk 6 Jan 2009 21:40:15 -0000 1.2
+++ b/cdk/make/etc.mk 5 Mar 2009 08:48:44 -0000
@@ -1,6 +1,15 @@
yadd-etc: $(targetprefix)/etc/init.d/rcS
+
+if KERNEL26
+KERNEL_ARGS=--define=use_kernel_26
+endif
+
+if TARGETRULESET_FLASH
+FLASH_FS_ARGS=--define=use_flash_fs
+endif
$(targetprefix)/etc/init.d/rcS: root/etc/init.d/rcS.m4
+ m4 $(KERNEL_ARGS) $(FLASH_FS_ARGS) $< > $@
$(MAKE) -C root install
if ENABLE_IDE
echo $(HDD_MOUNT_ENTRY) >> $(targetprefix)/etc/fstab
Code: Alles auswählen
RCS file: /cvs/tuxbox/cdk/make/flashable-dirs.mk,v
retrieving revision 1.3
diff -u -u -r1.3 flashable-dirs.mk
--- a/cdk/make/flashable-dirs.mk 18 Jan 2009 16:33:59 -0000 1.3
+++ b/cdk/make/flashable-dirs.mk 5 Mar 2009 08:48:44 -0000
@@ -3,8 +3,13 @@
# Pattern: $partition-$gui[-$filesystem]
if ENABLE_IDE
+if !KERNEL26
HDD_MOUNT_ENTRY=/dev/ide/host0/bus0/target0/lun0/part2 /hdd $(DEFAULT_FS_FSTAB) \
defaults 1 2
+else
+HDD_MOUNT_ENTRY=/dev/hda2 /hdd $(DEFAULT_FS_FSTAB) \
+defaults 1 2
+endif
endif
$(flashprefix)/var-neutrino $(flashprefix)/var-enigma $(flashprefix)/var-radiobox: \
Code: Alles auswählen
RCS file: /cvs/tuxbox/cdk/root/etc/init.d/Makefile.am,v
retrieving revision 1.15
diff -u -u -r1.15 Makefile.am
--- a/cdk/root/etc/init.d/Makefile.am 19 Feb 2009 08:56:01 -0000 1.15
+++ b/cdk/root/etc/init.d/Makefile.am 5 Mar 2009 08:48:44 -0000
@@ -20,7 +20,11 @@
KERNEL_ARGS=--define=use_kernel_26
endif
-COMMON_ARGS=--define=customizationsdir=$(customizationsdir) $(KERNEL_ARGS)
+if TARGETRULESET_FLASH
+FLASH_FS_ARGS=--define=use_flash_fs
+endif
+
+COMMON_ARGS=--define=customizationsdir=$(customizationsdir) $(KERNEL_ARGS) $(FLASH_FS_ARGS)
rcS: rcS.m4
m4 $(COMMON_ARGS) $< > $@
Index: cdk/root/etc/init.d/rcS.m4
Code: Alles auswählen
RCS file: /cvs/tuxbox/cdk/root/etc/init.d/rcS.m4,v
retrieving revision 1.6
diff -u -u -r1.6 rcS.m4
--- a/cdk/root/etc/init.d/rcS.m4 19 Feb 2009 08:56:01 -0000 1.6
+++ b/cdk/root/etc/init.d/rcS.m4 5 Mar 2009 08:48:44 -0000
@@ -46,122 +46,120 @@
KMINOR=`get_second $(uname -r)`
IFS=$OLD_IFS
-if [ $KMINOR -ge 6 ]; then
- MD=
- mount -t proc proc /proc
- mount -t tmpfs tmp /tmp
- mount -t tmpfs dev /dev
- mount -t sysfs sys /sys
- echo "/sbin/hotplug" > /proc/sys/kernel/hotplug
- # create necessary nodes,
- # static for now, i am just too lazy for udev :-)
- mkdir -p /dev/pts /dev/dbox /dev/dvb/adapter0 /dev/loop /dev/i2c /dev/input /dev/sound /dev/v4l /dev/fb /dev/vc /dev/mtdblock /dev/mtd /dev/tts
- if type -p makedevices; then
- makedevices
- else
- # in theory, now it is too late to create /dev/console...
- mknod /dev/console c 5 1
- mknod /dev/null c 1 3
- mknod /dev/tty c 5 0
- mknod /dev/tty0 c 4 0
- mknod /dev/tty1 c 4 1
- mknod /dev/tty2 c 4 2
- mknod /dev/tty3 c 4 3
- mknod /dev/ptmx c 5 2
-
- mknod /dev/urandom c 1 9
- mknod /dev/random c 1 8
- mknod /dev/mem c 1 1
- mknod /dev/kmem c 1 2
-
- mknod /dev/watchdog c 10 130
-
- mknod /dev/dvb/adapter0/audio0 c 212 1
- mknod /dev/dvb/adapter0/ca0 c 212 6
- mknod /dev/dvb/adapter0/ca1 c 212 22
- mknod /dev/dvb/adapter0/demux0 c 212 4
- mknod /dev/dvb/adapter0/dvr0 c 212 5
- mknod /dev/dvb/adapter0/frontend0 c 212 3
- mknod /dev/dvb/adapter0/net0 c 212 7
- mknod /dev/dvb/adapter0/video0 c 212 0
-
- mknod /dev/fb0 c 29 0
-
- mknod /dev/v4l/video0 c 81 0
-
- mknod /dev/sound/dsp c 14 3
- mknod /dev/sound/mixer c 14 0
- mknod /dev/sound/mixer1 c 14 16
-
- mknod /dev/input/event0 c 13 64
- mknod /dev/input/mouse0 c 13 32
- mknod /dev/input/mice c 13 63
-
- mknod /dev/i2c/0 c 89 0
-
- # 6 loop devices are enough.
- for i in 0 1 2 3 4 5; do
- mknod /dev/loop/$i b 7 $i
- mknod /dev/mtdblock/$i b 31 $i
- done
- mknod /dev/mtd/0 c 90 0
- mknod /dev/mtd/1 c 90 2
- mknod /dev/mtd/2 c 90 4
- mknod /dev/mtd/3 c 90 6
- mknod /dev/mtd/4 c 90 8
- mknod /dev/mtd/5 c 90 10
- mknod /dev/mtd/0ro c 90 1
- mknod /dev/mtd/1ro c 90 3
- mknod /dev/mtd/2ro c 90 5
- mknod /dev/mtd/3ro c 90 7
- mknod /dev/mtd/4ro c 90 9
- mknod /dev/mtd/5ro c 90 11
-
- mknod /dev/tts/0 c 4 64
- mknod /dev/tts/1 c 4 65
- fi
- # devices with dynamic minor numbers are created by /sbin/hotplug
+ifdef({use_kernel_26}, {
+dnl === Kernel 2.6 ===
+MD=
+mount -t proc proc /proc
+mount -t tmpfs tmp /tmp
+mount -t tmpfs dev /dev
+mount -t sysfs sys /sys
+echo "/sbin/hotplug" > /proc/sys/kernel/hotplug
+dnl
+dnl create necessary nodes,
+dnl static for now, i am just too lazy for udev :-)
+mkdir -p /dev/pts /dev/dbox /dev/dvb/adapter0 /dev/loop /dev/i2c /dev/input /dev/sound /dev/v4l /dev/fb /dev/vc /dev/mtdblock /dev/mtd /dev/tts
+if type -p makedevices; then
+ makedevices
+else
+ # in theory, now it is too late to create /dev/console...
+ mknod /dev/console c 5 1
+ mknod /dev/null c 1 3
+ mknod /dev/tty c 5 0
+ mknod /dev/tty0 c 4 0
+ mknod /dev/tty1 c 4 1
+ mknod /dev/tty2 c 4 2
+ mknod /dev/tty3 c 4 3
+ mknod /dev/ptmx c 5 2
+
+ mknod /dev/urandom c 1 9
+ mknod /dev/random c 1 8
+ mknod /dev/mem c 1 1
+ mknod /dev/kmem c 1 2
+
+ mknod /dev/watchdog c 10 130
+
+ mknod /dev/dvb/adapter0/audio0 c 212 1
+ mknod /dev/dvb/adapter0/ca0 c 212 6
+ mknod /dev/dvb/adapter0/ca1 c 212 22
+ mknod /dev/dvb/adapter0/demux0 c 212 4
+ mknod /dev/dvb/adapter0/dvr0 c 212 5
+ mknod /dev/dvb/adapter0/frontend0 c 212 3
+ mknod /dev/dvb/adapter0/net0 c 212 7
+ mknod /dev/dvb/adapter0/video0 c 212 0
+
+ mknod /dev/fb0 c 29 0
+
+ mknod /dev/v4l/video0 c 81 0
+
+ mknod /dev/sound/dsp c 14 3
+ mknod /dev/sound/mixer c 14 0
+ mknod /dev/sound/mixer1 c 14 16
+
+ mknod /dev/input/event0 c 13 64
+ mknod /dev/input/mouse0 c 13 32
+ mknod /dev/input/mice c 13 63
+
+ mknod /dev/i2c/0 c 89 0
+
+ # 6 loop devices are enough
+ for i in 0 1 2 3 4 5; do
+ mknod /dev/loop/$i b 7 $i
+ mknod /dev/mtdblock/$i b 31 $i
+ mknod /dev/mtd/$i c 90 $(expr $i + $i )
+ mknod /dev/mtd/${i}ro c 90 $(expr 1 + $i + $i )
+ done
- ln -sf /dev/fb0 /dev/fb/0
- ln -sf /dev/tty0 /dev/vc/0
-
- mount /dev/pts
+ mknod /dev/tts/0 c 4 64
+ mknod /dev/tts/1 c 4 65
+fi
+
+dnl devices with dynamic minor numbers are created by /sbin/hotplug
+ln -sf /dev/fb0 /dev/fb/0
+ln -sf /dev/tty0 /dev/vc/0
+
+# manual mounts...
+mount /dev/pts
+ifdef({use_flash_fs},{mount /dev/mtdblock/3 /var})
+
+# If appropriate, load ide and file system drivers
+if [ -e /lib/modules/$(uname -r)/extra/ide/dboxide.ko ] ; then
+ loadmodule(dboxide)
+ loadmodule(ide-disk)
fi
-# If appropriate, load ide drivers and file system drivers
-if [ $KMINOR -ge 6 ]; then
- # kernel 2.6
- if [ -e /lib/modules/$(uname -r)/extra/ide/dboxide.ko ] ; then
- loadmodule(dboxide)
- fi
-else
- # kernel 2.4
- if [ -e /lib/modules/$(uname -r)/misc/dboxide.o ] ; then
- loadmodule(ide-core)
- loadmodule(dboxide)
- loadmodule(ide-detect)
- loadmodule(ide-disk)
- loadmodule(ext2)
- loadmodule(jbd)
- loadmodule(ext3)
- loadmodule(xfs)
- fi
+# TODO: mmc still not working
+if [ -e /lib/modules/$(uname -r)/extra/mmc/mmc_spi_block.ko ] ; then
+ ifmarkerfile({mmc},{loadmodule(mmc_spi_block)})
fi
-if [ $KMINOR -ge 6 ]; then
- # everything else is already mounted
- mount /var
-else
- # Mount file systems in /etc/fstab
- mount -a
+if [ -e /sys/module/ide_disk -o -e /sys/module/mmc_spi_block ] ; then
+ ifmarkerfile({ext2fs},{loadmodule(ext2)})
+ ifmarkerfile({ext3fs},{loadmodule(ext3)})
+ loadmodule(xfs)
+ ifmarkerfile({vfatfs},{loadmodule(vfat)})
fi
+runprogifexists({/var/tuxbox/config/target0.hdparm},{hdparm},{"`cat /var/tuxbox/config/target0.hdparm`" /dev/hda})
+runprogifexists({/var/tuxbox/config/target1.hdparm},{hdparm},{"`cat /var/tuxbox/config/target1.hdparm`" /dev/hdb})
+},{ dnl === Kernel 2.4 ===
+if [ -e /lib/modules/$(uname -r)/misc/dboxide.o ] ; then
+ loadmodule(ide-core)
+ loadmodule(dboxide)
+ loadmodule(ide-detect)
+ loadmodule(ide-disk)
+ loadmodule(ext2)
+ loadmodule(jbd)
+ loadmodule(ext3)
+ loadmodule(xfs)
+ runprogifexists({/var/tuxbox/config/target0.hdparm},{hdparm},{"`cat /var/tuxbox/config/target0.hdparm`" /dev/ide/host0/bus0/target0/lun0/disc})
+ runprogifexists({/var/tuxbox/config/target1.hdparm},{hdparm},{"`cat /var/tuxbox/config/target1.hdparm`" /dev/ide/host0/bus0/target1/lun0/disc})
+fi
+})
+# Mount all file systems in /etc/fstab
+mount -a
# Turn on swap
ifmarkerfile({swap},{swapon -a})
-runprogifexists({/var/tuxbox/config/target0.hdparm},{hdparm},{"`cat /var/tuxbox/config/target0.hdparm`" /dev/ide/host0/bus0/target0/lun0/disc})
-runprogifexists({/var/tuxbox/config/target1.hdparm},{hdparm},{"`cat /var/tuxbox/config/target1.hdparm`" /dev/ide/host0/bus0/target1/lun0/disc})
-
# Set time zone etc
. /etc/profile
@@ -188,115 +186,110 @@
exit 1
fi
-if [ $KMINOR -ge 6 ]; then
- # kernel 2.6
-
- dnl FIXME: using loadmodule makes no sense here
- dnl since modprobe is used to pull in the dependencies
-
- # I2C core
- loadmodule(dbox2_i2c)
- # load order is somehow important, if dbox2_napi (which pulls in
- # e.g. the demodulator drivers) is loaded first, at least tda80{xx,44h}
- # hang while initalizing the i2c-bus :-(
- loadmodule(saa7126)
- loadmodule(avs)
- loadmodule(lcd)
-
- loadmodule(dbox2_fp_input)
-
- loadmodule(dbox2_napi)
-
- loadmodule(avia_gt_fb)
- loadmodule(avia_gt_lirc)
- loadmodule(avia_gt_oss)
- loadmodule(avia_gt_v4l2)
-
- loadmodule(aviaEXT)
+ifdef({use_kernel_26},
+{
+dnl === Kernel 2.6 ===
+dnl FIXME: using loadmodule makes no sense here
+dnl since modprobe is used to pull in the dependencies
+# === I2C core
+loadmodule(dbox2_i2c)
+
+dnl load order is somehow important, if dbox2_napi (which pulls in
+dnl e.g. the demodulator drivers) is loaded first, at least tda80{xx,44h}
+dnl hang while initalizing the i2c-bus :-(
+# ==== Demodulator, Frontprocessor etc.
+loadmodule(saa7126)
+loadmodule(avs)
+loadmodule(lcd)
+loadmodule(dbox2_fp_input)
+loadmodule(dbox2_napi)
+
+# ==== avia drivers
+loadmodule(avia_gt_fb)
+loadmodule(avia_gt_lirc)
+loadmodule(avia_gt_oss)
+loadmodule(avia_gt_v4l2)
+loadmodule(aviaEXT)},{
+dnl === Kernel 2.4 ===
+loadmodule(dbox2_i2c)
+
+dnl Frontprocessor
+loadmodule(dbox2_fp)
+loadmodule(lcd)
+if [ -e /var/etc/.oldrc ]; then
+ loadmodule(dbox2_fp_input, disable_new_rc=1)
+elif [ -e /var/etc/.newrc ]; then
+ loadmodule(dbox2_fp_input, disable_old_rc=1)
+elif [ -e /var/etc/.philips_rc_patch ]; then
+ loadmodule(dbox2_fp_input, philips_rc_patch=1)
else
- # kernel 2.4
-
- # I2C core
- loadmodule(dbox2_i2c)
-
- # Frontprocessor
- loadmodule(dbox2_fp)
- loadmodule(lcd)
- if [ -e /var/etc/.oldrc ]; then
- loadmodule(dbox2_fp_input, disable_new_rc=1)
- elif [ -e /var/etc/.newrc ]; then
- loadmodule(dbox2_fp_input, disable_old_rc=1)
- elif [ -e /var/etc/.philips_rc_patch ]; then
- loadmodule(dbox2_fp_input, philips_rc_patch=1)
- else
- loadmodule(dbox2_fp_input)
- fi
+ loadmodule(dbox2_fp_input)
+fi
- # Misc IO
- loadmodule(avs)
- loadmodule(saa7126)
-
- # Frontends
- if [ $VENDOR_ID -eq 1 ]; then
- # Nokia
- loadmodule(ves1820)
- loadmodule(ves1x93, board_type=1)
- loadmodule(cam, mio=0xC000000 firmware=/var/tuxbox/ucodes/cam-alpha.bin)
- elif [ $VENDOR_ID -eq 2 ]; then
- # Philips
- ifmarkerfile({tda80xx.o},
- {loadmodule(tda80xx)},
- {loadmodule(tda8044h)})
- loadmodule(cam, mio=0xC040000 firmware=/var/tuxbox/ucodes/cam-alpha.bin)
- elif [ $VENDOR_ID -eq 3 ]; then
- # Sagem
- loadmodule(at76c651)
- loadmodule(ves1x93, board_type=2)
- loadmodule(cam, mio=0xC000000 firmware=/var/tuxbox/ucodes/cam-alpha.bin)
- fi
+dnl Misc IO
+loadmodule(avs)
+loadmodule(saa7126)
+
+dnl Frontends
+if [ $VENDOR_ID -eq 1 ]; then
+ dnl Nokia
+ loadmodule(ves1820)
+ loadmodule(ves1x93, board_type=1)
+ loadmodule(cam, mio=0xC000000 firmware=/var/tuxbox/ucodes/cam-alpha.bin)
+elif [ $VENDOR_ID -eq 2 ]; then
+ dnl Philips
+ ifmarkerfile({tda80xx.o},
+ {loadmodule(tda80xx)},
+ {loadmodule(tda8044h)})
+ loadmodule(cam, mio=0xC040000 firmware=/var/tuxbox/ucodes/cam-alpha.bin)
+elif [ $VENDOR_ID -eq 3 ]; then
+ dnl Sagem
+ loadmodule(at76c651)
+ loadmodule(ves1x93, board_type=2)
+ loadmodule(cam, mio=0xC000000 firmware=/var/tuxbox/ucodes/cam-alpha.bin)
+fi
- loadmodule(dvb_i2c_bridge)
+loadmodule(dvb_i2c_bridge)
- loadmodule(avia_napi)
- loadmodule(cam_napi)
- loadmodule(dbox2_fp_napi)
-
- # Possibly turn off the watchdog on AVIA 500
- ifmarkerfile({no_watchdog},
- {loadmodule(avia_av, firmware=/var/tuxbox/ucodes no_watchdog=1)},
- {loadmodule(avia_av, firmware=/var/tuxbox/ucodes)})
-
- # Bei Avia_gt hw_sections und nowatchdog abfragen
- GTOPTS=""
- ifmarkerfile({hw_sections},{GTOPTS="hw_sections=0 "})
- ifmarkerfile({no_enxwatchdog},{GTOPTS="${{GTOPTS}}no_watchdog=1 "})
+loadmodule(avia_napi)
+loadmodule(cam_napi)
+loadmodule(dbox2_fp_napi)
+
+dnl Possibly turn off the watchdog on AVIA 500
+ifmarkerfile({no_watchdog},
+ {loadmodule(avia_av, firmware=/var/tuxbox/ucodes no_watchdog=1)},
+ {loadmodule(avia_av, firmware=/var/tuxbox/ucodes)})
+
+dnl Bei Avia_gt hw_sections und nowatchdog abfragen
+GTOPTS=""
+ifmarkerfile({hw_sections},{GTOPTS="hw_sections=0 "})
+ifmarkerfile({no_enxwatchdog},{GTOPTS="${{GTOPTS}}no_watchdog=1 "})
- loadmodule(avia_gt, {ucode=/var/tuxbox/ucodes/ucode.bin ${GTOPTS}})
+loadmodule(avia_gt, {ucode=/var/tuxbox/ucodes/ucode.bin ${GTOPTS}})
- loadmodule(avia_gt_fb, console_transparent=0)
- loadmodule(avia_gt_lirc)
- loadmodule(avia_gt_oss)
- loadmodule(avia_gt_v4l2)
+loadmodule(avia_gt_fb, console_transparent=0)
+loadmodule(avia_gt_lirc)
+loadmodule(avia_gt_oss)
+loadmodule(avia_gt_v4l2)
+
+loadmodule(avia_av_napi)
+ifmarkerfile({spts_mode},
+ {loadmodule(avia_gt_napi, mode=1)
+ loadmodule(dvb2eth)},
+ {loadmodule(avia_gt_napi)})
- loadmodule(avia_av_napi)
- ifmarkerfile({spts_mode},
- {loadmodule(avia_gt_napi, mode=1)
- loadmodule(dvb2eth)},
- {loadmodule(avia_gt_napi)})
+loadmodule(aviaEXT)
+})
- loadmodule(aviaEXT)
-fi
-
-# Create a telnet greeting
+dnl Create a telnet greeting
echo "$VENDOR $MODEL - Kernel %r (%t)." > /etc/issue.net
-# compatibility links
-if [ $KMINOR -lt 6 ]; then
- # compatibility links
- ln -sf demux0 /dev/dvb/adapter0/demux1
- ln -sf dvr0 /dev/dvb/adapter0/dvr1
- ln -sf fb/0 /dev/fb0
-fi
+ifdef({use_kernel_26}, {}, { dnl === Kernel 2.4 ===
+ dnl compatibility links
+ ln -sf demux0 /dev/dvb/adapter0/demux1
+ ln -sf dvr0 /dev/dvb/adapter0/dvr1
+ ln -sf fb/0 /dev/fb0
+})
if [ ! -d /var/etc ] ; then
mkdir /var/etc
@@ -318,19 +311,21 @@
loadmodule(smbfs)
fi
-# Start the nfs server if /etc/exports exists
+dnl Start the nfs server if /etc/exports exists
runprogifexists({/etc/exports},{loadmodule(nfsd)
pidof portmap >/dev/null || portmap
exportfs -r
rpc.mountd
rpc.nfsd 3})
-
-#Start the samba server if /var/etc/.sambaserver and /etc/smb.conf.dbox exist
-ifmarkerfile({sambaserver},{if [ -e /etc/smb.conf -a -x /bin/nmbd -a -x /bin/smbd ]; then
+dnl
+dnl Start the samba server if /var/etc/.sambaserver and /etc/smb.conf.dbox exist
+ifmarkerfile({sambaserver},{
+ if [ -e /etc/smb.conf -a -x /bin/nmbd -a -x /bin/smbd ]; then
/bin/nmbd -D
/bin/smbd -D -a -s /etc/smb.conf
- fi})
-
+ fi
+})
+dnl
ifmarkerfile({tuxmaild},{tuxmaild})
ifmarkerfile({tuxcald},{tuxcald})
ifmarkerfile({rdate},{rdate time.fu-berlin.de})
@@ -344,3 +339,5 @@
elif [ -e /etc/init.d/rcS.local ]; then
. /etc/init.d/rcS.local
fi
+dnl debug helper
+ifdef({use_kernel_26},{dmesg >/tmp/dmesg-rcS.log},{})