mirror of https://github.com/OpenIPC/firmware.git
[Sigmastar] revise infinity6e initramfs setup (#725)
Co-authored-by: Viktor <viktorxda@users.noreply.github.com>pull/731/head
parent
cccbf2af54
commit
1278dc117b
|
@ -0,0 +1,19 @@
|
|||
diff --git a/init/main.c b/init/main.c
|
||||
index fda1470cb9a2..19d19446514b 100755
|
||||
--- a/init/main.c
|
||||
+++ b/init/main.c
|
||||
@@ -1052,11 +1052,13 @@ static noinline void __init kernel_init_freeable(void)
|
||||
*/
|
||||
|
||||
if (!ramdisk_execute_command)
|
||||
- ramdisk_execute_command = "/init";
|
||||
+ ramdisk_execute_command = "/sbin/init";
|
||||
|
||||
if (sys_access((const char __user *) ramdisk_execute_command, 0) != 0) {
|
||||
ramdisk_execute_command = NULL;
|
||||
prepare_namespace();
|
||||
+ } else {
|
||||
+ devtmpfs_mount("dev");
|
||||
}
|
||||
|
||||
/*
|
|
@ -362,6 +362,8 @@ CONFIG_DEFERRED_INIICALLS=y
|
|||
CONFIG_ARCH_INFINITY6E=y
|
||||
CONFIG_SS_PROFILING_TIME=y
|
||||
CONFIG_SS_MIU_ARBITRATION=y
|
||||
CONFIG_SS_LOWPWR_STR=y
|
||||
# CONFIG_SS_USB_LOWPWR_SUSPEND is not set
|
||||
# CONFIG_ARCH_MXC is not set
|
||||
# CONFIG_ARCH_MEDIATEK is not set
|
||||
|
||||
|
@ -1111,10 +1113,6 @@ CONFIG_FIXED_PHY=y
|
|||
# CONFIG_MICREL_KS8995MA is not set
|
||||
# CONFIG_PPP is not set
|
||||
# CONFIG_SLIP is not set
|
||||
|
||||
#
|
||||
# Host-side USB support is needed for USB Network Adapter support
|
||||
#
|
||||
# CONFIG_USB_NET_DRIVERS is not set
|
||||
CONFIG_WLAN=y
|
||||
# CONFIG_WLAN_VENDOR_ADMTEK is not set
|
||||
|
@ -1956,6 +1954,7 @@ CONFIG_SS_VOLTAGE_CTRL_WITH_OSC=y
|
|||
CONFIG_MS_IOPOWER=y
|
||||
# CONFIG_SS_SWTOE is not set
|
||||
# CONFIG_MS_EMAC_TOE is not set
|
||||
# CONFIG_SS_GYRO is not set
|
||||
|
||||
#
|
||||
# Firmware Drivers
|
||||
|
@ -1973,6 +1972,8 @@ CONFIG_DCACHE_WORD_ACCESS=y
|
|||
# CONFIG_EXT4_FS is not set
|
||||
# CONFIG_REISERFS_FS is not set
|
||||
# CONFIG_JFS_FS is not set
|
||||
# CONFIG_XFS_FS is not set
|
||||
# CONFIG_GFS2_FS is not set
|
||||
# CONFIG_OCFS2_FS is not set
|
||||
# CONFIG_BTRFS_FS is not set
|
||||
# CONFIG_NILFS2_FS is not set
|
||||
|
@ -2181,6 +2182,7 @@ CONFIG_DEBUG_FS=y
|
|||
CONFIG_SECTION_MISMATCH_WARN_ONLY=y
|
||||
# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
|
||||
CONFIG_MAGIC_SYSRQ=y
|
||||
CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x1
|
||||
CONFIG_DEBUG_KERNEL=y
|
||||
|
||||
#
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -23,25 +23,23 @@ BR2_LINUX_KERNEL=y
|
|||
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.9.84"
|
||||
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_SIGMASTAR_PATH)/board/infinity6e/kernel/ssc338q.sdcard.config.camhi"
|
||||
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_SIGMASTAR_PATH)/board/infinity6e/kernel/ssc338q.generic.config.camhi"
|
||||
BR2_LINUX_KERNEL_UIMAGE=y
|
||||
BR2_LINUX_KERNEL_XZ=y
|
||||
BR2_LINUX_KERNEL_EXT_SIGMASTAR_PATCHER=y
|
||||
BR2_LINUX_KERNEL_EXT_SIGMASTAR_PATCHER_LIST="$(BR2_EXTERNAL_SIGMASTAR_PATH)/board/infinity6e/kernel/patches/ $(BR2_EXTERNAL_SIGMASTAR_PATH)/board/infinity6e/kernel/overlay"
|
||||
BR2_LINUX_KERNEL_EXT_SIGMASTAR_INITRAMFS=y
|
||||
|
||||
# Filesystem
|
||||
# BR2_TARGET_TZ_INFO is not set
|
||||
BR2_TARGET_ROOTFS_CPIO=y
|
||||
BR2_TARGET_ROOTFS_SQUASHFS=y
|
||||
BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y
|
||||
BR2_TARGET_ROOTFS_INITRAMFS=y
|
||||
BR2_ROOTFS_OVERLAY="$(TOPDIR)/../general/overlay"
|
||||
BR2_ROOTFS_POST_BUILD_SCRIPT="$(TOPDIR)/../scripts/executing_commands_for_$(BR2_TOOLCHAIN_BUILDROOT_LIBC).sh"
|
||||
|
||||
# OpenIPC configuration
|
||||
BR2_TOOLCHAIN_BUILDROOT_VENDOR="openipc"
|
||||
BR2_TARGET_GENERIC_ISSUE="Welcome to OpenIPC"
|
||||
BR2_TARGET_GENERIC_HOSTNAME="openipc-ssc338q"
|
||||
BR2_TARGET_GENERIC_HOSTNAME="openipc-ssc338q-initramfs"
|
||||
BR2_GLOBAL_PATCH_DIR="$(TOPDIR)/../general/package/all-patches"
|
||||
|
||||
# OpenIPC packages
|
|
@ -12,9 +12,4 @@ 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
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
################################################################################
|
||||
#
|
||||
# linux-ext-sigmastar_initramfs
|
||||
#
|
||||
################################################################################
|
||||
|
||||
ifeq ($(BR2_LINUX_KERNEL_EXT_SIGMASTAR_INITRAMFS),y)
|
||||
LINUX_EXTENSIONS += sigmastar-initramfs
|
||||
LINUX_DEPENDENCIES += sigmastar-initramfs
|
||||
endif
|
||||
|
||||
define SIGMASTAR_INITRAMFS_PREPARE_KERNEL
|
||||
cp -rf $(SIGMASTAR_INITRAMFS_PKGDIR)/files/initramfs $(@D)
|
||||
$(SIGMASTAR_INITRAMFS_PKGDIR)/sigmastar-initramfs.sh "$(@D)" "$(MAKE)"
|
||||
endef
|
|
@ -1 +0,0 @@
|
|||
../../general/package/sigmastar-initramfs
|
|
@ -1,2 +0,0 @@
|
|||
config BR2_PACKAGE_SIGMASTAR_INITRAMFS
|
||||
bool "sigmastar-initramfs"
|
|
@ -1,32 +0,0 @@
|
|||
#!/bin/sh
|
||||
rootfs=/squashfs
|
||||
rootdir=/overlay/root
|
||||
workdir=/overlay/work
|
||||
|
||||
mount -t devtmpfs devtmpfs /dev
|
||||
mount -t proc proc /proc
|
||||
mount -t sysfs sysfs /sys
|
||||
|
||||
sleep 1
|
||||
|
||||
[ -e /dev/mmcblk0p1 ] || exec sh
|
||||
fsck.fat -a /dev/mmcblk0p1
|
||||
mkdir -p $rootfs /mnt /overlay /sdcard /tmp
|
||||
mount -r /dev/mmcblk0p1 /sdcard || exec sh
|
||||
|
||||
cp -f /sdcard/rootfs.squashfs.* /tmp || exec sh
|
||||
mount /tmp/rootfs.squashfs.* $rootfs || exec sh
|
||||
mount -t tmpfs tmpfs -o size=5M /overlay
|
||||
[ -e /sdcard/settings.tar ] && tar -xf /sdcard/settings.tar -C /overlay
|
||||
|
||||
mkdir -p $rootdir $workdir
|
||||
mount -t overlay overlay -o lowerdir=$rootfs,upperdir=$rootdir,workdir=$workdir /mnt
|
||||
mount -o move /dev /mnt/dev
|
||||
mount -o move /overlay /mnt/overlay
|
||||
mount -o move $rootfs /mnt/rom
|
||||
|
||||
umount /sdcard
|
||||
umount /proc
|
||||
umount /sys
|
||||
|
||||
exec switch_root /mnt /sbin/init
|
File diff suppressed because it is too large
Load Diff
|
@ -1,13 +0,0 @@
|
|||
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
|
|
@ -1,24 +0,0 @@
|
|||
#!/bin/sh
|
||||
DAEMON="inotifyd"
|
||||
PIDFILE="/var/run/$DAEMON.pid"
|
||||
INOTIFYD_ARGS="savesettings /etc:w"
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
printf "Starting $DAEMON: "
|
||||
start-stop-daemon -q -S -b -m -p $PIDFILE -x $DAEMON -- $INOTIFYD_ARGS
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
;;
|
||||
|
||||
stop)
|
||||
printf "Stopping $DAEMON: "
|
||||
start-stop-daemon -q -K -p $PIDFILE
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: $0 {start|stop}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $?
|
|
@ -1,9 +0,0 @@
|
|||
#!/bin/sh
|
||||
file=/mnt/mmcblk0p1/settings.tar
|
||||
|
||||
if cat /proc/mounts | grep -q mmcblk0p1 && [ -e /mnt/mmcblk0p1 ]; then
|
||||
[ -e $file ] && time=$(expr $(date +%s) - $(date +%s -r $file));
|
||||
if [ -z $time ] || [ $time -lt 0 ] || [ $time -ge 5 ]; then
|
||||
tar -cf $file -C /overlay root
|
||||
fi
|
||||
fi
|
|
@ -1,21 +0,0 @@
|
|||
################################################################################
|
||||
#
|
||||
# sigmastar-initramfs
|
||||
#
|
||||
################################################################################
|
||||
|
||||
SIGMASTAR_INITRAMFS_VERSION = 1.0
|
||||
SIGMASTAR_INITRAMFS_SITE =
|
||||
SIGMASTAR_INITRAMFS_SOURCE =
|
||||
|
||||
SIGMASTAR_INITRAMFS_PATH = $(SIGMASTAR_INITRAMFS_PKGDIR)/files/script
|
||||
|
||||
define SIGMASTAR_INITRAMFS_INSTALL_TARGET_CMDS
|
||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/etc/init.d
|
||||
$(INSTALL) -m 755 -t $(TARGET_DIR)/etc/init.d $(SIGMASTAR_INITRAMFS_PATH)/S99inotifyd
|
||||
|
||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/usr/sbin
|
||||
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/sbin $(SIGMASTAR_INITRAMFS_PATH)/savesettings
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
|
@ -1,28 +0,0 @@
|
|||
#!/bin/bash
|
||||
BUSYBOX_SOURCE=busybox-1.36.0
|
||||
BUSYBOX_SITE=https://www.busybox.net/downloads
|
||||
|
||||
DOSFSTOOLS_SOURCE=dosfstools-4.2
|
||||
DOSFSTOOLS_SITE=https://github.com/dosfstools/dosfstools/releases/download/v4.2
|
||||
|
||||
TOOLCHAIN_SOURCE=cortex_a7_thumb2_hf-gcc8.4.0-musl-4_9-1e913a17
|
||||
TOOLCHAIN_SITE=https://github.com/openipc/firmware/releases/download/latest
|
||||
|
||||
FILES=$1/initramfs/source
|
||||
CROSS=$FILES/arm-openipc-linux-musleabihf_sdk-buildroot/bin
|
||||
|
||||
wget -c $BUSYBOX_SITE/$BUSYBOX_SOURCE.tar.bz2 -P $FILES
|
||||
wget -c $DOSFSTOOLS_SITE/$DOSFSTOOLS_SOURCE.tar.gz -P $FILES
|
||||
wget -c $TOOLCHAIN_SITE/$TOOLCHAIN_SOURCE.tgz -P $FILES
|
||||
|
||||
tar -xf $FILES/$BUSYBOX_SOURCE.tar.bz2 -C $FILES
|
||||
tar -xf $FILES/$DOSFSTOOLS_SOURCE.tar.gz -C $FILES
|
||||
tar -xf $FILES/$TOOLCHAIN_SOURCE.tgz -C $FILES
|
||||
|
||||
mv -f $FILES/../initramfs_defconfig $FILES/$BUSYBOX_SOURCE/.config
|
||||
$2 CROSS_COMPILE=$CROSS/arm-linux- -C $FILES/$BUSYBOX_SOURCE
|
||||
mv -f $FILES/$BUSYBOX_SOURCE/busybox $FILES/..
|
||||
|
||||
cd $FILES/$DOSFSTOOLS_SOURCE && ./autogen.sh && ./configure
|
||||
$2 CC=$CROSS/arm-linux-gcc CFLAGS="-static -s" -C $FILES/$DOSFSTOOLS_SOURCE
|
||||
mv -f $FILES/$DOSFSTOOLS_SOURCE/src/fsck.fat $FILES/..
|
|
@ -1,13 +1,13 @@
|
|||
#!/bin/sh
|
||||
CONFIG=
|
||||
SOC=$(fw_printenv -n soc)
|
||||
|
||||
# SSC338Q CamHi
|
||||
if [ "$CONFIG" = "ssc338q_lite_defconfig" ] || [ "$CONFIG" = "ssc338q_sdcard_defconfig" ]; then
|
||||
if [ "$SOC" == "ssc338q" ]; then
|
||||
modprobe 8733bu
|
||||
fi
|
||||
|
||||
# HI3516EV300 CamHi
|
||||
if [ "$CONFIG" = "hi3516ev300_ultimate_defconfig" ]; then
|
||||
if [ "$SOC" == "hi3516ev300" ]; then
|
||||
devmem 0x100C0080 32 0x530
|
||||
gpio clear 7
|
||||
gpio unexport 7
|
||||
|
@ -15,7 +15,7 @@ if [ "$CONFIG" = "hi3516ev300_ultimate_defconfig" ]; then
|
|||
fi
|
||||
|
||||
# T21 BJS
|
||||
if [ "$CONFIG" = "t21_lite_defconfig" ]; then
|
||||
if [ "$SOC" == "t21" ]; then
|
||||
gpio clear 50
|
||||
gpio unexport 50
|
||||
modprobe 8188fu
|
||||
|
|
|
@ -24,9 +24,6 @@ define WIRELESS_CONFIGURATION_INSTALL_TARGET_CMDS
|
|||
|
||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/usr/sbin
|
||||
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/sbin $(WIRELESS_CONFIGURATION_PATH)/script/wireless
|
||||
|
||||
# Set config for wireless adapter
|
||||
sed -i "s/CONFIG=/CONFIG=$(notdir $(DEFCONFIG))/g" $(TARGET_DIR)/etc/network/adapter
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
|
|
Loading…
Reference in New Issue