Compare commits
4 Commits
f838e9f0bd
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 8e49163f6e | |||
| 91b584dfd2 | |||
| b2a0aab680 | |||
| d9415b0fb5 |
@@ -83,6 +83,7 @@ bin_install \
|
||||
/bin/mount \
|
||||
/bin/rm \
|
||||
/bin/sh \
|
||||
/bin/sleep \
|
||||
/bin/sort \
|
||||
/bin/tail \
|
||||
/bin/umount \
|
||||
|
||||
2
ci/Jenkinsfile
vendored
2
ci/Jenkinsfile
vendored
@@ -13,7 +13,7 @@ pipeline {
|
||||
yamlFile 'ci/podTemplate.yaml'
|
||||
yamlMergeStrategy merge()
|
||||
workspaceVolume persistentVolumeClaimWorkspaceVolume(
|
||||
claimName: 'buildroot-aimeeos'
|
||||
claimName: 'buildroot'
|
||||
)
|
||||
defaultContainer 'build'
|
||||
}
|
||||
|
||||
@@ -11,4 +11,4 @@ BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
|
||||
# BR2_PACKAGE_BUSYBOX is not set
|
||||
# BR2_TARGET_ROOTFS_TAR is not set
|
||||
AIMEEOS=y
|
||||
AIMEEOS_DEFAULT_ROOTFLAGS="systemd.mask=serial-getty@ttyAMA0 systemd.debug_shell systemd.default_debug_tty=ttyAMA0"
|
||||
BR2_PACKAGE_AIMEE_OS_ROOT_SHELL=y
|
||||
|
||||
@@ -67,6 +67,11 @@ $(BR2_EXTERNAL_AIMEEOS_PATH)/boot/grub2/gen-grub-cfg.sh $(LINUX_IMAGE_NAME)
|
||||
endef
|
||||
LINUX_TARGET_FINALIZE_HOOKS += AIMEEOS_GEN_GRUB_CFG
|
||||
|
||||
define AIMEEOS_TARGET_FINALIZE_HOOKS
|
||||
echo uninitialized > $(TARGET_DIR)/etc/machine-id
|
||||
endef
|
||||
TARGET_FINALIZE_HOOKS += AIMEEOS_TARGET_FINALIZE_HOOKS
|
||||
|
||||
BR2_ROOTFS_POST_IMAGE_SCRIPT += $(BR2_EXTERNAL_AIMEEOS_PATH)/update/make-package.sh
|
||||
|
||||
endif
|
||||
|
||||
@@ -8,3 +8,25 @@ config BR2_PACKAGE_AIMEE_OS_UTILS
|
||||
select BR2_PACKAGE_UTIL_LINUX_SWITCH_ROOT
|
||||
select BR2_PACKAGE_WGET
|
||||
select BR2_TARGET_GRUB2_INSTALL_TOOLS
|
||||
|
||||
if BR2_PACKAGE_AIMEE_OS_UTILS
|
||||
|
||||
config AIMEE_OS_ROOT_SHELL
|
||||
bool "Spawn a root shell on the serial console by default"
|
||||
help
|
||||
With this option enabled, the system will boot up normally, with
|
||||
a root shell connected to the default serial console. This is
|
||||
useful for initial provisioning and troubleshooting.
|
||||
|
||||
if AIMEE_OS_ROOT_SHELL
|
||||
|
||||
config AIMEE_OS_ROOT_SHELL_CONSOLE
|
||||
string "Console name"
|
||||
default ttyAMA0
|
||||
help
|
||||
Name of the console device where the root shell will be spawned.
|
||||
Do not include the /dev prefix
|
||||
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
@@ -28,4 +28,20 @@ define AIMEE_OS_UTILS_INSTALL_INIT_SYSTEMD
|
||||
$(TARGET_DIR)/usr/lib/systemd/network/90-default.network
|
||||
endef
|
||||
|
||||
define AIMEE_OS_UTILS_ROOT_SHELL_INSTALL
|
||||
|
||||
$(INSTALL) -D -m u=rw,go=r \
|
||||
$(AIMEE_OS_UTILS_PKGDIR)/root-shell@.service \
|
||||
$(TARGET_DIR)/usr/lib/systemd/system/root-shell@.service
|
||||
$(INSTALL) -d -m u=rwx,go=rx \
|
||||
$(TARGET_DIR)/usr/lib/systemd/system-preset
|
||||
printf 'enable root-shell@.service %s\n' \
|
||||
$(AIMEE_OS_ROOT_SHELL_CONSOLE) \
|
||||
> $(TARGET_DIR)/usr/lib/systemd/system-preset/50-root-shell.preset
|
||||
endef
|
||||
|
||||
ifeq ($(AIMEE_OS_ROOT_SHELL),y)
|
||||
AIMEE_OS_UTILS_INSTALL_INIT_SYSTEMD += $(AIMEE_OS_UTILS_ROOT_SHELL_INSTALL)
|
||||
endif
|
||||
|
||||
$(eval $(generic-package))
|
||||
|
||||
26
package/aimee-os-utils/root-shell@.service
Normal file
26
package/aimee-os-utils/root-shell@.service
Normal file
@@ -0,0 +1,26 @@
|
||||
[Unit]
|
||||
Description=root shell on %I
|
||||
After=sshd.service
|
||||
Conflicts=shutdown.target
|
||||
Conflicts=getty@%i.service serial-getty@%i.service
|
||||
|
||||
[Service]
|
||||
Type=idle
|
||||
Environment=TERM=linux
|
||||
ExecStart=/bin/sh
|
||||
Restart=always
|
||||
RestartSec=0
|
||||
StandardInput=tty
|
||||
TTYPath=/dev/%I
|
||||
TTYReset=yes
|
||||
TTYVHangup=yes
|
||||
KillMode=process
|
||||
IgnoreSIGPIPE=no
|
||||
KillSignal=SIGHUP
|
||||
|
||||
# Unset locale for the console getty since the console has problems
|
||||
# displaying some internationalized messages.
|
||||
UnsetEnvironment=LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user