always-waiting / leetcode Goto Github PK
View Code? Open in Web Editor NEWLeetcode练习
Leetcode练习
1.安装febootstrap
https://www.dwhd.org/20160630_111307.html
2.构建目录结构
febootstrap -i bash -i wget -i yum -i telnet -i iputils -i iproute -i vim -i gzip -i tar centos76 centos76-extend http://mirrors.aliyun.com/centos/7/os/x86_64/
chroot ~/febootstrap/centos76-extend yum install elrepo-release -y
chroot ~/febootstrap/centos76-extend/ yum --enablerepo=elrepo-kernel install kernel-ml kernel-ml-devel.x86_64
cd centos76-extend/
time tar -cf - . | xz -v --threads=24 > ~/febootstrap/initramfs/rootfs.tar.xz
cd initramfs/
wget -O ~/febootstrap/initramfs/bin/busybox https://busybox.net/downloads/binaries/1.21.1/busybox-x86_64
cat <<EOF > init
#!/bin/sh
[ -d /dev ] || mkdir -m 0755 /dev
[ -d /root ] || mkdir -m 0700 /root
[ -d /sys ] || mkdir /sys
[ -d /proc ] || mkdir /proc
[ -d /tmp ] || mkdir /tmp
mkdir -p /var/lock
mount -t sysfs -o nodev,noexec,nosuid sysfs /sys
mount -t proc -o nodev,noexec,nosuid proc /proc
# Some things don't work properly without /etc/mtab.
ln -sf /proc/mounts /etc/mtab
grep -q '\<quiet\>' /proc/cmdline || echo "Loading, please wait..."
# Note that this only becomes /dev on the real filesystem if udev's scripts
# are used; which they will be, but it's worth pointing out
if ! mount -t devtmpfs -o mode=0755 udev /dev; then
echo "W: devtmpfs not available, falling back to tmpfs for /dev"
mount -t tmpfs -o mode=0755 udev /dev
[ -e /dev/console ] || mknod -m 0600 /dev/console c 5 1
[ -e /dev/null ] || mknod /dev/null c 1 3
fi
mkdir /dev/pts
mount -t devpts -o noexec,nosuid,gid=5,mode=0620 devpts /dev/pts || true
mount -t tmpfs -o "noexec,nosuid,size=10%,mode=0755" tmpfs /run
mkdir /run/initramfs
# compatibility symlink for the pre-oneiric locations
ln -s /run/initramfs /dev/.initramfs
# Set modprobe env
export MODPROBE_OPTIONS="-qb"
# mdadm needs hostname to be set. This has to be done before the udev rules are called!
if [ -f "/etc/hostname" ]; then
/bin/hostname -b -F /etc/hostname 2>&1 1>/dev/null
fi
exec /sbin/init
EOF
find . -print0 | cpio --null -ov --format=newc | gzip -9 > ../build/initramfs.gz
initramfs.gz就是需要的内存镜像,如果需要对内存镜像做定制化处理,可是使用chroot命令。例如:
# 按照包
chroot ~/febootstrap/centos76-extend yum install elrepo-release -y
3.参考链接
https://cloud.tencent.com/developer/article/1454524
https://www.dwhd.org/20160630_111307.html
https://cloud.tencent.com/developer/article/1584786
http://linuxcoming.com/blog/2019/06/21/build_ram_os.html
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.