From f1cc636be4b66b563367938f7ea9bc966c25b958 Mon Sep 17 00:00:00 2001 From: crims0n Date: Mon, 22 Nov 2021 17:02:16 +0300 Subject: [PATCH] fix --- .../lib/systemd/system/cmdline-parser.service | 5 +- linux-live/minioslib | 176 +++++++++--------- .../06-virtmanager/install | 0 .../06-virtmanager/postinstall | 0 4 files changed, 92 insertions(+), 89 deletions(-) rename {linux-live/modules => modules}/06-virtmanager/install (100%) rename {linux-live/modules => modules}/06-virtmanager/postinstall (100%) diff --git a/linux-live/basesystem/01-core/rootcopy-install/usr/lib/systemd/system/cmdline-parser.service b/linux-live/basesystem/01-core/rootcopy-install/usr/lib/systemd/system/cmdline-parser.service index c7ceff1..187449d 100644 --- a/linux-live/basesystem/01-core/rootcopy-install/usr/lib/systemd/system/cmdline-parser.service +++ b/linux-live/basesystem/01-core/rootcopy-install/usr/lib/systemd/system/cmdline-parser.service @@ -1,6 +1,7 @@ [Unit] Description=Сommand line parsing script -Before=ssh-keygen.service +Before=basic.target +After=local-fs.target sysinit.target [Service] Type=oneshot @@ -9,4 +10,4 @@ RemainAfterExit=true StandardOutput=journal [Install] -WantedBy=multi-user.target \ No newline at end of file +WantedBy=basic.target \ No newline at end of file diff --git a/linux-live/minioslib b/linux-live/minioslib index 8f10c1f..9702552 100644 --- a/linux-live/minioslib +++ b/linux-live/minioslib @@ -1516,17 +1516,21 @@ function chroot_configure() { (cd /linux-live/basesystem/01-core/rootcopy-install && cp --parents -afr * /) - # if [ $CLOUD != "true" ]; then - # echo "Set up password for user 'root'" >>$OUTPUT 2>&1 - # echo root:$ROOT_PASSWORD | chpasswd >>$OUTPUT 2>&1 + if [ -f /usr/lib/systemd/system/cmdline-parser.service ]; then + echo "Enable cmdline-parser.service autostart." >>$OUTPUT 2>&1 + systemctl enable cmdline-parser.service >>$OUTPUT 2>&1 + else + if [ $CLOUD != "true" ]; then + echo "Set up password for user 'root'" >>$OUTPUT 2>&1 + echo root:$ROOT_PASSWORD | chpasswd >>$OUTPUT 2>&1 - # echo "Set up user '$USER_NAME'" >>$OUTPUT 2>&1 - # adduser --uid 1000 --gecos '' $USER_NAME --disabled-password >>$OUTPUT 2>&1 - # echo "Set up password for user '$USER_NAME'" >>$OUTPUT 2>&1 - # echo $USER_NAME:$USER_PASSWORD | chpasswd >>$OUTPUT 2>&1 - # usermod -a -G sudo $USER_NAME + echo "Set up user '$USER_NAME'" >>$OUTPUT 2>&1 + adduser --uid 1000 --gecos '' $USER_NAME --disabled-password >>$OUTPUT 2>&1 + echo "Set up password for user '$USER_NAME'" >>$OUTPUT 2>&1 + echo $USER_NAME:$USER_PASSWORD | chpasswd >>$OUTPUT 2>&1 + usermod -a -G sudo $USER_NAME - : 'if [ ! -d /home/$USER_NAME ]; then + : 'if [ ! -d /home/$USER_NAME ]; then mkdir -p /home/$USER_NAME fi cp -r /etc/skel/* /home/$USER_NAME @@ -1534,16 +1538,82 @@ function chroot_configure() { chown $USER_NAME:$USER_NAME /home/$USER_NAME chown -R $USER_NAME:$USER_NAME /home/$USER_NAME' - # cat </etc/sudoers.d/90-minios - # live user is default user in minios. - # It needs passwordless sudo functionality. - #$USER_NAME ALL=(ALL) NOPASSWD:ALL - #EOF - # else - # echo "Set up password for user 'root'" >>$OUTPUT 2>&1 - # echo root:$ROOT_PASSWORD | chpasswd >>$OUTPUT 2>&1 - # rm -rf /home/live - # fi + cat </etc/sudoers.d/90-minios +# live user is default user in minios. +# It needs passwordless sudo functionality. +$USER_NAME ALL=(ALL) NOPASSWD:ALL +EOF + + cat </etc/issue + + + \l + + + + + + Thank you for using MiniOS. + Based on Debian GNU/Linux. + Powered by Slax. + + :::: :::: ::::::::::: :::: ::: ::::::::::: :::::::: ::::::::  + +:+:+: :+:+:+ :+: :+:+: :+: :+: :+: :+: :+: :+:  + +:+ +:+:+ +:+ +:+ :+:+:+ +:+ +:+ +:+ +:+ +:+  + +#+ +:+ +#+ +#+ +#+ +:+ +#+ +#+ +#+ +:+ +#++:++#++  + +#+ +#+ +#+ +#+ +#+#+# +#+ +#+ +#+ +#+  + #+# #+# #+# #+# #+#+# #+# #+# #+# #+# #+#  + ### ### ########### ### #### ########### ######## ########  + + Root login name: root + Password: $ROOT_PASSWORD + User login name: $USER_NAME + Password: $USER_PASSWORD + + + + + +EOF + else + echo "Set up password for user 'root'" >>$OUTPUT 2>&1 + echo root:$ROOT_PASSWORD | chpasswd >>$OUTPUT 2>&1 + rm -rf /home/live + cat </etc/issue + + + \l + + + + + + Thank you for using MiniOS. + Based on Debian GNU/Linux. + Powered by Slax. + + :::: :::: ::::::::::: :::: ::: ::::::::::: :::::::: ::::::::  + +:+:+: :+:+:+ :+: :+:+: :+: :+: :+: :+: :+: :+:  + +:+ +:+:+ +:+ +:+ :+:+:+ +:+ +:+ +:+ +:+ +:+  + +#+ +:+ +#+ +#+ +#+ +:+ +#+ +#+ +#+ +:+ +#++:++#++  + +#+ +#+ +#+ +#+ +#+#+# +#+ +#+ +#+ +#+  + #+# #+# #+# #+# #+#+# #+# #+# #+# #+# #+#  + ### ### ########### ### #### ########### ######## ########  + + User login name set by + cloud-init. You must use + your ssh key to login. + Root login name: root + Password: $ROOT_PASSWORD + + + + + + +EOF + fi + fi if [ ! -d /etc/NetworkManager ]; then echo "Enable dhclient.service autostart." >>$OUTPUT 2>&1 @@ -1631,74 +1701,6 @@ fi echo "Sudo is not installed. Run the command as root or install sudo." EOF fi - -: ' if [ $CLOUD != "true" ]; then - cat </etc/issue - - - \l - - - - - - Thank you for using MiniOS. - Based on Debian GNU/Linux. - Powered by Slax. - - :::: :::: ::::::::::: :::: ::: ::::::::::: :::::::: ::::::::  - +:+:+: :+:+:+ :+: :+:+: :+: :+: :+: :+: :+: :+:  - +:+ +:+:+ +:+ +:+ :+:+:+ +:+ +:+ +:+ +:+ +:+  - +#+ +:+ +#+ +#+ +#+ +:+ +#+ +#+ +#+ +:+ +#++:++#++  - +#+ +#+ +#+ +#+ +#+#+# +#+ +#+ +#+ +#+  - #+# #+# #+# #+# #+#+# #+# #+# #+# #+# #+#  - ### ### ########### ### #### ########### ######## ########  - - Root login name: root - Password: $ROOT_PASSWORD - User login name: $USER_NAME - Password: $USER_PASSWORD - - - - - -EOF - else - cat </etc/issue - - - \l - - - - - - Thank you for using MiniOS. - Based on Debian GNU/Linux. - Powered by Slax. - - :::: :::: ::::::::::: :::: ::: ::::::::::: :::::::: ::::::::  - +:+:+: :+:+:+ :+: :+:+: :+: :+: :+: :+: :+: :+:  - +:+ +:+:+ +:+ +:+ :+:+:+ +:+ +:+ +:+ +:+ +:+  - +#+ +:+ +#+ +#+ +#+ +:+ +#+ +#+ +#+ +:+ +#++:++#++  - +#+ +#+ +#+ +#+ +#+#+# +#+ +#+ +#+ +#+  - #+# #+# #+# #+# #+#+# #+# #+# #+# #+# #+#  - ### ### ########### ### #### ########### ######## ########  - - User login name set by - cloud-init. You must use - your ssh key to login. - Root login name: root - Password: $ROOT_PASSWORD - - - - - - -EOF - fi' } # ================================================================= diff --git a/linux-live/modules/06-virtmanager/install b/modules/06-virtmanager/install similarity index 100% rename from linux-live/modules/06-virtmanager/install rename to modules/06-virtmanager/install diff --git a/linux-live/modules/06-virtmanager/postinstall b/modules/06-virtmanager/postinstall similarity index 100% rename from linux-live/modules/06-virtmanager/postinstall rename to modules/06-virtmanager/postinstall