From ccdf1c8a34c961d51d94f5feb89c9b50f19ff640 Mon Sep 17 00:00:00 2001 From: Sunmin Lee Date: Mon, 9 Apr 2018 14:54:06 +0900 Subject: [PATCH 01/16] Revert "New post script: generic-prepatch-backup.post" The password backup is handled by factory-reset-backup currently. (This reverts commit 48080560365283b516dfd3feed24df46d0e7d434.) Change-Id: Ib98a2028e1effe03af4ba0305583f04b578fac04 --- scripts/generic-prepatch-backup.post | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 scripts/generic-prepatch-backup.post diff --git a/scripts/generic-prepatch-backup.post b/scripts/generic-prepatch-backup.post deleted file mode 100644 index a251667..0000000 --- a/scripts/generic-prepatch-backup.post +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -echo "#################### generic-prepatch-backup.post ####################" - -if [ -e $INSTALL_ROOT/usr/lib/initrd-recovery/fota/backup-passwd.sh ]; then - $INSTALL_ROOT/usr/lib/initrd-recovery/fota/backup-passwd.sh -fi -- 2.7.4 From a7f82941b4460ad7414489da4a8f5a66dc463bda Mon Sep 17 00:00:00 2001 From: Lukasz Wojciechowski Date: Fri, 13 Jul 2018 16:48:02 +0200 Subject: [PATCH 02/16] [TRE-1958] Add generic-dbus-policychecker.post script Change-Id: Ic2a6a3beb45f88fe2acdaade88ea398dd3e5adf1 Signed-off-by: Lukasz Wojciechowski --- scripts/generic-dbus-policychecker.post | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 scripts/generic-dbus-policychecker.post diff --git a/scripts/generic-dbus-policychecker.post b/scripts/generic-dbus-policychecker.post new file mode 100644 index 0000000..33845fa --- /dev/null +++ b/scripts/generic-dbus-policychecker.post @@ -0,0 +1,7 @@ +#!/bin/sh +echo "#################### generic-dbus-policychecker.post ####################" +for f in /etc/dbus-1/system.d/*.conf; do +echo +echo "$0: Checking D-Bus policy file: $f" +dbus-policychecker "$f" +done -- 2.7.4 From ba302c548aaa7aadc38db2804ce33da4b6f9b826 Mon Sep 17 00:00:00 2001 From: Karol Lewandowski Date: Fri, 14 Sep 2018 10:51:24 +0200 Subject: [PATCH 03/16] Add generic-users.post(script) This script will create standard 'owner' user. It's supposed to be used by all profile wanting standard Tizen user(s). Change-Id: I3db0ea3a9bc2366a8ad9d3dd26d64fe48f3d9579 --- scripts/generic-users.post | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 scripts/generic-users.post diff --git a/scripts/generic-users.post b/scripts/generic-users.post new file mode 100644 index 0000000..cb2a242 --- /dev/null +++ b/scripts/generic-users.post @@ -0,0 +1,18 @@ +#!/bin/sh +echo "#################### generic-users.post ####################" + +if ! generic_base_user_exists owner; then + # By default GUM will create users in /opt/etc/passwd, which is + # additional users database suitable for end-user created accounts. + # However, the 'owner' user is shipped by Tizen system itself and + # it's its default user. Consequently, it should always be available + # and thus, it should be added to /etc/passwd. + conf=/etc/gumd/gumd.conf + origf=${conf}.orig + mv -v $conf $origf + sed -e 's,^\(PASSWD_FILE\).*,\1=/etc/passwd,' -e 's,^\(SHADOW_FILE\).*,\1=/etc/shadow,' <$origf >$conf + gum-utils --offline --add-user --username=owner --usertype=admin --usecret=tizen + mv -v $origf $conf +fi + + -- 2.7.4 From 7c1088f06f9de5790c05791111bc3f8311337de6 Mon Sep 17 00:00:00 2001 From: Lukasz Wojciechowski Date: Mon, 29 Oct 2018 11:16:29 +0100 Subject: [PATCH 04/16] FIX:[TRE-1958] verify if dbus-policychecker file exists Change-Id: Ia2d66d372e7320946874dda432e65804fdcb22e1 Signed-off-by: Lukasz Wojciechowski --- scripts/generic-dbus-policychecker.post | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/generic-dbus-policychecker.post b/scripts/generic-dbus-policychecker.post index 33845fa..c42a55f 100644 --- a/scripts/generic-dbus-policychecker.post +++ b/scripts/generic-dbus-policychecker.post @@ -1,7 +1,9 @@ #!/bin/sh echo "#################### generic-dbus-policychecker.post ####################" -for f in /etc/dbus-1/system.d/*.conf; do -echo -echo "$0: Checking D-Bus policy file: $f" -dbus-policychecker "$f" -done +if [ -x /usr/bin/dbus-policychecker ] ; then + for f in /etc/dbus-1/system.d/*.conf; do + echo + echo "$0: Checking D-Bus policy file: $f" + /usr/bin/dbus-policychecker "$f" + done +fi -- 2.7.4 From 8af248bc13c11043690b2165392fe3942801bcc2 Mon Sep 17 00:00:00 2001 From: "sanghyeok.oh" Date: Wed, 23 Jan 2019 11:30:48 +0900 Subject: [PATCH 05/16] post: dbus: rename conf file and exit MIC build if policy check failed Change-Id: Ibe4920d4ffc1d2cae289ff182ec49ef452a33b42 Signed-off-by: sanghyeok.oh --- scripts/generic-dbus-policychecker.post | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/scripts/generic-dbus-policychecker.post b/scripts/generic-dbus-policychecker.post index c42a55f..3541260 100644 --- a/scripts/generic-dbus-policychecker.post +++ b/scripts/generic-dbus-policychecker.post @@ -1,9 +1,23 @@ #!/bin/sh echo "#################### generic-dbus-policychecker.post ####################" if [ -x /usr/bin/dbus-policychecker ] ; then + fail_cnt=0 for f in /etc/dbus-1/system.d/*.conf; do echo echo "$0: Checking D-Bus policy file: $f" - /usr/bin/dbus-policychecker "$f" + result=$(/usr/bin/dbus-policychecker "$f") + fail=$(echo "$result" | grep FAILED | wc -l) + echo "$result" + if [ $fail -gt 0 ]; then + echo "Found $fail Fails" + echo "Remove conf file : mv $f $f.fail" + mv "$f" "${f}.fail" + fail_cnt=$(( ${fail_cnt} + 1 )) + fi done + if [ $fail_cnt -gt 0 ]; then + echo "Error: MIC build exits due to failed cases on dbus policy checker.(${fail_cnt} errors)" + exit 1 + fi + fi -- 2.7.4 From e64028ba85e1eef7cb18159e2235f44423cd7cfe Mon Sep 17 00:00:00 2001 From: "jin-gyu.kim" Date: Mon, 15 Apr 2019 13:19:31 +0900 Subject: [PATCH 06/16] Create security-manager DB backup. - To apply DB recovering feature, create backup file. Change-Id: I5515c120117189fcbdb15854d7d938bb83ff7483 --- scripts/generic-security.post | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/generic-security.post b/scripts/generic-security.post index 13e5bab..bf97212 100644 --- a/scripts/generic-security.post +++ b/scripts/generic-security.post @@ -8,4 +8,8 @@ fi if [ -e /opt/share/security-config/test/image_test.sh ]; then echo 'Run security-test' /opt/share/security-config/test/image_test.sh -fi +fi + +# 04-15-2019 : This is to create security-manager DB backup file. +security-manager-cmd -b + -- 2.7.4 From 465cd3a2c9429b49f3ec91d89d975aa701737a39 Mon Sep 17 00:00:00 2001 From: "sanghyeok.oh" Date: Thu, 25 Apr 2019 08:44:37 +0900 Subject: [PATCH 07/16] post: dbus: add script for dbus policy serializer For kdbus environment and libdbuspolicy, Add script to generate serialized data. Change-Id: I9e418e05baa25785341830414324ba7ba3369c00 Signed-off-by: sanghyeok.oh --- scripts/generic-dbus-policychecker.post | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/generic-dbus-policychecker.post b/scripts/generic-dbus-policychecker.post index 3541260..204de58 100644 --- a/scripts/generic-dbus-policychecker.post +++ b/scripts/generic-dbus-policychecker.post @@ -21,3 +21,12 @@ if [ -x /usr/bin/dbus-policychecker ] ; then fi fi + +if [ -x /usr/bin/dbuspolicyserializer ] ; then + echo "#################### generic-dbus-policyserializer ####################" + echo + echo "$0: Serializing system.conf:" + dbuspolicyserializer --system + echo "$0: Serializing session.conf:" + dbuspolicyserializer --session +fi -- 2.7.4 From 648e0f262855060c5529c6e1d9207d243feabdf3 Mon Sep 17 00:00:00 2001 From: "sanghyeok.oh" Date: Tue, 30 Apr 2019 16:57:21 +0900 Subject: [PATCH 08/16] post: dbus: remove script for dbus policy serializer meta-tv: tv-libdbuspolicy-serialize.post Change-Id: I1e8986be5578f58261ca732a9577cdc2ae5c3291 Signed-off-by: sanghyeok.oh --- scripts/generic-dbus-policychecker.post | 9 --------- 1 file changed, 9 deletions(-) diff --git a/scripts/generic-dbus-policychecker.post b/scripts/generic-dbus-policychecker.post index 204de58..3541260 100644 --- a/scripts/generic-dbus-policychecker.post +++ b/scripts/generic-dbus-policychecker.post @@ -21,12 +21,3 @@ if [ -x /usr/bin/dbus-policychecker ] ; then fi fi - -if [ -x /usr/bin/dbuspolicyserializer ] ; then - echo "#################### generic-dbus-policyserializer ####################" - echo - echo "$0: Serializing system.conf:" - dbuspolicyserializer --system - echo "$0: Serializing session.conf:" - dbuspolicyserializer --session -fi -- 2.7.4 From 4898ab718ab052beed1b7a1911fed21a80d15181 Mon Sep 17 00:00:00 2001 From: "sanghyeok.oh" Date: Wed, 8 May 2019 21:11:54 +0900 Subject: [PATCH 09/16] dbus: modified to use renamed tool tool name has changed dbus-policychecker to dbuspolicy-checker Change-Id: I3e5993ed365c9c5e4c37232f377e000c6af93e1b Signed-off-by: sanghyeok.oh --- scripts/generic-dbus-policychecker.post | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/generic-dbus-policychecker.post b/scripts/generic-dbus-policychecker.post index 3541260..c97719a 100644 --- a/scripts/generic-dbus-policychecker.post +++ b/scripts/generic-dbus-policychecker.post @@ -1,11 +1,11 @@ #!/bin/sh echo "#################### generic-dbus-policychecker.post ####################" -if [ -x /usr/bin/dbus-policychecker ] ; then +if [ -x /usr/bin/dbuspolicy-checker ] ; then fail_cnt=0 for f in /etc/dbus-1/system.d/*.conf; do echo echo "$0: Checking D-Bus policy file: $f" - result=$(/usr/bin/dbus-policychecker "$f") + result=$(/usr/bin/dbuspolicy-checker "$f") fail=$(echo "$result" | grep FAILED | wc -l) echo "$result" if [ $fail -gt 0 ]; then -- 2.7.4 From 2e9b636e457554ac63a702a95b9c418e94c6a59e Mon Sep 17 00:00:00 2001 From: DoHyun Pyun Date: Wed, 11 Mar 2020 16:57:42 +0900 Subject: [PATCH 10/16] [TRE-2373] Rename rfkill util-linux will include the rfkill, so remove it. Change-Id: I7c41a877c26516e3f7218ea19e814c6c44e881dd Signed-off-by: DoHyun Pyun --- patterns/generic-base.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/patterns/generic-base.yaml b/patterns/generic-base.yaml index 79a2b71..a2c2337 100644 --- a/patterns/generic-base.yaml +++ b/patterns/generic-base.yaml @@ -4,7 +4,6 @@ Name: generic-base Packages: - e2fsprogs - connman -- rfkill - util-linux - kmod-compat - kmod -- 2.7.4 From c4a3bbcbb06907b730d3dca8093bf5c56a921e5b Mon Sep 17 00:00:00 2001 From: INSUN PYO Date: Fri, 24 Jul 2020 19:53:26 +0900 Subject: [PATCH 11/16] post-umount: Add dm-verity.umount script This script is executed after umounting the loop image to generate the dm-verity meta and hash. Change-Id: I377bcfb6c89f0797b19b023ffe8404a113bb3c97 --- scripts/dm-verity.umount | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 scripts/dm-verity.umount diff --git a/scripts/dm-verity.umount b/scripts/dm-verity.umount new file mode 100644 index 0000000..c9a283b --- /dev/null +++ b/scripts/dm-verity.umount @@ -0,0 +1,10 @@ +date +'[%m/%d %H:%M:%S %Z] dm-verity.umount umount post script - start' + +for IMG_PATH in $IMG_PATHS; do + if [ `basename $IMG_PATH` == "rootfs.img" ]; then + echo "Run verityctl format rootfs.img" + /usr/bin/verityctl format $IMG_PATH + fi +done + +date +'[%m/%d %H:%M:%S %Z] dm-verity.umount umount post script - end' -- 2.7.4 From 1d0fd3cf960964111f7ece114437d2e441ed5a98 Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Wed, 10 Mar 2021 14:43:33 +0900 Subject: [PATCH 12/16] [TRE-2649] Add /var/log/zypp directory delete logic to post script Change-Id: Ieb9a69595f1b0d5e0ba9d368fea968161ccfa7bb Signed-off-by: DongHun Kwak --- scripts/generic-packaging.post | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/generic-packaging.post b/scripts/generic-packaging.post index c31901c..c86f3b2 100644 --- a/scripts/generic-packaging.post +++ b/scripts/generic-packaging.post @@ -3,6 +3,9 @@ echo "#################### generic-packaging.post ####################" rm -rf /root/.zypp +# remove libzypp history +rm -rf /var/log/zypp + # was: rpm.post rm -f /var/lib/rpm/__db* rpmdb --rebuilddb -- 2.7.4 From 495272b516cc485ec5302c33f6bad2880e048ae2 Mon Sep 17 00:00:00 2001 From: INSUN PYO Date: Fri, 14 May 2021 18:54:50 +0900 Subject: [PATCH 13/16] post: dbus: add /usr/share/dbus-1/system.d/*.conf to dbuspolicy checker Change-Id: Id44f4e883f1e5bd2c3cdbd38409779d7fa20ec07 --- scripts/generic-dbus-policychecker.post | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/generic-dbus-policychecker.post b/scripts/generic-dbus-policychecker.post index c97719a..d39478b 100644 --- a/scripts/generic-dbus-policychecker.post +++ b/scripts/generic-dbus-policychecker.post @@ -2,7 +2,7 @@ echo "#################### generic-dbus-policychecker.post ####################" if [ -x /usr/bin/dbuspolicy-checker ] ; then fail_cnt=0 - for f in /etc/dbus-1/system.d/*.conf; do + for f in /etc/dbus-1/system.d/*.conf /usr/share/dbus-1/system.d/*.conf; do echo echo "$0: Checking D-Bus policy file: $f" result=$(/usr/bin/dbuspolicy-checker "$f") -- 2.7.4 From ca2a53f0a37f6127392058eb1929c69a0a45be63 Mon Sep 17 00:00:00 2001 From: Mateusz Majewski Date: Wed, 2 Jun 2021 15:49:01 +0200 Subject: [PATCH 14/16] [TRE-2697] Add module dependency rebuild Change-Id: Ibd85d9ac92471e5499239268da00a8cb23dc8e04 --- patterns/generic-depmod.yaml | 5 +++++ scripts/generic-depmod.post | 8 ++++++++ 2 files changed, 13 insertions(+) create mode 100644 patterns/generic-depmod.yaml create mode 100644 scripts/generic-depmod.post diff --git a/patterns/generic-depmod.yaml b/patterns/generic-depmod.yaml new file mode 100644 index 0000000..843aa1d --- /dev/null +++ b/patterns/generic-depmod.yaml @@ -0,0 +1,5 @@ +Summary: Generic Depmod +Description: Generic Depmod +Name: generic-depmod +Packages: +- kmod-compat diff --git a/scripts/generic-depmod.post b/scripts/generic-depmod.post new file mode 100644 index 0000000..b61ac6e --- /dev/null +++ b/scripts/generic-depmod.post @@ -0,0 +1,8 @@ +#!/bin/sh +echo "#################### generic-depmod.post ####################" + +for D in /lib/modules/*; do + [ -d "$D" ] || continue + [ "$(find "$D" -name '*.ko' -print | head -c1 | wc -c)" -ne 0 ] || continue + depmod "$(basename $D)" +done -- 2.7.4 From 96ed2d5724479146ceacb7d7608954aca0551308 Mon Sep 17 00:00:00 2001 From: Mateusz Majewski Date: Thu, 24 Jun 2021 13:43:10 +0200 Subject: [PATCH 15/16] [TRE-2746] Revert all the depmod calls from the images Change-Id: Ic151feac6c854cc9fae90101b0444b35b08d8214 --- patterns/generic-depmod.yaml | 5 ----- scripts/generic-depmod.post | 8 -------- 2 files changed, 13 deletions(-) delete mode 100644 patterns/generic-depmod.yaml delete mode 100644 scripts/generic-depmod.post diff --git a/patterns/generic-depmod.yaml b/patterns/generic-depmod.yaml deleted file mode 100644 index 843aa1d..0000000 --- a/patterns/generic-depmod.yaml +++ /dev/null @@ -1,5 +0,0 @@ -Summary: Generic Depmod -Description: Generic Depmod -Name: generic-depmod -Packages: -- kmod-compat diff --git a/scripts/generic-depmod.post b/scripts/generic-depmod.post deleted file mode 100644 index b61ac6e..0000000 --- a/scripts/generic-depmod.post +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -echo "#################### generic-depmod.post ####################" - -for D in /lib/modules/*; do - [ -d "$D" ] || continue - [ "$(find "$D" -name '*.ko' -print | head -c1 | wc -c)" -ne 0 ] || continue - depmod "$(basename $D)" -done -- 2.7.4 From 4c198097f5c848e61702a264fe166dbb67618fd4 Mon Sep 17 00:00:00 2001 From: INSUN PYO Date: Thu, 16 Dec 2021 13:10:26 +0900 Subject: [PATCH 16/16] post-umount: add dm-verity-inactivated.umount script The purpose of this script is only checking dm-verity image creation. dm-verity is not activated. Change-Id: I359e5bf37552f40861a429eab3ba61a403326b6c --- scripts/dm-verity-inactivated.umount | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 scripts/dm-verity-inactivated.umount diff --git a/scripts/dm-verity-inactivated.umount b/scripts/dm-verity-inactivated.umount new file mode 100644 index 0000000..11c8a6b --- /dev/null +++ b/scripts/dm-verity-inactivated.umount @@ -0,0 +1,13 @@ +date +'[%m/%d %H:%M:%S %Z] dm-verity_only_image.umount umount post script - start' + +for IMG_PATH in $IMG_PATHS; do + if [ `basename $IMG_PATH` == "rootfs.img" ]; then + echo "Run verityctl format rootfs.img" + /usr/bin/verityctl format $IMG_PATH + + echo "Disable dm-verity" + /usr/bin/sed -i 's/dm-verity0/dm-verity1/' $IMG_PATH + fi +done + +date +'[%m/%d %H:%M:%S %Z] dm-verity_only_image.umount umount post script - end' -- 2.7.4