From patchwork Fri May 4 03:20:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosy Song X-Patchwork-Id: 908471 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rosinson.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DCfkNgHr"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40cckg0gzqz9s35 for ; Fri, 4 May 2018 13:22:03 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:Message-Id: Date: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=YfqyJHR/ApsSC+rZ3mcsNQRH647an6ZcniKbf8F4FHo=; b=DCfkNgHrOypXA7 ItJHM0OuOoTZksI46I3ReHNAXfdjPyRcQgirvKhNEVsj6EJ75+q7wMlZ7FtiH+GPzQxilWUD+CQzG F6yKes194bgmuB4D8EJGlVNmxc17/rO5wL6GA4nX1vxahY1fRgXVMegwc4SlASvAecDwuBhaSMScl vORZK7Z/sfWhE+QatYXx7sQpAC6i61zP03ZoSUsyBsbusjzIVchgJuRZgEDZNvV1zC8g357iNr6jM RxS/qgm3AQRFcQ1hmfs4oMldBQcAzeTqHQr+ToCvViVpFrrvikVvcQWs8rLex73j6lcIkrtJAzoAk mxYoYwutU/eYIUlEh2DQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fERIC-0006yy-IZ; Fri, 04 May 2018 03:21:56 +0000 Received: from out20-61.mail.aliyun.com ([115.124.20.61]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fERHp-0006w1-7b for lede-dev@lists.infradead.org; Fri, 04 May 2018 03:21:39 +0000 X-Alimail-AntiSpam: AC=CONTINUE; BC=0.08808781|-1; CH=green; FP=0|0|0|0|0|-1|-1|-1; HT=e01e01542; MF=rosysong@rosinson.com; NM=1; PH=DS; RN=3; RT=3; SR=0; TI=SMTPD_---.BvIkdGc_1525404048; Received: from localhost.localdomain(mailfrom:rosysong@rosinson.com fp:SMTPD_---.BvIkdGc_1525404048) by smtp.aliyun-inc.com(10.147.41.199); Fri, 04 May 2018 11:20:48 +0800 From: Rosy Song To: lede-dev@lists.infradead.org Date: Fri, 4 May 2018 11:20:06 +0800 Message-Id: <20180504032006.3804-1-rosysong@rosinson.com> X-Mailer: git-send-email 2.13.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180503_202133_473841_601BAAFF X-CRM114-Status: UNSURE ( 9.11 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [115.124.20.61 listed in list.dnswl.org] 0.0 T_SPF_TEMPERROR SPF: test of record failed (temperror) 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Subject: [LEDE-DEV] [PATCH] samba36: fix bug when firstboot without saving config files. X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rosy Song , john@phrozen.org MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org When we upgrade firmware(without saving config files), system will reboot and executes switchjffs2() function(see fstools package). During the process of switchjffs2(), the devices(such as /dev/sdaxx, /dev/blockmmcxx) mounted under /mnt dir will lost. This is for patch https://patchwork.ozlabs.org/patch/892633/ Since it will lost mount point, samba service also generate the options for devices. Signed-off-by: Rosy Song --- package/network/services/samba36/Makefile | 2 - .../network/services/samba36/files/samba.defaults | 60 ++++++++++++++++++++++ 2 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 package/network/services/samba36/files/samba.defaults diff --git a/package/network/services/samba36/Makefile b/package/network/services/samba36/Makefile index 39bfcc6c4f..53843a7269 100644 --- a/package/network/services/samba36/Makefile +++ b/package/network/services/samba36/Makefile @@ -149,8 +149,6 @@ define Package/samba36-server/conffiles endef define Package/samba36-server/install - $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_CONF) ./files/samba.config $(1)/etc/config/samba $(INSTALL_DIR) $(1)/etc/samba $(INSTALL_DATA) ./files/smb.conf.template $(1)/etc/samba $(INSTALL_DATA) $(PKG_BUILD_DIR)/codepages/lowcase.dat $(1)/etc/samba diff --git a/package/network/services/samba36/files/samba.defaults b/package/network/services/samba36/files/samba.defaults new file mode 100644 index 0000000000..ae8dad98a9 --- /dev/null +++ b/package/network/services/samba36/files/samba.defaults @@ -0,0 +1,60 @@ +#!/bin/sh +# +# Copyright (C) 2018 OpenWrt.org +# Copyright (C) 2018 rosysong@rosinson.com +# + +. /lib/functions.sh +. /lib/samba/samba.sh + +samba_conf_file=/etc/config/samba + +samba_append_header() { +cat > $samba_conf_file < +cat >> $samba_conf_file <