在Debian安装上安装systemd服务

问题描述 投票:0回答:1

我正在使用simple-cdd实用程序构建定制的Debian ISO。直到我附加了自己的.deb软件包之前,它一直运行良好。

build-simple-cdd --dist stretch --profiles moj --force-root --local-packages /root/iso/deb

build-simple-cdd正常工作,因为我在tmp目录结构中看到了我的deb包,并且成功创建了iso映像。但是debian安装失败enter image description here

我怀疑该postinst脚本失败,因为它在可能不可用时会使用systemctl命令。

#!/bin/sh
set -e

echo $1
if [ "$1" = "configure" ]; then 
    echo "Configuring privileges..."
    chown user:user /usr/bin/Koncentrator
    chmod 0755 /usr/bin/Koncentrator

    echo "Enabling Koncentrator services..." 
    systemctl daemon-reload
    systemctl enable Xvfb.service
    systemctl enable Koncentrator.service
fi

我已经将systemd依赖项添加到控制文件中,但是它不起作用。

deb debian-based
1个回答
0
投票

我针对此问题进行了解决。 simple-cdd允许准备安装后脚本。 apt install在那里没有问题。使用此解决方案需要两个步骤:

  1. 将deb软件包添加到安装磁盘。通过配置文件配置文件(moj.conf)进行配置:
all_extras="$all_extras /root/iso/files/customapackage_0.1.3.deb"
  1. 在moj.postinst脚本中运行apt安装:
#!/bin/sh

mount /dev/cdrom /media/cdrom
cd /media/cdrom/simple-cdd
apt install ./custompackage_0.1.3.deb
cd /
sync
umount /media/cdrom

如果要调试postinst脚本,可以在其中插入长时间睡眠:

#!/bin/sh

sleep 10000000
...

然后在完成安装阶段切换端子(Ctrl + Alt + F1-6)。比调用chroot / target切换目标内环境

© www.soinside.com 2019 - 2024. All rights reserved.