Message ID | 20240215151026.115341-2-stefano.babic@swupdate.org |
---|---|
State | Changes Requested |
Delegated to: | Stefano Babic |
Headers | show
Return-Path: <swupdate+bncBAABBZ6SXCXAMGQEZFGA7AI@googlegroups.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20230601 header.b=Mt0v3dzq; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::33a; helo=mail-wm1-x33a.google.com; envelope-from=swupdate+bncbaabbz6sxcxamgqezfga7ai@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-wm1-x33a.google.com (mail-wm1-x33a.google.com [IPv6:2a00:1450:4864:20::33a]) (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 4TbJR1313Kz23j4 for <incoming@patchwork.ozlabs.org>; Fri, 16 Feb 2024 02:10:36 +1100 (AEDT) Received: by mail-wm1-x33a.google.com with SMTP id 5b1f17b1804b1-41205f308f0sf6230155e9.0 for <incoming@patchwork.ozlabs.org>; Thu, 15 Feb 2024 07:10:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708009833; cv=pass; d=google.com; s=arc-20160816; b=CZbi5a5u3MvSNbwdOyuqtdjU0c/xPlpK1jENM/M5K9G6fR5kGLRHwGjwycn1oP0LVL D797FyxClWBDJqiCEsa7LgWm9yN9sLL63FP5RWl8DAFPI38yTZYDaD1TTxB0DwVJ8nlD HpPJESy/t87EQ6lT+uUcwqcceYp2O5GSITdPe6S0JZ8PgHl0dtr588Om4/SplKpPK8QY 687oGS4XB42lwC/1i2L72fzoFsl3K7cGJuw8cWLcb6YCnSifJ2GzdJBi66UM87zHm6zU 4R3pxaPwNhb0xjwFAhPcn/1jX8mbg8MWVm99HlW/7t98VwxOeX3AePAMj0tG6Z2FDqh1 23dA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:ui-outboundreport:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:sender :dkim-signature; bh=YdObCI8MvvN/a3DwaX15+IltFJgokHN5ysoD4m2LsCs=; fh=DsHR8zf0uJaSwpamGnnqwnzMjYfaxLHKwhPYV9hQPAA=; b=uAaEIjdtN62D1ZrudJe3xj1Y2B4lH40fkrZEAxi5ArzUlzWmtDG7OYh31jUDOQAWaD ci8XkJLJwBinZZkorEhvY91oxGWFr9Ht254UFa0rOdDxVoCTAZ4OrZOVQOwK53hxSaBa xqqG+2gL2Ph9zfARl1mh5p4wDu+Wmn+OsWQ/qVd8aHGWXfwmhHs7xjNKShQhDJEQkHIy m8zSFMtN27lOD5cTxGRCYmUVeA3k8CDMfmW0hK0CR1eqzRziSlzpiH3uM0lfz3l58tUR 00AWGnhfCNKa0QTlO+/Xdw2xIsSuCnalE5ZJZEK2mCnTXhXi23q97SX7dljF/c7+ij+7 vGvw==; darn=patchwork.ozlabs.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@swupdate.org header.s=s1-ionos header.b=opBLHF9j; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.24 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1708009832; x=1708614632; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:ui-outboundreport:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:sender:from:to:cc :subject:date:message-id:reply-to; bh=YdObCI8MvvN/a3DwaX15+IltFJgokHN5ysoD4m2LsCs=; b=Mt0v3dzqJcplwXNjXPaWipvpmT3Uo5CHPLARg9a6oJ/TW6p7enG0Uak5IvFR9BKPMC Z8cUVeaqdmK2Aq6nKUCarVY+PiW0OxG9STgRydq01UlnOZM+TxLh8uM6PLlsgInVL6GT uMxIK1E6SD7xGv/VX0rMygdmS3J0P3UsUy5xFafIx/hzlwS8XoEvz0/bAzpWTyISriYb rj0zovMUd14hSJWLftNMtqO3jaYobpilvAvcnSwsz8D8vJI3RRC4DwxNX+pzdIEqxrU1 nhcOvJ4njGfr+XSUVeOAMHAK5ROGWK81C40Q0kgA08INWe9tFN0bUS7ffXSdJcBslgK7 nL+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708009833; x=1708614633; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender :ui-outboundreport:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:x-beenthere:x-gm-message-state:sender:from :to:cc:subject:date:message-id:reply-to; bh=YdObCI8MvvN/a3DwaX15+IltFJgokHN5ysoD4m2LsCs=; b=gAmmNoad+wYxDFUjlUqsfX70hMqK5yifgtvRB/unzPVb4y9LML0rs+EHy+CWSZJXbH casA+klYN8pZ1xL4kwY75ez84zyoYf1NDPTEQGBsiSMAtFOrJM8OPjdFGAc+pyoru8H8 Xfu5DTp+2vcgaLMV+xbFzqzFg25dIiYtzzB3/F5swq+tDjuyWcIC2gW9s2vQ8ogg959A /s1udhUyy/lvdTn62Ir4mZ7zuVjy5UmCWybMVM6UDhDC5+moTl/X9XLxtQbdCthZCCmQ vWGLrd+w2pUxhnfgAThgdzrscxpaIUxgyERgYLgaFuVzab+n4/VpCXSFL+ox+q598JUt yCNA== Sender: swupdate@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCX6ewdOX8uJ94ha8jV7S/XVdOohhusjWG5TVsHxjuCLFERDTDffYKmUfRrH6XEM15PSD99KLnfyOLI4sr/53pAX7ffZJsLz82WTLLSkVQ== X-Gm-Message-State: AOJu0YzPYOZc4P8kJvuTtQRTTAYk5FN7j9DjTneQVv6c2FIS4Swojb/S 5DKH/edVvbfU3OAox5Wn4RoVtxqWdJ1xq9xY6rAQIYg7V7QK6qL4 X-Google-Smtp-Source: AGHT+IEXz2qbcBbThVH/zGrQZk50fd3W6ELd31q+YIZtwqtTbO9ubvEOn4LKAscBqDNXJsJ/Avk5wg== X-Received: by 2002:a05:600c:3111:b0:410:adc2:6d1c with SMTP id g17-20020a05600c311100b00410adc26d1cmr1620033wmo.12.1708009832250; Thu, 15 Feb 2024 07:10:32 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:600c:1f1b:b0:410:c70e:9f02 with SMTP id bd27-20020a05600c1f1b00b00410c70e9f02ls2533333wmb.2.-pod-prod-08-eu; Thu, 15 Feb 2024 07:10:30 -0800 (PST) X-Received: by 2002:a05:600c:18a3:b0:412:10a1:25ed with SMTP id x35-20020a05600c18a300b0041210a125edmr1664003wmp.33.1708009830543; Thu, 15 Feb 2024 07:10:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708009830; cv=none; d=google.com; s=arc-20160816; b=W5ESj1FHdKmZfl/HXW6J6prdz9abxr00CiYZDzEcxQoRxhitqD17XhrhyWVYvR3TqB 0TuwkUFIFciS+VPK0xWUgaOfHdZEk60J88UYEmLkk/Iqj0Qs5QQlhPcWGo8wLfu3dxp4 UI4ZNZfGSsFN/oNJMaBWsMqwHZH2vOK7a554QcnblIKErOhiy/RVChQ7J3VuFEskadXC 9/6WK4FAvxfd/p2yY20kErsYWsvliULRI68PJoCb5f88TOkY7kfaVaHyfnRO/TS5VQJm uiBizj4EcNDPImPPiT4iN8FbPGMyFARzGWp5FgPYMsi3QpkhgAVG/bEr9+AAS80LW/mo HN4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=nX0iPDXZJqyrBLvXdsxiOoCZ/9vzxayy304FKe5kOqU=; fh=TiEWcqMcKpHk5s7uErzpntoONrNfOXwKpI5P8bIlggk=; b=UR/yGx3JKHosdkiOwamJFaXHzrfuDNM8DoHDcWLg0w6ArBghXLEbPcViyoZyGV76rW 9PIuXM3clWHWqGX+SMnMmwQ+3+R8EIUZkieFTycaBCKGVGoSnYTSuj3FHUuq1Y8/GUBi TeWssN3TF0ze0FfA/FOAjYPCySikfbXAflROUyrP1O9dnThRSTTy2ISP1eN2HsOIUFHZ Yvjdv5RmehiSZdePxQcTsUCVYGcwi62MlE9epm0Q7eGR/1W3J0E6QuOeVX/hVX1WU9XL QXO2WYhZu3nnOMNsrfXBCVAou20/p+FVNBGq5kRQUzv7U4ky/HByq+0WvbKJsZcn7J0h MpQA==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@swupdate.org header.s=s1-ionos header.b=opBLHF9j; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.24 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org Received: from mout.kundenserver.de (mout.kundenserver.de. [212.227.17.24]) by gmr-mx.google.com with ESMTPS id l34-20020a05600c1d2200b00410d2828564si55291wms.0.2024.02.15.07.10.30 for <swupdate@googlegroups.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 07:10:30 -0800 (PST) Received-SPF: pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.24 as permitted sender) client-ip=212.227.17.24; X-UI-Sender-Class: 55c96926-9e95-11ee-ae09-1f7a4046a0f6 Received: from paperino.fritz.box ([88.217.136.221]) by mrelayeu.kundenserver.de (mreue108 [213.165.67.113]) with ESMTPSA (Nemesis) id 1MIdaF-1rmzi43jAj-00Echz; Thu, 15 Feb 2024 16:10:29 +0100 From: Stefano Babic <stefano.babic@swupdate.org> To: swupdate@googlegroups.com Cc: Stefano Babic <stefano.babic@swupdate.org> Subject: [swupdate] [PATCH 2/2] Lua: add function emmcbootpart Date: Thu, 15 Feb 2024 16:10:26 +0100 Message-Id: <20240215151026.115341-2-stefano.babic@swupdate.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240215151026.115341-1-stefano.babic@swupdate.org> References: <20240215151026.115341-1-stefano.babic@swupdate.org> MIME-Version: 1.0 X-Provags-ID: V03:K1:/6h3+fDmNONf8ZE3p0NxqsYxDUajYbhv/SpEOZcY4UUxACPAdT5 NK73VvbGhkczu/iHjfzb1GvOqyDoapEmEJmEDegZACQhOQLBgk5ZeA3h1RXeJ4Ld//yZsbr SR0YnENm+75mPb+JhBhq0RzXrPZRxHGMmlcRWWdBe+sqToD5xGa7Tdwk39FmHu50AtRYIhu J+AY2rehmOjmHOVHDnXYg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:jp1SVC9uTRs=;if157ECCQYOTNQdT2zZdXX84sOa hnk97aQJLBnCqpQqNFVHb+0jAgYw4N/VrbHvC3KMJCHtykkyXZdTBaW6RnTKXeWzK1i+hCxjR ICcQUt/6XFPpAJHxr/SOIo81mA6VCOoeWrxhhe6EVWE9UKxMKikmQr/RgGYJSVr58p6OwLrKW WBf3Yn9s64TNm+6li8kzFnsYgS64kvbKDsAEAgvGX6MMeJlT7N1ioil6epdvVLK4wYmkWCnFt ftomn1aMDR/yiv92dTXBAcj5N3RAa3Gd81/q5nRO13+dok9Z5HyhrPfftDS1dev/GailB+P6e mPpJXUmojtT2e5sKsjYzhsOiAXIezF8MqlqG76yD76SwUnFNDN8bgcZ/Axb8cdYtJzD8ZADOc cKjKqGAdzKhT+rsOrFjBOxKnM0lwRjbDoEqmAIKjQj6D1oVoK1+s07tihXvJwuDao96MCPc+Q F2rvRobOIWzO4ylUdnjQRaEEaUGSNNbgM3MmBsOVFlXuJHVupGJ+kPg/PUmJ+7ciuu8je8tMl Cp8y3cVROM97cza0UsVIpTboFy+w5cSm8JjFHwxlaSVjtwtRjH9LgKLDDhsX2lr6atB1HN/Dy 0IFla7NtU9gCBI9lUY3JnkbW4hRJVX1mKRTFRlqpz1tY+vF/q/opOUbLrdOF3wm/YKweQht1F FXuDlWM7fs1IMhAqOx78Z/5YkXDjAoX6p4w3T76GgjRyxBRQICIQnOZobweEIW2FXrhwAvzH5 7zVOlV/orweX7WFzLRJXFxhQ0bQ9oogJRk+xDY/Zk+8CAZ2ZHOEWfk= X-Original-Sender: stefano.babic@swupdate.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@swupdate.org header.s=s1-ionos header.b=opBLHF9j; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.24 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: <swupdate.googlegroups.com> X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: <https://groups.google.com/group/swupdate/post>, <mailto:swupdate@googlegroups.com> List-Help: <https://groups.google.com/support/>, <mailto:swupdate+help@googlegroups.com> List-Archive: <https://groups.google.com/group/swupdate List-Subscribe: <https://groups.google.com/group/swupdate/subscribe>, <mailto:swupdate+subscribe@googlegroups.com> List-Unsubscribe: <mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>, <https://groups.google.com/group/swupdate/subscribe> |
Series |
[1/2] handler: eMMC internal register
|
expand
|
diff --git a/corelib/lua_interface.c b/corelib/lua_interface.c index de3b8702..a9e30b33 100644 --- a/corelib/lua_interface.c +++ b/corelib/lua_interface.c @@ -967,6 +967,22 @@ l_get_hw_exit: return 1; } +static int l_get_emmc_bootpart(lua_State *L) +{ + const char *device = luaL_checkstring(L, 1); + int active = -1, fd; + + if (device) { + fd = open(device, O_RDONLY); + if (fd) { + active = emmc_get_active_bootpart(fd); + close(fd); + } + } + lua_pushinteger(L, active); + return 1; +} + static void lua_push_enum(lua_State *L, const char *name, int value) { lua_pushstring(L, name); @@ -1188,6 +1204,7 @@ static const luaL_Reg l_swupdate[] = { { "get_hw", l_get_hw }, { "getversion", lua_get_swupdate_version }, { "progress", lua_notify_progress }, + { "emmcbootpart", l_get_emmc_bootpart }, { NULL, NULL } };
Function returns the HW boot device of an eMMC. Signed-off-by: Stefano Babic <stefano.babic@swupdate.org> --- corelib/lua_interface.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) -- 2.34.1