@@ -52,42 +52,13 @@ prepare_env_etc() {
5252 msg_3 " prepare_env_etc() done"
5353}
5454
55- setup_login () {
56- #
57- # What login method will be used is setup during FIRST_BOOT,
58- # at this point we just ensure everything is available and initial boot
59- # will use the default loging that should work on all platforms.
60- #
61- # SKIP_LOGIN
62- msg_2 " Install Debian AOK login methods"
63- cp " ${aok_content} /Debian/bin/login.loop" /bin
64- chmod +x /bin/login.loop
65- cp " ${aok_content} /Debian/bin/login.once" /bin
66- chmod +x /bin/login.once
67-
68- # TODO: enabled in Debian, verify it can be ignored here
69- # cp -a "$aok_content"/Debian/etc/pam.d/common-auth /etc/pam.d
70-
71- mv /bin/login /bin/login.original
72- # ln -sf /bin/login.original /bin/login
73-
74- /usr/local/bin/aok -l disable > /dev/null || {
75- error_msg " Failed to disable login during deploy"
76- }
77-
78- if [ ! -L /bin/login ]; then
79- ls -l /bin/login
80- error_msg " At this point /bin/login should be a softlink!"
81- fi
82- }
83-
8455# ===============================================================
8556#
8657# Main
8758#
8859# ===============================================================
8960
90- tsd_start =" $( date +%s) "
61+ tsdev_start =" $( date +%s) "
9162
9263. /opt/AOK/tools/utils.sh
9364
@@ -117,8 +88,33 @@ apt update -y
11788msg_1 " apt upgrade"
11889apt upgrade -y
11990
91+ #
92+ # To ensure that
93+ # a) Deleting stuff, doesnt unintentionally delete what was supposed to
94+ # be added in DEPB_PKGS
95+ # b) If this is not prebuilt, and man-db is removed, saves the delay
96+ # if DEB_PKGS adds something with a man page, just to then delete
97+ # the man DB
98+ #
99+ # It makes sense do first delete, then add
100+ #
101+ if [ -n " $DEB_PKGS_SKIP " ]; then
102+ msg_1 " Removing Devuan packages"
103+ echo " $DEB_PKGS_SKIP "
104+ echo
105+ #
106+ # To prevent leftovers having to potentially be purged later
107+ # we do purge instead of remove, purge implies a remove
108+ #
109+ # shellcheck disable=SC2086
110+ apt purge -y $DEB_PKGS_SKIP || {
111+ error_msg " apt remove failed"
112+ }
113+
114+ fi
115+
120116if [ -n " $DEB_PKGS " ]; then
121- msg_1 " Add co43 Devuan packages"
117+ msg_1 " Add Devuan packages"
122118 echo " $DEB_PKGS "
123119 bash -c " DEBIAN_FRONTEND=noninteractive apt install -y $DEB_PKGS "
124120fi
145141
146142msg_1 " Setup complete!"
147143
148- duration=" $(( $(date +% s) - tsd_start )) "
144+ duration=" $(( $(date +% s) - tsdev_start )) "
149145display_time_elapsed " $duration " " Setup Devuan"
150146
151147if [ -n " $is_prebuilt " ]; then
152148 msg_1 " Prebuild completed, exiting"
153- exit
154- fi
155-
156- if deploy_state_is_it " $deploy_state_pre_build " ; then
157- set_new_etc_profile " $setup_final "
149+ exit 123
158150else
159- " $setup_final "
160- not_prebuilt=1
161- fi
162-
163- msg_1 " Setup complete!"
164-
165- duration=" $(( $(date +% s) - tsd_start)) "
166- display_time_elapsed " $duration " " Setup Devuan"
167-
168- if [ " $not_prebuilt " = 1 ]; then
169151 msg_1 " Please reboot/restart this app now!"
170152 echo " /etc/inittab was changed during the install."
171153 echo " In order for this new version to be used, a restart is needed."
0 commit comments