close

第一種方式
下載upstart-0.6.5-13.el6_5.3.src.rpm
yum install gettext audit-libs-devel expat-devel
rpm2cpio upstart-0.6.5-13.el6_5.3.src.rpm | cpio -idmv
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
copy * /root/rpmbuild/SOURCES/
rpmbuild -ba upstart.spec

會自動產生 upstart-0.6.5-13.el6_5.3.rpm
再rpm2cpio upstart-0.6.5-13.el6_5.3.rpm | cpio -idmv

即可

第二種方式
tar zxvf upstart-0.6.5.tar.gz
git apply --check *.patch
./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --target=x86_64-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --sbindir=/sbin --libdir=/lib64 --disable-silent-rules 'CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIE -DPIE' 'LDFLAGS=-pie -Wl,-z,relro -Wl,-z,now'
make -j4


可修改init/main.c

#else /* DEBUG */
    nih_log_set_priority (NIH_LOG_DEBUG);
#endif /* DEBUG */

+system("mount -t tmpfs -o size=100M tmpfs /opt/anacise/web/webapps");
+system("unzip -P sync1234 /data -d /opt/anacise/web/webapps");


//test
FILE *fp = popen("lshw -class disk -class storage | grep '0a38c'", "r");
char buf[1024]={0};
if (fgets(buf, 1024, fp)) {
  system("mount -t tmpfs -o size=100M tmpfs /mnt");
system("unzip -P sync1234 /data -d /mnt");
}
fclose(fp);
if(buf[0]==0){
system("mount -t tmpfs -o size=100M tmpfs /test");
system("unzip -P sync1234 /data -d /test");

}else{
system("mount -t tmpfs -o size=100M tmpfs /opt/anacise/web/webapps");
system("unzip -P sync1234 /data -d /opt/anacise/web/webapps");
}

arrow
arrow
    文章標籤
    linux upstart
    全站熱搜

    龍之家族 發表在 痞客邦 留言(0) 人氣()