[autoboot] rewrite autoboot