version 1.5, 2013/01/28 10:42:47
|
version 1.6.2.6, 2013/07/29 15:06:59
|
Line 43 clean_romfs()
|
Line 43 clean_romfs()
|
build_romfs() |
build_romfs() |
{ |
{ |
echo "+++ Build ELWIX RomFS directory ..." |
echo "+++ Build ELWIX RomFS directory ..." |
mkdir -p $ROMFS_USR | mkdir -p $ROMFS |
|
|
cd $ROMFS_USR | cd $ROMFS |
|
|
install -d bin; |
install -d bin; |
|
install -d boot; |
|
install -d boot/defaults; |
|
install -d boot/firmware; |
|
install -d boot/kernel; |
|
install -d boot/modules; |
|
install -d boot/zfs; |
|
install -d dev; |
|
install -d elwix; |
|
install -d elwix/altroot; |
|
install -d elwix/altroot/var; |
|
install -d elwix/cf; |
|
install -d elwix/etc; |
|
install -d -o 883 -g 883 elwix/etc/mqtt; |
|
install -d elwix/exports; |
|
install -d elwix/home; |
|
install -d -m 0750 elwix/root; |
|
install -d -m 0750 elwix/root/.ssh; |
|
install -d elwix/system; |
|
install -d elwix/tftpboot; |
|
ln -fs /elwix/etc etc; |
|
ln -fs /elwix/exports exports; |
|
ln -fs /elwix/home home; |
|
ln -fs /elwix/root root; |
|
ln -fs /elwix/system system; |
|
ln -fs /elwix/tftpboot tftpboot; |
|
install -d mnt; |
|
install -d -m 0555 proc; |
install -d sbin; |
install -d sbin; |
install -d lib; | ln -fs /var/tmp tmp; |
install -d lib/geom; | install -d usr; |
install -d libdata; | install -d usr/bin; |
install -d libexec; | install -d usr/lib; |
install -d local; | ln -fs /usr/lib lib; |
install -d local/bin; | install -d usr/lib/engines; |
install -d local/lib; | install -d usr/lib/geom; |
install -d local/libexec; | install -d usr/lib32; |
install -d local/libdata; | install -d usr/libdata; |
install -d local/sbin; | install -d usr/libexec; |
install -d share; | ln -fs /usr/libexec libexec; |
install -d share/misc; | install -d usr/local; |
install -d share/skel; | install -d usr/local/bin; |
install -d share/zoneinfo; | install -d usr/local/lib; |
| install -d usr/local/libexec; |
| install -d usr/local/libdata; |
| install -d usr/local/sbin; |
| install -d usr/sbin; |
| install -d usr/share; |
| install -d usr/share/misc; |
| install -d usr/share/skel; |
| install -d usr/share/zoneinfo; |
| install -d var; |
|
|
ln -s /elwix/pkg pkg; |
|
|
|
chown -hR root:wheel . |
chown -hR root:wheel . |
cd - |
cd - |
} |
} |
|
|
install_romfs() |
install_romfs() |
{ |
{ |
LIBS="${ROMFS_USR}/lib" | LIBS="${ROMFS}/usr/lib" |
LIBEXEC="${ROMFS_USR}/libexec" | LIBEXEC="${ROMFS}/usr/libexec" |
LIBDATA="${ROMFS_USR}/libdata" | LIBDATA="${ROMFS}/usr/libdata" |
BIN="${ROMFS_USR}/bin" | BIN="${ROMFS}/bin" |
SBIN="${ROMFS_USR}/sbin" | UBIN="${ROMFS}/usr/bin" |
SHARE="${ROMFS_USR}/share" | SBIN="${ROMFS}/sbin" |
| USBIN="${ROMFS}/usr/sbin" |
| SHARE="${ROMFS}/usr/share" |
SKEL="${SHARE}/skel" |
SKEL="${SHARE}/skel" |
MISC="${SHARE}/misc" |
MISC="${SHARE}/misc" |
|
|
Line 96 install_romfs()
|
Line 132 install_romfs()
|
install -v ${CFGDIR}/root.skel/profile $SKEL/dot.profile; |
install -v ${CFGDIR}/root.skel/profile $SKEL/dot.profile; |
install -v ${CFGDIR}/root.skel/vimrc $SKEL/dot.vimrc; |
install -v ${CFGDIR}/root.skel/vimrc $SKEL/dot.vimrc; |
|
|
|
find ${WORLD}/libexec -type f -name ld-elf.so\* -exec install {} $LIBEXEC \; |
|
|
find ${WORLD}/lib -type f -name \*.so.\* -exec install {} $LIBS \; |
find ${WORLD}/lib -type f -name \*.so.\* -exec install {} $LIBS \; |
find ${WORLD}/lib -type f -name libalias_\*.so -exec install {} $LIBS \; |
find ${WORLD}/lib -type f -name libalias_\*.so -exec install {} $LIBS \; |
find ${WORLD}/lib/geom -type f -name \*.so -exec install {} $LIBS/geom \; |
find ${WORLD}/lib/geom -type f -name \*.so -exec install {} $LIBS/geom \; |
find ${WORLD}/usr/lib -type f -name \*.so.\* -exec install {} $LIBS \; |
find ${WORLD}/usr/lib -type f -name \*.so.\* -exec install {} $LIBS \; |
|
find ${WORLD}/usr/lib/engines -type f -name \*.so -exec install {} $LIBS/engines \; |
|
|
InstallList ${ELWIX_ROMFS} ${WORLD} ${ROMFS} |
InstallList ${ELWIX_ROMFS} ${WORLD} ${ROMFS} |
|
|
InstallDir ${WORLD}/usr/local/bin $BIN | InstallDir ${WORLD}/usr/local/bin $UBIN |
InstallDir ${WORLD}/usr/local/sbin $SBIN | InstallDir ${WORLD}/usr/local/sbin $USBIN |
InstallDir ${WORLD}/usr/local/lib $LIBS | InstallFiles \*.so\* ${WORLD}/usr/local/lib $LIBS |
InstallDir ${WORLD}/usr/local/libdata $LIBDATA |
InstallDir ${WORLD}/usr/local/libdata $LIBDATA |
|
|
chown -R root:wheel $SBIN $BIN $LIBDATA $LIBEXEC $LIBS | chown -R root:wheel $SBIN $BIN $USBIN $UBIN $LIBDATA $LIBEXEC $LIBS |
} |
} |
|
|
build_image() |
|
{ |
|
echo "+++ Build ELWIX Firmware system image ..." |
|
|
|
cd ${ROMFS_USR} |
|
pax -w -z -v -f${REL}/${ROMFS_IMG} . |
|
cd - |
|
|
|
# Stop using uzip fs |
|
# makefs -ominfree=0,bsize=8192,fsize=1024,optimization=space -s${ROMFS_SIZE} \ |
|
# ${REL}/${ROMFS_IMG} ${ROMFS_USR} |
|
|
|
# MDDEV=$(mdconfig -a -t vnode -f ${REL}/${ROMFS_IMG}); |
|
# tunefs -L elwixFirmware /dev/$MDDEV; |
|
# mdconfig -d -u $MDDEV; |
|
|
|
# mkuzip -s 8192 -o ${REL}/${ROMFS_IMG}.uzip ${REL}/${ROMFS_IMG}; |
|
# mv ${REL}/${ROMFS_IMG}.uzip ${REL}/${ROMFS_IMG} |
|
} |
|
|
|
build_image2() |
build_image2() |
{ |
{ |
echo "+++ Build ELWIX Firmware secondary image ..." |
echo "+++ Build ELWIX Firmware secondary image ..." |
Line 185 clean_romfs
|
Line 204 clean_romfs
|
build_romfs |
build_romfs |
|
|
install_romfs |
install_romfs |
build_image |
|
|
|
install_romfs2 |
install_romfs2 |
build_image2 |
build_image2 |