How to make mkinitcpio busybox ash to source /etc/profile?
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
Arch Linux /usr/lib/initcpio/busybox
is owned by package mkinitcpio-busybox 1.27.2-1 and is configured low on features, for example CONFIG_FEATURE_USE_INITTAB is not set.
In a custom initramfs, containing that busybox, I managed to get ssh network logins that do source /etc/profile
working. Also there is an ash shell prompt visible on the VGA monitor.
However that "vga" shell doesn't source /etc/profile
.
Q:Difference between Login Shell and Non-Login Shell? makes me think that this shell is not a login shell.
That shell is started by /init
:
exec setsid sh -c 'exec sh </dev/tty1 >/dev/tty1 2>&1'
Regression:
exec setsid sh -c 'exec sh -i </dev/tty1 >/dev/tty1 2>&1'
exec setsid sh -c 'exec sh - </dev/tty1 >/dev/tty1 2>&1'
exec setsid sh -c 'exec -sh </dev/tty1 >/dev/tty1 2>&1'
How to make this busybox
ash
shell to source /etc/profile
and/or make it an (auto) login shell?
arch-linux busybox ash
add a comment |Â
up vote
1
down vote
favorite
Arch Linux /usr/lib/initcpio/busybox
is owned by package mkinitcpio-busybox 1.27.2-1 and is configured low on features, for example CONFIG_FEATURE_USE_INITTAB is not set.
In a custom initramfs, containing that busybox, I managed to get ssh network logins that do source /etc/profile
working. Also there is an ash shell prompt visible on the VGA monitor.
However that "vga" shell doesn't source /etc/profile
.
Q:Difference between Login Shell and Non-Login Shell? makes me think that this shell is not a login shell.
That shell is started by /init
:
exec setsid sh -c 'exec sh </dev/tty1 >/dev/tty1 2>&1'
Regression:
exec setsid sh -c 'exec sh -i </dev/tty1 >/dev/tty1 2>&1'
exec setsid sh -c 'exec sh - </dev/tty1 >/dev/tty1 2>&1'
exec setsid sh -c 'exec -sh </dev/tty1 >/dev/tty1 2>&1'
How to make this busybox
ash
shell to source /etc/profile
and/or make it an (auto) login shell?
arch-linux busybox ash
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Arch Linux /usr/lib/initcpio/busybox
is owned by package mkinitcpio-busybox 1.27.2-1 and is configured low on features, for example CONFIG_FEATURE_USE_INITTAB is not set.
In a custom initramfs, containing that busybox, I managed to get ssh network logins that do source /etc/profile
working. Also there is an ash shell prompt visible on the VGA monitor.
However that "vga" shell doesn't source /etc/profile
.
Q:Difference between Login Shell and Non-Login Shell? makes me think that this shell is not a login shell.
That shell is started by /init
:
exec setsid sh -c 'exec sh </dev/tty1 >/dev/tty1 2>&1'
Regression:
exec setsid sh -c 'exec sh -i </dev/tty1 >/dev/tty1 2>&1'
exec setsid sh -c 'exec sh - </dev/tty1 >/dev/tty1 2>&1'
exec setsid sh -c 'exec -sh </dev/tty1 >/dev/tty1 2>&1'
How to make this busybox
ash
shell to source /etc/profile
and/or make it an (auto) login shell?
arch-linux busybox ash
Arch Linux /usr/lib/initcpio/busybox
is owned by package mkinitcpio-busybox 1.27.2-1 and is configured low on features, for example CONFIG_FEATURE_USE_INITTAB is not set.
In a custom initramfs, containing that busybox, I managed to get ssh network logins that do source /etc/profile
working. Also there is an ash shell prompt visible on the VGA monitor.
However that "vga" shell doesn't source /etc/profile
.
Q:Difference between Login Shell and Non-Login Shell? makes me think that this shell is not a login shell.
That shell is started by /init
:
exec setsid sh -c 'exec sh </dev/tty1 >/dev/tty1 2>&1'
Regression:
exec setsid sh -c 'exec sh -i </dev/tty1 >/dev/tty1 2>&1'
exec setsid sh -c 'exec sh - </dev/tty1 >/dev/tty1 2>&1'
exec setsid sh -c 'exec -sh </dev/tty1 >/dev/tty1 2>&1'
How to make this busybox
ash
shell to source /etc/profile
and/or make it an (auto) login shell?
arch-linux busybox ash
edited Dec 24 '17 at 16:34
asked Dec 24 '17 at 15:36
Pro Backup
1,91452853
1,91452853
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
Conventionally, a shell acts as a login shell if it is invoked with a command name beginning with -
. exec -sh
would work is you had an executable called -sh
in the path. BusyBox ash also supports the -l
option, so you can run sh -l
.
When you log in, the login
program (or sshd
, or whatever is handling the login) takes care of running the user's shell with a leading -
in the command name (the command name doesn't have to be the same as the name of the executable, it's just a very common convention which login
violates on purpose). Here, âÂÂwhatever is handling the loginâ is your mini-script, so you have to take care of it.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
Conventionally, a shell acts as a login shell if it is invoked with a command name beginning with -
. exec -sh
would work is you had an executable called -sh
in the path. BusyBox ash also supports the -l
option, so you can run sh -l
.
When you log in, the login
program (or sshd
, or whatever is handling the login) takes care of running the user's shell with a leading -
in the command name (the command name doesn't have to be the same as the name of the executable, it's just a very common convention which login
violates on purpose). Here, âÂÂwhatever is handling the loginâ is your mini-script, so you have to take care of it.
add a comment |Â
up vote
2
down vote
accepted
Conventionally, a shell acts as a login shell if it is invoked with a command name beginning with -
. exec -sh
would work is you had an executable called -sh
in the path. BusyBox ash also supports the -l
option, so you can run sh -l
.
When you log in, the login
program (or sshd
, or whatever is handling the login) takes care of running the user's shell with a leading -
in the command name (the command name doesn't have to be the same as the name of the executable, it's just a very common convention which login
violates on purpose). Here, âÂÂwhatever is handling the loginâ is your mini-script, so you have to take care of it.
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
Conventionally, a shell acts as a login shell if it is invoked with a command name beginning with -
. exec -sh
would work is you had an executable called -sh
in the path. BusyBox ash also supports the -l
option, so you can run sh -l
.
When you log in, the login
program (or sshd
, or whatever is handling the login) takes care of running the user's shell with a leading -
in the command name (the command name doesn't have to be the same as the name of the executable, it's just a very common convention which login
violates on purpose). Here, âÂÂwhatever is handling the loginâ is your mini-script, so you have to take care of it.
Conventionally, a shell acts as a login shell if it is invoked with a command name beginning with -
. exec -sh
would work is you had an executable called -sh
in the path. BusyBox ash also supports the -l
option, so you can run sh -l
.
When you log in, the login
program (or sshd
, or whatever is handling the login) takes care of running the user's shell with a leading -
in the command name (the command name doesn't have to be the same as the name of the executable, it's just a very common convention which login
violates on purpose). Here, âÂÂwhatever is handling the loginâ is your mini-script, so you have to take care of it.
answered Dec 24 '17 at 18:02
Gilles
506k12010031529
506k12010031529
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f412821%2fhow-to-make-mkinitcpio-busybox-ash-to-source-etc-profile%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password