]> pilppa.org Git - familiar-h63xx-build.git/commitdiff
base-files, initscripts: stop the populate-volatiles madness. reinstate populate...
authorRene Wagner <rw@handhelds.org>
Wed, 16 Aug 2006 12:56:27 +0000 (14:56 +0200)
committerRene Wagner <rw@handhelds.org>
Wed, 16 Aug 2006 12:56:27 +0000 (14:56 +0200)
- populate-volatiles.sh needs > 5 seconds to create a handful of files/directories
- removing /etc/resolv.conf from the package broke upgrades since ipkg will
  remove it and no longer be able to perform DNS lookups
- also add /etc/resolv.conf to CONFFILES
- and remove all sorts of cruft that has accumulated over the years
- this was all working fine 2 years ago...

Signed-off-by: Rene Wagner <rw@handhelds.org>
org.handhelds.familiar/packages/base-files/base-files_3.0.14.bb
org.handhelds.familiar/packages/initscripts/initscripts-1.0/populate-volatile.sh
org.handhelds.familiar/packages/initscripts/initscripts-1.0/volatiles [deleted file]
org.handhelds.familiar/packages/initscripts/initscripts_1.0.bb

index 6c711096eb736ec02f5696760802ec3b45f0dc59..16e91e5df5904f659eb63ccfcb0a3fc209cc3b79 100644 (file)
@@ -1,10 +1,10 @@
 DESCRIPTION = "Miscellaneous files for the base system."
 SECTION = "base"
 PRIORITY = "required"
-PR = "r48"
 LICENSE = "GPL"
+PR = "r49"
 
-PACKAGE_ARCH = "${MACHINE_ARCH}"
+RDEPENDS = " initscripts (>= 1.0-r62)"
 
 SRC_URI = " \
            file://nsswitch.conf \
@@ -27,6 +27,19 @@ SRC_URI = " \
            file://licenses/Artistic "
 S = "${WORKDIR}"
 
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+PACKAGES = "${PN}-doc ${PN}"
+FILES_${PN} = "/"
+FILES_${PN}-doc = "${docdir}"
+
+
+CONFFILES_${PN} = "${sysconfdir}/resolv.conf \
+                   ${sysconfdir}/fstab \
+                  ${sysconfdir}/hostname"
+
+
 docdir_append = "/${P}"
 dirs1777 = "/tmp ${localstatedir}/lock ${localstatedir}/tmp"
 dirs2775 = "/home ${prefix}/src ${localstatedir}/local"
@@ -41,19 +54,28 @@ dirs755 = "/bin /boot /dev ${sysconfdir} ${sysconfdir}/default \
           ${localstatedir}/lock/subsys ${localstatedir}/log \
           ${localstatedir}/run ${localstatedir}/spool \
           /mnt /media /media/card /media/cf /media/net /media/ram \
-          /media/union /media/realroot /media/hdd \
+          /media/hdd \
            /media/mmc1"
 conffiles = "${sysconfdir}/debian_version ${sysconfdir}/host.conf \
             ${sysconfdir}/inputrc ${sysconfdir}/issue /${sysconfdir}/issue.net \
             ${sysconfdir}/nsswitch.conf ${sysconfdir}/profile \
             ${sysconfdir}/default"
 
+def filter_tmpfs(files, d):
+       r = []
+       for f in files.split():
+               if f.startswith("${localstatedir}") or f.startswith("/var"):
+                       r.append(f)
+       return " ".join(r)
+
+tmpfsdirs1777 = "${@filter_tmpfs(bb.data.getVar("dirs1777", d, 0), d)}"
+tmpfsdirs2775 = "${@filter_tmpfs(bb.data.getVar("dirs2775", d, 0), d)}"
+tmpfsdirs755 = "${@filter_tmpfs(bb.data.getVar("dirs755", d, 0), d)}"
+tmpfsfiles664 = "${localstatedir}/run/utmp \
+                ${localstatedir}/log/wtmp \
+                ${localstatedir}/log/lastlog"
+
 hostname = "openembedded"
-hostname_openslug = "openslug"
-hostname_mnci = "MNCI"
-PACKAGE_ARCH_mnci = "mnci"
-hostname_rt3000 = "MNRT"
-PACKAGE_ARCH_rt3000 = "rt3000"
 
 do_install () {
        for d in ${dirs755}; do
@@ -107,76 +129,27 @@ do_install () {
                install -m 0644 ${WORKDIR}/licenses/$license ${D}${datadir}/common-licenses/
        done
 
-       ln -sf /proc/mounts ${D}${sysconfdir}/mtab
-}
-
-
-do_install_append_mnci () {
-       rmdir ${D}/tmp
-       mkdir -p ${D}${localstatedir}/tmp
-       ln -s var/tmp ${D}/tmp
-}
-
-do_install_append_nylon() {
-       printf "" "" >${D}${sysconfdir}/resolv.conf
-       rm -r ${D}/mnt/*
-       rm -r ${D}/media
-       rm -rf ${D}/tmp
-       ln -sf /var/tmp ${D}/tmp
-}
-
-do_install_append_openslug() {
-       printf "" "" >${D}${sysconfdir}/resolv.conf
-       rm -r ${D}/mnt/*
-       rmdir ${D}/home/root
-       install -m 0755 -d ${D}/root
-       ln -s ../root ${D}/home/root
-}
-
-
-#some familiar stuff below
-do_install_append_familiar() {
-       mkdir -p ${D}/${sysconfdir}/default/volatiles
-       echo "l root root 644 /etc/resolv.conf /var/run/resolv.conf" > ${D}/${sysconfdir}/default/volatiles/01_resolv.conf
-}
-
-do_install_append_openzaurus() {
-       mkdir -p ${D}/${sysconfdir}/default/volatiles
-       echo "l root root 644 /etc/resolv.conf /var/run/resolv.conf" > ${D}/${sysconfdir}/default/volatiles/01_resolv.conf
-}
-
-pkg_postinst_familiar() {
-#!/bin/sh
-/etc/init.d/populate-volatile.sh
-}
+       if (grep -q "^\(tmpfs\|ramfs\)\W\+/var" ${D}${sysconfdir}/fstab); then
+               # remove from package
+               rm -rf ${D}${localstatedir}/*
+
+               # create on boot
+               install -d ${D}${sysconfdir}/init.d ${D}${sysconfdir}/rcS.d
+               echo "mkdir -p ${tmpfsdirs1777}" >> ${D}${sysconfdir}/init.d/populate-var.sh
+               echo "chmod 1777 ${tmpfsdirs1777}" >> ${D}${sysconfdir}/init.d/populate-var.sh
+               echo "mkdir -p ${tmpfsdirs2775}" >> ${D}${sysconfdir}/init.d/populate-var.sh
+               echo "chmod 2775 ${tmpfsdirs2775}" >> ${D}${sysconfdir}/init.d/populate-var.sh
+               echo "mkdir -p ${tmpfsdirs755}" >> ${D}${sysconfdir}/init.d/populate-var.sh
+               echo "chmod 0755 ${tmpfsdirs755}" >> ${D}${sysconfdir}/init.d/populate-var.sh
+               echo "touch ${tmpfsfiles664}" >> ${D}${sysconfdir}/init.d/populate-var.sh
+               echo "chmod 0664 ${tmpfsfiles664}" >> ${D}${sysconfdir}/init.d/populate-var.sh
+               chmod 0755 ${D}${sysconfdir}/init.d/populate-var.sh
+               ln -sf ../init.d/populate-var.sh ${D}${sysconfdir}/rcS.d/S37populate-var.sh
+
+               # ship symlinks
+               ln -sf ${localstatedir}/run/resolv.conf ${D}${sysconfdir}/resolv.conf
+               ln -sf ${localstatedir}/ld.so.cache ${D}${sysconfdir}/ld.so.cache
+       fi
 
-pkg_postinst_openzaurus() {
-#!/bin/sh
-/etc/init.d/populate-volatile.sh
+       ln -sf /proc/mounts ${D}${sysconfdir}/mtab
 }
-
-DEPENDS_append_familiar = " initscripts" 
-RDEPENDS_append_familiar = " initscripts (>= 1.0-r60)"
-DEPENDS_append_openzaurus = " initscripts" 
-RDEPENDS_append_openzaurus = " initscripts (>= 1.0-r60)"
-
-
-PACKAGES = "${PN}-doc ${PN}"
-FILES_${PN} = "/"
-FILES_${PN}-doc = "${docdir} ${datadir}/common-licenses"
-
-
-# Unslung distribution specific packages follow ...
-
-PACKAGES_unslung = "${PN}-unslung"
-PACKAGE_ARCH_${PN}-unslung = "nslu2"
-MAINTAINER_${PN}-unslung = "NSLU2 Linux <www.nslu2-linux.org>"
-RDEPENDS_${PN}-unslung = "nslu2-linksys-ramdisk"
-RPROVIDES_${PN}-unslung = "${PN}"
-
-FILES_${PN}-unslung = ""
-
-CONFFILES_${PN} = "${sysconfdir}/fstab ${sysconfdir}/hostname"
-CONFFILES_${PN}_nylon = "${sysconfdir}/resolv.conf ${sysconfdir}/fstab ${sysconfdir}/hostname"
-CONFFILES_${PN}_openslug = "${sysconfdir}/resolv.conf ${sysconfdir}/fstab ${sysconfdir}/hostname"
-
index 99a469d5764831365ee8c4ac3e04c71a7868decb..6614ad666e7ce77ae17669c892106ffede076384 100755 (executable)
@@ -6,6 +6,8 @@ CFGDIR="/etc/default/volatiles"
 TMPROOT="/var/tmp"
 COREDEF="00_core"
 
+ls ${CFGDIR}/*  2> /dev/null > /dev/null || exit 0
+
 [ "${VERBOSE}" != "no" ] && echo "Populating volatile Filesystems."
 
 
diff --git a/org.handhelds.familiar/packages/initscripts/initscripts-1.0/volatiles b/org.handhelds.familiar/packages/initscripts/initscripts-1.0/volatiles
deleted file mode 100644 (file)
index 37ce8b5..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-# 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:
-# <type> <owner> <group> <mode> <path> [<linksource>]
-# where the items are separated by whitespace !
-#
-# <type> : 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
-#
-# 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 0775 /var
-d root root 0755 /var/backups
-d root root 0755 /var/cache
-d root root 0755 /var/lib
-d root root 0755 /var/lib/ipkg
-d root root 0755 /var/lib/misc
-d root root 2775 /var/local
-d root root 1777 /var/lock
-d root root 0755 /var/lock/subsys
-d root root 0755 /var/log
-d root root 0755 /var/run
-d root root 0755 /var/spool
-d root root 1777 /var/tmp
-f root root 0664 /var/run/utmp
-f root root 0664 /var/log/wtmp
-f root root 0664 /var/log/lastlog
index 2215b2f25696bf873dfcf82196592a13b83073ad..f851036737bafa891fe7e5177c75a4691e8543a6 100644 (file)
@@ -6,7 +6,7 @@ DEPENDS = "makedevs"
 DEPENDS_openzaurus = "makedevs virtual/kernel"
 RDEPENDS = "makedevs"
 LICENSE = "GPL"
-PR = "r61"
+PR = "r62"
 
 SRC_URI = "file://halt \
            file://ramdisk \
@@ -30,8 +30,7 @@ SRC_URI = "file://halt \
            file://umountnfs.sh \
            file://sysfs.sh \
            file://device_table.txt \
-           file://populate-volatile.sh \
-           file://volatiles "
+           file://populate-volatile.sh "
 
 SRC_URI_append_arm          = " file://alignment.sh"
 SRC_URI_append_openzaurus   = " file://checkversion"
@@ -82,7 +81,6 @@ do_install () {
        install -m 0755    ${WORKDIR}/devpts            ${D}${sysconfdir}/default
        install -m 0755    ${WORKDIR}/sysfs.sh          ${D}${sysconfdir}/init.d
        install -m 0755    ${WORKDIR}/populate-volatile.sh ${D}${sysconfdir}/init.d
-       install -m 0644    ${WORKDIR}/volatiles         ${D}${sysconfdir}/default/volatiles/00_core
        if [ "${TARGET_ARCH}" = "arm" ]; then
                install -m 0755 ${WORKDIR}/alignment.sh ${D}${sysconfdir}/init.d
        fi