mirror of
https://github.com/superconvert/smart-os.git
synced 2024-11-22 02:04:23 +08:00
can run xfce4 in smartosgit add *.sh!
This commit is contained in:
parent
3074c3014d
commit
e87a814c50
@ -20,6 +20,7 @@ LINUX_SRC_URL=https://mirror.bjtu.edu.cn/kernel/linux/kernel/v5.x/linux-5.8.6.ta
|
|||||||
#GLIBC_SRC_URL=https://ftp.gnu.org/gnu/glibc/glibc-2.32.tar.bz2
|
#GLIBC_SRC_URL=https://ftp.gnu.org/gnu/glibc/glibc-2.32.tar.bz2
|
||||||
GLIBC_SRC_URL=https://mirrors.ustc.edu.cn/gnu/glibc/glibc-2.27.tar.xz
|
GLIBC_SRC_URL=https://mirrors.ustc.edu.cn/gnu/glibc/glibc-2.27.tar.xz
|
||||||
BUSYBOX_SRC_URL=https://busybox.net/downloads/busybox-1.34.1.tar.bz2
|
BUSYBOX_SRC_URL=https://busybox.net/downloads/busybox-1.34.1.tar.bz2
|
||||||
|
LSHW_SRC_URL=https://www.ezix.org/software/files/lshw-B.02.19.2.tar.gz
|
||||||
PCIUTILS_SRC_URL=http://mj.ucw.cz/download/linux/pci/pciutils-3.8.0.tar.gz
|
PCIUTILS_SRC_URL=http://mj.ucw.cz/download/linux/pci/pciutils-3.8.0.tar.gz
|
||||||
OPENSSL_SRC_URL=https://www.openssl.org/source/openssl-1.1.1q.tar.gz
|
OPENSSL_SRC_URL=https://www.openssl.org/source/openssl-1.1.1q.tar.gz
|
||||||
OPENSSH_SRC_URL=https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.8p1.tar.gz
|
OPENSSH_SRC_URL=https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.8p1.tar.gz
|
||||||
@ -40,6 +41,7 @@ cd source
|
|||||||
LINUX_SRC_NAME=$(download_src ${LINUX_SRC_URL})
|
LINUX_SRC_NAME=$(download_src ${LINUX_SRC_URL})
|
||||||
GLIBC_SRC_NAME=$(download_src ${GLIBC_SRC_URL})
|
GLIBC_SRC_NAME=$(download_src ${GLIBC_SRC_URL})
|
||||||
BUSYBOX_SRC_NAME=$(download_src ${BUSYBOX_SRC_URL})
|
BUSYBOX_SRC_NAME=$(download_src ${BUSYBOX_SRC_URL})
|
||||||
|
LSHW_SRC_NAME=$(download_src ${LSHW_SRC_URL})
|
||||||
PCIUTILS_SRC_NAME=$(download_src ${PCIUTILS_SRC_URL})
|
PCIUTILS_SRC_NAME=$(download_src ${PCIUTILS_SRC_URL})
|
||||||
OPENSSL_SRC_NAME=$(download_src ${OPENSSL_SRC_URL})
|
OPENSSL_SRC_NAME=$(download_src ${OPENSSL_SRC_URL})
|
||||||
OPENSSH_SRC_NAME=$(download_src ${OPENSSH_SRC_URL})
|
OPENSSH_SRC_NAME=$(download_src ${OPENSSH_SRC_URL})
|
||||||
@ -57,6 +59,7 @@ mkdir -pv ${build_dir}
|
|||||||
LINUX_SRC_DIR=$(unzip_src ".tar.xz" ${LINUX_SRC_NAME}); echo "unzip ${LINUX_SRC_NAME} source code"
|
LINUX_SRC_DIR=$(unzip_src ".tar.xz" ${LINUX_SRC_NAME}); echo "unzip ${LINUX_SRC_NAME} source code"
|
||||||
GLIBC_SRC_DIR=$(unzip_src ".tar.xz" ${GLIBC_SRC_NAME}); echo "unzip ${GLIBC_SRC_NAME} source code"
|
GLIBC_SRC_DIR=$(unzip_src ".tar.xz" ${GLIBC_SRC_NAME}); echo "unzip ${GLIBC_SRC_NAME} source code"
|
||||||
BUSYBOX_SRC_DIR=$(unzip_src ".tar.bz2" ${BUSYBOX_SRC_NAME}); echo "unzip ${BUSYBOX_SRC_NAME} source code"
|
BUSYBOX_SRC_DIR=$(unzip_src ".tar.bz2" ${BUSYBOX_SRC_NAME}); echo "unzip ${BUSYBOX_SRC_NAME} source code"
|
||||||
|
LSHW_SRC_DIR=$(unzip_src ".tar.gz" ${LSHW_SRC_NAME}); echo "unzip ${LSHW_SRC_NAME} source code"
|
||||||
PCIUTILS_SRC_DIR=$(unzip_src ".tar.gz" ${PCIUTILS_SRC_NAME}); echo "unzip ${PCIUTILS_SRC_NAME} source code"
|
PCIUTILS_SRC_DIR=$(unzip_src ".tar.gz" ${PCIUTILS_SRC_NAME}); echo "unzip ${PCIUTILS_SRC_NAME} source code"
|
||||||
OPENSSL_SRC_DIR=$(unzip_src ".tar.gz" ${OPENSSL_SRC_NAME}); echo "unzip ${OPENSSL_SRC_NAME} source code"
|
OPENSSL_SRC_DIR=$(unzip_src ".tar.gz" ${OPENSSL_SRC_NAME}); echo "unzip ${OPENSSL_SRC_NAME} source code"
|
||||||
OPENSSH_SRC_DIR=$(unzip_src ".tar.gz" ${OPENSSH_SRC_NAME}); echo "unzip ${OPENSSH_SRC_NAME} source code"
|
OPENSSH_SRC_DIR=$(unzip_src ".tar.gz" ${OPENSSH_SRC_NAME}); echo "unzip ${OPENSSH_SRC_NAME} source code"
|
||||||
@ -68,48 +71,13 @@ BINUTILS_SRC_DIR=$(unzip_src ".tar.xz" ${BINUTILS_SRC_NAME}); echo "unzip ${BINU
|
|||||||
# 重新生成目标文件
|
# 重新生成目标文件
|
||||||
#
|
#
|
||||||
#-----------------------------------------------
|
#-----------------------------------------------
|
||||||
if [ "$1" != "" ]; then
|
if [ "$1" = "rebuild" ]; then
|
||||||
if [ $1 != "rebuild" ]; then
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
echo "rebuild"
|
echo "rebuild"
|
||||||
cd ${build_dir}
|
cd ${build_dir}
|
||||||
rm -rf linux_install glibc_install busybox_install gcc_install binutils_install
|
rm -rf linux_install glibc_install busybox_install pciutils_install openssl_install openssh_install gcc_install binutils_install
|
||||||
# 编译内核, 最终所有模块都装到目录 /lib/modules/4.14.9
|
|
||||||
if [ ! -d "linux_install" ]; then
|
|
||||||
mkdir -pv linux_install && cd ${LINUX_SRC_DIR}
|
|
||||||
make INSTALL_HDR_PATH=${linux_install} headers_install -j8 && cp arch/x86_64/boot/bzImage ${linux_install} && cd ..
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 编译glibc
|
|
||||||
if [ ! -d "glibc_install" ]; then
|
|
||||||
mkdir -pv glibc_install && cd ${GLIBC_SRC_DIR}
|
|
||||||
mkdir -pv build && cd build
|
|
||||||
make install -j8 DESTDIR=${glibc_install} && cd .. && cd ..
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 编译 busybox
|
|
||||||
if [ ! -d "busybox_install" ]; then
|
|
||||||
mkdir -pv busybox_install && cd ${BUSYBOX_SRC_DIR}
|
|
||||||
make CONFIG_PREFIX=${busybox_install} install && cd ..
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 编译 libgcc
|
|
||||||
if [ ! -d "gcc_install" ]; then
|
|
||||||
mkdir -pv gcc_install && cd ${GCC_SRC_DIR}
|
|
||||||
make install -j8 DESTDIR=${gcc_install} && cd ..
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 编译 binutils
|
|
||||||
if [ ! -d "binutils_install" ]; then
|
|
||||||
mkdir -pv binutils_install && cd ${BINUTILS_SRC_DIR}
|
|
||||||
make install -j8 DESTDIR=${binutils_install} && cd ..
|
|
||||||
fi
|
|
||||||
cd ..
|
cd ..
|
||||||
exit
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
#---------------------------------------------
|
#---------------------------------------------
|
||||||
#
|
#
|
||||||
# 编译源码
|
# 编译源码
|
||||||
@ -120,10 +88,9 @@ cd ${build_dir}
|
|||||||
# 编译内核, 最终所有模块都装到目录 /lib/modules/5.8.6
|
# 编译内核, 最终所有模块都装到目录 /lib/modules/5.8.6
|
||||||
if [ ! -d "linux_install" ]; then
|
if [ ! -d "linux_install" ]; then
|
||||||
mkdir -pv linux_install && cd ${LINUX_SRC_DIR} && make mrproper && make x86_64_defconfig
|
mkdir -pv linux_install && cd ${LINUX_SRC_DIR} && make mrproper && make x86_64_defconfig
|
||||||
# Enable the VESA framebuffer for graphics support.
|
|
||||||
# 内核 3d 加速 https://wiki.gentoo.org/wiki/Xorg/Hardware_3D_acceleration_guide
|
|
||||||
# xfce4 需要 drm 支持,内核版本尽量大于等于 18.04 的,所以选取了 5.8.6 的内核
|
|
||||||
|
|
||||||
|
# 下面的配置主要显卡相关的配置,必须开启, 内核 3d 加速 https://wiki.gentoo.org/wiki/Xorg/Hardware_3D_acceleration_guide
|
||||||
|
# xfce4 需要 drm 支持,内核版本尽量大于等于 18.04 的,所以选取了 5.8.6 的内核
|
||||||
sed -i "s/# CONFIG_X86_SYSFB is not set/CONFIG_X86_SYSFB=y/" .config
|
sed -i "s/# CONFIG_X86_SYSFB is not set/CONFIG_X86_SYSFB=y/" .config
|
||||||
|
|
||||||
sed -i "/CONFIG_VIRTUALIZATION=y/i\CONFIG_HAVE_KVM_IRQCHIP=y" .config
|
sed -i "/CONFIG_VIRTUALIZATION=y/i\CONFIG_HAVE_KVM_IRQCHIP=y" .config
|
||||||
@ -289,6 +256,12 @@ if [ ! -d "linux_install" ]; then
|
|||||||
sed -i "/# CONFIG_DMA_API_DEBUG is not set/i\# CONFIG_CMA_SIZE_SEL_MAX is not set" .config
|
sed -i "/# CONFIG_DMA_API_DEBUG is not set/i\# CONFIG_CMA_SIZE_SEL_MAX is not set" .config
|
||||||
sed -i "/# CONFIG_DMA_API_DEBUG is not set/i\CONFIG_CMA_ALIGNMENT=8" .config
|
sed -i "/# CONFIG_DMA_API_DEBUG is not set/i\CONFIG_CMA_ALIGNMENT=8" .config
|
||||||
|
|
||||||
|
# 鼠标的配置 ( 否则 xfce4 界面上鼠标不能操作 /dev/input/mice, 上层需要 xf86-input-evdev, libevdev )
|
||||||
|
sed -i "/# CONFIG_INPUT_MOUSEDEV is not set/a\CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768" .config
|
||||||
|
sed -i "/# CONFIG_INPUT_MOUSEDEV is not set/a\CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024" .config
|
||||||
|
sed -i "/# CONFIG_INPUT_MOUSEDEV is not set/a\CONFIG_INPUT_MOUSEDEV_PSAUX=y" .config
|
||||||
|
sed -i "s/# CONFIG_INPUT_MOUSEDEV is not set/CONFIG_INPUT_MOUSEDEV=y/" .config
|
||||||
|
|
||||||
# 网络需要 TUN/TAP 驱动 [ Device Drivers ] ---> [ Network device support ] ---> [ Universal TUN/TAP device driver support ]
|
# 网络需要 TUN/TAP 驱动 [ Device Drivers ] ---> [ Network device support ] ---> [ Universal TUN/TAP device driver support ]
|
||||||
make bzImage -j8
|
make bzImage -j8
|
||||||
make modules -j8
|
make modules -j8
|
||||||
@ -326,6 +299,13 @@ if [ ! -d "busybox_install" ]; then
|
|||||||
cd ..
|
cd ..
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# 编译 lshw ( 调试方便 )
|
||||||
|
if [ ! -d "lshw_install" ]; then
|
||||||
|
mkdir -pv lshw_install && cd ${LSHW_SRC_DIR}
|
||||||
|
CFLAGS="-L${glibc_install}/lib64 $CFLAGS" make -j8 && make install -j8 DESTDIR=${lshw_install} PREFIX=/usr
|
||||||
|
cd ..
|
||||||
|
fi
|
||||||
|
|
||||||
# 编译 pciutils ( busybox 的 lspci 太简单 )
|
# 编译 pciutils ( busybox 的 lspci 太简单 )
|
||||||
if [ ! -d "pciutils_install" ]; then
|
if [ ! -d "pciutils_install" ]; then
|
||||||
mkdir -pv pciutils_install && cd ${PCIUTILS_SRC_DIR}
|
mkdir -pv pciutils_install && cd ${PCIUTILS_SRC_DIR}
|
||||||
@ -344,7 +324,7 @@ fi
|
|||||||
# 编译 openssh
|
# 编译 openssh
|
||||||
if [ ! -d "openssh_install" ]; then
|
if [ ! -d "openssh_install" ]; then
|
||||||
mkdir -pv openssh_install && cd ${OPENSSH_SRC_DIR}
|
mkdir -pv openssh_install && cd ${OPENSSH_SRC_DIR}
|
||||||
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-ssl-dir=${openssl_install}/usr/ --with-pam --without-openssl-header-check
|
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-ssl-dir=${openssl_install}/usr/ --without-openssl-header-check
|
||||||
CFLAGS="-L${glibc_install}/lib64 -L${openssl_install}/usr/lib $CFLAGS" make -j8 && make install -j8 DESTDIR=${openssh_install} PREFIX=/usr
|
CFLAGS="-L${glibc_install}/lib64 -L${openssl_install}/usr/lib $CFLAGS" make -j8 && make install -j8 DESTDIR=${openssh_install} PREFIX=/usr
|
||||||
# 修改配置文件
|
# 修改配置文件
|
||||||
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/" ${openssh_install}/etc/ssh/sshd_config
|
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/" ${openssh_install}/etc/ssh/sshd_config
|
||||||
@ -363,13 +343,18 @@ if [ ! -d "openssh_install" ]; then
|
|||||||
ssh-keygen -t rsa -P "" -f ${openssh_install}/etc/ssh/ssh_host_rsa_key
|
ssh-keygen -t rsa -P "" -f ${openssh_install}/etc/ssh/ssh_host_rsa_key
|
||||||
fi
|
fi
|
||||||
# 开启 sftp, 可以进行文件上传
|
# 开启 sftp, 可以进行文件上传
|
||||||
sed -i "s/\/usr\/libexec\/sftp-server/internal-sftp/" ${openssh_install}/etc/ssh/sshd_config
|
if [ -f "${openssh_install}/etc/ssh/sshd_config" ]; then
|
||||||
|
sed -i "s/\/usr\/libexec\/sftp-server/internal-sftp/" ${openssh_install}/etc/ssh/sshd_config
|
||||||
|
fi
|
||||||
cd ..
|
cd ..
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 编译 gcc
|
# 编译 gcc
|
||||||
if [ ! -d "gcc_install" ]; then
|
if [ ! -d "gcc_install" ]; then
|
||||||
mkdir -pv gcc_install && cd ${GCC_SRC_DIR} && make distclean && rm ./config.cache
|
mkdir -pv gcc_install && cd ${GCC_SRC_DIR}
|
||||||
|
if [ -f "config.cache" ]; then
|
||||||
|
rm ./config.cache
|
||||||
|
fi
|
||||||
./contrib/download_prerequisites
|
./contrib/download_prerequisites
|
||||||
./configure --prefix=/usr --enable-languages=c,c++ --disable-multilib --disable-static --disable-libquadmath --enable-shared
|
./configure --prefix=/usr --enable-languages=c,c++ --disable-multilib --disable-static --disable-libquadmath --enable-shared
|
||||||
CFLAGS="-L${glibc_install}/lib64 $CFLAGS" make -j8 && make install -j8 DESTDIR=${gcc_install} && cd ..
|
CFLAGS="-L${glibc_install}/lib64 $CFLAGS" make -j8 && make install -j8 DESTDIR=${gcc_install} && cd ..
|
||||||
|
@ -157,8 +157,8 @@ cat<<"EOF">etc/inittab
|
|||||||
# login, but since we are bypassing login in this case, BusyBox lets you do
|
# login, but since we are bypassing login in this case, BusyBox lets you do
|
||||||
# this yourself...
|
# this yourself...
|
||||||
#
|
#
|
||||||
# Start an "askfirst" shell on the console (whatever that may be)
|
# Start an "askfirst" shell on the console (whatever that may be) -f root 自动登录
|
||||||
::respawn:-/bin/login
|
::respawn:-/bin/login -f root
|
||||||
# Start an "askfirst" shell on /dev/tty2-4
|
# Start an "askfirst" shell on /dev/tty2-4
|
||||||
tty2::respawn:-/bin/sh
|
tty2::respawn:-/bin/sh
|
||||||
tty3::respawn:-/bin/sh
|
tty3::respawn:-/bin/sh
|
||||||
@ -196,6 +196,9 @@ cd ..
|
|||||||
echo "${CYAN}--- build diskfs ---${NC}"
|
echo "${CYAN}--- build diskfs ---${NC}"
|
||||||
cp rootfs/* ${diskfs} -r
|
cp rootfs/* ${diskfs} -r
|
||||||
|
|
||||||
|
# 单独的 lshw
|
||||||
|
cp ${lshw_install}/* ${diskfs} -r
|
||||||
|
|
||||||
# 单独的 pciutils
|
# 单独的 pciutils
|
||||||
cp ${pciutils_install}/* ${diskfs} -r
|
cp ${pciutils_install}/* ${diskfs} -r
|
||||||
if [ -f "${diskfs}/usr/share/pci.ids.gz" ]; then
|
if [ -f "${diskfs}/usr/share/pci.ids.gz" ]; then
|
||||||
@ -253,8 +256,10 @@ if [ "${with_xfce}" = true ]; then
|
|||||||
# dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
|
# dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
|
||||||
# dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
|
# dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
|
||||||
# dbus-daemon --config-file=/usr/share/defaults/at-spi2/accessibility.conf --nofork --print-address 3
|
# dbus-daemon --config-file=/usr/share/defaults/at-spi2/accessibility.conf --nofork --print-address 3
|
||||||
echo "dd if=/dev/zero of=/swapfile bs=1M count=2048" > ${diskfs}/xfce.sh
|
echo "if [ -f "/swapfile" ]; then" > ${diskfs}/xfce.sh
|
||||||
echo "mkswap /swapfile" >> ${diskfs}/xfce.sh
|
echo " dd if=/dev/zero of=/swapfile bs=1M count=2048" >> ${diskfs}/xfce.sh
|
||||||
|
echo " mkswap /swapfile" >> ${diskfs}/xfce.sh
|
||||||
|
echo "fi" >> ${diskfs}/xfce.sh
|
||||||
echo "swapon /swapfile" >> ${diskfs}/xfce.sh
|
echo "swapon /swapfile" >> ${diskfs}/xfce.sh
|
||||||
echo "dbus-daemon --system --nopidfile --systemd-activation" >> ${diskfs}/xfce.sh
|
echo "dbus-daemon --system --nopidfile --systemd-activation" >> ${diskfs}/xfce.sh
|
||||||
echo "xinit /usr/local/bin/xfce4-session -- /usr/local/bin/Xorg :10" >> ${diskfs}/xfce.sh
|
echo "xinit /usr/local/bin/xfce4-session -- /usr/local/bin/Xorg :10" >> ${diskfs}/xfce.sh
|
||||||
@ -274,6 +279,23 @@ if [ "${with_xfce}" = true ]; then
|
|||||||
# ln -s /usr/share/X11/xkb /usr/local/share/X11
|
# ln -s /usr/share/X11/xkb /usr/local/share/X11
|
||||||
# 2. 需要改动 libpcre.so.1 ---> libpcre.so.3
|
# 2. 需要改动 libpcre.so.1 ---> libpcre.so.3
|
||||||
# 3. xfce4-session 需要 libuuid.so
|
# 3. xfce4-session 需要 libuuid.so
|
||||||
|
|
||||||
|
# 依赖版本 libpcre.so.3
|
||||||
|
if [ -f "${xfce_install}/usr/local/lib/libpcre.so.1" ]; then
|
||||||
|
rm ${xfce_install}/usr/local/lib/libpcre.so.3 -rf
|
||||||
|
fi
|
||||||
|
# 依赖版本 libedit2
|
||||||
|
if [ -f "${xfce_install}/usr/local/lib/libedit.so.0" ]; then
|
||||||
|
rm ${xfce_install}/usr/local/lib/libedit.so.2 -rf
|
||||||
|
fi
|
||||||
|
# 依赖版本 libtinfo.so.5
|
||||||
|
if [ -f "${xfce_install}/usr/lib/libtinfo.so.6" ]; then
|
||||||
|
rm ${xfce_install}/usr/lib/libtinfo.so.5 -rf
|
||||||
|
fi
|
||||||
|
# 依赖版本 libffi.so.6
|
||||||
|
if [ -f "${xfce_install}/usr/local/lib/libffi.so.8" ]; then
|
||||||
|
rm ${xfce_install}/usr/local/lib/libffi.so.6 -rf
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 我们测试驱动, 制作的镜像启动后,我们进入此目录 insmod hello_world.ko 即可
|
# 我们测试驱动, 制作的镜像启动后,我们进入此目录 insmod hello_world.ko 即可
|
||||||
@ -341,15 +363,11 @@ chmod +x ${diskfs}/etc/init.d/rcS
|
|||||||
|
|
||||||
# 登陆 login shell ,非 non-login shell
|
# 登陆 login shell ,非 non-login shell
|
||||||
if [ "${with_login}" = true ]; then
|
if [ "${with_login}" = true ]; then
|
||||||
cat - > ${diskfs}/etc/profile << EOF
|
echo "export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" >> ${diskfs}/etc/profile
|
||||||
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
echo "export LD_LIBRARY_PATH=/lib:/lib64:/usr/lib:/usr/lib64:/usr/local/lib:/usr/local/lib64:/usr/lib/x86_64-linux-gnu" >> ${diskfs}/etc/profile
|
||||||
export LD_LIBRARY_PATH="/lib:/lib64:/usr/lib:/usr/lib64:/usr/local/lib:/usr/local/lib64:/usr/lib/x86_64-linux-gnu"
|
|
||||||
EOF
|
|
||||||
else
|
else
|
||||||
cat - > ${diskfs}/etc/bash.bashrc << EOF
|
echo "export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" >> ${diskfs}/etc/bash.bashrc
|
||||||
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
echo "export LD_LIBRARY_PATH=/lib:/lib64:/usr/lib:/usr/lib64:/usr/local/lib:/usr/local/lib64:/usr/lib/x86_64-linux-gnu" >> ${diskfs}/etc/bash.bashrc
|
||||||
export LD_LIBRARY_PATH="/lib:/lib64:/usr/lib:/usr/lib64:/usr/local/lib:/usr/local/lib64:/usr/lib/x86_64-linux-gnu"
|
|
||||||
EOF
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "${GREEN}+++ build diskfs ok +++${NC}"
|
echo "${GREEN}+++ build diskfs ok +++${NC}"
|
||||||
@ -358,6 +376,25 @@ echo "${GREEN}+++ build diskfs ok +++${NC}"
|
|||||||
umount ${loop_dev}
|
umount ${loop_dev}
|
||||||
losetup -d ${loop_dev}
|
losetup -d ${loop_dev}
|
||||||
|
|
||||||
|
#----------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# 常用命令
|
||||||
|
#
|
||||||
|
#----------------------------------------------------------------
|
||||||
|
# 查看CPU信息:cat /proc/cpuinfo
|
||||||
|
# 查看板卡信息:cat /proc/pci
|
||||||
|
# 查看PCI信息:lspci (相比cat /proc/pci更直观)
|
||||||
|
# 查看内存信息:cat /proc/meminfo
|
||||||
|
# 查看USB设备:cat /proc/bus/usb/devices
|
||||||
|
# 查看键盘和鼠标:cat /proc/bus/input/devices
|
||||||
|
# 查看系统硬盘信息和使用情况:fdisk & disk - l & df
|
||||||
|
# 查看各设备的中断请求(IRQ):cat /proc/interrupts
|
||||||
|
# 查看系统体系结构:uname -a
|
||||||
|
# dmidecode查看硬件信息,包括bios、cpu、内存等信息
|
||||||
|
# dmesg | more 查看硬件信息
|
||||||
|
# modinfo命令可以单看指定的模块/驱动的信息
|
||||||
|
# linux为什么访问设备数据先要mount? https://www.zhihu.com/question/524667726
|
||||||
|
|
||||||
#---------------------------------------------------------------
|
#---------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# 查看磁盘内容
|
# 查看磁盘内容
|
||||||
|
@ -92,7 +92,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# 指定内存
|
# 指定内存
|
||||||
memory="-m 8G"
|
memory="-m 4G"
|
||||||
|
|
||||||
# 主磁盘
|
# 主磁盘
|
||||||
disk="-drive format=raw,file=disk.img"
|
disk="-drive format=raw,file=disk.img"
|
||||||
@ -109,6 +109,6 @@ display="-vga qxl"
|
|||||||
|
|
||||||
# 启动镜像 网络对应 run_nat.sh 里面的配置 ( -enable-kvm : vmware 里面 CPU 设置需要支持虚拟化 Intel VT-x/EPT 或 AMD-V/RVI )
|
# 启动镜像 网络对应 run_nat.sh 里面的配置 ( -enable-kvm : vmware 里面 CPU 设置需要支持虚拟化 Intel VT-x/EPT 或 AMD-V/RVI )
|
||||||
# 命令 qemu-system-x86_64 -device help 可以查看支持哪些设备
|
# 命令 qemu-system-x86_64 -device help 可以查看支持哪些设备
|
||||||
qemu-system-x86_64 ${display} -device qxl ${memory} ${disk} ${sdb_img} ${network} ${logfile}
|
qemu-system-x86_64 -device qxl ${display} ${memory} ${disk} ${sdb_img} ${network} ${logfile}
|
||||||
# stop nat
|
# stop nat
|
||||||
stop_nat
|
stop_nat
|
||||||
|
@ -37,7 +37,10 @@ build_dir=`pwd`"/build"
|
|||||||
linux_install=${build_dir}"/linux_install"
|
linux_install=${build_dir}"/linux_install"
|
||||||
glibc_install=${build_dir}"/glibc_install"
|
glibc_install=${build_dir}"/glibc_install"
|
||||||
busybox_install=${build_dir}"/busybox_install"
|
busybox_install=${build_dir}"/busybox_install"
|
||||||
|
lshw_install=${build_dir}"/lshw_install"
|
||||||
pciutils_install=${build_dir}"/pciutils_install"
|
pciutils_install=${build_dir}"/pciutils_install"
|
||||||
|
openssl_install=${build_dir}"/openssl_install"
|
||||||
|
openssh_install=${build_dir}"/openssh_install"
|
||||||
gcc_install=${build_dir}"/gcc_install"
|
gcc_install=${build_dir}"/gcc_install"
|
||||||
binutils_install=${build_dir}"/binutils_install"
|
binutils_install=${build_dir}"/binutils_install"
|
||||||
xorg_install=${build_dir}"/xorg_install"
|
xorg_install=${build_dir}"/xorg_install"
|
||||||
|
18
mk_xfce.sh
18
mk_xfce.sh
@ -69,6 +69,8 @@ WAYLANDCORE_SRC_URL=https://wayland.freedesktop.org/releases/wayland-1.20.0.tar.
|
|||||||
WAYLANDPROT_SRC_URL=https://wayland.freedesktop.org/releases/wayland-protocols-1.25.tar.xz
|
WAYLANDPROT_SRC_URL=https://wayland.freedesktop.org/releases/wayland-protocols-1.25.tar.xz
|
||||||
UPOWER_SRC_URL=https://gitlab.freedesktop.org/upower/upower/-/archive/v1.90.0/upower-v1.90.0.tar.gz
|
UPOWER_SRC_URL=https://gitlab.freedesktop.org/upower/upower/-/archive/v1.90.0/upower-v1.90.0.tar.gz
|
||||||
MESA_SRC_URL=https://gitlab.freedesktop.org/mesa/mesa/-/archive/mesa-20.0.0-rc3/mesa-mesa-20.0.0-rc3.tar.gz
|
MESA_SRC_URL=https://gitlab.freedesktop.org/mesa/mesa/-/archive/mesa-20.0.0-rc3/mesa-mesa-20.0.0-rc3.tar.gz
|
||||||
|
SHAREDMIMEINFO_SRC_URL=https://gitlab.freedesktop.org/xdg/shared-mime-info/-/archive/2.2/shared-mime-info-2.2.tar.gz
|
||||||
|
DESKTOPFILEUTILS_SRC_URL=https://gitlab.freedesktop.org/xdg/desktop-file-utils/-/archive/0.26/desktop-file-utils-0.26.tar.gz
|
||||||
SPICEPROT_SRC_URL=https://gitlab.freedesktop.org/spice/spice-protocol/uploads/cf23e217768affaca44896598bd50f3e/spice-protocol-0.14.2.tar.xz
|
SPICEPROT_SRC_URL=https://gitlab.freedesktop.org/spice/spice-protocol/uploads/cf23e217768affaca44896598bd50f3e/spice-protocol-0.14.2.tar.xz
|
||||||
LIBDRM_SRC_URL=https://dri.freedesktop.org/libdrm/libdrm-2.4.110.tar.xz
|
LIBDRM_SRC_URL=https://dri.freedesktop.org/libdrm/libdrm-2.4.110.tar.xz
|
||||||
DBUS1_SRC_URL=https://dbus.freedesktop.org/releases/dbus/dbus-1.12.12.tar.gz
|
DBUS1_SRC_URL=https://dbus.freedesktop.org/releases/dbus/dbus-1.12.12.tar.gz
|
||||||
@ -144,6 +146,7 @@ FONTMISC_SRC_URL=https://www.x.org/releases/individual/font/font-misc-misc-1.1.2
|
|||||||
XF86INPUT_SRC_URL=https://www.x.org/releases/individual/driver/xf86-input-libinput-1.2.1.tar.xz
|
XF86INPUT_SRC_URL=https://www.x.org/releases/individual/driver/xf86-input-libinput-1.2.1.tar.xz
|
||||||
XF86INPUTVM_SRC_URL=https://www.x.org/releases/individual/driver/xf86-input-vmmouse-13.2.0.tar.xz
|
XF86INPUTVM_SRC_URL=https://www.x.org/releases/individual/driver/xf86-input-vmmouse-13.2.0.tar.xz
|
||||||
XF86INPUTMM_SRC_URL=https://www.x.org/releases/individual/driver/xf86-input-mouse-1.9.3.tar.bz2
|
XF86INPUTMM_SRC_URL=https://www.x.org/releases/individual/driver/xf86-input-mouse-1.9.3.tar.bz2
|
||||||
|
XF86INPUTEVDEV_SRC_URL=https://www.x.org/releases/individual/driver/xf86-input-evdev-2.10.6.tar.bz2
|
||||||
XF86VIDEOATI_SRC_URL=https://www.x.org/releases/individual/driver/xf86-video-ati-19.1.0.tar.bz2
|
XF86VIDEOATI_SRC_URL=https://www.x.org/releases/individual/driver/xf86-video-ati-19.1.0.tar.bz2
|
||||||
XF86VIDEOVESA_SRC_URL=https://www.x.org/releases/individual/driver/xf86-video-vesa-2.5.0.tar.bz2
|
XF86VIDEOVESA_SRC_URL=https://www.x.org/releases/individual/driver/xf86-video-vesa-2.5.0.tar.bz2
|
||||||
XF86VIDEOINTEL_SRC_URL=https://www.x.org/releases/individual/driver/xf86-video-intel-2.99.917.tar.bz2
|
XF86VIDEOINTEL_SRC_URL=https://www.x.org/releases/individual/driver/xf86-video-intel-2.99.917.tar.bz2
|
||||||
@ -191,6 +194,8 @@ HARFBUZZ_SRC_NAME=$(download_src ${HARFBUZZ_SRC_URL})
|
|||||||
FRIBIDI_SRC_NAME=$(download_src ${FRIBIDI_SRC_URL})
|
FRIBIDI_SRC_NAME=$(download_src ${FRIBIDI_SRC_URL})
|
||||||
PANGO_SRC_NAME=$(download_src ${PANGO_SRC_URL})
|
PANGO_SRC_NAME=$(download_src ${PANGO_SRC_URL})
|
||||||
GDKPIXBUF_SRC_NAME=$(download_src ${GDKPIXBUF_SRC_URL})
|
GDKPIXBUF_SRC_NAME=$(download_src ${GDKPIXBUF_SRC_URL})
|
||||||
|
SHAREDMIMEINFO_SRC_NAME=$(download_src ${SHAREDMIMEINFO_SRC_URL})
|
||||||
|
DESKTOPFILEUTILS_SRC_NAME=$(download_src ${DESKTOPFILEUTILS_SRC_URL})
|
||||||
LIBATK_SRC_NAME=$(download_src ${LIBATK_SRC_URL})
|
LIBATK_SRC_NAME=$(download_src ${LIBATK_SRC_URL})
|
||||||
GETTEXT_SRC_NAME=$(download_src ${GETTEXT_SRC_URL})
|
GETTEXT_SRC_NAME=$(download_src ${GETTEXT_SRC_URL})
|
||||||
WAYLANDCORE_SRC_NAME=$(download_src ${WAYLANDCORE_SRC_URL})
|
WAYLANDCORE_SRC_NAME=$(download_src ${WAYLANDCORE_SRC_URL})
|
||||||
@ -271,6 +276,7 @@ SPICEPROT_SRC_NAME=$(download_src ${SPICEPROT_SRC_URL})
|
|||||||
XF86INPUT_SRC_NAME=$(download_src ${XF86INPUT_SRC_URL})
|
XF86INPUT_SRC_NAME=$(download_src ${XF86INPUT_SRC_URL})
|
||||||
XF86INPUTVM_SRC_NAME=$(download_src ${XF86INPUTVM_SRC_URL})
|
XF86INPUTVM_SRC_NAME=$(download_src ${XF86INPUTVM_SRC_URL})
|
||||||
XF86INPUTMM_SRC_NAME=$(download_src ${XF86INPUTMM_SRC_URL})
|
XF86INPUTMM_SRC_NAME=$(download_src ${XF86INPUTMM_SRC_URL})
|
||||||
|
XF86INPUTEVDEV_SRC_NAME=$(download_src ${XF86INPUTEVDEV_SRC_URL})
|
||||||
XF86VIDEOATI_SRC_NAME=$(download_src ${XF86VIDEOATI_SRC_URL})
|
XF86VIDEOATI_SRC_NAME=$(download_src ${XF86VIDEOATI_SRC_URL})
|
||||||
XF86VIDEOVESA_SRC_NAME=$(download_src ${XF86VIDEOVESA_SRC_URL})
|
XF86VIDEOVESA_SRC_NAME=$(download_src ${XF86VIDEOVESA_SRC_URL})
|
||||||
XF86VIDEOINTEL_SRC_NAME=$(download_src ${XF86VIDEOINTEL_SRC_URL})
|
XF86VIDEOINTEL_SRC_NAME=$(download_src ${XF86VIDEOINTEL_SRC_URL})
|
||||||
@ -339,6 +345,8 @@ LIBATK_SRC_DIR=$(unzip_src ".tar.xz" ${LIBATK_SRC_NAME}); echo "unzip ${LIBATK_S
|
|||||||
LIBEPOXY_SRC_DIR=$(unzip_src ".tar.xz" ${LIBEPOXY_SRC_NAME}); echo "unzip ${LIBEPOXY_SRC_NAME} source code"
|
LIBEPOXY_SRC_DIR=$(unzip_src ".tar.xz" ${LIBEPOXY_SRC_NAME}); echo "unzip ${LIBEPOXY_SRC_NAME} source code"
|
||||||
LIBATK_CORE_SRC_DIR=$(unzip_src ".tar.xz" ${LIBATK_CORE_SRC_NAME}); echo "unzip ${LIBATK_CORE_SRC_NAME} source code"
|
LIBATK_CORE_SRC_DIR=$(unzip_src ".tar.xz" ${LIBATK_CORE_SRC_NAME}); echo "unzip ${LIBATK_CORE_SRC_NAME} source code"
|
||||||
LIBATK_BRIDGE_SRC_DIR=$(unzip_src ".tar.xz" ${LIBATK_BRIDGE_SRC_NAME}); echo "unzip ${LIBATK_BRIDGE_SRC_NAME} source code"
|
LIBATK_BRIDGE_SRC_DIR=$(unzip_src ".tar.xz" ${LIBATK_BRIDGE_SRC_NAME}); echo "unzip ${LIBATK_BRIDGE_SRC_NAME} source code"
|
||||||
|
SHAREDMIMEINFO_SRC_DIR=$(unzip_src ".tar.gz" ${SHAREDMIMEINFO_SRC_NAME}); echo "unzip ${SHAREDMIMEINFO_SRC_NAME} source code"
|
||||||
|
DESKTOPFILEUTILS_SRC_DIR=$(unzip_src ".tar.gz" ${DESKTOPFILEUTILS_SRC_NAME}); echo "unzip ${DESKTOPFILEUTILS_SRC_NAME} source code"
|
||||||
GRAPHENE_SRC_DIR=$(unzip_src ".tar.xz" ${GRAPHENE_SRC_NAME}); echo "unzip ${GRAPHENE_SRC_NAME} source code"
|
GRAPHENE_SRC_DIR=$(unzip_src ".tar.xz" ${GRAPHENE_SRC_NAME}); echo "unzip ${GRAPHENE_SRC_NAME} source code"
|
||||||
GETTEXT_SRC_DIR=$(unzip_src ".tar.gz" ${GETTEXT_SRC_NAME}); echo "unzip ${GETTEXT_SRC_NAME} source code"
|
GETTEXT_SRC_DIR=$(unzip_src ".tar.gz" ${GETTEXT_SRC_NAME}); echo "unzip ${GETTEXT_SRC_NAME} source code"
|
||||||
WAYLANDCORE_SRC_DIR=$(unzip_src ".tar.xz" ${WAYLANDCORE_SRC_NAME}); echo "unzip ${WAYLANDCORE_SRC_NAME} source code"
|
WAYLANDCORE_SRC_DIR=$(unzip_src ".tar.xz" ${WAYLANDCORE_SRC_NAME}); echo "unzip ${WAYLANDCORE_SRC_NAME} source code"
|
||||||
@ -406,6 +414,7 @@ SPICEPROT_SRC_DIR=$(unzip_src ".tar.xz" ${SPICEPROT_SRC_NAME}); echo "unzip ${SP
|
|||||||
XF86INPUT_SRC_DIR=$(unzip_src ".tar.xz" ${XF86INPUT_SRC_NAME}); echo "unzip ${XF86INPUT_SRC_NAME} source code"
|
XF86INPUT_SRC_DIR=$(unzip_src ".tar.xz" ${XF86INPUT_SRC_NAME}); echo "unzip ${XF86INPUT_SRC_NAME} source code"
|
||||||
XF86INPUTVM_SRC_DIR=$(unzip_src ".tar.xz" ${XF86INPUTVM_SRC_NAME}); echo "unzip ${XF86INPUTVM_SRC_NAME} source code"
|
XF86INPUTVM_SRC_DIR=$(unzip_src ".tar.xz" ${XF86INPUTVM_SRC_NAME}); echo "unzip ${XF86INPUTVM_SRC_NAME} source code"
|
||||||
XF86INPUTMM_SRC_DIR=$(unzip_src ".tar.bz2" ${XF86INPUTMM_SRC_NAME}); echo "unzip ${XF86INPUTMM_SRC_NAME} source code"
|
XF86INPUTMM_SRC_DIR=$(unzip_src ".tar.bz2" ${XF86INPUTMM_SRC_NAME}); echo "unzip ${XF86INPUTMM_SRC_NAME} source code"
|
||||||
|
XF86INPUTEVDEV_SRC_DIR=$(unzip_src ".tar.bz2" ${XF86INPUTEVDEV_SRC_NAME}); echo "unzip ${XF86INPUTEVDEV_SRC_NAME} source code"
|
||||||
XF86VIDEOATI_SRC_DIR=$(unzip_src ".tar.bz2" ${XF86VIDEOATI_SRC_NAME}); echo "unzip ${XF86VIDEOATI_SRC_NAME} source code"
|
XF86VIDEOATI_SRC_DIR=$(unzip_src ".tar.bz2" ${XF86VIDEOATI_SRC_NAME}); echo "unzip ${XF86VIDEOATI_SRC_NAME} source code"
|
||||||
XF86VIDEOVESA_SRC_DIR=$(unzip_src ".tar.bz2" ${XF86VIDEOVESA_SRC_NAME}); echo "unzip ${XF86VIDEOVESA_SRC_NAME} source code"
|
XF86VIDEOVESA_SRC_DIR=$(unzip_src ".tar.bz2" ${XF86VIDEOVESA_SRC_NAME}); echo "unzip ${XF86VIDEOVESA_SRC_NAME} source code"
|
||||||
XF86VIDEOINTEL_SRC_DIR=$(unzip_src ".tar.bz2" ${XF86VIDEOINTEL_SRC_NAME}); echo "unzip ${XF86VIDEOINTEL_SRC_NAME} source code"
|
XF86VIDEOINTEL_SRC_DIR=$(unzip_src ".tar.bz2" ${XF86VIDEOINTEL_SRC_NAME}); echo "unzip ${XF86VIDEOINTEL_SRC_NAME} source code"
|
||||||
@ -788,6 +797,12 @@ llvm_build() {
|
|||||||
common_build dbus-1 ${DBUS1_SRC_DIR} --disable-tests
|
common_build dbus-1 ${DBUS1_SRC_DIR} --disable-tests
|
||||||
# 编译 ( libsensors4 )
|
# 编译 ( libsensors4 )
|
||||||
common_build im_sensors ${IMSENSORS_SRC_DIR}
|
common_build im_sensors ${IMSENSORS_SRC_DIR}
|
||||||
|
# 编译 shared-mime-info ( GNOME 需要这个 ) 并更新 mime 数据库
|
||||||
|
meson_build sharedmimeinfo ${SHAREDMIMEINFO_SRC_DIR}
|
||||||
|
${xfce_install}/usr/bin/update-mime-database ${xfce_install}/usr/share/mime
|
||||||
|
# 编译 desktop-file-utils ( GNOME 需要这个 ) 并更新 applications 数据库
|
||||||
|
meson_build desktopfileutils ${DESKTOPFILEUTILS_SRC_DIR}
|
||||||
|
${xfce_install}/usr/bin/update-desktop-database ${xfce_install}/usr/share/applications
|
||||||
fi
|
fi
|
||||||
# 编译 libatk
|
# 编译 libatk
|
||||||
meson_build libatk ${LIBATK_SRC_DIR}
|
meson_build libatk ${LIBATK_SRC_DIR}
|
||||||
@ -883,6 +898,8 @@ llvm_build() {
|
|||||||
common_build xf86inputvm ${XF86INPUTVM_SRC_DIR}
|
common_build xf86inputvm ${XF86INPUTVM_SRC_DIR}
|
||||||
# xf86inputmm
|
# xf86inputmm
|
||||||
common_build xf86inputmm ${XF86INPUTMM_SRC_DIR}
|
common_build xf86inputmm ${XF86INPUTMM_SRC_DIR}
|
||||||
|
# xf86inputevdev
|
||||||
|
common_build xf86inputevdev ${XF86INPUTEVDEV_SRC_DIR}
|
||||||
# xf86videoati ( 为了虚拟机上能显示图形,我们把常用的显卡驱动全部编译了 )
|
# xf86videoati ( 为了虚拟机上能显示图形,我们把常用的显卡驱动全部编译了 )
|
||||||
# common_build xf86videoati ${XF86VIDEOATI_SRC_DIR}
|
# common_build xf86videoati ${XF86VIDEOATI_SRC_DIR}
|
||||||
# xf86videovesa ( vesa是一个支持大部分显卡的通用驱动,不提供任何 2D 和 3D 加速功能 也可以 apt install libgl1-mesa-dri )
|
# xf86videovesa ( vesa是一个支持大部分显卡的通用驱动,不提供任何 2D 和 3D 加速功能 也可以 apt install libgl1-mesa-dri )
|
||||||
@ -948,7 +965,6 @@ llvm_build() {
|
|||||||
cd ${XFCE_SRC_DIR}
|
cd ${XFCE_SRC_DIR}
|
||||||
|
|
||||||
echo "${CYAN}build xfce4 utils${NC}"
|
echo "${CYAN}build xfce4 utils${NC}"
|
||||||
sleep 3
|
|
||||||
|
|
||||||
# 必须去掉这个,否则 xfce 编译不过,做的还是有点差,和 gtk+ 的编译还是差一个档次
|
# 必须去掉这个,否则 xfce 编译不过,做的还是有点差,和 gtk+ 的编译还是差一个档次
|
||||||
#unset PKG_CONFIG_SYSROOT_DIR
|
#unset PKG_CONFIG_SYSROOT_DIR
|
||||||
|
Loading…
Reference in New Issue
Block a user