mirror of
https://github.com/home-assistant/operating-system.git
synced 2025-12-25 12:48:03 +00:00
* Update build-all.sh * Delete ovf-create.sh * Update patches.sh * Update hdd-image.sh * Create .travis.yml * Update hdd-image.sh * Update hdd-image.sh * Update hdd-image.sh * Update hdd-image.sh * Update ota.sh * Update post-build.sh * Update post-image.sh * Update rauc.sh * Update rootfs-layer.sh * Update hassos-cli * Update hassos-supervisor * Update hassos-config * Update hassos-apparmor * Update hassos-expand * Update hassos-persists-journald * Update hassos-rate * Update hassos-hook.sh * Update hassos-hook.sh * Rename uboot-boot.sh to uboot-boot.ush * Rename uboot-boot.sh to uboot-boot.ush * Update hassos-hook.sh * Rename uboot-boot.sh to uboot-boot.ush * Rename uboot-boot.sh to uboot-boot.ush * Update hassos-hook.sh * Update odroid_c2_defconfig * Update rpi0_w_defconfig * Update rpi2_defconfig * Update rpi3_64_defconfig * Update rpi3_defconfig * Update rpi_defconfig * Update tinker_defconfig * Update enter.sh * Update .travis.yml
38 lines
1.0 KiB
Bash
Executable File
38 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
function fix_rootfs() {
|
|
|
|
# Cleanup etc
|
|
rm -rf "${TARGET_DIR:?}/etc/init.d"
|
|
rm -rf "${TARGET_DIR:?}/etc/network"
|
|
rm -rf "${TARGET_DIR:?}/etc/X11"
|
|
rm -rf "${TARGET_DIR:?}/etc/xdg"
|
|
|
|
# Cleanup root
|
|
rm -rf "${TARGET_DIR:?}/media"
|
|
rm -rf "${TARGET_DIR:?}/srv"
|
|
rm -rf "${TARGET_DIR:?}/opt"
|
|
|
|
# Cleanup miscs
|
|
rm -rf "${TARGET_DIR}/usr/lib/modules-load.d"
|
|
|
|
# Fix: permission for system connection files
|
|
chmod 600 "${TARGET_DIR}/usr/share/system-connections"/*
|
|
|
|
# Fix: tempfs with /srv
|
|
sed -i "/srv/d" "${TARGET_DIR}/usr/lib/tmpfiles.d/home.conf"
|
|
|
|
# Fix: Could not generate persistent MAC address
|
|
sed -i "s/MACAddressPolicy=persistent/MACAddressPolicy=none/g" "${TARGET_DIR}/usr/lib/systemd/network/99-default.link"
|
|
}
|
|
|
|
|
|
function install_hassos_cli() {
|
|
|
|
sed -i "s|\(root.*\)/bin/sh|\1/usr/sbin/hassos-cli|" "${TARGET_DIR}/etc/passwd"
|
|
|
|
if ! grep "hassos-cli" "${TARGET_DIR}/etc/shells"; then
|
|
echo "/usr/sbin/hassos-cli" >> "${TARGET_DIR}/etc/shells"
|
|
fi
|
|
}
|