Some fixes
This commit is contained in:
parent
72ab95d4bf
commit
8344baa786
10
README.md
10
README.md
@ -86,14 +86,14 @@ This isn't actually using systemd to start services, rather it parses systemd .s
|
|||||||
##### Autostart services
|
##### Autostart services
|
||||||
To enable service on host boot, edit `/etc/archbox.conf` :
|
To enable service on host boot, edit `/etc/archbox.conf` :
|
||||||
```
|
```
|
||||||
SERVICES=( vmware-networks-configuration vmware-networks vmware-usbarbitrator nginx )
|
SERVICES="vmware-networks-configuration vmware-networks vmware-usbarbitrator nginx"
|
||||||
```
|
```
|
||||||
Keep in mind that this doesn't resolve service dependencies, so you may need to enable the dependencies manually. you can use ```archboxctl desc <service>``` to read the .service file
|
Keep in mind that this doesn't resolve service dependencies, so you may need to enable the dependencies manually. you can use ```archboxctl desc <service>``` to read the .service file
|
||||||
|
|
||||||
##### Post-exec delay
|
##### Post-exec delay
|
||||||
Services are asynchronously started, if some services have some issues when starting together you may want to add post-exec delay.
|
Services are asynchronously started, if some services have some issues when starting together you may want to add post-exec delay.
|
||||||
```
|
```
|
||||||
SERVICES=( php-fpm:3 nginx )
|
SERVICES="php-fpm:3 nginx"
|
||||||
```
|
```
|
||||||
|
|
||||||
This will add 3 seconds delay after executing php-fpm.
|
This will add 3 seconds delay after executing php-fpm.
|
||||||
@ -163,6 +163,12 @@ sudo ln -s /usr /run/current-system/sw
|
|||||||
```
|
```
|
||||||
make sure /run isn't mounted.
|
make sure /run isn't mounted.
|
||||||
|
|
||||||
|
##### Archbox didn't recognize commands
|
||||||
|
Add ```PATH``` variable to ```/etc/archbox.conf```, for example:
|
||||||
|
```
|
||||||
|
ENV_VAR="PATH=/usr/bin:/usr/local/bin"
|
||||||
|
```
|
||||||
|
|
||||||
#### PulseAudio refused to connect
|
#### PulseAudio refused to connect
|
||||||
This can be caused by different dbus machine-id between chroot and host, copying ```/etc/machine-id``` from host to chroot should do the job.
|
This can be caused by different dbus machine-id between chroot and host, copying ```/etc/machine-id``` from host to chroot should do the job.
|
||||||
#### XDG_RUNTIME_DIR is not visible in Archbox
|
#### XDG_RUNTIME_DIR is not visible in Archbox
|
||||||
|
@ -27,14 +27,14 @@ ENV_VAR="${ENV_VAR:-}"
|
|||||||
|
|
||||||
# Parse a Systemd service and executes it on boot, order matters, for example:
|
# Parse a Systemd service and executes it on boot, order matters, for example:
|
||||||
#
|
#
|
||||||
# SERVICES=( vmware-networks-configuration vmware-networks vmware-usbarbitrator php-fpm:3 nginx )
|
# SERVICES="vmware-networks-configuration vmware-networks vmware-usbarbitrator php-fpm:3 nginx"
|
||||||
#
|
#
|
||||||
# Keep in mind that this doesn't resolve service dependencies, so you may need to
|
# Keep in mind that this doesn't resolve service dependencies, so you may need to
|
||||||
# enable the dependencies manually.
|
# enable the dependencies manually.
|
||||||
SERVICES=( ${SERVICES:-} )
|
SERVICES="${SERVICES:-}"
|
||||||
|
|
||||||
# Share other host directories into Archbox, absolute path needed.
|
# Share other host directories into Archbox, absolute path needed.
|
||||||
SHARED_FOLDER=( ${SHARED_FOLDERS:-/home} )
|
SHARED_FOLDER="${SHARED_FOLDERS:-/home}"
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
11
src/archbox
11
src/archbox
@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
. /etc/archbox.conf
|
. /etc/archbox.conf
|
||||||
|
|
||||||
set --
|
|
||||||
|
|
||||||
# Text colors/formatting
|
# Text colors/formatting
|
||||||
red="\033[38;5;1"
|
red="\033[38;5;1"
|
||||||
green="\033[38;5;2"
|
green="\033[38;5;2"
|
||||||
@ -16,11 +14,11 @@ err(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
msg(){
|
msg(){
|
||||||
printf "${green}${bold}%s${reset}\n" "==> $*" 1>&2
|
printf "${green}${bold}%s${reset}\n" "==> $*"
|
||||||
}
|
}
|
||||||
|
|
||||||
checkdep(){
|
checkdep(){
|
||||||
command -v $1 2>/dev/null || err "Install $1!"
|
command -v $1 >/dev/null 2>&1 || err "Install $1!"
|
||||||
}
|
}
|
||||||
|
|
||||||
asroot(){
|
asroot(){
|
||||||
@ -71,7 +69,8 @@ fetch_tarball(){
|
|||||||
case $1 in
|
case $1 in
|
||||||
-c|--create)
|
-c|--create)
|
||||||
asroot
|
asroot
|
||||||
[ $2 ] && err "Specify the link of Arch Linux bootstrap tarball!"
|
echo $2
|
||||||
|
[ ! $2 ] && err "Specify the link of Arch Linux bootstrap tarball!"
|
||||||
msg "Creating chroot directory..."
|
msg "Creating chroot directory..."
|
||||||
mkdir -p $INSTALL_PATH
|
mkdir -p $INSTALL_PATH
|
||||||
cd $INSTALL_PATH
|
cd $INSTALL_PATH
|
||||||
@ -91,7 +90,7 @@ case $1 in
|
|||||||
sed -i "s/CheckSpace/#CheckSpace/g" "${CHROOT}"/etc/pacman.conf
|
sed -i "s/CheckSpace/#CheckSpace/g" "${CHROOT}"/etc/pacman.conf
|
||||||
msg "Mounting necessary filesystems..."
|
msg "Mounting necessary filesystems..."
|
||||||
"${PREFIX}"/share/archbox/bin/init start
|
"${PREFIX}"/share/archbox/bin/init start
|
||||||
cp "${PREFIX}"/share/archbox/chroot_setup.bash "${CHROOT}"/chroot_setup
|
cp "${PREFIX}"/share/archbox/chroot_setup "${CHROOT}"/chroot_setup
|
||||||
printf "%s" $ARCHBOX_USER > /tmp/archbox_user
|
printf "%s" $ARCHBOX_USER > /tmp/archbox_user
|
||||||
chroot $CHROOT /bin/sh /chroot_setup
|
chroot $CHROOT /bin/sh /chroot_setup
|
||||||
exit $?
|
exit $?
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
. /etc/archbox.conf >/dev/null 2>&1
|
. /etc/archbox.conf >/dev/null 2>&1
|
||||||
|
|
||||||
set --
|
|
||||||
|
|
||||||
# Text colors/formatting
|
# Text colors/formatting
|
||||||
red="\033[38;5;1"
|
red="\033[38;5;1"
|
||||||
green="\033[38;5;2"
|
green="\033[38;5;2"
|
||||||
@ -31,7 +29,7 @@ install_desktop(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
checkdep(){
|
checkdep(){
|
||||||
command -v $1 2>/dev/null || err "Install $1!"
|
command -v $1 >/dev/null 2>&1 || err "Install $1!"
|
||||||
}
|
}
|
||||||
|
|
||||||
help_text(){
|
help_text(){
|
||||||
|
@ -1,7 +1,3 @@
|
|||||||
. /etc/archbox.conf >/dev/null 2>&1
|
|
||||||
|
|
||||||
set --
|
|
||||||
|
|
||||||
# Text colors/formatting
|
# Text colors/formatting
|
||||||
red="\033[38;5;1"
|
red="\033[38;5;1"
|
||||||
green="\033[38;5;2"
|
green="\033[38;5;2"
|
||||||
@ -23,13 +19,16 @@ msg "Initializing pacman keyrings..."
|
|||||||
pacman-key --init
|
pacman-key --init
|
||||||
pacman-key --populate archlinux
|
pacman-key --populate archlinux
|
||||||
msg "Installing essential packages..."
|
msg "Installing essential packages..."
|
||||||
pacman -Syu base base-devel xorg pulseaudio nano --noconfirm
|
pacman -Syu base base-devel nano --noconfirm
|
||||||
|
printf "%s" "Do you want to use GUI apps? (y/n) "
|
||||||
|
read INSTALL_GUI
|
||||||
|
[ "$INSTALL_GUI" = "y" ] && pacman -Syu xorg pulseaudio --noconfirm
|
||||||
msg "Installing archboxctl..."
|
msg "Installing archboxctl..."
|
||||||
mkdir -p /usr/local/bin
|
mkdir -p /usr/local/bin
|
||||||
curl https://raw.githubusercontent.com/lemniskett/archboxctl/master/archboxctl.bash > /usr/local/bin/archboxctl
|
curl https://raw.githubusercontent.com/lemniskett/archboxctl/master/archboxctl.bash > /usr/local/bin/archboxctl
|
||||||
chmod 755 /usr/local/bin/archboxctl
|
chmod 755 /usr/local/bin/archboxctl
|
||||||
msg "Setting up locale..."
|
msg "Setting up locale..."
|
||||||
printf "%s\n" "Uncomment needed locale, enter to continue"
|
printf "%s" "Uncomment needed locale, enter to continue"
|
||||||
read
|
read
|
||||||
nano /etc/locale.gen
|
nano /etc/locale.gen
|
||||||
locale-gen
|
locale-gen
|
||||||
@ -38,6 +37,7 @@ printf "%s\n" "Enter your timezone, for example : \"Asia/Jakarta\""
|
|||||||
while true; do
|
while true; do
|
||||||
read TIMEZONE \
|
read TIMEZONE \
|
||||||
&& [ -e /usr/share/zoneinfo/$TIMEZONE ] \
|
&& [ -e /usr/share/zoneinfo/$TIMEZONE ] \
|
||||||
|
&& rm -f /etc/localtime \
|
||||||
&& ln -s /usr/share/zoneinfo/$TIMEZONE /etc/localtime \
|
&& ln -s /usr/share/zoneinfo/$TIMEZONE /etc/localtime \
|
||||||
&& break \
|
&& break \
|
||||||
|| printf "%s\n" "Timezone not found, enter it again."
|
|| printf "%s\n" "Timezone not found, enter it again."
|
||||||
|
@ -7,4 +7,4 @@ REQ_ENV="DBUS_SESSION_BUS_ADDRESS=${DBUS_SESSION_BUS_ADDRESS} XDG_RUNTIME_DIR=${
|
|||||||
|
|
||||||
ENV="$REQ_ENV $ENV_VAR"
|
ENV="$REQ_ENV $ENV_VAR"
|
||||||
COMMAND="$@"
|
COMMAND="$@"
|
||||||
chroot $CHROOT /sbin/env $ENV /bin/su $ARCHBOX_USER
|
chroot $CHROOT /usr/bin/env $ENV /bin/su $ARCHBOX_USER
|
||||||
|
2
src/exec
2
src/exec
@ -7,4 +7,4 @@ REQ_ENV="DBUS_SESSION_BUS_ADDRESS=${DBUS_SESSION_BUS_ADDRESS} XDG_RUNTIME_DIR=${
|
|||||||
|
|
||||||
ENV="$REQ_ENV $ENV_VAR"
|
ENV="$REQ_ENV $ENV_VAR"
|
||||||
COMMAND="$@"
|
COMMAND="$@"
|
||||||
chroot $CHROOT /bin/su -c "env $ENV $COMMAND" $ARCHBOX_USER
|
chroot $CHROOT /bin/su -c "/usr/bin/env $ENV $COMMAND" $ARCHBOX_USER
|
||||||
|
18
src/init
18
src/init
@ -18,19 +18,19 @@ msg(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
rbind(){
|
rbind(){
|
||||||
if mount | grep "${CHROOT}"${1} >/dev/null 2>&1; then
|
if [ "$(mount | grep "${CHROOT}"${1} >/dev/null 2>&1)" ]; then
|
||||||
msg "${CHROOT}${1} already mounted."
|
msg "${CHROOT}${1} already mounted."
|
||||||
else
|
else
|
||||||
mount -R $1 "${CHROOT}"${1}
|
mount -R $1 "${CHROOT}"${1}
|
||||||
msg "${CHROOT}${1} mounted!"
|
msg "${CHROOT}${1} mounted!"
|
||||||
fi
|
fi
|
||||||
if [ $2 = "make-rslave" ]; then
|
if [ "$2" = "make-rslave" ]; then
|
||||||
mount --make-rslave ${CHROOT}${1}
|
mount --make-rslave ${CHROOT}${1}
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
rbind_diff() {
|
rbind_diff() {
|
||||||
if mount | grep "${CHROOT}"${2}; then
|
if [ "$(mount | grep "${CHROOT}"${2})" ]; then
|
||||||
msg "$CHROOT$2 already mounted."
|
msg "$CHROOT$2 already mounted."
|
||||||
else
|
else
|
||||||
mount -R $1 "${CHROOT}"${2}
|
mount -R $1 "${CHROOT}"${2}
|
||||||
@ -39,18 +39,18 @@ rbind_diff() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bindproc() {
|
bindproc() {
|
||||||
if mount | grep "${CHROOT}"/proc; then
|
if [ "$(mount | grep "${CHROOT}"/proc)" ]; then
|
||||||
msg "${CHROOT}/proc already mounted."
|
msg "${CHROOT}/proc already mounted."
|
||||||
else
|
else
|
||||||
mount -t proc /proc "${CHROOT}"/proc
|
mount -t proc /proc "${CHROOT}"/proc
|
||||||
msg "${CHROOT}/proc mounted!")
|
msg "${CHROOT}/proc mounted!"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
rmbind() {
|
rmbind() {
|
||||||
umount_args=-R
|
umount_args=-R
|
||||||
[ $LAZY_UMOUNT = "yes" ] && umount_args=-Rl
|
[ "$LAZY_UMOUNT" = "yes" ] && umount_args=-Rl
|
||||||
if mount | grep "${CHROOT}"${1}; then
|
if [ "$(mount | grep "${CHROOT}"${1})" ]; then
|
||||||
umount $umount_args "${CHROOT}"${1}
|
umount $umount_args "${CHROOT}"${1}
|
||||||
msg "${CHROOT}${1} unmounted!"
|
msg "${CHROOT}${1} unmounted!"
|
||||||
fi
|
fi
|
||||||
@ -62,8 +62,8 @@ case $1 in
|
|||||||
rbind /tmp
|
rbind /tmp
|
||||||
rbind /sys make-rslave
|
rbind /sys make-rslave
|
||||||
rbind /dev make-rslave
|
rbind /dev make-rslave
|
||||||
[ $MOUNT_RUN = "yes" ] && rbind /run
|
[ "$MOUNT_RUN" = "yes" ] && rbind /run
|
||||||
if [ $MOUNT_MOD = "yes" ]; then
|
if [ "$MOUNT_MOD" = "yes" ]; then
|
||||||
rbind "$(readlink -f /lib/modules)"
|
rbind "$(readlink -f /lib/modules)"
|
||||||
rbind /boot
|
rbind /boot
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user