diff --git a/ipk-source/openwrt-overlay/debian-binary b/ipk-source/openwrt-overlay/debian-binary new file mode 100644 index 0000000..cd5ac03 --- /dev/null +++ b/ipk-source/openwrt-overlay/debian-binary @@ -0,0 +1 @@ +2.0 diff --git a/ipk-source/openwrt-overlay/root/real_rootfs/etc/systemd/system/multi-user.target.wants/openwrt-subsystem.target b/ipk-source/openwrt-overlay/root/real_rootfs/etc/systemd/system/multi-user.target.wants/openwrt-subsystem.target new file mode 120000 index 0000000..6ed5543 --- /dev/null +++ b/ipk-source/openwrt-overlay/root/real_rootfs/etc/systemd/system/multi-user.target.wants/openwrt-subsystem.target @@ -0,0 +1 @@ +../openwrt-subsystem.target \ No newline at end of file diff --git a/ipk-source/openwrt-overlay/root/real_rootfs/etc/systemd/system/openwrt-overlay.service b/ipk-source/openwrt-overlay/root/real_rootfs/etc/systemd/system/openwrt-overlay.service new file mode 100644 index 0000000..13fb8df --- /dev/null +++ b/ipk-source/openwrt-overlay/root/real_rootfs/etc/systemd/system/openwrt-overlay.service @@ -0,0 +1,15 @@ +[Unit] +Description=Set up OpenWRT overlay filesystem +DefaultDependencies=no +Requires=qmi_shutdown_modemd.service +After=qmi_shutdown_modemd.service +ConditionPathExists=/usr/sbin/openwrt-overlay.sh + +[Service] +Type=oneshot +ExecStart=/usr/sbin/openwrt-overlay.sh +RemainAfterExit=true + +[Install] +WantedBy=openwrt-subsystem.target + diff --git a/ipk-source/openwrt-overlay/root/real_rootfs/etc/systemd/system/openwrt-subsystem.target b/ipk-source/openwrt-overlay/root/real_rootfs/etc/systemd/system/openwrt-subsystem.target new file mode 100644 index 0000000..877af4e --- /dev/null +++ b/ipk-source/openwrt-overlay/root/real_rootfs/etc/systemd/system/openwrt-subsystem.target @@ -0,0 +1,7 @@ +[Unit] +Description=OpenWRT Subsystem Target +Requires=openwrt-overlay.service +After=qmi_shutdown_modemd.service openwrt-overlay.service + +[Install] +WantedBy=multi-user.target diff --git a/ipk-source/openwrt-overlay/root/real_rootfs/etc/systemd/system/openwrt-subsystem.target.wants/openwrt-overlay.service b/ipk-source/openwrt-overlay/root/real_rootfs/etc/systemd/system/openwrt-subsystem.target.wants/openwrt-overlay.service new file mode 120000 index 0000000..92cb17a --- /dev/null +++ b/ipk-source/openwrt-overlay/root/real_rootfs/etc/systemd/system/openwrt-subsystem.target.wants/openwrt-overlay.service @@ -0,0 +1 @@ +../openwrt-overlay.service \ No newline at end of file diff --git a/opkg-feed/installer/mount-fix-sdxlemur b/ipk-source/openwrt-overlay/root/real_rootfs/usr/sbin/openwrt-overlay.sh similarity index 65% rename from opkg-feed/installer/mount-fix-sdxlemur rename to ipk-source/openwrt-overlay/root/real_rootfs/usr/sbin/openwrt-overlay.sh index 3a0bbc8..be1b344 100755 --- a/opkg-feed/installer/mount-fix-sdxlemur +++ b/ipk-source/openwrt-overlay/root/real_rootfs/usr/sbin/openwrt-overlay.sh @@ -1,8 +1,7 @@ #!/bin/sh - newroot() { - /bin/echo "Begin mount fix process to make a usable userspace" + /bin/echo "Begin mount fix process to make a usable userspace for OpenWRT Subsystem" # Forcefully unmount /etc /bin/echo "Unmounting the bind at /etc" @@ -14,7 +13,6 @@ newroot() { # Make mount namespaces private mount --make-rprivate / - mount --make-rprivate /usrdata # Ensure necessary directories exist for overlay and pivot_root /bin/echo "Creating new overlay system" @@ -41,11 +39,13 @@ newroot() { /sbin/pivot_root /rootfs /rootfs/real_rootfs >/dev/null 2>&1 # Move the mounted filesystems to the new locations + /bin/echo "Moving previous mount points to the new root" /bin/mount --move /real_rootfs/sys /sys /bin/mount --move /real_rootfs/proc /proc /bin/mount --move /real_rootfs/tmp /tmp /bin/mount --move /real_rootfs/dev /dev /bin/mount --move /real_rootfs/firmware /firmware + /bin/mount --move /real_rootfs/usrdata /usrdata /bin/mount --move /real_rootfs/persist /persist /bin/mount --move /real_rootfs/cache /cache /bin/mount --move /real_rootfs/data /data @@ -54,6 +54,23 @@ newroot() { /bin/mount --move /real_rootfs/var/volatile /var/volatile /bin/mount --move /real_rootfs/systemrw /systemrw + # Bind-mount core mountpoints back into real_rootfs for chroot/debug + /bin/echo "Binding previous mount points to the old root" + /bin/mount --bind /dev /real_rootfs/dev + /bin/mount --bind /proc /real_rootfs/proc + /bin/mount --bind /sys /real_rootfs/sys + /bin/mount --bind /tmp /real_rootfs/tmp + /bin/mount --bind /run /real_rootfs/run + /bin/mount --bind /firmware /real_rootfs/firmware + /bin/mount --bind /persist /real_rootfs/persist + /bin/mount --bind /cache /real_rootfs/cache + /bin/mount --bind /data /real_rootfs/data + /bin/mount --bind /systemrw /real_rootfs/systemrw + /bin/mount --bind /usrdata /real_rootfs/usrdata + /bin/mount --bind /etc /real_rootfs/etc + /bin/mount --bind /etc/machine-id /real_rootfs/etc/machine-id + /bin/mount --bind /var/volatile /real_rootfs/var/volatile + echo "Complete" } diff --git a/ipk-source/openwrt-overlay/root/real_rootfs/usrdata/etc/systemd/system/multi-user.target.wants/openwrt-subsystem.target b/ipk-source/openwrt-overlay/root/real_rootfs/usrdata/etc/systemd/system/multi-user.target.wants/openwrt-subsystem.target new file mode 120000 index 0000000..6ed5543 --- /dev/null +++ b/ipk-source/openwrt-overlay/root/real_rootfs/usrdata/etc/systemd/system/multi-user.target.wants/openwrt-subsystem.target @@ -0,0 +1 @@ +../openwrt-subsystem.target \ No newline at end of file diff --git a/ipk-source/openwrt-overlay/root/real_rootfs/usrdata/etc/systemd/system/openwrt-overlay.service b/ipk-source/openwrt-overlay/root/real_rootfs/usrdata/etc/systemd/system/openwrt-overlay.service new file mode 100644 index 0000000..13fb8df --- /dev/null +++ b/ipk-source/openwrt-overlay/root/real_rootfs/usrdata/etc/systemd/system/openwrt-overlay.service @@ -0,0 +1,15 @@ +[Unit] +Description=Set up OpenWRT overlay filesystem +DefaultDependencies=no +Requires=qmi_shutdown_modemd.service +After=qmi_shutdown_modemd.service +ConditionPathExists=/usr/sbin/openwrt-overlay.sh + +[Service] +Type=oneshot +ExecStart=/usr/sbin/openwrt-overlay.sh +RemainAfterExit=true + +[Install] +WantedBy=openwrt-subsystem.target + diff --git a/ipk-source/openwrt-overlay/root/real_rootfs/usrdata/etc/systemd/system/openwrt-subsystem.target b/ipk-source/openwrt-overlay/root/real_rootfs/usrdata/etc/systemd/system/openwrt-subsystem.target new file mode 100644 index 0000000..877af4e --- /dev/null +++ b/ipk-source/openwrt-overlay/root/real_rootfs/usrdata/etc/systemd/system/openwrt-subsystem.target @@ -0,0 +1,7 @@ +[Unit] +Description=OpenWRT Subsystem Target +Requires=openwrt-overlay.service +After=qmi_shutdown_modemd.service openwrt-overlay.service + +[Install] +WantedBy=multi-user.target diff --git a/ipk-source/openwrt-overlay/root/real_rootfs/usrdata/etc/systemd/system/openwrt-subsystem.target.wants/openwrt-overlay.service b/ipk-source/openwrt-overlay/root/real_rootfs/usrdata/etc/systemd/system/openwrt-subsystem.target.wants/openwrt-overlay.service new file mode 120000 index 0000000..92cb17a --- /dev/null +++ b/ipk-source/openwrt-overlay/root/real_rootfs/usrdata/etc/systemd/system/openwrt-subsystem.target.wants/openwrt-overlay.service @@ -0,0 +1 @@ +../openwrt-overlay.service \ No newline at end of file diff --git a/opkg-feed/installer/openwrt-overlay-sdxlemur.tar.gz b/opkg-feed/installer/openwrt-overlay-sdxlemur.tar.gz new file mode 100644 index 0000000..2703bed Binary files /dev/null and b/opkg-feed/installer/openwrt-overlay-sdxlemur.tar.gz differ