vx32

Local 9vx git repository for patches.
git clone git://r-36.net/vx32
Log | Files | Refs

mkbootfs (824B)


      1 #!/bin/rc
      2  
      3 fn cmds {
      4 	if(! test -e /sys/lib/dist/bin/386/bzfs) {
      5 		@{
      6 			cd /sys/lib/dist/cmd
      7 			mk install
      8 			mk clean
      9 		}
     10 	}
     11 }
     12 
     13 fn bootraw {
     14 	proto=bootfs.proto
     15 	rm -rf bootfs
     16 	mkdir bootfs
     17 	
     18 	# make files writable for now.
     19 	cat $proto | sed 's!d000!d775!;s!000!664!;s!555!775!;s!444!664!' > proto.cp
     20 	disk/mkfs -a proto.cp | disk/mkext -d bootfs
     21 	@{
     22 		cd bootfs/386/bin
     23 		strip * */* >[2]/dev/null || status=''
     24 	}
     25 	disk/mkfs -a -s bootfs proto.cp >boot.raw
     26 	rm proto.cp
     27 }
     28 
     29 fn bootbz2 {
     30 	/sys/lib/dist/bin/386/bflz -n 32 < boot.raw >boot.bflz
     31 	bzip2 -9 < boot.bflz >boot.bz2
     32 	rm boot.raw boot.bflz
     33 }
     34 
     35 fn rootbz2 {
     36 	{
     37 		echo bzfilesystem
     38 		cat boot.bz2
     39 		dd -if /dev/zero -bs 1024 -count 1 >[2]/dev/null
     40 	} >rootfs.bz2
     41 	ls -l rootfs.bz2
     42 	rm boot.bz2
     43 }
     44 
     45 cmds
     46 bind -a /sys/lib/dist/bin/386 /386/bin
     47 bootraw
     48 bootbz2
     49 rootbz2
     50