Message ID | 20231126202428.1158-1-zajec5@gmail.com |
---|---|
State | RFC |
Delegated to: | Rafał Miłecki |
Headers | show
Return-Path: <openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=3T6Ws8a2; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=Gv17LQnF; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SdgHb6Rt5z1yRy for <incoming@patchwork.ozlabs.org>; Mon, 27 Nov 2023 07:27:05 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=voxfoIZZn1Op0xsqX2fCVnZsj5YtSFpyEN+NVEcPUuY=; b=3T6Ws8a2cLwDP7 SVCQRjFSmx7Z8xXBJJ+DXYxNPMMF9fe+NxUXw3NbUCLvth6oHpjHEEakKeSm1HPOJbw6TiQRmodf7 QzljpZuOMjXFAUpTvg7vzJcbcWo+6usJn9PRRyzJ/W8UY95JXcxrIC8hqTkPlpx09QsQR44drDm20 Sw47fGOWMadL9tsJ/RtK44U6Z8kOYot2v2hCLFZ+KUBI7vsUGp/7yBzJRPbyeAW8ZPI1YKTvG7gf1 6T9JKAI/8nxV7VIRsorE2LTIAme499vW5q85n8kRd8IGrzEhP2k+T5TdB/9CO8IzGbcPxJ9NDgH1D uIKCMl92xOgw3XH3XoiQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r7LgI-00Ey1c-2q; Sun, 26 Nov 2023 20:24:43 +0000 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r7LgE-00ExyR-2y for openwrt-devel@lists.openwrt.org; Sun, 26 Nov 2023 20:24:40 +0000 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-548f0b7ab11so4922497a12.1 for <openwrt-devel@lists.openwrt.org>; Sun, 26 Nov 2023 12:24:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701030276; x=1701635076; darn=lists.openwrt.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=RHCa95Zx/hVUf1frHT9pUmrsqRs5jXzzckY08ofZ1+0=; b=Gv17LQnFBnIqgOWsj8p1P93wjPfSdoYfbD9rDEqefxAr+18SUlj2GycSViFe/jfZKZ +CAhpAugWmE5eEdzH/0eDvkDcEnMrMlwoHoY4sRew3XU6gdVIwNPYQZjOMcO5sUNdUgS kFY//CINnjAVdVzbTpxpBb+xWjwPx3+aAHqDcIYPJRIUWQdSlgaBqAbz0CK8lSkpncJ1 i9A5j6PMq5/i9CNlSQVEPYMDvqUuE7AUIG+KZhxkx+z48MmFBubEYaygNyVxMFW7oH0r 0KeydrkLleOuQjxtIxE3pBUvp2CD4JqKNzDcBWrG72aZFma1KD9VqmSuPrOgZP9yuJWY Zhqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701030276; x=1701635076; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RHCa95Zx/hVUf1frHT9pUmrsqRs5jXzzckY08ofZ1+0=; b=bXKTdVXB2XKNXSkWc0W7M8JnsDCogBTs3mpQuDHtlKk0fLQywC9CF698radE3GULHR KpnBfCTuZSuhQuKYb/EvM0/pMo/xyF5JlY4B6K55gnV1B7XT67I2CyNt92WCrUH2yUd2 SCiApvcPaloCdP3cBFp9GcMaTc/MnZbBpDwCDsM0XQ+hE2K8ahVFNLewgwyp4TbVF/k5 zgVD/3YaCbZqmqZ2wo8ho8iyAvX4VsbMUBYH94oc9ebqGcJhD1rDU7zqXboCtFhgw2O3 BHdCBxjV09WT5aTE/A0lz/Dq7/2BMVt0hZmvqFMQ21lQ4ZTKwxc0x+NZOlzEBRpOPmmC 340g== X-Gm-Message-State: AOJu0Yxt7y6EKVP11N28Xm47vaHAlfE8EwaqYpTuPV1HRJipjq130Cdi cDZtRKzEMcdz+9IEfQD1lCxQEx3FT4w= X-Google-Smtp-Source: AGHT+IGEcwmAgofFjXO8EXZ0qXyDWG8d7uk3/pKwo91aA+Bry+gb7RK+QjjVD8E/J/zb0s9Yr+qt5Q== X-Received: by 2002:a17:906:5352:b0:9e6:b18c:15dd with SMTP id j18-20020a170906535200b009e6b18c15ddmr6859036ejo.13.1701030276273; Sun, 26 Nov 2023 12:24:36 -0800 (PST) Received: from localhost.lan (031011218106.poznan.vectranet.pl. [31.11.218.106]) by smtp.gmail.com with ESMTPSA id w1-20020a170906b18100b00a046a773175sm4844475ejy.122.2023.11.26.12.24.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Nov 2023 12:24:35 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= <zajec5@gmail.com> To: openwrt-devel@lists.openwrt.org Cc: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= <rafal@milecki.pl>, Hauke Mehrtens <hauke@hauke-m.de> Subject: [PATCH RFC] base-files: execute package's "postinst" after executing uci-defaults Date: Sun, 26 Nov 2023 21:24:28 +0100 Message-Id: <20231126202428.1158-1-zajec5@gmail.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231126_122439_002971_55DE93E9 X-CRM114-Status: GOOD ( 11.69 ) X-Spam-Score: 0.1 (/) X-Spam-Report: =?unknown-8bit?q?Spam_detection_software=2C_running_on_the_sy?= =?unknown-8bit?q?stem_=22bombadil=2Einfradead=2Eorg=22=2C?= =?unknown-8bit?q?_has_NOT_identified_this_incoming_email_as_spam=2E__The_ori?= =?unknown-8bit?q?ginal?= =?unknown-8bit?q?_message_has_been_attached_to_this_so_you_can_view_it_or_la?= =?unknown-8bit?q?bel?= =?unknown-8bit?q?_similar_future_email=2E__If_you_have_any_questions=2C_see?= =?unknown-8bit?q?_the_administrator_of_that_system_for_details=2E?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_preview=3A__From=3A_Rafa=C5=82_Mi=C5=82ecki_With_t?= =?unknown-8bit?q?his_change_=22postinst=22_scripts?= =?unknown-8bit?q?_can_perform_extra_actions_after_applying_all_kind_of_fixup?= =?unknown-8bit?q?s_implemented_using?= =?unknown-8bit?q?_uci-defaults=2E_This_is_needed_e=2Eg=2E_by_uhttpd-mod-ubus?= =?unknown-8bit?q?_which_after_installation?= =?unknown-8bit?q?_in_a_running_systems_needs_to=3A_1=2E_Update_uhttpd_config?= =?unknown-8bit?q?_using_its_uci-defaults?= =?unknown-8bit?q?_script_2=2E_Reload_uhttpd_?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_analysis_details=3A___=280=2E1_points=2C_5=2E0_req?= =?unknown-8bit?q?uired=29?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_pts_rule_name______________description?= =?unknown-8bit?q?_----_----------------------_------------------------------?= =?unknown-8bit?q?--------------------?= =?unknown-8bit?q?_-0=2E0_RCVD=5FIN=5FDNSWL=5FNONE_____RBL=3A_Sender_listed_a?= =?unknown-8bit?q?t_https=3A//www=2Ednswl=2Eorg/=2C?= =?unknown-8bit?q?_no_trust?= =?unknown-8bit?b?IFsyYTAwOjE0NTA6NDg2NDoyMDowOjA6MDo1MzYgbGlzdGVkIGluXQ==?= =?unknown-8bit?b?IFtsaXN0LmRuc3dsLm9yZ10=?= =?unknown-8bit?q?_-0=2E0_SPF=5FPASS_______________SPF=3A_sender_matches_SPF_?= =?unknown-8bit?q?record?= =?unknown-8bit?q?_0=2E0_SPF=5FHELO=5FNONE__________SPF=3A_HELO_does_not_publ?= =?unknown-8bit?q?ish_an_SPF_Record?= =?unknown-8bit?q?_0=2E0_FREEMAIL=5FFROM__________Sender_email_is_commonly_ab?= =?unknown-8bit?q?used_enduser_mail?= =?unknown-8bit?q?_provider?= =?unknown-8bit?q?_=5Bzajec5=5Bat=5Dgmail=2Ecom=5D?= =?unknown-8bit?q?_0=2E2_FREEMAIL=5FENVFROM=5FEND=5FDIGIT_Envelope-from_freem?= =?unknown-8bit?q?ail_username_ends?= =?unknown-8bit?q?_in_digit?= =?unknown-8bit?q?_=5Bzajec5=5Bat=5Dgmail=2Ecom=5D?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FAU__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_author=27s_domain?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID_____________Message_has_at_least_one_v?= =?unknown-8bit?q?alid_DKIM_or_DK_signature?= =?unknown-8bit?q?_0=2E1_DKIM=5FSIGNED____________Message_has_a_DKIM_or_DK_si?= =?unknown-8bit?q?gnature=2C_not_necessarily?= =?unknown-8bit?q?_valid?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FEF__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_envelope-from_domain?= X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List <openwrt-devel.lists.openwrt.org> List-Unsubscribe: <https://lists.openwrt.org/mailman/options/openwrt-devel>, <mailto:openwrt-devel-request@lists.openwrt.org?subject=unsubscribe> List-Archive: <http://lists.openwrt.org/pipermail/openwrt-devel/> List-Post: <mailto:openwrt-devel@lists.openwrt.org> List-Help: <mailto:openwrt-devel-request@lists.openwrt.org?subject=help> List-Subscribe: <https://lists.openwrt.org/mailman/listinfo/openwrt-devel>, <mailto:openwrt-devel-request@lists.openwrt.org?subject=subscribe> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "openwrt-devel" <openwrt-devel-bounces@lists.openwrt.org> Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org |
Series |
[RFC] base-files: execute package's "postinst" after executing uci-defaults
|
expand
|
diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index d9628dbb7a..851d2f1791 100644 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -270,11 +270,6 @@ default_postinst() { add_group_and_user "${pkgname}" - if [ -f "$root/usr/lib/opkg/info/${pkgname}.postinst-pkg" ]; then - ( . "$root/usr/lib/opkg/info/${pkgname}.postinst-pkg" ) - ret=$? - fi - if [ -d "$root/rootfs-overlay" ]; then cp -R $root/rootfs-overlay/. $root/ rm -fR $root/rootfs-overlay/ @@ -300,6 +295,11 @@ default_postinst() { rm -f /tmp/luci-indexcache fi + if [ -f "$root/usr/lib/opkg/info/${pkgname}.postinst-pkg" ]; then + ( . "$root/usr/lib/opkg/info/${pkgname}.postinst-pkg" ) + ret=$? + fi + local shell="$(command -v bash)" for i in $(grep -s "^/etc/init.d/" "$root$filelist"); do if [ -n "$root" ]; then