mirror of https://github.com/OpenIPC/firmware.git
Merge branch 'master' into master
commit
b6cce49db0
|
@ -2121,8 +2121,8 @@ CONFIG_SQUASHFS_ZLIB=y
|
|||
# CONFIG_SQUASHFS_LZO is not set
|
||||
CONFIG_SQUASHFS_XZ=y
|
||||
# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set
|
||||
# CONFIG_SQUASHFS_EMBEDDED is not set
|
||||
CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
|
||||
CONFIG_SQUASHFS_EMBEDDED=y
|
||||
CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=2
|
||||
# CONFIG_VXFS_FS is not set
|
||||
# CONFIG_MINIX_FS is not set
|
||||
# CONFIG_OMFS_FS is not set
|
||||
|
|
|
@ -30,6 +30,7 @@ source "$BR2_EXTERNAL_SIGMASTAR_PATH/package/node-exporter/Config.in"
|
|||
source "$BR2_EXTERNAL_SIGMASTAR_PATH/package/opus-openipc/Config.in"
|
||||
source "$BR2_EXTERNAL_SIGMASTAR_PATH/package/rtl8188fu-openipc/Config.in"
|
||||
source "$BR2_EXTERNAL_SIGMASTAR_PATH/package/rtl8192eu-openipc/Config.in"
|
||||
source "$BR2_EXTERNAL_SIGMASTAR_PATH/package/rtl8733bu-openipc/Config.in"
|
||||
source "$BR2_EXTERNAL_SIGMASTAR_PATH/package/sigmastar-osdrv-msc313e/Config.in"
|
||||
source "$BR2_EXTERNAL_SIGMASTAR_PATH/package/sigmastar-osdrv-ssc335/Config.in"
|
||||
source "$BR2_EXTERNAL_SIGMASTAR_PATH/package/ssw101b/Config.in"
|
||||
|
|
|
@ -12,4 +12,9 @@ config BR2_LINUX_KERNEL_EXT_SIGMASTAR_PATCHER_LIST
|
|||
help
|
||||
Space-separated list of patches to be applied
|
||||
|
||||
config BR2_LINUX_KERNEL_EXT_SIGMASTAR_INITRAMFS
|
||||
bool "SigmaStar initramfs"
|
||||
help
|
||||
Simple initramfs that boots the rootfs from sdcard
|
||||
|
||||
endif # BR2_LINUX_KERNEL_EXT_SIGMASTAR_PATCHER
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
################################################################################
|
||||
#
|
||||
# linux-ext-sigmastar_initramfs
|
||||
#
|
||||
################################################################################
|
||||
|
||||
LINUX_EXTENSIONS += sigmastar-initramfs
|
||||
|
||||
SIGMASTAR_INITRAMFS_BUSYBOX_VERSION = 1.36.0
|
||||
SIGMASTAR_INITRAMFS_BUSYBOX_SOURCE = busybox-$(SIGMASTAR_INITRAMFS_BUSYBOX_VERSION).tar.bz2
|
||||
SIGMASTAR_INITRAMFS_BUSYBOX_SITE = https://www.busybox.net/downloads
|
||||
|
||||
SIGMASTAR_INITRAMFS_DOSFSTOOLS_VERSION = 4.2
|
||||
SIGMASTAR_INITRAMFS_DOSFSTOOLS_SOURCE = dosfstools-$(SIGMASTAR_INITRAMFS_DOSFSTOOLS_VERSION).tar.gz
|
||||
SIGMASTAR_INITRAMFS_DOSFSTOOLS_SITE = https://github.com/dosfstools/dosfstools/releases/download/v$(SIGMASTAR_INITRAMFS_DOSFSTOOLS_VERSION)
|
||||
|
||||
SIGMASTAR_INITRAMFS_BUSYBOX_PATH = $(HOST_DIR)/source/busybox-$(SIGMASTAR_INITRAMFS_BUSYBOX_VERSION)
|
||||
SIGMASTAR_INITRAMFS_DOSFSTOOLS_PATH = $(HOST_DIR)/source/dosfstools-$(SIGMASTAR_INITRAMFS_DOSFSTOOLS_VERSION)
|
||||
SIGMASTAR_INITRAMFS_TOOLCHAIN = $(PER_PACKAGE_DIR)/toolchain/host/bin/$(GNU_TARGET_NAME)-gcc
|
||||
|
||||
define SIGMASTAR_INITRAMFS_PREPARE_KERNEL
|
||||
mkdir -p $(LINUX_DIR)/initramfs
|
||||
cp -f $(SIGMASTAR_INITRAMFS_PKGDIR)/files/* $(LINUX_DIR)/initramfs
|
||||
|
||||
wget $(SIGMASTAR_INITRAMFS_BUSYBOX_SITE)/$(SIGMASTAR_INITRAMFS_BUSYBOX_SOURCE) \
|
||||
-P $(HOST_DIR)/source -c
|
||||
tar -xf $(HOST_DIR)/source/$(SIGMASTAR_INITRAMFS_BUSYBOX_SOURCE) -C $(HOST_DIR)/source
|
||||
|
||||
wget $(SIGMASTAR_INITRAMFS_DOSFSTOOLS_SITE)/$(SIGMASTAR_INITRAMFS_DOSFSTOOLS_SOURCE) \
|
||||
-P $(HOST_DIR)/source -c
|
||||
tar -xf $(HOST_DIR)/source/$(SIGMASTAR_INITRAMFS_DOSFSTOOLS_SOURCE) -C $(HOST_DIR)/source
|
||||
|
||||
cp -f $(SIGMASTAR_INITRAMFS_PKGDIR)/files/initramfs_defconfig \
|
||||
$(SIGMASTAR_INITRAMFS_BUSYBOX_PATH)/.config
|
||||
$(MAKE) CC=$(SIGMASTAR_INITRAMFS_TOOLCHAIN) -C $(SIGMASTAR_INITRAMFS_BUSYBOX_PATH)
|
||||
cp -f $(SIGMASTAR_INITRAMFS_BUSYBOX_PATH)/busybox $(LINUX_DIR)/initramfs
|
||||
|
||||
cd $(SIGMASTAR_INITRAMFS_DOSFSTOOLS_PATH) && ./autogen.sh && ./configure
|
||||
$(MAKE) CC=$(SIGMASTAR_INITRAMFS_TOOLCHAIN) CFLAGS="-static -s" \
|
||||
-C $(SIGMASTAR_INITRAMFS_DOSFSTOOLS_PATH)
|
||||
cp -f $(SIGMASTAR_INITRAMFS_DOSFSTOOLS_PATH)/src/fsck.fat $(LINUX_DIR)/initramfs
|
||||
endef
|
|
@ -0,0 +1 @@
|
|||
../../general/package/rtl8733bu-openipc
|
|
@ -0,0 +1 @@
|
|||
../../general/package/sigmastar-initramfs
|
|
@ -1,7 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
on_exit()
|
||||
{
|
||||
on_exit() {
|
||||
mountpoint -q /proc && umount /proc
|
||||
exec /sbin/init $*
|
||||
}
|
||||
|
@ -11,36 +10,44 @@ trap on_exit 0
|
|||
mount -t proc proc /proc || exit
|
||||
grep -q overlay /proc/filesystems || exit
|
||||
|
||||
if grep -q ubifs /proc/cmdline; then
|
||||
mount -t ubifs ubi0:rootfs_data /overlay
|
||||
else
|
||||
mtdblkdev=`awk -F ':' '/rootfs_data/ {print $1}' /proc/mtd | sed 's/mtd/mtdblock/'`
|
||||
mtdchrdev=`grep 'rootfs_data' /proc/mtd | cut -d: -f1`
|
||||
mount -t jffs2 /dev/${mtdblkdev} /overlay
|
||||
|
||||
if [ $? -ne 0 ] || { dmesg | grep "jffs2.*: Magic bitmask.*not found" > /dev/null 2>&1; } then
|
||||
echo "jffs2 health check error, format required!"
|
||||
flash_eraseall -j /dev/${mtdchrdev}
|
||||
echo "Done! Remounting..."
|
||||
mount -t jffs2 /dev/${mtdblkdev} /overlay || mount -t tmpfs tmpfs /overlay || exit
|
||||
if ! cat /proc/mounts | grep ${mtdblkdev}; then
|
||||
echo "--------------------------------"
|
||||
echo "Crash - your flash in the trash!"
|
||||
echo "--------------------------------"
|
||||
fi
|
||||
if ! grep -q 'root=.*nfs\|mmcblk\|ram' /proc/cmdline; then
|
||||
if grep -q ubifs /proc/cmdline; then
|
||||
mount -t ubifs ubi0:rootfs_data /overlay
|
||||
else
|
||||
mtdblkdev=$(awk -F ':' '/rootfs_data/ {print $1}' /proc/mtd | sed 's/mtd/mtdblock/')
|
||||
mtdchrdev=$(grep 'rootfs_data' /proc/mtd | cut -d: -f1)
|
||||
mount -t jffs2 /dev/${mtdblkdev} /overlay
|
||||
|
||||
if [ $? -ne 0 ] || { dmesg | grep "jffs2.*: Magic bitmask.*not found" >/dev/null 2>&1; }; then
|
||||
echo "jffs2 health check error, format required!"
|
||||
flash_eraseall -j /dev/${mtdchrdev}
|
||||
echo "Done! Remounting..."
|
||||
mount -t jffs2 /dev/${mtdblkdev} /overlay || mount -t tmpfs tmpfs /overlay || exit
|
||||
if ! cat /proc/mounts | grep ${mtdblkdev}; then
|
||||
echo "--------------------------------"
|
||||
echo "Crash - your flash in the trash!"
|
||||
echo "--------------------------------"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if grep -q overlayfs /proc/filesystems; then
|
||||
mount -t overlayfs overlayfs -o lowerdir=/,upperdir=/overlay,ro /mnt || { umount /overlay; exit; }
|
||||
else
|
||||
overlay_rootdir=/overlay/root
|
||||
overlay_workdir=/overlay/work
|
||||
mkdir -p ${overlay_rootdir} ${overlay_workdir}
|
||||
mount -t overlay overlay -o lowerdir=/,upperdir=${overlay_rootdir},workdir=${overlay_workdir} /mnt || { umount /overlay; exit; }
|
||||
fi
|
||||
if grep -q overlayfs /proc/filesystems; then
|
||||
mount -t overlayfs overlayfs -o lowerdir=/,upperdir=/overlay,ro /mnt || {
|
||||
umount /overlay
|
||||
exit
|
||||
}
|
||||
else
|
||||
overlay_rootdir=/overlay/root
|
||||
overlay_workdir=/overlay/work
|
||||
mkdir -p ${overlay_rootdir} ${overlay_workdir}
|
||||
mount -t overlay overlay -o lowerdir=/,upperdir=${overlay_rootdir},workdir=${overlay_workdir} /mnt || {
|
||||
umount /overlay
|
||||
exit
|
||||
}
|
||||
fi
|
||||
|
||||
pivot_root /mnt /mnt/rom
|
||||
mount -o noatime,move /rom/proc /proc
|
||||
mount -o noatime,move /rom/dev /dev
|
||||
mount -o noatime,move /rom/overlay /overlay
|
||||
pivot_root /mnt /mnt/rom
|
||||
mount -o noatime,move /rom/proc /proc
|
||||
mount -o noatime,move /rom/dev /dev
|
||||
mount -o noatime,move /rom/overlay /overlay
|
||||
fi
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
config BR2_PACKAGE_RTL8733BU_OPENIPC
|
||||
bool "rtl8733bu-openipc"
|
||||
help
|
||||
RTL8733BU wifi driver
|
||||
|
||||
comment "RTL8733BU needs a Linux kernel to be built"
|
||||
depends on !BR2_LINUX_KERNEL
|
|
@ -0,0 +1,18 @@
|
|||
################################################################################
|
||||
#
|
||||
# rtl8733bu-openipc
|
||||
#
|
||||
################################################################################
|
||||
|
||||
RTL8733BU_OPENIPC_VERSION = 8c35a579acbe67675c66021160ba8cc6522cd00c
|
||||
RTL8733BU_OPENIPC_SITE = $(call github,gitguest0,rtl8733bu,$(RTL8733BU_OPENIPC_VERSION))
|
||||
RTL8733BU_OPENIPC_LICENSE = GPL-2.0
|
||||
RTL8733BU_OPENIPC_LICENSE_FILES = COPYING
|
||||
|
||||
RTL8733BU_OPENIPC_MODULE_MAKE_OPTS = \
|
||||
CONFIG_RTL8733BU=m \
|
||||
KVER=$(LINUX_VERSION_PROBED) \
|
||||
KSRC=$(LINUX_DIR)
|
||||
|
||||
$(eval $(kernel-module))
|
||||
$(eval $(generic-package))
|
|
@ -0,0 +1,2 @@
|
|||
config BR2_PACKAGE_SIGMASTAR_INITRAMFS
|
||||
bool "sigmastar-initramfs"
|
|
@ -0,0 +1,21 @@
|
|||
#!/bin/sh
|
||||
mount -t devtmpfs devtmpfs /dev
|
||||
mount -t proc proc /proc
|
||||
mount -t sysfs sysfs /sys
|
||||
|
||||
sleep 1
|
||||
fsck.fat -a /dev/mmcblk0p1
|
||||
mkdir -p /root /sdcard /tmp
|
||||
mount -r /dev/mmcblk0p1 /sdcard
|
||||
|
||||
echo OpenIPC: Copy squashfs
|
||||
cp -f /sdcard/rootfs.squashfs.* /tmp || exec sh
|
||||
mount /tmp/rootfs.squashfs.* /root || exec sh
|
||||
|
||||
umount /sdcard
|
||||
umount /dev
|
||||
umount /proc
|
||||
umount /sys
|
||||
|
||||
echo OpenIPC: Switch to new root
|
||||
exec switch_root /root /init
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,13 @@
|
|||
dir /bin 755 0 0
|
||||
dir /dev 755 0 0
|
||||
nod /dev/console 644 0 0 c 5 1
|
||||
dir /proc 755 0 0
|
||||
dir /sys 755 0 0
|
||||
|
||||
file /init initramfs/init 755 0 0
|
||||
file /bin/fsck.fat initramfs/fsck.fat 755 0 0
|
||||
|
||||
file /bin/busybox initramfs/busybox 755 0 0
|
||||
slink /bin/sh busybox 777 0 0
|
||||
slink /bin/mount busybox 777 0 0
|
||||
slink /bin/switch_root busybox 777 0 0
|
|
@ -0,0 +1,11 @@
|
|||
################################################################################
|
||||
#
|
||||
# sigmastar-initramfs
|
||||
#
|
||||
################################################################################
|
||||
|
||||
SIGMASTAR_INITRAMFS_VERSION = 1.0
|
||||
SIGMASTAR_INITRAMFS_SITE =
|
||||
SIGMASTAR_INITRAMFS_SOURCE =
|
||||
|
||||
$(eval $(generic-package))
|
Loading…
Reference in New Issue