From 37c529011376ceb87e22ac3af970839805e37e66 Mon Sep 17 00:00:00 2001 From: Ricardo Salveti de Araujo Date: Mon, 9 Nov 2009 20:47:29 -0300 Subject: [PATCH 046/118] initscripts-1.0: adding mamona modifications Signed-off-by: Ricardo Salveti de Araujo --- recipes/initscripts/initscripts-1.0/checkroot | 2 +- .../initscripts/initscripts-1.0/mamona/bootmisc.sh | 85 ++++++++++++++++++++ .../initscripts/initscripts-1.0/mamona/volatiles | 37 +++++++++ recipes/initscripts/initscripts_1.0.bb | 11 ++- 4 files changed, 131 insertions(+), 4 deletions(-) create mode 100755 recipes/initscripts/initscripts-1.0/mamona/bootmisc.sh create mode 100644 recipes/initscripts/initscripts-1.0/mamona/volatiles diff --git a/recipes/initscripts/initscripts-1.0/checkroot b/recipes/initscripts/initscripts-1.0/checkroot index 7ad00d0..fe9cc37 100755 --- a/recipes/initscripts/initscripts-1.0/checkroot +++ b/recipes/initscripts/initscripts-1.0/checkroot @@ -186,7 +186,7 @@ ROOTFSDEV="/dev/root" if ! grep -q "^$ROOTFSDEV\>" /proc/mounts; then ROOTFSDEV="rootfs" fi -if [ x$(grep "^$ROOTFSDEV\>" /proc/mounts | awk '{print $4}') = "x$rootmode" ]; then +if grep "^$ROOTFSDEV\>" /proc/mounts | awk '{print $4}' | egrep -q "(^|,)$rootmode($|,)" ; then echo "Root filesystem already $rootmode, not remounting" exit 0 fi diff --git a/recipes/initscripts/initscripts-1.0/mamona/bootmisc.sh b/recipes/initscripts/initscripts-1.0/mamona/bootmisc.sh new file mode 100755 index 0000000..b00c543 --- /dev/null +++ b/recipes/initscripts/initscripts-1.0/mamona/bootmisc.sh @@ -0,0 +1,85 @@ +# +# bootmisc.sh Miscellaneous things to be done during bootup. +# + +. /etc/default/rcS +# +# Put a nologin file in /etc to prevent people from logging in before +# system startup is complete. +# +if test "$DELAYLOGIN" = yes +then + echo "System bootup in progress - please wait" > /etc/nologin + cp /etc/nologin /etc/nologin.boot +fi + +# +# Set pseudo-terminal access permissions. +# +if ( ! grep -q devfs /proc/mounts ) && test -c /dev/ttyp0 +then + chmod 666 /dev/tty[p-za-e][0-9a-f] + chown root:tty /dev/tty[p-za-e][0-9a-f] +fi + +# +# Apply /proc settings if defined +# +SYSCTL_CONF="/etc/sysctl.conf" +if [ -f "${SYSCTL_CONF}" ] +then + if [ -x "/sbin/sysctl" ] + then + /sbin/sysctl -p "${SYSCTL_CONF}" + else + echo "To have ${SYSCTL_CONF} applied during boot, install package ." + fi +fi + +# +# Update /etc/motd. +# +if test "$EDITMOTD" != no +then + uname -a > /etc/motd.tmp + sed 1d /etc/motd >> /etc/motd.tmp + mv /etc/motd.tmp /etc/motd +fi + +# +# This is as good a place as any for a sanity check +# /tmp should be a symlink to /var/tmp to cut down on the number +# of mounted ramdisks. +if test ! -L /tmp && test -d /var/tmp +then + # also check if we have /tmp already mounted (happens with maemo initfs) + if awk -F' ' '{ print $2 }' < /proc/mounts | grep -q "^/tmp" + then + umount /tmp + fi + rm -rf /tmp + ln -sf /var/tmp /tmp +fi + +# +# Update dynamic library cache, but only if ld.so.conf is present +# +if [ -e /etc/ld.so.conf ] ; then + /sbin/ldconfig +fi + +# Set the system clock from hardware clock +# If the timestamp is 1 day or more recent than the current time, +# use the timestamp instead. +test -x /etc/init.d/hwclock.sh && /etc/init.d/hwclock.sh start +if test -e /etc/timestamp +then + SYSTEMDATE=`date "+%Y%m%d"` + TIMESTAMP=`cat /etc/timestamp | awk '{ print substr($0,9,4) substr($0,1,4);}'` + NEEDUPDATE=`expr \( $TIMESTAMP \> $SYSTEMDATE \)` + if [ $NEEDUPDATE -eq 1 ]; then + date `cat /etc/timestamp` + /etc/init.d/hwclock.sh stop + fi +fi +: exit 0 diff --git a/recipes/initscripts/initscripts-1.0/mamona/volatiles b/recipes/initscripts/initscripts-1.0/mamona/volatiles new file mode 100644 index 0000000..ba856ab --- /dev/null +++ b/recipes/initscripts/initscripts-1.0/mamona/volatiles @@ -0,0 +1,37 @@ +# This configuration file lists filesystem objects that should get verified +# during startup and be created if missing. +# +# Every line must either be a comment starting with # +# or a definition of format: +# +# where the items are separated by whitespace ! +# +# : d|f|l : (d)irectory|(f)ile|(l)ink +# +# A linking example: +# l root root 0777 /var/test /tmp/testfile +# f root root 0644 /var/test none +# +# Understanding links: +# When populate-volatile is to verify/create a directory or file, it will first +# check it's existence. If a link is found to exist in the place of the target, +# the path of the target is replaced with the target the link points to. +# Thus, if a link is in the place to be verified, the object will be created +# in the place the link points to instead. +# This explains the order of "link before object" as in the example above, where +# a link will be created at /var/test pointing to /tmp/testfile and due to this +# link the file defined as /var/test will actually be created as /tmp/testfile. +d root root 0755 /var/volatile/cache none +d root root 1777 /var/volatile/lock none +d root root 0755 /var/volatile/log none +d root root 0755 /var/volatile/run none +d root root 1777 /var/volatile/tmp none +l root root 0755 /var/cache /var/volatile/cache +l root root 1777 /var/lock /var/volatile/lock +l root root 0755 /var/log /var/volatile/log +l root root 0755 /var/run /var/volatile/run +l root root 1777 /var/tmp /var/volatile/tmp +d root root 0755 /var/lock/subsys none +f root root 0664 /var/log/wtmp none +f root root 0644 /var/log/lastlog none +f root root 0664 /var/run/utmp none diff --git a/recipes/initscripts/initscripts_1.0.bb b/recipes/initscripts/initscripts_1.0.bb index 6642144..a3f412c 100644 --- a/recipes/initscripts/initscripts_1.0.bb +++ b/recipes/initscripts/initscripts_1.0.bb @@ -4,7 +4,7 @@ PRIORITY = "required" DEPENDS = "makedevs" RDEPENDS = "makedevs" LICENSE = "GPL" -PR = "r115" +PR = "r116" SRC_URI = "file://functions \ file://halt \ @@ -103,8 +103,8 @@ do_install () { ln -sf ../init.d/umountfs ${D}${sysconfdir}/rc0.d/S40umountfs # udev will run at S55 if installed ln -sf ../init.d/halt ${D}${sysconfdir}/rc0.d/S90halt - ln -sf ../init.d/save-rtc.sh ${D}${sysconfdir}/rc0.d/S25save-rtc.sh - ln -sf ../init.d/save-rtc.sh ${D}${sysconfdir}/rc6.d/S25save-rtc.sh + ln -sf ../init.d/save-rtc.sh ${D}${sysconfdir}/rc0.d/S15save-rtc.sh + ln -sf ../init.d/save-rtc.sh ${D}${sysconfdir}/rc6.d/S15save-rtc.sh ln -sf ../init.d/banner ${D}${sysconfdir}/rcS.d/S02banner ln -sf ../init.d/checkroot ${D}${sysconfdir}/rcS.d/S10checkroot # ln -sf ../init.d/checkfs.sh ${D}${sysconfdir}/rcS.d/S30checkfs.sh @@ -131,6 +131,11 @@ do_install_append_angstrom () { rm ${D}${sysconfdir}/init.d/devices ${D}${sysconfdir}/rcS.d/S05devices } +# Mamona also doesn't support devfs +do_install_append_mamona () { + rm ${D}${sysconfdir}/init.d/devices ${D}${sysconfdir}/rcS.d/S05devices +} + # HIPOX needs /sys in reboot for kexec check do_install_append_hipox () { ln -sf ../init.d/sysfs.sh ${D}${sysconfdir}/rc6.d/S80sysfs -- 1.6.3.3