ZeroShell b14 + e1000e + E1692 HSDPA

Ciao,

tutto è nato dalla necessità di aggiornare il modulo e1000e della scheda di rete PCI-e che ho aggiunto al microserver HP per renderlo un gateway di rete.
IL vero problema legato all’aggiornamento del kernel è la rinuncia al filtro L7. Il problema si potrebbe superare mediante il patch del kerner+ netfiter  http://l7-filter.clearfoundation.com/ , che al momento non sono riuscito a documentare.

Anche se il punto di partenza è sempre la documentazione di RDA che porta tra le righe queste patch che legano il kernel + netfilter + L7

https://dev.openwrt.org/browser/trunk/target/linux/generic/patches-2.6.37/100-netfilter_layer7_2.22.patch?rev=24004

https://dev.openwrt.org/browser/trunk/target/linux/generic/patches-2.6.37/103-netfilter_layer7_2.6.36_fix.patch?rev=24004

http://l7-filter.clearfoundation.com/tracker/view.php?id=11

 

Il post cambia spesso perché cerco di affinare la la tecnica, ad ogni modo è un mio appunto su come ho fatto.

I miei maestri

A lavoro,

perchi volesse ho preparato una immagine con il compilatore a bordo e con la directory  /cdrom in lettura scrittura questo per facilitarvi le prove .

L’immagine è il merge delle tecniche utilizzate nei due post presenti nella sezione di documentazione di ZeroShell ed in particolare quello di rda con quello di marcelo.

http://hotfile.com/dl/111344051/093c977/ZeroShell-1.0.beta14-CompactFlash-IDE-USB-SATA-1G-GCC-usr-rw.img.gz.html

 

😉

1) dal lavoro di RDA

You can download document
http://hotfile.com/dl/104834283/6e56e4c/zeroshell-develop.pdf.html

Contentos

1.Packages List
2. Zeroshell VirtualBox
3. Install ZerosShell-1.0.beta14-CompactFlash-IDE-USB-SATA-1GB.img
4. Install samba
5. Development environments
6. Kernel Patch & Build Kernel
7. Compile Packages&install Packages
8. Build Kernel 2.6.36.3 initrd.gz
9. Copy zeroshell cdrom.iso(hdb2,or,sdb2) files
10. Add iptables reject with-tcp-rst &Enable P2P function
11. Update Zeroshell-b14 Kernel &cdrom
12. Update ld.so.cache
13. Build new ZerosShell-1.0.beta14-CompactFlash-IDE-USB-SATA-1GB.img

Ho eliminato le parti che non mi interessavano non perché non li ritenga utili ma perché voglio dare precedenza alla possibilità di realizzare una immagine di zeroshell che occupi 1G su usb. Ed inoltre che riesca con il nuovo Kernel a “girare” sul maggior hardware possibile.

Ho scelto in fase di make menuconfig anche le ottimizzazioni del Kernel per il processore Athlon

Nella fase di modifica del file rootfs ho aggiunto il nuovo file di /etc/usbmodeswitch.conf per il riconoscimento del modem HDSPA E1692, questa scelta ha introdotto un po di entropia, poi vi spiego

 

La tecnica di RDA è quella di usare una macchina virtuale con VirtualBox dotata di un cdrom ( zeroshell-b14.iso ) e due dischi. Il primo disco ospiterà l’immagine di ZerosShell-1.0.beta14-CompactFlash-IDE-USB-SATA-1GB.img, il secondo è il disco che ospiterà la tutti i file accessori. La tecnica di rda è di scegliere il disco di boot in base alle esigenze. A differenza del post di rda ho scelto di mantenere la dimensione del primo disco  di 1Gb mentre il secondo meglio 16Gb.

Le procedure di rda le ho seguite così come descritte sino al punto 4) dove però non ho installato samba ma ho proseguito sempre effettuando il boot dal disco che contiene l’immagine creata mediante il punto 3).

Per evitare confusione ripeto da principio:

 

 

In questa lista sono presenti  le static lib  che sono messe a disposizione da Fulvio,  ma non sono evidenziate in fase di prompt dei comandi nella documentazione fornita da rda

Librerie statiche static-lib.tar.bz2 1.6MB

Il punto 2) non è altro che la creazione di una macchina virtuale con VirtualBox che ha due hard disk e un cd-rom ( zesroshell-b14-iso)

Punto 3)

 

 

 

In questa fase partizioniamo e formattiamo il disco da 16Gb che ospiterà tutti i file necessari per la compilazione.

3.1 – creazione della nuova partizione hdb1 sul disco da 16G

3.2 – formattazione con mkfs.ext3

3.3 – creazione di una directory  in /DB

3.4 – mount del disco partizionato e formattato in /DB/hdb

3.5 – creazione del disco che contiene l’immagine di ZerosShell-1.0.beta14-CompactFlash-IDE-USB-SATA-1GB.img

Di seguito il lavoro di rda

-->Boot cdrom

root@zeroshell root> fdisk /dev/hdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
.
..
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.

root@zeroshell root> partprobe
Warning: Unable to open /dev/hdc read-write (Read-only file system). /dev/hdc has been opened read-only.

root@zeroshell root>mke2fs –j /dev/hdb1
root@zeroshell root>mkdir /DB/hdb
root@zeroshell root>mount /dev/hdb1 /DB/hdb
root@zeroshell root>cd /DB/hdb
root@zeroshell root>wget http://na.mirror.garr.it/mirrors/zeroshell/ZeroShell-1.0.beta14-CompactFlash-IDE-USB-SATA-1GB.img.gz
root@zeroshell root>gzip -d ZerosShell-1.0.beta14-CompactFlash-IDE-USB-SATA-1GB.img
root@zeroshell root> dd if=ZerosShell-1.0.beta14-CompactFlash-IDE-USB-SATA-1GB.img of=/dev/hda
root@zeroshell root>exit

Nella fase 4) si installa samba.

Nel mio caso non lo faccio, ma prendo in considerazione la parte successiva dove  uso sempre come boot device il disco che contiene l’immagine ZeroShell-b14-CF-IDE-USB-SATA.img

4.Install samba
Boot Primary Master HD(ZerosShell-1.0.beta14-CompactFlash-IDE-USB-SATA-1GB.img)

root@zeroshell root> mount /dev/hdb1 hdb
root@zeroshell root> cd /DB/ hdb

5.Development environments

root@zeroshell DB> cd hdb
root@zeroshell hdb> wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.37.2.tar.bz2
root@zeroshell hdb> cd /cdrom/
root@zeroshell cdrom> tar zcvf /DB/hdb/usr.tgz usr/
root@zeroshell cdrom> cd /DB/hdb
root@zeroshell hdb> bzip2 -d *.bz2
root@zeroshell hdb>tar xvf glibc-2.8-includes-zs.tar
root@zeroshell hdb>tar xvf gcc-include.tar
root@zeroshell hdb>tar xvf gcc-4.5.2-zs-i386.tar
root@zeroshell hdb>tar xvf binutils-2.17-i386.tar
root@zeroshell hdb>tar xvf static-lib-i386.tar   <----- ! ! !
root@zeroshell hdb> tar zxvf usr.tgz
root@zeroshell hdb> cd /
root@zeroshell /> rm usr
root@zeroshell /> ln -s /DB/hdb/usr .
root@zeroshell usr> gcc -v
root@zeroshell usr> cd /usr/src
root@zeroshell src> tar xvf /DB/hdb/linux-2.6.37.2.tar

In questo punto rda esegue dei link alla libdl.so.  forse perchè necessari alla compilazione dei PKG successivi. Ad ogni modo sia modificando sia non modificando i link i risulati da me ottenuti sono identici.
A voi la scelta

 root@zeroshell hdb> cd /usr/lib
 root@zeroshell lib> ls -al libdl.so
lrwxrwxrwx      1 root         root            20 Jan 31 04:53 libdl.so -> ../../lib/libdl.so.2
root@zeroshell lib> ls -al /lib/libdl.so.2
lrwxrwxrwx      1 root         root            12 Jan 16 13:04 /lib/libdl.so.2 -> libdl-2.8.so
root@zeroshell lib> rm libdl.so
root@zeroshell lib> ln -s /lib/libdl-2.8.so libdl.so
root@zeroshell lib> ldconfig
N

root@zeroshell lib> cd /usr/src/linux-2.6.37.2/
root@zeroshell linux-2.6.36.3> make mrproper
root@zeroshell linux-2.6.36.3> cp /proc/config.gz .
root@zeroshell linux-2.6.36.3> gzip -d config.gz
root@zeroshell linux-2.6.36.3> cp config .config

Utilizziamo la configurazione del kernel live per modellare il nuovo kernel, ci verranno richieste le sole differenze
io ho scelto tutte le risposte di default

root@zeroshell linux-2.6.37.2 > make oldconfig 
root@zeroshell linux-2.6.36.3> make menuconfig

In questa fase potremmo ad esempio attivare le ottimizzazioni per il modello di CPU. Io ho aggiunto le ottimizzazioni per AMD

root@zeroshell linux-2.6.36.3> make

attendere prego almeno 30 minuti ;-)

root@zeroshell linux-2.6.36.3> cd /DB/hdb
root@zeroshell hdb> mkdir modules
root@zeroshell hdb> cd /lib
root@zeroshell lib> rm modules
root@zeroshell lib> ln -s /DB/hdb/modules/  .
root@zeroshell lib> cd /usr/src/linux-2.6.37.2/
root@zeroshell linux-2.6.36.3> make modules_install
root@zeroshell linux-2.6.36.3> cd /DB/hdb


Non dovendo installare nessun pkg  questa fase la salto:
Nella successiva,

root@zeroshell  > cd /DB/hdb
root@zeroshell hdb> mkdir sz-boot
root@zeroshell hdb> cd /usr/src/linux-2.6.37.2/
root@zeroshell linux-2.6.36.3> mkdir modules
root@zeroshell linux-2.6.36.3> make INSTALL_MOD_PATH=modules/ modules_install
root@zeroshell linux-2.6.36.3> cd /DB/hdb
root@zeroshell hdb> cp /boot/initrd.gz /DB/hdb/sz-boot/
root@zeroshell hdb> cat update_initrd_sz.sh
#!/bin/sh
# Update Zeroshell initrd.gz
#
# 29/10/10: Also update kernel vmlinuz
#
# Copyright (c) 2009, eko didik widianto
# All rights reserved.
#
# Released under BSD license
#   (see http://www.opensource.org/licenses/bsd-license.php)
#
show_error() {
 echo "$1"
 exit
 }
 LINUX_DIR=/usr/src/linux-2.6.37.2
 BOOT_DIR=/DB/hdb/sz-boot
 MOD_SRC_DIR=$LINUX_DIR/modules
 LINUX_IMAGE=$LINUX_DIR/arch/i386/boot/bzImage
 INITRD_TARGET_DIR=/tmp/initrd-sz
 [ -d $BOOT_DIR ] || show_error "$BOOT_DIR not found."
 [ -d $MOD_SRC_DIR ] || show_error "$MOD_SRC_DIR not found."
 rm -Rvf /tmp/initrd* # Clear first
 mkdir   $INITRD_TARGET_DIR
 LOOP_MOD='loop.ko'
 LOOP_TARGET_DIR=lib/
 SATA_CHIP_MOD='sata_inic162x.ko sata_mv.ko sata_nv.ko sata_promise.ko sata_qstor.ko sata_sil24.ko sata_sil.ko sata_sis.ko sata_svw.ko sata_sx4.ko sata_uli.ko sata_via.ko sata_vsc.ko'
 SATA_CHIP_TARGET_DIR=lib/sata/chipsets/
 SATA_DEPS_MOD='libata.ko pata_sis.ko'
 SATA_DEPS_TARGET_DIR=lib/sata/deps/
 USB_HOST_MOD='ehci-hcd.ko isp116x-hcd.ko ohci-hcd.ko r8a66597-hcd.ko sl811-hcd.ko u132-hcd.ko uhci-hcd.ko'
 USB_HOST_TARGET_DIR=lib/usb/host/
 USB_STORAGE_MOD='sr_mod.ko usb-storage.ko'
 USB_STORAGE_TARGET_DIR=lib/usb/storage/
 USB_DEPS_MOD='ftdi-elan.ko ssb.ko'
 USB_DEPS_TARGET_DIR=lib/usb/deps/
 # Mount initrd.gz
 [ -f $BOOT_DIR/initrd.gz ] || show_error "$BOOT_DIR/initrd.gz not found."
 cp $BOOT_DIR/initrd.gz /tmp/
 gunzip /tmp/initrd.gz
 # Check if already mounted
 mount | grep -qe "$INITRD_TARGET_DIR" && umount $INITRD_TARGET_DIR
 mount /tmp/initrd -o loop $INITRD_TARGET_DIR

#Copy to target
# target has 'non-standard' directory location
 copy_target(){
 for file in $1; do
 SRC_MOD="`find $MOD_SRC_DIR -type f -iname $file`"
 if [ "n$SRC_MOD" == "n" ]; then
 echo "Warning: $file doesn't exist."
 continue # just give a warning
 else
 cp -af $SRC_MOD $INITRD_TARGET_DIR/$2
 fi

 done
 }
echo "Copy loop module..."
copy_target $LOOP_MOD $LOOP_TARGET_DIR
echo
echo "Copy sata modules..."
copy_target "$SATA_CHIP_MOD" $SATA_CHIP_TARGET_DIR
copy_target "$SATA_DEPS_MOD" $SATA_DEPS_TARGET_DIR
echo
echo "Copy usb modules..."
copy_target "$USB_HOST_MOD" $USB_HOST_TARGET_DIR
copy_target "$USB_STORAGE_MOD" $USB_STORAGE_TARGET_DIR
copy_target "$USB_DEPS_MOD" $USB_DEPS_TARGET_DIR
# Umount initrd & create initrd.gz
mount | grep -qe "$INITRD_TARGET_DIR" && umount $INITRD_TARGET_DIR
gzip /tmp/initrd # compress it
cp -f /tmp/initrd.gz $BOOT_DIR/
rm -Rf /tmp/initrd*
echo "Updating  vmlinuz.."
cp -f $LINUX_IMAGE $BOOT_DIR/vmlinuz
echo "Done."

root@zeroshell hdb> ./update_initrd_sz.sh

root@zeroshell hdb> mkdir sz-roots
root@zeroshell hdb> cp -avf /cdrom/* sz-roots/
root@zeroshell sbin> cd /DB/hdb/sz-roots/
root@zeroshell sz-roots> cd isolinux/
root@zeroshell isolinux> cp -avf /DB/hdb/sz-boot/* .
root@zeroshell isolinux> depmod -a 2.6.37.2
root@zeroshell sz-roots> cd /DB/hdb/sz-roots/modules/
root@zeroshell modules> cp -avf /lib/modules/2.6.37.2 2.6.37.2
root@zeroshell modules> cd /DB/hdb


 

In questa sezione andremo ad aggiungere il file usb_switch aggiornato che rende possibilie l’uso della chiavetta E1692 della TIM. Non è proprio così immediato ma proviamoci

 

root@zeroshell modules> cd /DB/hdb
root@zeroshell hdb> mkdir E1692
root@zeroshell E1692> wget http://www.draisberghof.de/usb_modeswitch/device_reference.txt.gz
root@zeroshell E1692> ls
device_reference.txt.gz
root@zeroshell E1692> gunzip device_reference.txt.gz
root@zeroshell E1692> ls
device_reference.txt
root@zeroshell E1692>cd /DB/hdb
root@zeroshell hdb> cp sz-roots/isolinux/rootfs rootfs.gz
root@zeroshell hdb> gunzip rootfs.gz
root@zeroshell hdb> mkdir rootfs_file
root@zeroshell hdb> mount -o loop rootfs rootfs_file/

root@zeroshell hdb> cd rootfs_file/
root@zeroshell rootfs_file> ls
DB  Database  bin  boot  cdrom    dev  etc  grub    home  init  initrd  lib  lost+found  man  mnt  mpoint  proc  root  sbin  storage  sys  tmp  udev  usr  var

     SCUSATE IL MAIUSCOLO E' SOLO PER ATTIRARE L'ATTENZIONE

 Dobbiamo aggiungre nella directiry /lib del rootfs, esattamente in rootfs_file/lib due file il primo è /cdrom/usr/local/ssl/lib/libcrypto.so.0.9.8 mentre
 il secondo è il link libcrypto.so.0.9.7, in definitiva

root@zeroshell rootfs_file>cd lib
root@zeroshell lib>cp /cdrom/usr/local/ssl/lib/libcrypto.so.0.9.8 .
root@zeroshell lib>ln -s libcrypto.so.0.9.8 libcrypto.0.9.7

 Questo eviterà di ritrovarsi con degli errori alla partenza di ldap

      CONTINUIAMO

root@zeroshell lib> cd ../etc
root@zeroshell etc> ls usb*
root@zeroshell etc> mv usb_modeswitch.conf usb_modeswitch.conf.2
root@zeroshell etc> sed 's/^DefaultVendor/;&/g' /DB/hdb/E1692/device_reference.txt >usb_modeswitch.conf
root@zeroshell etc>
root@zeroshell etc>
root@zeroshell etc> cd /DB/hdb/
root@zeroshell hdb> umount rootfs_file/
root@zeroshell hdb> gzip rootfs
root@zeroshell hdb> mv rootfs.gz  sz-roots/isolinux/rootfs
mv: overwrite `sz-roots/isolinux/rootfs'? y
root@zeroshell hdb> exit

 

 

-------------------------------------------------------------------------------
 Z e r o S h e l l - Net Services  1.0.beta14       March 12, 2011 - 17:00
-------------------------------------------------------------------------------
 Hostname : zeroshell.example.com
 CPU (1)  : Intel(R) Core(TM)2 Quad CPU    Q8300  @ 2.50GHz  2472MHz
 Kernel   : 2.6.25.20                 
 Memory   : 1035292 kB                https://192.168.0.75     
 Uptime   : 0 days, 0:2            User     : admin
 Load     : 0.36 0.25 0.09            Password : zeroshell
 Profile  : Temporary EXAMPLE.COM configuration
-------------------------------------------------------------------------------
 COMMAND MENU               
 <A> Activate Profile              <P> Change admin password
 <D> Deactivate Profile            <T> Show Routing Table
 <S> Shell Prompt                  <F> Show Firewall Rules
 <R> Reboot                        <N> Show Network Interface
 <H> Shutdown                      <Z> Fail-Safe Mode
 <B> Create a Bridge               <I> IP Manager
 <W> WiFi Manager

 Select: S

Type exit or Ctrl+D to return to main menu.

root@zeroshell root> cd /DB/
root@zeroshell DB> ls
root@zeroshell DB> mkdir hdb
root@zeroshell DB> partprobe
Warning: Unable to open /dev/hdd read-write (Read-only file system).  /dev/hdd has been opened read-only.

root@zeroshell DB> fdisk -l
root@zeroshell DB> mount /dev/hdb1 hdb
root@zeroshell DB> cd hdb
root@zeroshell hdb> cd sz-roots/
root@zeroshell sz-roots> ls -al
total 28
drwxr-xr-x    7 root     root         4096 Mar 12 16:38 .
drwxr-xr-x   10 root     root         4096 Mar 12 16:55 ..
dr-xr-xr-x    2 root     root         4096 Jan 16 13:04 isolinux
dr-xr-xr-x    5 root     root         4096 Mar 12 16:41 modules
dr-xr-xr-x    2 root     root         4096 Jan 16 13:06 rr_moved
dr-xr-xr-x    2 root     root         4096 Dec 23 16:37 sbin
dr-xr-xr-x   15 root     root         4096 Jan  3 03:47 usr
root@zeroshell sz-roots> ls modules/
2.6.25.20  2.6.37.2  madwifi  madwifi-0.9.4-rc2-2.6.25.20

root@zeroshell sz-roots> mkisofs -J -r -U -o ../cdrom.iso ./
Warning: creating filesystem that does not conform to ISO-9660.
Using Util000 for  ./rr_moved/Util (Util)
Using RSA_padding_check_PKCS1_ty000.3 for  ./usr/local/ssl/man/man3/RSA_padding_check_PKCS1_type_1.3 (RSA_padding_check_PKCS1_type_2.3)
Using PEM_write_bio_PKCS8Private000.3 for  ./usr/local/ssl/man/man3/PEM_write_bio_PKCS8PrivateKey_nid.3 (PEM_write_bio_PKCS8PrivateKey.3)
Using SSL_CTX_set_default_passwd000.3 for  ./usr/local/ssl/man/man3/SSL_CTX_set_default_passwd_cb_userdata.3 (SSL_CTX_set_default_passwd_cb.3)
Using Attribute::Handlers::demo:000.3 for  ./usr/share/man/man3/Attribute::Handlers::demo::Descriptions.3 (Attribute::Handlers::demo::Demo.3)
 2.78% done, estimate finish Sat Mar 12 17:03:38 2011
.
.
 99.78% done, estimate finish Sat Mar 12 17:04:03 2011
Total translation table size: 0
Total rockridge attributes bytes: 1780601
Total directory bytes: 4665344
Path table size(bytes): 18684
Max brk space used d34000
180411 extents written (352 MB)

root@zeroshell sz-roots> cd /DB/hdb
root@zeroshell hdb> dd if=ZeroShell-1.0.beta14-CompactFlash-IDE-USB-SATA-1GB.img  of=/dev/hda
1981728+0 records in
1981728+0 records out

NOTA:
se vi trovate con un errore lagato ad rr_moved ( io ho risolto camcellandola dalla dir dove eseguivo il mkfisofs)

 In questa sezione a differenza di rda SALVO solo l'immagine della partizione hda1  mentre con fdisk creo sia la hda2 sia la hda3.
Questo perchè voglio mantenere la dimensione all'interno di 1GB e quindi la partizione hda3, che contiene solo il profilo temporaneo.
Ma vediamo in dettaglio.

root@zeroshell hdb> ls -al
total 4900350
drwxr-xr-x   10 root     root         4096 Mar 12 17:03 .
drwxr-xr-x    3 root     root         1024 Mar 12 17:00 ..
drwxr-xr-x    2 root     root         4096 Mar 12 16:49 E1692
-rw-r--r--    1 root     root     1048576000 Mar  1 15:45 ZeroShell-1.0.beta14-Athlon64-2.6.37.1.img
-rw-r--r--    1 root     root     1014644736 Jan 16 15:28 ZeroShell-1.0.beta14-CompactFlash-IDE-USB-SATA-1GB.img
-rw-r--r--    1 root     root     1073741824 Feb 25 18:35 ZeroShell-1.0.beta14-CompactFlash-IDE-USB-SATA-2.6.37.1.img
-rw-r--r--    1 root     root     1073741824 Feb 19 10:49 ZeroShell-1.0.beta14-CompactFlash-IDE-USB-SATA-2.6.37.img
-rw-r--r--    1 root     root     52613120 Feb 19  2010 binutils-2.17-i386.tar
-rw-r--r--    1 root     root     369481728 Mar 12 17:04 cdrom.iso
-r--r--r--    1 root     root        13098 Mar 11 15:07 config_from_cdrom.gz
-rw-r--r--    1 root     root     138004480 Feb 13 17:21 gcc-4.5.2-i386.tar
-rw-r--r--    1 root     root     29706240 Feb 19  2010 gcc-include.tar
-rw-r--r--    1 root     root     20992000 Feb 19  2010 glibc-2.8-includes-zs.tar
-rw-r--r--    1 root     root     73631411 Feb 25 00:47 linux-2.6.37.2.tar.bz2
drwx------    2 root     root         4096 Feb 18 16:05 lost+found
drwxr-xr-x    3 root     root         4096 Mar 12 16:27 modules
drwxr-xr-x    2 root     root         4096 Mar 12 16:51 rootfs_file
-rw-r--r--    1 root     root      6850560 Feb 19  2010 static-lib.tar
drwxr-xr-x    2 root     root         4096 Mar 12 16:37 sz-boot
drwxr-xr-x    7 root     root         4096 Mar 12 16:38 sz-roots
-rwxr-xr-x    1 root     root         2641 Mar  2 18:33 update_initrd_sz.sh
drwxr-xr-x   15 root     root         4096 Mar 11 17:14 usr
-rw-r--r--    1 root     root     110941079 Mar 11 16:30 usr.tgz

root@zeroshell hdb> mkdir hda3
root@zeroshell hdb> mkdir /tmp/hda3
root@zeroshell hdb> mount /dev/hda3 /tmp/hda3
root@zeroshell hda3> cd /tmp/hda3     
root@zeroshell hda3> ls
_DB.001  lost+found  swap-file
root@zeroshell hda3> tar cvf /DB/hdb/hda3/hda3.tar ./
./
./lost+found/
./_DB.001/
.
.
./_DB.001/var/register/system/net/nb/FO/PPPDRestart
.
./swap-file

root@zeroshell hda3> cd ..
root@zeroshell tmp> umount /dev/hda3
root@zeroshell tmp> cd /DB/hdb
root@zeroshell hdb> fdisk /dev/hda 

The number of cylinders for this disk is set to 1049.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
 (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): d
Partition number (1-4): 3

Command (m for help): d
Partition number (1-4): 2

Command (m for help): p

Disk /dev/hda: 1048 MB, 1048576000 bytes
32 heads, 61 sectors/track, 1049 cylinders
Units = cylinders of 1952 * 512 = 999424 bytes

 Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1          14       13633+  83  Linux

Command (m for help): n
Command action
 e   extended
 p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (15-1049, default 15):
Using default value 15
Last cylinder or +size or +sizeM or +sizeK (15-1049, default 1049): +500M

Command (m for help): p

Disk /dev/hda: 1048 MB, 1048576000 bytes
32 heads, 61 sectors/track, 1049 cylinders
Units = cylinders of 1952 * 512 = 999424 bytes

 Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1          14       13633+  83  Linux
/dev/hda2              15         515      488976   83  Linux

Command (m for help): n
Command action
 e   extended
 p   primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (516-1049, default 516):
Using default value 516
Last cylinder or +size or +sizeM or +sizeK (516-1049, default 1049):
Using default value 1049

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

root@zeroshell hdb> dd if=cdrom.iso of=/dev/hda2
721644+0 records in
721644+0 records out

root@zeroshell hdb> mkfs.ext3 /dev/hda3
mke2fs 1.41.1 (01-Sep-2008)

This filesystem will be automatically checked every 25 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

root@zeroshell hdb> mount /dev/hda3 /tmp/hda3/
root@zeroshell hdb> cd hda3
root@zeroshell hda3> ls
hda3.tar
root@zeroshell hda3> cd /tmp/hda3
root@zeroshell hda3> tar xvf /DB/hdb/hda3/hda3.tar 
./
./lost+found/
./_DB.001/
.
./swap-file
root@zeroshell hda3> df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/ram2              31M   16M   16M  50% /
/dev/hdd              152M  152M     0 100% /cdrom
shm                   506M     0  506M   0% /dev/shm
/dev/ram1              78M  4.2M   70M   6% /Database
/dev/hdb1              16G  6.6G  8.0G  46% /DB/hdb
/dev/hda3             493M  168M  300M  36% /tmp/hda3
root@zeroshell hda3> cd
root@zeroshell root> umount /tmp/hda3
root@zeroshell root> cd /DB/hdb/
root@zeroshell hdb> cd /DB/
root@zeroshell DB> ls
hdb
root@zeroshell DB> mkdir hda1
root@zeroshell DB> mount /dev/hda1 hda1
root@zeroshell DB> cd hda1
root@zeroshell hda1> cp /DB/hdb/sz-boot/vmlinuz .
cp: overwrite `./vmlinuz'? y
root@zeroshell hda1> cp /DB/hdb/sz-boot/initrd.gz .
cp: overwrite `./initrd.gz'? y
root@zeroshell hda1> exit

In questa fase avremo già UP and RUNNING il nuovo kernel e la partizione hda3 verrà riconosciuta come un profilo valido e usato come database della configurazione.

Io vi consiglio di disabilitare il profilo  da console e solo dopo il riavvio continuare con l’operazione di update di ld.so.cache

 

-------------------------------------------------------------------------------
 Z e r o S h e l l - Net Services  1.0.beta14       March 12, 2011 - 17:41
-------------------------------------------------------------------------------
 Hostname : zeroshell.example.com
 CPU (1)  : Intel(R) Core(TM)2 Quad CPU    Q8300  @ 2.50GHz  2472MHz
 Kernel   : 2.6.37.2                 
 Memory   : 1034816 kB                https://192.168.0.75     
 Uptime   : 0 days, 0:3            User     : admin
 Load     : 0.19 0.16 0.07            Password : zeroshell
 Profile  : Temporary EXAMPLE.COM configuration
-------------------------------------------------------------------------------
 COMMAND MENU               
 <A> Activate Profile              <P> Change admin password
 <D> Deactivate Profile            <T> Show Routing Table
 <S> Shell Prompt                  <F> Show Firewall Rules
 <R> Reboot                        <N> Show Network Interface
 <H> Shutdown                      <Z> Fail-Safe Mode
 <B> Create a Bridge               <I> IP Manager
 <W> WiFi Manager

 Select: S

Type exit or Ctrl+D to return to main menu.

root@zeroshell root> cd /DB
root@zeroshell DB> ls
root@zeroshell DB> mkdir hdb
root@zeroshell DB> partprobe
Warning: Unable to open /dev/hdd read-write (Read-only file system).  /dev/hdd has been opened read-only.
root@zeroshell DB> fdisk -l 

Disk /dev/hda: 1048 MB, 1048576000 bytes
32 heads, 61 sectors/track, 1049 cylinders
Units = cylinders of 1952 * 512 = 999424 bytes

 Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1          14       13633+  83  Linux
/dev/hda2              15         515      488976   83  Linux
/dev/hda3             516        1049      521184   83  Linux

Disk /dev/hdb: 16.7 GB, 16777216000 bytes
255 heads, 63 sectors/track, 2039 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

 Device Boot      Start         End      Blocks   Id  System
/dev/hdb1               1        2039    16378236   83  Linux

root@zeroshell DB> mount /dev/hdb1 hdb
root@zeroshell DB> cd hdb/

root@zeroshell hdb> cp sz-roots/isolinux/rootfs rootfs.gz  
root@zeroshell hdb> gunzip rootfs.gz
root@zeroshell hdb> mount -o loop rootfs rootfs_file/

root@zeroshell hdb> ldconfig  -v
ldconfig: Can't stat /opt/lib: No such file or directory
ldconfig: Can't stat /bck/zs-chroot/lib: No such file or directory
ldconfig: Can't stat /bck/zs-chroot/usr/lib: No such file or directory
/usr/local/lib:
ldconfig: Cannot stat /usr/local/lib/libstdc++.so: No such file or directory
 libzebra.so.0 -> libzebra.so.0.0.0
 libusbpp-0.1.so.4 -> libusbpp.so
 libusb.so.0 -> libusb.so.0.0.0
 libusb-0.1.so.4 -> libusb.so
 libsysfs.so.2 -> libsysfs.so.2.0.0
 libssp.so.0 -> libssp.so.0.0.0
 libsensors.so.3 -> libsensors.so.3.0.7
 libsasl2.so.2 -> libsasl2.so.2.0.18
 libreiserfs-0.3.so.0 -> libreiserfs.so
 libreadline.so.5 -> libreadline.so.5.0
 libradiusclient.so.0 -> libradiusclient.so.0.0.1
 libpng.so.3 -> libpng.so.3.35.0
 libpng12.so.0 -> libpng12.so.0.35.0
 libparted-1.6.so.12 -> libparted.so
 libnfnetlink.so.0 -> libnfnetlink.so.0.2.0
 libnetfilter_conntrack.so.1 -> libnetfilter_conntrack.so.1.2.0
 libmudflapth.so.0 -> libmudflapth.so.0.0.0
 libmudflap.so.0 -> libmudflap.so.0.0.0
 libmpfr.so.1 -> libmpfr.so.1.2.2
 libmpc.so.2 -> libmpc.so.2.0.0
 libmagic.so.1 -> libmagic.so.1.0
 liblwres.so.60 -> liblwres.so.60.0.1
 libltdl.so.3 -> libltdl.so.3.1.4
 libldap_r-2.2.so.7 -> libldap_r.so
 libldap-2.2.so.7 -> libldap.so
 liblber-2.2.so.7 -> liblber.so
 libkrb5support.so.0 -> libkrb5support.so.0.0
 libkrb5.so.3 -> libkrb5.so.3.2
 libkdb5.so.4 -> libkdb5.so.4.0
 libkadm5srv.so.5 -> libkadm5srv.so.5.1
 libkadm5clnt.so.5 -> libkadm5clnt.so.5.1
 libk5crypto.so.3 -> libk5crypto.so.3.0
 libiw.so.29 -> libiw.so.29
 libisccfg.so.62 -> libisccfg.so.62.0.0
 libisccc.so.60 -> libisccc.so.60.0.0
 libisc.so.62 -> libisc.so.62.0.1
 libhistory.so.5 -> libhistory.so.5.0
 libgssrpc.so.4 -> libgssrpc.so.4.0
 libgssapi_krb5.so.2 -> libgssapi_krb5.so.2.2
 libgpm.so.1 -> libgpm.so.1.18.0
 libgomp.so.1 -> libgomp.so.1.0.0
 libgmp.so.3 -> libgmp.so.3.5.2
 libgd.so.2 -> libgd.so.2.0.0
 libfreeradius-radius-2.1.10.so -> libfreeradius-radius.so
 libfreeradius-eap-2.1.10.so -> libfreeradius-eap.so
 libdns.so.69 -> libdns.so.69.0.1
 libdes425.so.3 -> libdes425.so.3.0
 libdb_cxx-4.2.so -> libdb_cxx.so
 libdb-4.2.so -> libdb.so
 libdal-0.3.so.0 -> libdal.so
 libcom_err.so.3 -> libcom_err.so.3.0
 libclamunrar_iface.so.6 -> libclamunrar_iface.so.6.1.7
 libclamunrar_iface.so.4 -> libclamunrar_iface.so.4.0.1
 libclamunrar.so.6 -> libclamunrar.so.6.1.7
 libclamunrar.so.4 -> libclamunrar.so.4.0.1
 libclamav.so.6 -> libclamav.so.6.1.7
 libclamav.so.4 -> libclamav.so.4.0.1
 libbind9.so.60 -> libbind9.so.60.0.4
/usr/local/ssl/lib:
 libssl.so.0.9.8 -> libssl.so.0.9.8
 libcrypto.so.0.9.8 -> libcrypto.so.0.9.8
/usr/local/lib/libnetfilter_conntrack:

root@zeroshell hdb> cd rootfs_file/etc/
root@zeroshell etc> cp /etc/ld.so.* .
cp: overwrite `./ld.so.cache'? y
cp: overwrite `./ld.so.conf'? y

root@zeroshell etc> pwd 
/DB/hdb/rootfs_file/etc
root@zeroshell etc> cd /DB/hdb/
root@zeroshell hdb> umount rootfs_file/
root@zeroshell hdb> gzip rootfs
root@zeroshell hdb> mv rootfs.gz  sz-roots/isolinux/rootfs
mv: overwrite `sz-roots/isolinux/rootfs'? y

root@zeroshell hdb> exit

-------------------------------------------------------------------------------
 Z e r o S h e l l - Net Services  1.0.beta14       March 12, 2011 - 17:53
-------------------------------------------------------------------------------
 Hostname : zeroshell.example.com
 CPU (1)  : Intel(R) Core(TM)2 Quad CPU    Q8300  @ 2.50GHz  2497MHz
 Kernel   : 2.6.25.20                 
 Memory   : 1035292 kB                https://192.168.0.75     
 Uptime   : 0 days, 0:2            User     : admin
 Load     : 0.36 0.22 0.09            Password : zeroshell
 Profile  : Temporary EXAMPLE.COM configuration
-------------------------------------------------------------------------------
 COMMAND MENU               
 <A> Activate Profile              <P> Change admin password
 <D> Deactivate Profile            <T> Show Routing Table
 <S> Shell Prompt                  <F> Show Firewall Rules
 <R> Reboot                        <N> Show Network Interface
 <H> Shutdown                      <Z> Fail-Safe Mode
 <B> Create a Bridge               <I> IP Manager
 <W> WiFi Manager

 Select: S

Type exit or Ctrl+D to return to main menu.

root@zeroshell root> cd /DB
root@zeroshell DB> ls
root@zeroshell DB> mkdir hdb
root@zeroshell DB> partprobe
Warning: Unable to open /dev/hdd read-write (Read-only file system).  /dev/hdd has been opened read-only.
root@zeroshell DB> df -h    
Filesystem            Size  Used Avail Use% Mounted on
/dev/ram2              31M   16M   16M  50% /
/dev/hdd              152M  152M     0 100% /cdrom
shm                   506M     0  506M   0% /dev/shm
/dev/ram1              78M  3.9M   70M   6% /Database
root@zeroshell DB>
root@zeroshell DB>
root@zeroshell DB> fdisk -l

Disk /dev/hda: 1048 MB, 1048576000 bytes
32 heads, 61 sectors/track, 1049 cylinders
Units = cylinders of 1952 * 512 = 999424 bytes

 Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1          14       13633+  83  Linux
/dev/hda2              15         515      488976   83  Linux
/dev/hda3             516        1049      521184   83  Linux

Disk /dev/hdb: 16.7 GB, 16777216000 bytes
255 heads, 63 sectors/track, 2039 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

 Device Boot      Start         End      Blocks   Id  System
/dev/hdb1               1        2039    16378236   83  Linux

root@zeroshell DB> mount /dev/hdb1 hdb/
root@zeroshell DB> cd hdb/
root@zeroshell hdb> cd sz-roots/

root@zeroshell sz-roots> mkisofs -J -r -U -o ../cdrom.iso  ./

Warning: creating filesystem that does not conform to ISO-9660.
Using Util000 for  ./rr_moved/Util (Util)
Using RSA_padding_check_PKCS1_ty000.3 for  ./usr/local/ssl/man/man3/RSA_padding_check_PKCS1_type_1.3 (RSA_padding_check_PKCS1_type_2.3)
Using PEM_write_bio_PKCS8Private000.3 for  ./usr/local/ssl/man/man3/PEM_write_bio_PKCS8PrivateKey_nid.3 (PEM_write_bio_PKCS8PrivateKey.3)
Using SSL_CTX_set_default_passwd000.3 for  ./usr/local/ssl/man/man3/SSL_CTX_set_default_passwd_cb_userdata.3 (SSL_CTX_set_default_passwd_cb.3)
Using Attribute::Handlers::demo:000.3 for  ./usr/share/man/man3/Attribute::Handlers::demo::Descriptions.3 (Attribute::Handlers::demo::Demo.3)
 2.78% done, estimate finish Sat Mar 12 17:55:24 2011
 5.55% done, estimate finish Sat Mar 12 17:55:42 2011
 8.31% done, estimate finish Sat Mar 12 17:56:24 2011
 11.09% done, estimate finish Sat Mar 12 17:56:27 2011
 .
 .
 97.00% done, estimate finish Sat Mar 12 17:56:56 2011
 99.78% done, estimate finish Sat Mar 12 17:56:59 2011
Total translation table size: 0
Total rockridge attributes bytes: 1780601
Total directory bytes: 4665344
Path table size(bytes): 18684
Max brk space used d34000
180412 extents written (352 MB)

root@zeroshell sz-roots> cd /DB/hdb/
root@zeroshell hdb> fdisk /dev/hda

The number of cylinders for this disk is set to 1049.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
 (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/hda: 1048 MB, 1048576000 bytes
32 heads, 61 sectors/track, 1049 cylinders
Units = cylinders of 1952 * 512 = 999424 bytes

 Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1          14       13633+  83  Linux
/dev/hda2              15         515      488976   83  Linux
/dev/hda3             516        1049      521184   83  Linux

Command (m for help): d
Partition number (1-4): 3

Command (m for help): d
Partition number (1-4): 2

Command (m for help): p

Disk /dev/hda: 1048 MB, 1048576000 bytes
32 heads, 61 sectors/track, 1049 cylinders
Units = cylinders of 1952 * 512 = 999424 bytes

 Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1          14       13633+  83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
root@zeroshell hdb> fdisk /dev/hda

The number of cylinders for this disk is set to 1049.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
 (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): n
Command action
 e   extended
 p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (15-1049, default 15):
Using default value 15
Last cylinder or +size or +sizeM or +sizeK (15-1049, default 1049): +500M

Command (m for help): n
Command action
 e   extended
 p   primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (516-1049, default 516):
Using default value 516
Last cylinder or +size or +sizeM or +sizeK (516-1049, default 1049):
Using default value 1049

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

root@zeroshell hdb> dd if=cdrom.iso of=/dev/hda2
721648+0 records in
721648+0 records out

root@zeroshell hdb> mkdir /tmp/hda3
root@zeroshell hdb> mkfs.ext3 /dev/hda3
mke2fs 1.41.1 (01-Sep-2008)
This filesystem will be automatically checked every 32 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

root@zeroshell hdb> mount /dev/hda3 /tmp/hda3

root@zeroshell hda3> cd /tmp/hda3
root@zeroshell hda3> ls
lost+found
root@zeroshell hda3> tar xvf /DB/hdb/hda3/hda3.tar 
./
./lost+found/
./_DB.001/
./_DB.001/.settings/LastActivation
./swap-file

root@zeroshell hda3> cd /DB/hdb
root@zeroshell hdb> dd if=/dev/hda of=ZeroShell-1.0.beta14-CompactFlash-IDE-USB-SATA-2-6-37-2-1G.img
2048000+0 records in
2048000+0 records out

root@zeroshell hdb> ls -al ZeroShell-1.0.beta14-CompactFlash-IDE-USB-SATA-2-6-37-2-1G.img
-rw-r--r--    1 root     root     1048576000 Mar 12 18:03 ZeroShell-1.0.beta14-CompactFlash-IDE-USB-SATA-2-6-37-2-1G.img

root@zeroshell hdb> bzip2 ZeroShell-1.0.beta14-CompactFlash-IDE-USB-SATA-2-6-37-2-1G.img
root@zeroshell hdb> ls -al
total 5097146
drwxr-xr-x   11 root     root         4096 Mar 12 18:06 .
drwxr-xr-x    3 root     root         1024 Mar 12 17:54 ..

-rw-r--r--    1 root     root     201312200 Mar 12 18:03 ZeroShell-1.0.beta14-CompactFlash-IDE-USB-SATA-2-6-37-2-1G.img.bz2

root@zeroshell hdb> df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/ram2              31M   16M   16M  50% /
/dev/hdd              152M  152M     0 100% /cdrom
shm                   506M     0  506M   0% /dev/shm
/dev/ram1              78M  4.2M   70M   6% /Database
/dev/hdb1              16G  6.8G  7.9G  47% /DB/hdb
/dev/hda3             493M  168M  300M  36% /tmp/hda3
root@zeroshell hdb> exit
BOOT HDA

 

 

 

 

 

 

PS.
IL POST E' IN CONTINUO AGGIORNAMENTO "PLEASE, FATE I BUONI SE POTETE"

 

Comments are closed.