From 293ef55bd720ae863af4474b7ac3ec90dd9fdacc Mon Sep 17 00:00:00 2001 From: Rene Wagner Date: Wed, 16 Aug 2006 14:56:27 +0200 Subject: [PATCH 1/1] base-files, initscripts: stop the populate-volatiles madness. reinstate populate-var.sh. fix upgrade path by re-adding /etc/resolv.conf. - 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 --- .../packages/base-files/base-files_3.0.14.bb | 131 +++++++----------- .../initscripts-1.0/populate-volatile.sh | 2 + .../initscripts/initscripts-1.0/volatiles | 39 ------ .../packages/initscripts/initscripts_1.0.bb | 6 +- 4 files changed, 56 insertions(+), 122 deletions(-) delete mode 100644 org.handhelds.familiar/packages/initscripts/initscripts-1.0/volatiles diff --git a/org.handhelds.familiar/packages/base-files/base-files_3.0.14.bb b/org.handhelds.familiar/packages/base-files/base-files_3.0.14.bb index 6c71109..16e91e5 100644 --- a/org.handhelds.familiar/packages/base-files/base-files_3.0.14.bb +++ b/org.handhelds.familiar/packages/base-files/base-files_3.0.14.bb @@ -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 " -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" - diff --git a/org.handhelds.familiar/packages/initscripts/initscripts-1.0/populate-volatile.sh b/org.handhelds.familiar/packages/initscripts/initscripts-1.0/populate-volatile.sh index 99a469d..6614ad6 100755 --- a/org.handhelds.familiar/packages/initscripts/initscripts-1.0/populate-volatile.sh +++ b/org.handhelds.familiar/packages/initscripts/initscripts-1.0/populate-volatile.sh @@ -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 index 37ce8b5..0000000 --- a/org.handhelds.familiar/packages/initscripts/initscripts-1.0/volatiles +++ /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: -# [] -# 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 -# -# 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 diff --git a/org.handhelds.familiar/packages/initscripts/initscripts_1.0.bb b/org.handhelds.familiar/packages/initscripts/initscripts_1.0.bb index 2215b2f..f851036 100644 --- a/org.handhelds.familiar/packages/initscripts/initscripts_1.0.bb +++ b/org.handhelds.familiar/packages/initscripts/initscripts_1.0.bb @@ -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 -- 2.41.1