]> code.ossystems Code Review - openembedded-core.git/commitdiff
apt: Do not install /var/log/apt for target
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>
Tue, 2 Nov 2021 19:57:24 +0000 (20:57 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 3 Nov 2021 10:12:01 +0000 (10:12 +0000)
/var/log is normally a link to /var/volatile/log and /var/volatile is a
tmpfs mount. So anything created in /var/log will not be available when
the tmpfs is mounted.

Also some whitespace clean up.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/apt/apt_2.2.4.bb

index 29fc49fb3922f5d2917564fd1f7396c2b8952ea0..4e710e11a8ed88b033f24f315c47c8b84958f5bc 100644 (file)
@@ -51,9 +51,8 @@ EXTRA_OECMAKE:append = " -DCURRENT_VENDOR=debian -DWITH_DOC=False \
     -DWITH_TESTS=False \
 "
 
-do_configure:prepend () {
-    echo "set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH )" >>  ${WORKDIR}/toolchain.cmake
-
+do_configure:prepend() {
+       echo "set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH )" >>  ${WORKDIR}/toolchain.cmake
 }
 
 # Unfortunately apt hardcodes this all over the place
@@ -61,7 +60,7 @@ FILES:${PN} += "${prefix}/lib/dpkg ${prefix}/lib/apt"
 RDEPENDS:${PN} += "bash perl dpkg"
 
 customize_apt_conf_sample() {
-    cat > ${D}${sysconfdir}/apt/apt.conf.sample << EOF
+       cat > ${D}${sysconfdir}/apt/apt.conf.sample << EOF
 Dir "${STAGING_DIR_NATIVE}/"
 {
    State "var/lib/apt/"
@@ -114,22 +113,25 @@ EOF
 }
 
 do_install:append:class-native() {
-    customize_apt_conf_sample
+       customize_apt_conf_sample
 }
 
 do_install:append:class-nativesdk() {
-    customize_apt_conf_sample
+       customize_apt_conf_sample
 }
 
-
 do_install:append:class-target() {
-    #Write the correct apt-architecture to apt.conf
-    APT_CONF=${D}/etc/apt/apt.conf
-    echo 'APT::Architecture "${DPKG_ARCH}";' > ${APT_CONF}
+       # Write the correct apt-architecture to apt.conf
+       APT_CONF=${D}${sysconfdir}/apt/apt.conf
+       echo 'APT::Architecture "${DPKG_ARCH}";' > ${APT_CONF}
+
+       # Remove /var/log/apt. /var/log is normally a link to /var/volatile/log
+       # and /var/volatile is a tmpfs mount. So anything created in /var/log
+       # will not be available when the tmpfs is mounted.
+       rm -rf ${D}${localstatedir}/log
 }
 
-# Avoid non-reproducible -src package
-do_install:append () {
-        sed -i -e "s,${B},,g" \
-            ${B}/apt-pkg/tagfile-keys.cc
+do_install:append() {
+       # Avoid non-reproducible -src package
+       sed -i -e "s,${B},,g" ${B}/apt-pkg/tagfile-keys.cc
 }