updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / quick-boot / quick-boot.install
blob4c81842b20835856014191b7ebd99f3ebfe447dc
1 post_install() {
4         echo "#!/bin/bash" > /etc/qinit.mknod_blocks
5         echo "#" >> /etc/qinit.mknod_blocks
6         echo "# /etc/qinit.mknod_blocks" >> /etc/qinit.mknod_blocks
7         echo "#" >> /etc/qinit.mknod_blocks
8         echo     >> /etc/qinit.mknod_blocks
9         echo     >> /etc/qinit.mknod_blocks
11         for dev in `fdisk -l | awk '{print $1}' | grep dev`; 
12         do
13         numero1=$(ls -l $dev | awk '{print $5}' | awk -F"," '{print $1}')
15         numero2=$(ls -l $dev | awk '{print $6}')
17         block=$(echo $dev | awk '{print $1}' | grep dev | cut -d/ -f3);
18         
19         makenode_block="/bin/mknod -m 660 /dev/$block b $numero1 $numero2"
20         echo $makenode_block >> /etc/qinit.mknod_blocks;
21         
22         if [ -b /lib/udev/devices/$block ]; then
23         rm -r /lib/udev/devices/$block
24         fi
25         done
27         chmod a+x /etc/qinit.mknod_blocks
29         /bin/cat /etc/inittab > /etc/inittab.backup
30         /bin/cat /etc/qinittab > /etc/inittab
31         touch /.readahead       
33   echo ""
34   echo -e "\033[37;41;1m Read First \033[0m"  
35   echo "Read the Wiki for more Informations!"
36   echo "/etc/inittab is backuped in /etc/inittab.backup"
37   echo "The first reboot, readahead will collect his data! No speeding up."
38   echo ""
41 post_upgrade() {
42                 echo "#!/bin/bash" > /etc/qinit.mknod_blocks
43         echo "#" >> /etc/qinit.mknod_blocks
44         echo "# /etc/qinit.mknod_blocks" >> /etc/qinit.mknod_blocks
45         echo "#" >> /etc/qinit.mknod_blocks
46         echo     >> /etc/qinit.mknod_blocks
47         echo     >> /etc/qinit.mknod_blocks
49         for dev in `fdisk -l | awk '{print $1}' | grep dev`; 
50         do
51         numero1=$(ls -l $dev | awk '{print $5}' | awk -F"," '{print $1}')
53         numero2=$(ls -l $dev | awk '{print $6}')
55         block=$(echo $dev | awk '{print $1}' | grep dev | cut -d/ -f3);
56         
57         makenode_block="/bin/mknod -m 660 /dev/$block b $numero1 $numero2"
58         echo $makenode_block >> /etc/qinit.mknod_blocks;
59         
60         if [ -b /lib/udev/devices/$block ]; then
61         rm -r /lib/udev/devices/$block
62         fi
63         done
65         chmod a+x /etc/qinit.mknod_blocks
67         /bin/cat /etc/qinittab > /etc/inittab
68         touch /.readahead       
70   echo ""
71   echo -e "\033[37;41;1m Read First \033[0m"  
72   echo "Read the Wiki for more Informations!"
73   echo "/etc/inittab is backuped in /etc/inittab.backup"
74   echo ""
77 post_remove() {
78   rm /etc/qinit.mknod_blocks
79   mv /etc/inittab.backup /etc/inittab
80   echo ""
81   echo -e "\033[37;41;1m Read First \033[0m"  
82   echo "/etc/inittab restored"
83   echo ""